/* =========================================================
   sav.dev — portfolio styles
   Paleta sóbria: violet-600/700 sobre preto profundo.
   Mobile-first, sem dependências externas pesadas.
   ========================================================= */

:root {
  /* fundos */
  --bg:        #07060b;
  --bg-soft:   #0b0a12;
  --panel:     #0e0c16;
  --panel-2:   #12101c;
  --line:      rgba(124, 58, 237, 0.14);     /* borda padrão muito sutil */
  --line-2:    rgba(124, 58, 237, 0.30);     /* borda hover */
  --line-3:    rgba(139, 92, 246, 0.45);     /* borda destaque */

  /* texto */
  --text:      #e7e5ee;
  --text-dim:  #9b97a8;
  --muted:     #5d5a6b;

  /* accent — violet sóbrio (não neon, mais profissional) */
  --accent:        #7c3aed;   /* violet-600 — primário */
  --accent-dark:   #6d28d9;   /* violet-700 — gradient end */
  --accent-soft:   #8b5cf6;   /* violet-500 — destaques discretos */

  /* glows comedidos */
  --glow-1: 0 0 12px rgba(124, 58, 237, 0.18);
  --glow-2: 0 0 24px rgba(124, 58, 237, 0.22), 0 6px 18px rgba(0, 0, 0, 0.5);
  --glow-strong: 0 0 18px rgba(139, 92, 246, 0.30), 0 10px 30px rgba(0, 0, 0, 0.55);

  /* sombras */
  --shadow: 0 1px 0 rgba(255,255,255,0.02), 0 12px 30px rgba(0,0,0,0.45);

  /* tipografia */
  --font:  "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* =========================================================
   Plano de fundo: gradiente radial sutil + grid muito tênue
   ========================================================= */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(55% 45% at 50% -5%, rgba(124, 58, 237, 0.10), transparent 65%),
    radial-gradient(40% 35% at 90% 95%, rgba(109, 40, 217, 0.06), transparent 70%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(124, 58, 237, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 25%, #000 30%, transparent 80%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 25%, #000 30%, transparent 80%);
}

/* =========================================================
   Snippets de código flutuando (decorativo)
   Só aparecem no desktop pra não poluir o mobile
   ========================================================= */
.code-bg { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.code-snippet {
  position: absolute;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(139, 92, 246, 0.18);
  background: rgba(14, 12, 22, 0.45);
  border: 1px solid rgba(124, 58, 237, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  white-space: pre;
  backdrop-filter: blur(2px);
  animation: float 22s ease-in-out infinite;
}
.code-snippet .k { color: rgba(167, 139, 250, 0.45); }
.code-snippet .s { color: rgba(125, 211, 252, 0.35); }
.code-snippet .c { color: rgba(148, 163, 184, 0.30); font-style: italic; }
.code-snippet .f { color: rgba(196, 181, 253, 0.40); }
@keyframes float {
  0%, 100% { transform: translate(0, 0); opacity: 0.55; }
  50%      { transform: translate(6px, -16px); opacity: 0.85; }
}
.cs-1 { top: 9%;  left: 3%;  animation-delay: 0s;   transform: rotate(-3deg); }
.cs-2 { top: 14%; right: 4%; animation-delay: 3s;   transform: rotate( 2deg); }
.cs-3 { top: 48%; left: 2%;  animation-delay: 5s;   transform: rotate( 1deg); }
.cs-4 { top: 62%; right: 3%; animation-delay: 7s;   transform: rotate(-2deg); }
@media (max-width: 820px) { .code-bg { display: none; } }

/* =========================================================
   Navbar
   ========================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(7, 6, 11, 0.65);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
  transition: background .25s ease, box-shadow .25s ease;
}
.nav.scrolled {
  background: rgba(7, 6, 11, 0.88);
  box-shadow: 0 1px 0 rgba(124, 58, 237, 0.08), 0 8px 24px rgba(0,0,0,0.45);
}
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
}

/* Brand: marca S + nome */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 6px; border-radius: 8px;
  transition: transform .2s ease;
}
.brand:hover { transform: translateY(-1px); }
.brand img {
  width: 30px; height: 30px;
  filter: drop-shadow(0 0 6px rgba(124, 58, 237, 0.35));
  transition: filter .25s ease;
}
.brand:hover img { filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.6)); }
.brand-name {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.5px;
  color: var(--text);
}
.brand-name .dot {
  color: var(--accent-soft);
}

/* Nav links */
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-link {
  position: relative;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 2px;
  transition: color .2s ease;
}
.nav-link::after {
  content: "";
  position: absolute; left: 0; right: 100%; bottom: 4px;
  height: 1px; background: var(--accent-soft);
  transition: right .25s ease;
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { right: 0; }

/* Menu mobile */
.menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.menu-btn:active { transform: scale(.95); }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; left: 0; right: 0; top: 100%;
    padding: 14px 20px 18px;
    background: rgba(7, 6, 11, 0.96);
    border-bottom: 1px solid var(--line);
    gap: 4px;
  }
  .nav-links.open .nav-link {
    padding: 14px 4px;        /* área de toque generosa */
    font-size: 16px;
    border-bottom: 1px solid rgba(124, 58, 237, 0.08);
  }
  .nav-links.open .nav-link:last-child { border-bottom: 0; }
  .menu-btn { display: inline-flex; }
}

/* =========================================================
   Hero / Terminal
   ========================================================= */
.hero {
  position: relative; z-index: 2;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 110px 16px 60px;
}
.hero-wrap { width: 100%; max-width: 920px; }

.terminal {
  position: relative;
  background: linear-gradient(180deg, #100e1a 0%, #0a0814 100%);
  border: 1px solid var(--line-3);
  border-radius: 14px;
  box-shadow: var(--glow-2);
  overflow: hidden;
}
.terminal::before {
  /* contorno gradiente sutil */
  content: "";
  position: absolute; inset: 0; border-radius: 14px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.45), rgba(124, 58, 237, 0) 50%, rgba(139, 92, 246, 0.25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.terminal-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px;
  background: rgba(18, 16, 28, 0.85);
  border-bottom: 1px solid rgba(124, 58, 237, 0.10);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #ff5f56; }
.dot.y { background: #ffbd2e; }
.dot.g { background: #27c93f; }
.terminal-title {
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

.terminal-body {
  padding: 22px 22px 30px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: #cfcadd;
}
.line { display: flex; gap: 10px; align-items: baseline; margin-bottom: 5px; }
.prompt { color: var(--accent-soft); }
.cmd { color: #e7e5ee; }
.out { padding-left: 22px; color: #918da3; }
.out .hl { color: var(--accent-soft); }
.tk-com { color: #6b6786; font-style: italic; }

.typing::after {
  content: "▌";
  color: var(--accent-soft);
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Logo grande no centro do terminal — a marca S real */
.hero-logo {
  display: flex; justify-content: center;
  margin: 22px 0 6px;
}
.hero-logo img {
  width: clamp(120px, 28vw, 200px);
  height: auto;
  filter: drop-shadow(0 0 12px rgba(124, 58, 237, 0.35))
          drop-shadow(0 0 28px rgba(109, 40, 217, 0.22));
  animation: pulse 4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(124, 58, 237, 0.32)) drop-shadow(0 0 28px rgba(109, 40, 217, 0.18)); }
  50%      { filter: drop-shadow(0 0 18px rgba(139, 92, 246, 0.50)) drop-shadow(0 0 42px rgba(124, 58, 237, 0.30)); }
}

.hero-sub { text-align: center; margin-top: 16px; }
.hero-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-soft);
  border: 1px solid var(--line-3);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.04);
}
.hero-title {
  margin: 14px 0 0;
  font-size: clamp(22px, 4.2vw, 34px);
  font-weight: 600;
  color: #f0eef7;
  letter-spacing: -0.4px;
  line-height: 1.25;
}
.hero-title .grad {
  background: linear-gradient(90deg, #c4b5fd 0%, #8b5cf6 60%, #6d28d9 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero-desc {
  margin: 12px auto 0;
  max-width: 560px;
  color: var(--text-dim);
  font-size: 14.5px;
}
.hero-actions {
  margin-top: 22px;
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: center;
}

/* =========================================================
   Botões — área de toque mínima 44px (mobile UX)
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .2s ease, box-shadow .25s ease, background .2s ease, border-color .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  box-shadow: 0 0 14px rgba(124, 58, 237, 0.30), 0 6px 16px rgba(0,0,0,0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 22px rgba(139, 92, 246, 0.45), 0 10px 24px rgba(0,0,0,0.45);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-3);
}
.btn-ghost:hover {
  background: rgba(124, 58, 237, 0.06);
  border-color: var(--accent-soft);
}

/* =========================================================
   Sections
   ========================================================= */
section { position: relative; z-index: 2; }
.section { max-width: 1180px; margin: 0 auto; padding: 70px 20px; }
.section-title {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #f0eef7;
  margin: 0 0 6px;
}
.section-title .accent { color: var(--accent-soft); }
.section-sub {
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 0 32px;
  font-size: 15px;
}

/* =========================================================
   Projects
   ========================================================= */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.card {
  position: relative;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 20px 20px;
  transition: transform .3s cubic-bezier(.2,.7,.2,1), border-color .25s, box-shadow .3s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-2);
  box-shadow: var(--glow-strong);
}
.card-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.22);
  color: var(--accent-soft);
  margin-bottom: 14px;
}
.card-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  color: #f0eef7;
}
.card-desc {
  margin: 0 0 14px;
  color: var(--text-dim);
  font-size: 14px;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag {
  font-family: var(--mono);
  font-size: 11px;
  color: #d8c9f7;
  background: rgba(124, 58, 237, 0.07);
  border: 1px solid rgba(124, 58, 237, 0.20);
  padding: 3px 8px;
  border-radius: 6px;
}
.card-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent-soft);
  font-size: 13px;
  font-weight: 600;
  transition: gap .2s ease, color .2s ease;
}
.card-link:hover { gap: 10px; color: #b5a3ff; }

/* =========================================================
   Skills
   ========================================================= */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px;
}
.skill {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 12px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .3s ease;
}
.skill:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  box-shadow: var(--glow-strong);
}
.skill-icon {
  color: var(--accent-soft);
  filter: drop-shadow(0 0 6px rgba(124, 58, 237, 0.25));
  transition: filter .25s ease, transform .25s ease;
}
.skill:hover .skill-icon {
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.55));
  transform: scale(1.06);
}
.skill-name {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  letter-spacing: 0.3px;
}

/* =========================================================
   Contact
   ========================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 22px;
}
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }

.box {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}
.box h3 { margin: 0 0 4px; font-size: 18px; color: #f0eef7; }
.box .lead { margin: 0 0 18px; color: var(--text-dim); font-size: 14px; }

.field {
  display: block; width: 100%;
  background: rgba(10, 8, 18, 0.7);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;            /* alto pra dedo grande */
  font-family: var(--font);
  font-size: 16px;          /* >=16px evita zoom no iOS */
  margin-bottom: 12px;
  transition: border-color .2s ease, box-shadow .2s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.field::placeholder { color: var(--muted); }
.field:focus {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}
textarea.field { min-height: 120px; resize: vertical; }

.socials { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.social {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(14, 12, 22, 0.55);
  color: var(--text);
  transition: transform .2s ease, border-color .25s ease, box-shadow .25s ease;
}
.social:hover {
  transform: translateX(3px);
  border-color: var(--line-2);
  box-shadow: var(--glow-1);
}
.social-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(124, 58, 237, 0.10);
  border: 1px solid rgba(124, 58, 237, 0.22);
  color: var(--accent-soft);
  flex-shrink: 0;
}
.social-meta { display: flex; flex-direction: column; min-width: 0; }
.social-meta .lbl { font-size: 12px; color: var(--text-dim); }
.social-meta .val {
  font-family: var(--mono);
  font-size: 14px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* =========================================================
   Footer
   ========================================================= */
footer {
  position: relative; z-index: 2;
  border-top: 1px solid var(--line);
  padding: 24px 20px 30px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}
footer .made {
  font-family: var(--mono);
}
footer .made .heart { color: var(--accent-soft); }
footer .made .name  { color: var(--accent-soft); font-weight: 700; }

/* =========================================================
   Scroll reveal
   ========================================================= */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); will-change: transform, opacity; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }

/* =========================================================
   Utilidades
   ========================================================= */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: #07060b; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-dark), var(--accent));
  border-radius: 999px;
}
::selection { background: rgba(124, 58, 237, 0.40); color: #fff; }

/* =========================================================
   Mobile fine-tuning — telas pequenas
   ========================================================= */
@media (max-width: 480px) {
  .hero { padding: 96px 12px 48px; }
  .hero-wrap { max-width: 100%; }
  .terminal-body { padding: 18px 16px 24px; font-size: 12.5px; }
  .terminal-bar { padding: 10px 12px; }
  .terminal-title { font-size: 11px; }
  .hero-logo img { width: 130px; }
  .hero-title { font-size: 22px; }
  .hero-desc { font-size: 14px; }
  .hero-actions .btn { flex: 1; min-width: 140px; }
  .section { padding: 56px 16px; }
  .section-title { font-size: 26px; }
  .card { padding: 18px 16px 16px; }
  .skill { padding: 16px 10px 12px; }
  .box { padding: 18px; }
}

/* =========================================================
   Acessibilidade — respeita usuários que reduzem animações
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .hero-logo img { animation: none; filter: drop-shadow(0 0 10px rgba(124, 58, 237, 0.35)); }
}
