/* ════════════════════════════════════════════════════════════
   PERÍCIA · Rodrigo Gaspar — Computação Forense
   Shared design system
   ════════════════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

:root {
  /* ── Ink / navy ── */
  --ink-900: #0a1320;   /* deepest */
  --ink-850: #0d1828;
  --ink-800: #101f33;
  --ink-700: #18304b;
  --ink-600: #21405f;
  --ink-line: rgba(233,224,206,0.12);

  /* ── Paper ── */
  --paper:    #f4efe5;   /* warm ivory */
  --paper-2:  #efe8da;
  --paper-card: #fbf8f1;
  --paper-line: rgba(16,31,51,0.12);

  /* ── Accent (overridable by Tweaks) ── */
  --accent:      #b88a3a;   /* restrained gold */
  --accent-soft: #cda75e;
  --accent-12:   rgba(184,138,58,0.12);
  --accent-22:   rgba(184,138,58,0.22);
  --accent-06:   rgba(184,138,58,0.06);

  /* ── Text ── */
  --on-dark:      #f4efe5;
  --on-dark-70:   rgba(244,239,229,0.70);
  --on-dark-45:   rgba(244,239,229,0.45);
  --on-dark-28:   rgba(244,239,229,0.28);
  --on-light:     #101f33;
  --on-light-70:  #3a4a5e;
  --on-light-45:  #6b7888;

  /* ── Type ── */
  --ff-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --ff-sans:    'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --ff-mono:    'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* ── Rhythm ── */
  --pad-x: clamp(28px, 6vw, 100px);
  --maxw: 1280px;
}

body {
  font-family: var(--ff-sans);
  background: var(--ink-900);
  color: var(--on-dark);
  overflow-x: hidden;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.005em;
}

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

/* ── Shared utility type ── */
.kicker {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.kicker::before {
  content: '';
  width: 22px; height: 1px;
  background: var(--accent);
  opacity: 0.8;
}
.kicker.no-rule::before { display: none; }

.eyebrow {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.display {
  font-family: var(--ff-display);
  font-weight: 420;
  line-height: 1.04;
  letter-spacing: -0.02em;
}
.display em { font-style: italic; color: var(--accent); font-weight: 440; }

/* ════════════ NAV ════════════ */
.site-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad-x);
  background: rgba(10,19,32,0.72);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--ink-line);
  transition: background .3s, padding .3s;
}
.site-nav.solid { background: rgba(10,19,32,0.94); }
/* Cabeçalho ganha fundo sólido enquanto o menu mobile está aberto,
   para nunca aparecer transparente sobreposto ao menu. */
.site-nav.menu-open { background: rgba(10,19,32,0.98); backdrop-filter: blur(14px); }
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--on-dark);
}
.brand-mark {
  width: 30px; height: 30px;
  border: 1px solid var(--accent-22);
  display: grid; place-items: center;
  font-family: var(--ff-mono); font-size: 13px; color: var(--accent);
  flex-shrink: 0;
}
.brand-name {
  font-family: var(--ff-display);
  font-size: 18px; font-weight: 500; letter-spacing: -0.01em;
  line-height: 1; white-space: nowrap;
}
.brand-name small {
  display: block;
  font-family: var(--ff-mono); font-size: 9px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--on-dark-45);
  margin-top: 4px; white-space: nowrap;
}

/* ── brand subtitle split-flap (built by nav-menu.js) ── */
.brand-flip {
  display: inline-block; perspective: 340px;
  vertical-align: bottom; line-height: 1;
}
.brand-flip-card {
  position: relative; display: inline-block;
  transform-style: preserve-3d;
  transition: transform .62s cubic-bezier(.45,.05,.18,1);
}
.brand-flip-card.is-back { transform: rotateX(180deg); }
.brand-flip-face {
  display: block; white-space: nowrap;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: opacity 0s linear .31s; /* swap faces at the flip midpoint */
}
.brand-flip-back {
  position: absolute; left: 0; top: 0;
  transform: rotateX(180deg); opacity: 0;
}
.brand-flip-card.is-back .brand-flip-front { opacity: 0; }
.brand-flip-card.is-back .brand-flip-back { opacity: 1; }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--on-dark-70); text-decoration: none;
  transition: color .2s; position: relative; padding: 4px 0; white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: var(--on-dark); }
.nav-links a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--accent);
}
.nav-right { display: flex; align-items: center; gap: 18px; }

/* ── mobile menu (built by nav-menu.js) ── */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 0 9px; cursor: pointer;
  background: transparent; border: 1px solid var(--ink-line);
}
.nav-toggle span { display: block; height: 1.5px; width: 100%; background: var(--accent); transition: transform .25s, opacity .2s; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.nav-mobile {
  position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 99;
  height: 100dvh; overflow-y: auto;
  background: rgba(10,19,32,0.98); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ink-line);
  padding: 92px var(--pad-x) 32px;
  transform: translateY(-100%); transition: transform .32s cubic-bezier(.4,0,.2,1);
  list-style: none; display: flex; flex-direction: column;
}
.site-nav.menu-open + .nav-mobile, .nav-mobile.open { transform: translateY(0); }
.nav-mobile li { border-top: 1px solid var(--ink-line); }
.nav-mobile a {
  display: block; padding: 18px 2px; text-decoration: none;
  font-family: var(--ff-display); font-size: 22px; color: var(--on-dark);
}
.nav-mobile a.active { color: var(--accent); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ff-mono); font-size: 11.5px; letter-spacing: 0.12em;
  text-transform: uppercase; text-decoration: none; cursor: pointer;
  padding: 14px 26px; border: 1px solid transparent;
  transition: all .22s ease; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--ink-900); border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-soft); border-color: var(--accent-soft); transform: translateY(-1px); }
.btn-ghost { color: var(--on-dark); border-color: var(--on-dark-28); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost-dark { color: var(--on-light); border-color: var(--paper-line); }
.btn-ghost-dark:hover { border-color: var(--accent); color: var(--accent); }
.btn .arrow { transition: transform .22s; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-sm { padding: 10px 18px; font-size: 10.5px; }

/* ════════════ FOOTER ════════════ */
.site-footer {
  background: var(--ink-900);
  border-top: 1px solid var(--ink-line);
  padding: 72px var(--pad-x) 36px;
}
.footer-grid {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 48px;
  padding-bottom: 48px; border-bottom: 1px solid var(--ink-line);
}
.footer-grid .brand { margin-bottom: 20px; }
.footer-blurb { color: var(--on-dark-45); font-size: 14px; max-width: 340px; line-height: 1.7; }
.footer-col h5 {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 18px;
}
.footer-col a {
  display: block; text-decoration: none; color: var(--on-dark-70);
  font-size: 14px; padding: 6px 0; transition: color .2s;
}
.footer-col a:hover { color: var(--on-dark); }
.footer-bottom {
  max-width: var(--maxw); margin: 0 auto; padding-top: 28px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px;
}
.footer-bottom span {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.1em;
  color: var(--on-dark-28); text-transform: uppercase;
}

/* ════════════ SECTION SCAFFOLD ════════════ */
section { position: relative; }
.wrap { max-width: var(--maxw); margin: 0 auto; }
.pad { padding: clamp(72px, 9vw, 130px) var(--pad-x); }

.section-head { max-width: 760px; margin-bottom: 64px; }
.section-head .kicker { margin-bottom: 26px; }
.section-title {
  font-family: var(--ff-display); font-weight: 430; letter-spacing: -0.02em;
  font-size: clamp(34px, 4.4vw, 56px); line-height: 1.08;
}
.section-title em { font-style: italic; color: var(--accent); }
.section-lead {
  font-size: clamp(16px, 1.4vw, 19px); line-height: 1.7;
  color: var(--on-light-70); margin-top: 22px; max-width: 620px;
}

/* tone variants */
.on-paper { background: var(--paper); color: var(--on-light); }
.on-paper .section-title { color: var(--on-light); }
.on-paper .kicker { color: var(--accent); }
.on-ink { background: var(--ink-850); color: var(--on-dark); }
.on-ink .section-lead { color: var(--on-dark-70); }
.on-ink-deep { background: var(--ink-900); color: var(--on-dark); }
.on-ink-deep .section-lead { color: var(--on-dark-70); }

/* ── Vínculos institucionais (timeline em grade invertida) ── */
.vinc-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(40px,6vw,90px); align-items: start; margin-top: clamp(72px, 9vw, 120px); }
.vinc-colL { order: 1; }
.vinc-intro { order: 2; }
.vinc-intro .section-lead em { font-style: italic; color: var(--accent); }
.vinc-intro .section-lead .hl { color: var(--accent); font-weight: 500; }
.vinc-intro .section-lead { margin-top: 22px; text-align: justify; text-justify: inter-word; }
.vinc-list { border-top: 1px solid var(--ink-line); }
.vinc-item { padding: 28px 0; border-bottom: 1px solid var(--ink-line); }
.vinc-body h4 { font-family: var(--ff-display); font-size: clamp(20px,2vw,27px); font-weight: 500; line-height: 1.2; color: var(--on-dark); margin-bottom: 7px; }
.vinc-org { font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.vinc-body p { font-size: 15px; line-height: 1.7; color: var(--on-dark-70); text-align: justify; text-justify: inter-word; }
.on-paper .vinc-list, .on-paper .vinc-item { border-color: var(--paper-line); }
.on-paper .vinc-body h4 { color: var(--on-light); }
.on-paper .vinc-body p { color: var(--on-light-70); }
@media (max-width: 980px) {
  .vinc-grid { grid-template-columns: 1fr; }
  .vinc-intro { order: 1; margin-bottom: 12px; }
  .vinc-colL { order: 2; }
}

/* ── reveal: no-op hooks (preview renderer freezes animations at t=0, so
   we never gate visibility on animation/transition). Kept as harmless classes. ── */
.reveal { opacity: 1; }

/* ── responsive ── */
@media (max-width: 980px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  /* CTA moves into the slide-down menu, freeing room for the brand */
  .nav-right > .btn { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .brand-name { font-size: 16px; }
  .brand-name small { font-size: 8px; letter-spacing: 0.16em; }
}

/* CTA cloned into the mobile menu — keep the primary-button look,
   overriding the generic .nav-mobile a link styling */
.nav-mobile-cta { border-top: none !important; margin-top: 24px; }
.nav-mobile-cta a.btn {
  display: inline-flex; width: 100%; justify-content: center;
  font-family: var(--ff-mono); font-size: 12px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-900); padding: 18px 26px;
}
