/* ============================================================
   Hugo Biller — portfolio
   Dark, hand-crafted, no framework.
   ============================================================ */

/* Tokens no contrato canonico do PADRAO-DESIGN-SEO.md (vault). Todo numero de
   contraste abaixo foi MEDIDO com contraste.py em 2026-09-09 — ao mudar um token,
   rode `py contraste.py paleta-padrao.json` e atualize o padrao. */
:root {
  color-scheme: dark;

  /* superficies */
  --ground:      #0a0a0b;
  --surface:     #141418;
  --surface-2:   #1a1a20;
  --surface-3:   #101013;

  /* texto */
  --ink:         #ededf0;   /* 16,94:1 no ground — AAA */
  --muted:       #a2a2ab;   /*  7,81:1 — AAA */
  --faint:       #86868f;   /*  5,09:1 no surface — AA  (era #74747e = 3,97:1, REPROVADO) */

  /* linhas: decorativa (isenta) x de controle (exige 3:1, WCAG 1.4.11) */
  --line:        rgba(255, 255, 255, 0.09);
  --line-strong: #676771;   /*  3,29:1 no surface — AA */

  /* marca (Aurea / ouro) */
  --accent:      #e8b04a;   /*  9,40:1 no surface — AAA */
  --accent-ink:  #f2c877;
  --accent-soft: rgba(232, 176, 74, 0.14);
  --ok:          #58c98a;

  /* forma, movimento, layout */
  --r:      16px;
  --r-sm:   10px;
  --r-pill: 999px;
  --maxw:   1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);
  --font:   "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: var(--font);
  background: var(--ground);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* subtle grain / vignette on the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(232, 176, 74, 0.06), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(120, 120, 200, 0.04), transparent 55%);
}

a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); position: relative; z-index: 1; }

/* ---------- skip link ---------- */
.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--accent); color: #10100a;
  padding: 10px 16px; border-radius: 8px; font-weight: 600;
  z-index: 100; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- focus ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--ground) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); background: color-mix(in srgb, var(--ground) 88%, transparent); }
.header-inner { display: flex; align-items: center; gap: 20px; height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(145deg, var(--accent), var(--accent-ink));
  color: #14120a; font-weight: 800; font-size: 13px; letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(232, 176, 74, 0.25);
}
.brand-name { font-size: 15.5px; }

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--muted); font-size: 14.5px; font-weight: 500;
  padding: 8px 14px; border-radius: 8px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--surface); }

.lang-toggle { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; }
.lang-toggle button {
  background: none; border: 0; cursor: pointer;
  color: var(--faint); font: inherit; font-size: 13px; font-weight: 700;
  padding: 6px 8px; border-radius: 7px; letter-spacing: 0.04em;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.lang-toggle button:hover { color: var(--ink); }
.lang-toggle button.is-active { color: var(--accent); }
.lang-sep { color: var(--faint); font-size: 12px; }

/* mobile nav: collapse links, keep lang toggle */
@media (max-width: 640px) {
  .nav { display: none; }
  .brand-name { display: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; padding: clamp(72px, 16vh, 150px) 0 clamp(56px, 10vh, 96px); overflow: hidden; }
.hero-glow {
  position: absolute; z-index: 0; top: -30%; left: 50%; translate: -50% 0;
  width: min(900px, 120vw); aspect-ratio: 1;
  background: radial-gradient(circle, rgba(232, 176, 74, 0.16), transparent 62%);
  filter: blur(20px); pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }

.eyebrow {
  display: inline-block; color: var(--accent);
  font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 6px 14px; border: 1px solid var(--accent-soft); border-radius: 100px;
  background: var(--accent-soft); margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.02; letter-spacing: -0.035em; font-weight: 800;
  max-width: 15ch;
}
.hero-title span { display: block; }
.hero-title .accent {
  background: linear-gradient(120deg, var(--accent-ink), var(--accent) 55%, #cf9a34);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  margin-top: 26px; max-width: 60ch;
  font-size: clamp(1.05rem, 2.3vw, 1.3rem); color: var(--muted); line-height: 1.6;
}
.hero-actions { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 14px; }

.hero-facts {
  margin-top: 56px; list-style: none; padding: 0;
  display: flex; flex-wrap: wrap; gap: clamp(28px, 6vw, 64px);
  border-top: 1px solid var(--line); padding-top: 32px;
}
.hero-facts li { display: flex; flex-direction: column; gap: 4px; }
.hero-facts strong { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.hero-facts span { font-size: 13.5px; color: var(--faint); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  padding: 13px 24px; border-radius: 11px; border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(145deg, var(--accent-ink), var(--accent));
  color: #14120a; box-shadow: 0 8px 24px rgba(232, 176, 74, 0.22);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(232, 176, 74, 0.32); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--accent); transform: translateY(-2px); }

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: clamp(64px, 11vh, 120px) 0; position: relative; }
.section-work { background: linear-gradient(180deg, transparent, var(--surface-3) 12%, var(--surface-3) 88%, transparent); }

.section-head { max-width: 46ch; margin-bottom: clamp(40px, 6vw, 64px); }
.section-kicker {
  display: inline-block; color: var(--accent);
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 16px;
}
.section-head h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.12; letter-spacing: -0.025em; font-weight: 800;
}

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: start; }
.about-lead p { font-size: clamp(1.05rem, 2vw, 1.22rem); color: var(--muted); }
.about-lead p + p { margin-top: 20px; }
.about-lead em { color: var(--ink); font-style: normal; border-bottom: 1px solid var(--accent-soft); }
.about-points { list-style: none; padding: 0; display: grid; gap: 2px; }
.about-points li {
  display: grid; gap: 4px; padding: 20px 22px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.about-points li:hover { border-color: var(--line-strong); transform: translateX(4px); }
.point-k { font-weight: 700; font-size: 15px; color: var(--ink); }
.point-v { font-size: 14px; color: var(--faint); }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* ---------- work cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card:first-child { grid-column: span 2; }
.card {
  position: relative; display: flex; flex-direction: column;
  padding: clamp(24px, 3vw, 32px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(400px 200px at var(--mx, 50%) 0%, rgba(232, 176, 74, 0.10), transparent 70%);
  opacity: 0; transition: opacity 0.35s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: 0 20px 44px rgba(0, 0, 0, 0.4); }
.card:hover::after { opacity: 1; }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.card-title { font-size: clamp(1.2rem, 2.4vw, 1.55rem); font-weight: 800; letter-spacing: -0.02em; }
.card-sub { color: var(--faint); font-weight: 500; font-size: 0.72em; }
.card-desc { color: var(--muted); font-size: 15px; line-height: 1.62; flex: 1; }

.tag {
  flex-shrink: 0; font-size: 11.5px; font-weight: 700; letter-spacing: 0.03em;
  padding: 5px 11px; border-radius: 100px; white-space: nowrap;
  color: var(--faint); background: var(--surface-2); border: 1px solid var(--line);
}
.tag-live { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.tag-live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: middle; box-shadow: 0 0 8px var(--ok); }

.card-tech { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.card-tech li {
  font-size: 12.5px; font-weight: 500; color: var(--muted);
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-3);
}
.card-links { margin-top: 18px; }
.card-links a { color: var(--accent); font-size: 14px; font-weight: 600; transition: color 0.2s var(--ease); }
.card-links a:hover { color: var(--accent-ink); }

@media (max-width: 720px) {
  .cards { grid-template-columns: 1fr; }
  .card:first-child { grid-column: span 1; }
}

/* ---------- stack ---------- */
.stack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.stack-group { padding: 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.stack-group h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 16px; }
.stack-group ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.stack-group li {
  font-size: 13.5px; color: var(--ink); padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface-3);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.stack-group li:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- contact ---------- */
.section-contact { padding-bottom: clamp(80px, 12vh, 140px); }
.contact-card {
  text-align: center; max-width: 640px; margin-inline: auto;
  padding: clamp(40px, 6vw, 72px) clamp(24px, 5vw, 56px);
  border: 1px solid var(--line-strong); border-radius: 24px;
  background:
    radial-gradient(600px 300px at 50% -20%, rgba(232, 176, 74, 0.1), transparent 60%),
    var(--surface);
}
.contact-card .section-kicker { margin-bottom: 12px; }
.contact-card h2 { font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 800; letter-spacing: -0.03em; }
.contact-sub { margin: 18px auto 32px; max-width: 44ch; color: var(--muted); font-size: 1.05rem; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--faint); font-size: 13.5px; }
.footer-note { color: var(--faint); }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ============================================================
   ADDITIONS — categorized portfolio (apps / experience / tools)
   ============================================================ */

/* card header block (type label + title), status tag to the right */
.card-head { display: flex; flex-direction: column; gap: 6px; }
.card-type {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--accent);
}

/* concept / not-yet-built card */
.card-muted { opacity: 0.82; }
.card-muted .card-type { color: var(--faint); }

/* ---------- mini grid (segurança & ferramentas) ---------- */
.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.mini-card {
  padding: 26px 24px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.mini-card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.mini-card h3 {
  font-size: 16px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 10px;
  display: flex; align-items: center; gap: 9px;
}
.mini-card h3::before {
  content: ""; width: 7px; height: 7px; border-radius: 2px;
  background: linear-gradient(145deg, var(--accent-ink), var(--accent)); flex-shrink: 0;
}
.mini-card p { font-size: 14.5px; color: var(--muted); line-height: 1.6; }

/* ---------- experience ---------- */
.exp-placeholder {
  border: 1px dashed var(--line-strong); border-radius: var(--r);
  background: var(--surface); padding: clamp(28px, 4vw, 40px);
  display: flex; flex-direction: column; gap: 14px; align-items: flex-start;
}
.exp-badge {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent-soft); border-radius: 100px; padding: 5px 13px;
}
.exp-placeholder p { color: var(--muted); font-size: 15.5px; max-width: 60ch; }

/* timeline (usado quando a experiência for preenchida) */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.tl-item {
  display: grid; grid-template-columns: 160px 1fr; gap: 24px;
  padding: 26px 0; border-top: 1px solid var(--line);
}
.tl-item:last-child { border-bottom: 1px solid var(--line); }
.tl-period { color: var(--faint); font-size: 14px; font-weight: 600; padding-top: 2px; }
.tl-role { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.tl-desc { color: var(--muted); font-size: 15px; margin-top: 6px; line-height: 1.6; }
.tl-tags { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tl-tags li {
  font-size: 12.5px; color: var(--muted);
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-3);
}
@media (max-width: 640px) {
  .tl-item { grid-template-columns: 1fr; gap: 8px; }
}
