/* Tokens, type, navigation, buttons and the sign-in dialog. */

@font-face {
  font-family: "Mona Sans";
  src: url(../fonts/mona-sans-latin.woff2) format("woff2-variations"), url(../fonts/mona-sans-latin.woff2) format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Mona Sans";
  src: url(../fonts/mona-sans-latin-ext.woff2) format("woff2-variations"), url(../fonts/mona-sans-latin-ext.woff2) format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Metric twin of Mona Sans on Arial, so the swap does not move the layout. */
@font-face {
  font-family: "Mona Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 104%;
  ascent-override: 104.8%;
  descent-override: 30.8%;
  line-gap-override: 0%;
}

:root {
  --night: #060a12;
  --deep: #0a111f;
  --panel: #0d1627;
  --panel-2: #121d33;
  --line: rgba(172, 198, 226, 0.12);
  --line-2: rgba(172, 198, 226, 0.22);
  --frost: #e8eef6;
  --mist: #a3b3c8;
  --fog: #7a8ba2;
  --glacier: #7ab0d0;
  --glacier-deep: #4e8eb8;
  --copper: #c89060;
  --copper-lite: #f0c48f;
  --ok: #6fd9ab;
  --err: #ff9a9a;
  --font: "Mona Sans", "Mona Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --swing: cubic-bezier(0.65, 0, 0.35, 1);
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 22px;
  --w: 1240px;
  --gut: clamp(20px, 4vw, 40px);
  --nav-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  background: var(--night);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}
body {
  min-height: 100vh;
  background: var(--night);
  color: var(--frost);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-stretch: 100%;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
::selection { background: rgba(200, 144, 96, 0.4); color: #fff; }
:focus-visible { outline: 2px solid var(--glacier); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.hidden { display: none !important; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 16px; top: -60px; z-index: 200; padding: 10px 16px;
  background: var(--frost); color: var(--night); border-radius: var(--r-s); font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip:focus { top: 16px; }

.wrap { width: min(100% - 2 * var(--gut), var(--w)); margin-inline: auto; }
section { position: relative; }

/* Type */
.display, h1, h2 {
  font-stretch: 112%;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-wrap: balance;
}
h2 { font-size: clamp(2.2rem, 4.6vw, 4rem); }
h3 { font-size: 1.3125rem; font-weight: 620; letter-spacing: -0.012em; line-height: 1.25; font-stretch: 104%; }
p { text-wrap: pretty; }
.lede { font-size: clamp(1.0625rem, 1.35vw, 1.25rem); color: var(--mist); max-width: 34em; line-height: 1.55; }
.lede strong { color: var(--frost); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.chapter-head { max-width: 46rem; margin-bottom: clamp(36px, 5vw, 64px); }
.chapter-head h2 + .lede { margin-top: 22px; }
.chapter { padding-block: clamp(96px, 12vw, 168px); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding: 0 24px; border-radius: var(--r-m);
  font-weight: 600; font-size: 1rem; letter-spacing: -0.005em; white-space: nowrap;
  transition: transform 0.35s var(--ease), background-color 0.25s, box-shadow 0.35s var(--ease), border-color 0.25s, color 0.25s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary {
  background: var(--frost); color: var(--night);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 10px 30px -12px rgba(200, 144, 96, 0.55);
}
.btn-primary:hover {
  background: #fff;
  box-shadow: 0 1px 0 #fff inset, 0 0 0 1px rgba(240, 196, 143, 0.7), 0 18px 44px -14px rgba(200, 144, 96, 0.8);
}
.btn-ghost { border: 1px solid var(--line-2); color: var(--frost); background: rgba(232, 238, 246, 0.02); }
.btn-ghost:hover { border-color: rgba(232, 238, 246, 0.45); background: rgba(232, 238, 246, 0.07); }
.btn-small { height: 40px; padding: 0 16px; font-size: 0.9375rem; border-radius: 10px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.assure { display: flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 0.9375rem; color: var(--mist); }
.assure svg { width: 18px; height: 18px; color: var(--ok); flex: none; }

/* Navigation */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  transition: background-color 0.35s, box-shadow 0.35s, backdrop-filter 0.35s;
}
.nav.scrolled {
  background: rgba(6, 10, 18, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 1px 0 var(--line);
}
.nav-inner { height: 100%; display: flex; align-items: center; gap: 36px; }
.nw { white-space: nowrap; }
.nav-logo img { height: 34px; width: auto; }
@media (min-width: 900px) { .nav-logo img { height: 40px; } }
.nav-links { display: flex; gap: 28px; margin-right: auto; }
.nav-links a { font-size: 0.9375rem; color: var(--mist); font-weight: 500; transition: color 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--frost); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-signin { font-size: 0.9375rem; font-weight: 550; color: var(--frost); padding: 8px 12px; border-radius: 10px; }
.nav-signin:hover { background: rgba(232, 238, 246, 0.07); }
.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 12px; margin-left: auto; align-items: center; justify-content: center; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 20px; height: 2px; background: var(--frost); border-radius: 2px; position: relative;
  transition: transform 0.35s var(--ease), background-color 0.2s;
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 45; padding: calc(var(--nav-h) + 24px) var(--gut) 32px;
  background: rgba(6, 10, 18, 0.96);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  display: flex; flex-direction: column; gap: 6px;
  opacity: 0; visibility: hidden; transition: opacity 0.35s var(--ease), visibility 0s linear 0.35s;
}
.nav-open .menu { opacity: 1; visibility: visible; transition: opacity 0.35s var(--ease); }
.menu a:not(.btn) { font-size: 2rem; font-weight: 650; font-stretch: 110%; letter-spacing: -0.03em; padding: 6px 0; }
.menu .actions { margin-top: auto; }
.menu .btn { flex: 1; }

@media (max-width: 960px) {
  .nav-links, .nav-actions { display: none; }
  /* The bars, not the button round them, line up with the edge of the text. */
  .nav-toggle { display: inline-flex; margin-right: -12px; }
}

/* Reveal on scroll: one quiet movement, never on the hero. */
.rise { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.rise.in { opacity: 1; transform: none; }
.no-js .rise { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .rise { opacity: 1; transform: none; }
}

/* The site-wide cookie notice (src/ui/cookieBanner.js) in this page's look. It only informs
   about essential cookies, so here it waits in a corner instead of blurring the page. */
html .cb-backdrop { display: none; }
html .cb-overlay { padding: 0 16px 18px; animation: cb-rise 0.7s var(--ease) 1.6s both; }
@keyframes cb-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
html .cb-card {
  display: flex; align-items: center; gap: 18px; max-width: 600px; padding: 10px 10px 10px 18px; border-radius: 14px; border: 1px solid var(--line-2);
  background: rgba(13, 22, 39, 0.94); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.85);
  font-family: var(--font); font-size: 0.875rem; color: var(--mist);
}
html .cb-header { display: none; }
html .cb-text { margin: 0; color: var(--mist); line-height: 1.45; }
html .cb-actions { flex: none; }
html .cb-text a { color: var(--glacier); }
html .cb-btn { font: inherit; font-size: 0.875rem; font-weight: 600; padding: 9px 22px; border-radius: 10px; letter-spacing: 0; }
html .cb-btn-accept, html .cb-btn-accept:hover { border: 0; box-shadow: none; transform: none; color: var(--night); background: var(--frost); }
html .cb-btn-accept:hover { background: #fff; }
@media (max-width: 600px) { html .cb-overlay { padding: 0 12px 12px; } html .cb-card { max-width: none; } }

/* Mona Sans covers Latin only; Chinese and Devanagari come from the system's own fonts. Tight
   tracking and short lines are made for Latin capitals: here they would crowd the characters
   and clip the marks above and below the line. */
:root:lang(zh) { --font: "Mona Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif; }
:root:lang(hi) { --font: "Mona Sans", "Nirmala UI", "Kohinoor Devanagari", "Noto Sans Devanagari", system-ui, sans-serif; }
:lang(zh) :is(.display, h1, h2, h3, .hero-title), :lang(hi) :is(.display, h1, h2, h3, .hero-title) { letter-spacing: 0; line-height: 1.25; }
:lang(hi) body { line-height: 1.75; }
