/* ============================================================
   VGU — Shared styles (imported by every page)
   ============================================================ */
@import url("tokens.css");

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { overflow-x: clip; scroll-behavior: smooth; }
body {
  overflow-x: clip;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--t-light);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg, video, canvas { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; font-weight: 600; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
ul[class], ol[class] { list-style: none; padding: 0; }
::selection { background: var(--electric); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
html:focus-within { scroll-behavior: smooth; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 300;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: var(--r-pill);
  text-decoration: none; font-size: var(--fs-sm); transition: top var(--dur-2) var(--ease-out);
}
.skip-link:focus { top: 12px; }

/* ---------- Layout primitives ---------- */
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); }
.section { padding-block: clamp(3.4rem, 8vw, 6.5rem); }
.section--dark { background: var(--ink); color: var(--t-dark); }
.section--ink2 { background: var(--ink-2); color: var(--t-dark); }
.section--paper2 { background: var(--paper-2); }

.section-head { max-width: 720px; margin-bottom: var(--sp-7); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--row {
  max-width: none; display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-5); flex-wrap: wrap;
}
.section-head--row .section-head__lede { max-width: 460px; }

.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: var(--fs-xs); font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--electric);
  margin-bottom: var(--sp-4);
}
.section--dark .kicker, .section--ink2 .kicker { color: var(--cyan); }
.kicker::before { content: ""; width: 26px; height: 2px; background: currentColor; }

.section-head h1, .section-head h2 { font-size: var(--fs-h2); margin-bottom: var(--sp-4); }
.section-head__lede { color: var(--t-light-2); font-size: var(--fs-lede); max-width: 60ch; }
.section--dark .section-head__lede, .section--ink2 .section-head__lede { color: var(--t-dark-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 28px; border-radius: var(--r-pill); border: 1px solid transparent;
  font-family: var(--font-display); font-weight: 600; font-size: var(--fs-sm);
  letter-spacing: 0.02em; text-decoration: none; cursor: pointer;
  transition: background var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
  will-change: transform;
}
.btn--solid { background: var(--accent); color: #fff; }
.btn--solid:hover { background: var(--accent-deep); transform: translateY(-1px); box-shadow: var(--shadow-1); }
.btn--paper { background: var(--paper); color: var(--t-light); }
.btn--paper:hover { background: #fff; transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn--cyan { background: var(--gold); color: var(--ink); }
.btn--cyan:hover { background: #cfa75d; transform: translateY(-1px); box-shadow: var(--shadow-1); }
.btn--ghost { border-color: currentColor; color: inherit; background: transparent; }
.btn--solid, .btn--cyan, .btn--paper {
  transition: background var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.btn--ghost:hover { background: rgba(142, 42, 32, 0.08); }
.btn--ghost-light { border-color: rgba(255,255,255,0.35); color: #fff; background: transparent; }
.btn--ghost-light:hover { border-color: var(--cyan); color: var(--cyan); }
.btn--sm { padding: 10px 20px; font-size: var(--fs-xs); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display);
  font-weight: 600; font-size: var(--fs-sm); text-decoration: none; color: var(--electric);
}
.link-arrow svg { transition: transform var(--dur-2) var(--ease-out); }
.link-arrow:hover svg { transform: translateX(5px); }
.section--dark .link-arrow, .section--ink2 .link-arrow { color: var(--cyan); }

/* ---------- Tags ---------- */
.tag {
  display: inline-block; padding: 4px 12px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em;
  background: rgba(142, 42, 32, 0.08); color: var(--accent); border: 1px solid rgba(142, 42, 32, 0.3);
}
.section--dark .tag, .section--ink2 .tag { background: rgba(193, 154, 75, 0.1); color: var(--gold); border-color: rgba(193, 154, 75, 0.35); }
.tag--gold { background: rgba(240,180,41,0.12); color: #a97a0c; border-color: rgba(240,180,41,0.4); }
.tag--violet { background: rgba(169,138,77,0.12); color: #7c6432; border-color: rgba(169,138,77,0.4); }
.tag--outline { background: transparent; border-color: var(--line-light); color: var(--t-light-2); }
.section--dark .tag--outline, .section--ink2 .tag--outline { border-color: var(--line-dark); color: var(--t-dark-2); }

/* ---------- Announcement bar ---------- */
.announce {
  background: var(--accent);
  color: #f6ede6; font-size: var(--fs-xs); text-align: center; padding: 9px 16px;
  position: relative; z-index: 60;
}
.announce a { color: #fff; font-weight: 700; text-underline-offset: 3px; }
.announce .tag-demo { opacity: 0.75; font-weight: 400; margin-left: 10px; }

/* ---------- Header / navigation ---------- */
.site-head {
  position: sticky; top: 0; z-index: 100;
  background: rgba(24, 18, 12, 0.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-dark);
  min-height: var(--nav-h);
}
.site-head__inner {
  max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(16px, 3vw, 32px);
  display: flex; align-items: center; gap: var(--sp-5); min-height: var(--nav-h);
}
.brand {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.02em;
  flex-shrink: 0;
}
.brand__mark { width: 40px; height: 40px; flex-shrink: 0; }
.brand small { display: block; font-size: 0.6rem; font-weight: 500; letter-spacing: 0.14em; color: var(--t-dark-2); text-transform: uppercase; line-height: 1.4; }
.brand strong { line-height: 1.1; }

.site-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.site-nav > li { position: relative; }
.site-nav > li > a, .site-nav > li > button {
  display: flex; align-items: center; gap: 6px; padding: 10px 13px; border: 0; background: none;
  color: var(--t-dark-2); font-family: var(--font-display); font-weight: 500; font-size: 0.92rem;
  text-decoration: none; cursor: pointer; border-radius: var(--r-sm);
  transition: color var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out);
  white-space: nowrap;
}
.site-nav > li > a:hover, .site-nav > li > button:hover,
.site-nav > li > a[aria-expanded="true"], .site-nav > li > button[aria-expanded="true"] {
  color: #fff; background: rgba(255, 255, 255, 0.06);
}
.site-nav .caret { width: 9px; height: 9px; transition: transform var(--dur-2) var(--ease-out); }
.site-nav > li > button[aria-expanded="true"] .caret { transform: rotate(180deg); }
.site-nav__cta { margin-left: 10px; }

.dropdown {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  min-width: 230px; padding: 10px; border-radius: var(--r-md);
  background: var(--ink-2); border: 1px solid var(--line-dark); box-shadow: var(--shadow-2);
  display: grid; gap: 2px; opacity: 0; visibility: hidden; pointer-events: none;
  translate: 0 -6px; transition: opacity var(--dur-2) var(--ease-out), translate var(--dur-2) var(--ease-out), visibility 0s var(--dur-2);
}
.site-nav li:hover > .dropdown, .site-nav li:focus-within > .dropdown,
.site-nav li > button[aria-expanded="true"] + .dropdown {
  opacity: 1; visibility: visible; pointer-events: auto; translate: 0 0; transition-delay: 0s;
}
.dropdown a {
  display: block; padding: 9px 14px; border-radius: var(--r-sm); color: var(--t-dark-2);
  font-size: var(--fs-sm); text-decoration: none; font-weight: 500;
  transition: color var(--dur-1), background var(--dur-1);
}
.dropdown a:hover { color: #fff; background: rgba(193, 154, 75, 0.1); }
.dropdown a span { display: block; font-size: var(--fs-xs); color: var(--t-dark-2); opacity: 0.7; margin-top: 2px; }

.nav-toggle {
  display: none; margin-left: auto; width: 46px; height: 46px; border: 1px solid var(--line-dark);
  border-radius: var(--r-sm); background: none; cursor: pointer; position: relative;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after {
  content: ""; position: absolute; left: 12px; right: 12px; height: 2px;
  background: #fff; border-radius: 2px; transition: transform var(--dur-2) var(--ease-out), opacity var(--dur-2);
}
.nav-toggle::before { top: 16px; }
.nav-toggle span { top: 22px; }
.nav-toggle::after { top: 28px; }
body.nav-open .nav-toggle::before { transform: translateY(6px) rotate(45deg); }
body.nav-open .nav-toggle span { opacity: 0; }
body.nav-open .nav-toggle::after { transform: translateY(-6px) rotate(-45deg); }

/* Mobile nav overlay */
.mobile-nav {
  position: fixed; inset: 0; z-index: 90; background: var(--ink); color: var(--t-dark);
  padding: calc(var(--nav-h) + 40px) 24px 60px; overflow-y: auto;
  opacity: 0; visibility: hidden; transition: opacity var(--dur-2) var(--ease-out), visibility 0s var(--dur-2);
}
body.nav-open .mobile-nav { opacity: 1; visibility: visible; transition-delay: 0s; }
.mobile-nav__group { border-bottom: 1px solid var(--line-dark); padding: 14px 0; }
.mobile-nav__group > p {
  font-family: var(--font-display); font-size: var(--fs-xs); letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 8px;
}
.mobile-nav a { display: block; padding: 8px 0; color: var(--t-dark); text-decoration: none; font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; }
.mobile-nav a:active { color: var(--cyan); }
body.nav-open { overflow: hidden; }

/* ---------- Footer ---------- */
.site-foot { background: var(--ink); color: var(--t-dark-2); border-top: 1px solid var(--line-dark); }
.site-foot__grid {
  display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--sp-7);
  padding-block: var(--sp-8) var(--sp-7);
}
.site-foot__brand .brand { margin-bottom: var(--sp-4); }
.site-foot p { font-size: var(--fs-sm); }
.site-foot h3 {
  font-size: var(--fs-xs); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: var(--sp-4);
}
.site-foot ul { display: grid; gap: 9px; }
.site-foot a { color: var(--t-dark-2); text-decoration: none; transition: color var(--dur-1); }
.site-foot a:hover { color: var(--cyan); }
.site-foot__base {
  display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap;
  padding-block: var(--sp-5); border-top: 1px solid var(--line-dark); font-size: var(--fs-xs);
}
.site-foot__proto {
  margin-top: var(--sp-5); padding: 12px 18px; border: 1px dashed var(--line-dark);
  border-radius: var(--r-md); font-size: var(--fs-xs); color: var(--t-dark-2);
}

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field label { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-sm); }
.field label span { font-weight: 400; color: var(--t-light-2); }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 16px; border: 1px solid #cfc6b4; border-radius: var(--r-md);
  background: #fff; color: var(--t-light);
  font-family: var(--font-body); font-size: 1rem;
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.field input::placeholder, .field textarea::placeholder { color: #948a79; opacity: 1; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(142, 42, 32, 0.12);
}
.field input.is-invalid, .field select.is-invalid { border-color: #e5484d; box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.12); }
.field__error { color: #e5484d; font-size: var(--fs-xs); min-height: 1em; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4) var(--sp-5); }
.form-grid .field--full { grid-column: 1 / -1; }
.form-note { font-size: var(--fs-xs); color: var(--t-light-2); }
.form-status { font-size: var(--fs-sm); font-weight: 600; }
.form-status--err { color: #e5484d; }
.form-status--ok { color: #12926b; }
.section--dark .form-status--ok { color: #4ade80; }

/* ---------- Cards ---------- */
.card {
  background: var(--paper-2); border: 1px solid var(--line-light); border-radius: var(--r-lg);
  color: var(--t-light);
  padding: var(--sp-6); transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), border-color var(--dur-2);
  position: relative;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: rgba(142, 42, 32, 0.35); }
.card h3 { font-size: var(--fs-h3); margin-bottom: var(--sp-2); }
.card p { color: var(--t-light-2); font-size: var(--fs-sm); }
.card--dark { background: var(--ink-3); border-color: var(--line-dark); color: var(--t-dark); }
.card--dark p { color: var(--t-dark-2); }
.card__icon {
  width: 48px; height: 48px; border-radius: var(--r-md); display: grid; place-items: center;
  background: rgba(142, 42, 32, 0.08); color: var(--electric); margin-bottom: var(--sp-4);
}
.card--dark .card__icon { background: rgba(193, 154, 75, 0.1); color: var(--cyan); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); }
.stat { border-left: 2px solid var(--cyan); padding-left: var(--sp-4); }
.stat__num { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 4vw, 3.2rem); color: #fff; line-height: 1; }
.stat__num sup { font-size: 0.5em; color: var(--cyan); }
.stat__label { font-size: var(--fs-sm); color: var(--t-dark-2); margin-top: 6px; }
.stat__note { display: block; font-size: var(--fs-xs); opacity: 0.7; margin-top: 4px; }

/* ---------- Timeline ---------- */
.timeline { display: grid; gap: 0; position: relative; }
.timeline__item { display: grid; grid-template-columns: 90px 30px 1fr; gap: var(--sp-4); padding-block: var(--sp-5); position: relative; }
.timeline__item:not(:last-child)::before {
  content: ""; position: absolute; left: 104px; top: 46px; bottom: -18px; width: 2px; background: var(--line-light);
}
.timeline__time { font-family: var(--font-display); font-weight: 700; color: var(--electric); text-align: right; font-size: var(--fs-sm); padding-top: 3px; }
.timeline__dot { width: 14px; height: 14px; border-radius: 50%; background: var(--paper-2); border: 3px solid var(--electric); justify-self: center; margin-top: 4px; position: relative; z-index: 1; }
.timeline__text h3 { font-size: var(--fs-h3); margin-bottom: 4px; }
.timeline__text p { color: var(--t-light-2); font-size: var(--fs-sm); max-width: 60ch; }

/* ---------- Generic grids ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-5); }

/* ---------- Reveal animation (IO-based, works without GSAP) ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); transition-delay: var(--rd, 0ms); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Page hero (subpages) ---------- */
.page-hero {
  background: var(--ink); color: var(--t-dark); padding: clamp(4rem, 9vw, 7.5rem) 0 clamp(3rem, 6vw, 5rem);
  position: relative; overflow: clip;
  border-bottom: 3px solid var(--accent);
}
.page-hero__inner { position: relative; z-index: 1; }
.page-hero h1 { font-size: var(--fs-h1); max-width: 16ch; }
.page-hero .kicker { color: var(--cyan); }
.page-hero__lede { color: var(--t-dark-2); font-size: var(--fs-lede); max-width: 62ch; margin-top: var(--sp-4); }
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--t-dark-2); margin-bottom: var(--sp-5); }
.crumbs a { color: var(--t-dark-2); text-decoration: none; }
.crumbs a:hover { color: var(--cyan); }
.crumbs [aria-current] { color: var(--cyan); }

/* ---------- Search overlay ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(24, 18, 12, 0.94);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: none; padding: 12vh 20px 20px;
}
.search-overlay.is-open { display: block; }
.search-panel { max-width: 680px; margin-inline: auto; }
.search-panel input {
  width: 100%; padding: 18px 56px 18px 22px; font-size: 1.15rem; color: var(--t-dark);
  background: var(--ink-2); border: 1px solid var(--line-dark); border-radius: var(--r-md);
}
.search-panel input:focus { outline: none; border-color: var(--cyan); }
.search-close {
  position: absolute; top: 26px; right: 26px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line-dark); background: var(--ink-2); color: #fff; cursor: pointer; font-size: 1.1rem;
}
.search-results { margin-top: var(--sp-4); display: grid; gap: 6px; max-height: 56vh; overflow-y: auto; }
.search-results a {
  display: flex; justify-content: space-between; gap: 14px; align-items: baseline;
  padding: 12px 16px; border-radius: var(--r-sm); background: var(--ink-2); border: 1px solid var(--line-dark);
  color: var(--t-dark); text-decoration: none;
}
.search-results a:hover { border-color: var(--cyan); }
.search-results .where { font-size: var(--fs-xs); color: var(--cyan); flex-shrink: 0; }
.search-hint { color: var(--t-dark-2); font-size: var(--fs-sm); margin-top: var(--sp-4); }
kbd { font-family: var(--font-body); font-size: 0.72rem; background: var(--ink-3); border: 1px solid var(--line-dark); border-radius: 5px; padding: 2px 7px; }

/* ---------- Page transition & loader ---------- */
.transition-veil {
  position: fixed; inset: 0; z-index: 400; background: var(--ink);
  transform: scaleY(0); transform-origin: bottom; pointer-events: none;
}
.transition-veil.is-in { transform: scaleY(1); transition: transform 0.42s var(--ease-out); }
.transition-veil.is-out { transform: scaleY(0); transform-origin: top; transition: transform 0.42s var(--ease-out); }
.loader {
  position: fixed; inset: 0; z-index: 500; background: var(--ink); display: grid; place-items: center;
  transition: opacity 0.5s var(--ease-out), visibility 0s 0.5s;
}
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader__mark { text-align: center; color: #fff; font-family: var(--font-display); }
.loader__bar { width: 120px; height: 2px; background: var(--line-dark); margin: 18px auto 0; overflow: hidden; border-radius: 2px; }
.loader__bar i { display: block; height: 100%; width: 40%; background: var(--cyan); border-radius: 2px; animation: slide 0.9s linear infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line-light); border: 0; }
.section--dark .divider, .section--ink2 .divider { background: var(--line-dark); }
.note-proto { font-size: var(--fs-xs); color: var(--t-light-2); font-style: italic; }
.section--dark .note-proto, .section--ink2 .note-proto { color: var(--t-dark-2); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .site-nav { display: none; }
  .nav-toggle { display: block; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .site-foot__grid { grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
  .section-head--row { flex-direction: column; align-items: flex-start; }
  .timeline__item { grid-template-columns: 60px 24px 1fr; }
  .timeline__item:not(:last-child)::before { left: 70px; }
}
@media (max-width: 480px) {
  .site-foot__grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
}
@media (min-width: 1600px) {
  :root { --wrap: 1360px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .transition-veil, .loader { display: none !important; }
}
