/* ============================================
   ViquinhoDev Portfolio — Theme & Layout
   ============================================ */

:root {
  --font-sans: "Outfit", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius-sm: 0.75rem;
  --radius-md: 1.25rem;
  --radius-lg: 2rem;
  --radius-xl: 2.5rem;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --header-h: 4.5rem;
  --max-w: 72rem;
}

/* Dark theme (default) */
[data-theme="dark"] {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(34, 211, 238, 0.35);
  --text: #f4f4f5;
  --text-muted: rgba(255, 255, 255, 0.62);
  --text-subtle: rgba(255, 255, 255, 0.4);
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.12);
  --accent-glow: rgba(34, 211, 238, 0.25);
  --header-bg: rgba(10, 10, 15, 0.85);
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  --gradient-hero: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(34, 211, 238, 0.15), transparent);
  --input-bg: rgba(255, 255, 255, 0.05);
  --btn-primary-text: #0a0a0f;
}

/* Light theme */
[data-theme="light"] {
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-card: rgba(15, 23, 42, 0.03);
  --bg-card-hover: rgba(15, 23, 42, 0.06);
  --border: rgba(15, 23, 42, 0.1);
  --border-hover: rgba(8, 145, 178, 0.4);
  --text: #0f172a;
  --text-muted: rgba(15, 23, 42, 0.68);
  --text-subtle: rgba(15, 23, 42, 0.45);
  --accent: #0891b2;
  --accent-dim: rgba(8, 145, 178, 0.1);
  --accent-glow: rgba(8, 145, 178, 0.2);
  --header-bg: rgba(248, 250, 252, 0.9);
  --shadow: 0 24px 48px rgba(15, 23, 42, 0.08);
  --gradient-hero: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(8, 145, 178, 0.12), transparent);
  --input-bg: rgba(15, 23, 42, 0.04);
  --btn-primary-text: #ffffff;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--gradient-hero);
  pointer-events: none;
  z-index: 0;
}

img {
  display: block;
  max-width: 100%;
}

/* Ícones SVG — tamanho fixo, nunca estica com max-width:100% */
.svg-icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.svg-icon--sm {
  width: 1rem;
  height: 1rem;
}

.svg-icon--md {
  width: 1.5rem;
  height: 1.5rem;
}

.svg-icon--lg {
  width: 2rem;
  height: 2rem;
}

.svg-icon--xl {
  width: 2.75rem;
  height: 2.75rem;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

ul {
  list-style: none;
}

.container {
  width: min(100% - 2rem, var(--max-w));
  margin-inline: auto;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.logo span {
  color: var(--accent);
}

.nav-desktop {
  display: none;
  gap: 2rem;
}

.nav-desktop a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav-desktop a:hover,
.nav-desktop a:focus-visible {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}

.icon-btn:hover {
  border-color: var(--border-hover);
  color: var(--accent);
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.lang-btn {
  width: auto;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.menu-toggle {
  display: flex;
}

.menu-toggle .icon-close {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.nav-mobile {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 99;
}

.nav-mobile.open {
  display: flex;
}

.nav-mobile a {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.nav-mobile a:hover {
  background: var(--bg-card);
  color: var(--accent);
}

@media (min-width: 768px) {
  .nav-desktop {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }
}

/* ---- Sections ---- */
main {
  position: relative;
  z-index: 1;
}

section {
  padding-block: 5rem;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--text-muted);
  max-width: 36rem;
  font-size: 1.05rem;
}

/* ---- Hero ---- */
.hero {
  min-height: calc(100dvh - var(--header-h));
  display: flex;
  align-items: center;
  padding-block: 3rem;
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.hero-badge-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 1.25rem;
}

.hero-title .highlight {
  color: var(--accent);
}

.hero-text {
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.125rem);
  max-width: 34rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--btn-primary-text);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--accent-glow);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  color: var(--accent);
}

.hero-card {
  position: relative;
  width: 100%;
  max-width: 22rem;
  margin-inline: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 2rem 2rem;
  box-shadow: var(--shadow);
}

.hero-card-bg {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero-card-bg::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 180deg, transparent, var(--accent-dim), transparent 60%);
  animation: rotate 12s linear infinite;
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

.hero-card-inner {
  position: relative;
  z-index: 1;
  width: 100%;
}

.avatar {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--btn-primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.75rem;
  font-weight: 900;
  margin: 0 auto 1.25rem;
  box-shadow: 0 0 40px var(--accent-glow);
}

.hero-card-name {
  font-size: 1.5rem;
  font-weight: 800;
}

.hero-card-tags {
  color: var(--text-subtle);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.lang-tags {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.lang-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg);
}

@media (min-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---- About ---- */
.about-grid {
  display: grid;
  gap: 3rem;
}

.about-text p + p {
  margin-top: 1rem;
  color: var(--text-muted);
}

.specialties {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
}

.specialty-card {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color var(--transition), transform var(--transition);
}

.specialty-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.specialty-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  border: 1px solid var(--border-hover);
  color: var(--accent);
}

.specialty-icon .svg-icon {
  width: 1.35rem;
  height: 1.35rem;
}

.specialty-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.specialty-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }
}

/* ---- Skills ---- */
.skills-section {
  background: var(--bg-elevated);
  border-block: 1px solid var(--border);
}

.skills-grid {
  display: grid;
  gap: 2.5rem;
}

.skills-group h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
  margin-bottom: 1rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.skill-tag {
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.skill-tag:hover {
  border-color: var(--border-hover);
  color: var(--accent);
  background: var(--bg-card-hover);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.75rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.25rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-align: center;
  transition: border-color var(--transition), transform var(--transition);
}

.tool-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
}

.tool-icon {
  width: 2rem;
  height: 2rem;
  color: var(--accent);
}

.tool-card .svg-icon {
  width: 2rem;
  height: 2rem;
  color: var(--accent);
}

.tool-card span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .skills-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---- Projects ---- */
.projects-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.project-card {
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.project-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  border: 1px solid var(--border-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.project-icon .svg-icon {
  width: 1.35rem;
  height: 1.35rem;
}

.project-card h4 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  transition: color var(--transition);
}

.project-card:hover h4 {
  color: var(--accent);
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.project-techs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.project-tech {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--border-hover);
}

@media (min-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.projects-footer {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

.projects-all-btn .svg-icon {
  width: 1.1rem;
  height: 1.1rem;
}

/* ---- Contact ---- */
.contact-wrapper {
  display: grid;
  gap: 2.5rem;
  margin-top: 2.5rem;
}

.contact-info-card,
.contact-form-card {
  padding: 2rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.contact-info-card {
  background: linear-gradient(135deg, var(--accent-dim), var(--bg-card));
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.75rem 0;
}

.contact-method {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  transition: border-color var(--transition), color var(--transition);
}

.contact-method:hover {
  border-color: var(--border-hover);
  color: var(--accent);
}

.contact-method .svg-icon {
  color: var(--accent);
}

.contact-method span {
  font-size: 0.9rem;
  word-break: break-all;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.social-link {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}

.social-link .svg-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.social-link:hover {
  border-color: var(--border-hover);
  color: var(--accent);
  transform: scale(1.08);
}

/* Form */
.form-group {
  margin-bottom: 1.15rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-group textarea {
  min-height: 8rem;
  resize: vertical;
}

.form-status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  display: none;
}

.form-status.show {
  display: block;
}

.form-status.success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.form-status.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

[data-theme="light"] .form-status.success {
  color: #15803d;
}

[data-theme="light"] .form-status.error {
  color: #b91c1c;
}

@media (min-width: 900px) {
  .contact-wrapper {
    grid-template-columns: 1fr 1.2fr;
    align-items: start;
  }
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding-block: 3rem 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  max-width: 22rem;
}

.footer-links h5,
.footer-social h5 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-subtle);
  margin-bottom: 1rem;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-subtle);
  text-align: center;
}

.theme-note {
  font-size: 0.75rem;
  opacity: 0.7;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* ---- Utilities ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
