/* ── Zerion Brand — shared styles ── */

@font-face {
  font-family: 'Aeonik Pro';
  src: url('fonts/AeonikPro-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Aeonik Pro';
  src: url('fonts/AeonikPro-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}

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

/* ── Design tokens ── */
:root {
  --sidebar-w: 300px;
  --header-h:  108px;

  /* ── Brand palette ── */
  --navy:     #06003C;
  --original: #3232DC;
  --digital:  #2461ED;
  --blue:     #56ACFF;
  --mint:     #3FFDEE;
  --peach:    #FF7583;
  --pink:     #FFBDFF;
  --grey:     #F0F0F0;

  /* ── Neutral scale (light) ── */
  --neutral-100: #f5f5f7;   /* Surface background */
  --neutral-200: #f0f0f2;   /* Component bg / input */
  --neutral-300: #e6e7e9;   /* Dividers, surface borders */
  --neutral-400: #cdced3;   /* Secondary element borders */
  --neutral-500: #9c9fa8;   /* UI secondary text & icons */
  --neutral-600: #81848e;   /* Secondary text & descriptions */
  --neutral-700: #71727d;   /* Placeholders, labels */
  --neutral-800: #44444e;   /* Navigation menu labels */

  /* ── Semantic — light ── */
  --surface:          #ffffff;
  --surface-hi:       var(--neutral-100);
  --surface-lo:       #2a2a3e; /* toggle active — unused in light */
  --text:             #16161a;              /* on-surface/regular  */
  --text-2:           var(--neutral-600);   /* on-surface/secondary */
  --text-3:           var(--neutral-500);
  --border:           var(--neutral-300);
  --divider:          var(--neutral-200);

  --font: 'Aeonik Pro', -apple-system, sans-serif;
}

html.dark {
  /* ── Neutral scale (dark) ── */
  --neutral-100: #1d1d21;   /* Surface background */
  --neutral-200: #29292c;   /* Component bg / input */
  --neutral-300: #2d2d32;   /* Dividers, surface borders */
  --neutral-400: #45464a;   /* Secondary element borders */
  --neutral-500: #70737b;   /* UI secondary text & icons */
  --neutral-600: #868990;   /* Secondary text & descriptions */
  --neutral-700: #9da0a6;   /* Placeholders, labels */
  --neutral-800: #cecfd1;   /* Navigation menu labels */

  --surface:    #16161a;    /* surface/regular */
  --surface-hi: var(--neutral-100);
  --surface-lo: #2a2a3e;
  --text:       #ececed;    /* on-surface/regular */
  --text-2:     var(--neutral-600);
  --text-3:     var(--neutral-500);
  --border:     var(--neutral-300);
  --divider:    var(--neutral-200);
}

/* ── Base ── */
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  display: flex; flex-direction: column;
  z-index: 10;
}
.sidebar-logo {
  height: var(--header-h);
  display: flex; align-items: center;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-nav { border-right: 1px solid var(--border); }
.z-logo { display: flex; align-items: center; text-decoration: none; }
.z-logo-light    { display: block; }
.z-logo-dark     { display: none; }
html.dark .z-logo-light { display: none; }
html.dark .z-logo-dark  { display: block; }

.sidebar-nav { padding: 32px; flex: 1; overflow-y: auto; }
.nav-group { display: flex; flex-direction: column; gap: 8px; }
.nav-section-label {
  font-size: 16px; font-weight: 500; line-height: 24px;
  letter-spacing: 0.25px; color: var(--text); text-decoration: none;
}
.nav-section-label.inactive { color: var(--text-2); }
.nav-sub { display: flex; flex-direction: column; gap: 8px; padding-left: 16px; }
/* Mobile-only nav links (Design Foundations / Milestones in drawer) */
.mobile-only-link { display: none; }
@media (max-width: 767px) {
  .mobile-only-link { display: block; }
}
.nav-item {
  display: block; font-size: 16px; font-weight: 400; line-height: 24px;
  letter-spacing: 0.1px; color: var(--text-2); text-decoration: none;
  transition: color 0.15s;
}
.nav-item:hover  { color: var(--text); }
.nav-item.active { color: var(--text); font-weight: 500; }
.nav-item.disabled { pointer-events: none; opacity: 0.4; cursor: default; }
.nav-soon {
  font-size: 11px; font-weight: 400;
  color: #b0b3bb; letter-spacing: 0.1px; margin-left: 4px;
}

/* ── Layout ── */
.main    { margin-left: var(--sidebar-w); }
.top-bar {
  position: sticky; top: 0; z-index: 5;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0 48px;
}
.top-bar-logo { display: none; align-items: center; text-decoration: none; }
.top-bar-logo .z-logo-light { display: block; }
.top-bar-logo .z-logo-dark { display: none; }
html.dark .top-bar-logo .z-logo-light { display: none; }
html.dark .top-bar-logo .z-logo-dark { display: block; }
.content { padding: 32px 32px 80px; max-width: 1200px; margin: 0 auto; }

/* ── Theme toggle — single icon ── */
.theme-toggle {
  display: flex; background: var(--border);
  border-radius: 10px; padding: 3px;
}
.theme-btn {
  width: 36px; height: 32px; border-radius: 7px; border: none;
  cursor: pointer; background: var(--surface); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: opacity 0.15s;
}
.theme-btn:hover { opacity: 0.75; }
.theme-btn svg { width: 16px; height: 16px; }
/* Light mode → show moon only */
#theme-light { display: none; }
#theme-dark  { display: flex; }
/* Dark mode → show sun only */
html.dark #theme-light { display: flex; }
html.dark #theme-dark  { display: none; }

/* ── Top nav links (Design Foundations / Milestones) ── */
.top-nav-links {
  display: flex; gap: 32px; align-items: center;
  margin-right: 32px;
}
.top-nav-link {
  font-size: 16px; font-weight: 500; line-height: 24px;
  letter-spacing: 0.25px; color: var(--text-2);
  text-decoration: none; transition: color 0.15s; white-space: nowrap;
}
.top-nav-link:hover { color: var(--text); }
.top-nav-link.active { color: var(--text); }

/* ── Page header ── */
.page-header {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 48px; margin-bottom: 32px;
}
.page-title { font-size: 60px; font-weight: 500; line-height: 72px; letter-spacing: -0.5px; }
.page-desc  { font-size: 20px; font-weight: 500; line-height: 24px; padding-top: 8px; }

/* ── Section ── */
.divider { height: 1px; background: var(--divider); margin: 48px 0 32px; }
.section-header { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-bottom: 32px; }
.section-title { font-size: 40px; font-weight: 500; line-height: 48px; letter-spacing: -0.5px; }
.section-desc  { font-size: 16px; font-weight: 500; line-height: 24px; letter-spacing: 0.25px; }

/* ── Hero ── */
.hero {
  width: 100%; height: 400px; border-radius: 16px;
  margin-bottom: 32px; overflow: hidden;
}
.hero video,
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }

.dl-tooltip {
  position: fixed; display: none;
  background: rgba(236,236,240,0.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--text); padding: 8px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500; letter-spacing: -0.1px;
  pointer-events: none; z-index: 9999; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
html.dark .dl-tooltip { background: rgba(29,29,33,0.92); color: var(--text); }

/* ── Large screen centering (sidebar 300 + content 1200 = 1500px total) ── */
@media (min-width: 1540px) {
  .sidebar { left: calc((100vw - 1500px) / 2); }
  .main {
    margin-left: calc((100vw - 1500px) / 2 + var(--sidebar-w));
    margin-right: calc((100vw - 1500px) / 2);
  }
  /* Replace individual header borders with a single full-viewport-width line */
  .sidebar-logo { border-bottom: none; }
  .top-bar      { border-bottom: none; }
  .sidebar-logo::after {
    content: '';
    position: fixed;
    top: calc(var(--header-h) - 1px);
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
    pointer-events: none;
    z-index: 5;
  }
}

/* ──────────────────────────────────────────
   RESPONSIVE
────────────────────────────────────────── */

/* Hamburger button — desktop: hidden */
.menu-btn {
  display: none;
  width: 36px; height: 36px; border: none; border-radius: 8px;
  background: transparent; color: var(--text-2);
  align-items: center; justify-content: center;
  cursor: pointer; transition: color 0.15s; flex-shrink: 0;
}
.menu-btn:hover { color: var(--text); }
.menu-btn svg { width: 20px; height: 20px; }

/* Sidebar overlay backdrop */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 99;
}
.sidebar-overlay.open { display: block; }

/* ── Tablet ≤ 1023px ── */
@media (max-width: 1023px) {
  :root { --sidebar-w: 220px; }
  .sidebar-logo { padding: 0 20px; }
  .sidebar-nav { padding: 24px 20px; }
  .top-bar { padding: 0 24px; }
  .content { padding: 24px 24px 60px; }
  .page-title { font-size: 48px; line-height: 56px; }
  .section-title { font-size: 32px; line-height: 40px; }
  .page-header { gap: 24px; margin-bottom: 32px; }
  .section-header { gap: 24px; }
  .hero { height: 320px; }
}

/* ── Mobile ≤ 767px ── */
@media (max-width: 767px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.25, 0, 0, 1);
    z-index: 100;
  }
  .sidebar.open { transform: translateX(0); }

  .main { margin-left: 0; }
  .menu-btn { display: flex; }

  /* Hide only inside .top-bar (inner pages have a hamburger to open sidebar) */
  .top-bar .top-nav-links { display: none; }

  /* Mobile top-bar layout for inner pages: logo (left) — theme — burger (right) */
  .top-bar-logo { display: flex; order: 1; margin-right: auto; }
  .top-bar .theme-toggle { order: 2; }
  .top-bar .menu-btn { order: 3; }

  .top-bar {
    padding: 0 20px;
    justify-content: space-between;
  }

  .content { padding: 20px 20px 60px; }

  .page-header { grid-template-columns: 1fr; gap: 12px; margin-bottom: 32px; }
  .page-title { font-size: 36px; line-height: 44px; }
  .page-desc { font-size: 16px; line-height: 22px; }

  .section-header { grid-template-columns: 1fr; gap: 8px; margin-bottom: 20px; }
  .section-title { font-size: 28px; line-height: 36px; }

  .hero { height: 220px; border-radius: 12px; margin-bottom: 32px; }
  .divider { margin: 28px 0 20px; }
}

/* ── Special text — scramble + reveal ── */
.special-text {
  white-space: pre-line;
  font-variant-numeric: tabular-nums;
}
