@font-face {
  font-family: 'Geist Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/geist-cyrillic-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}

@font-face {
  font-family: 'Geist Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/geist-cyrillic-wght-normal.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: 'Geist Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/geist-latin-ext-wght-normal.woff2') format('woff2');
  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;
}

@font-face {
  font-family: 'Geist Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/geist-latin-wght-normal.woff2') format('woff2');
  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;
}

:root {
  --site-type: 'Geist Variable', system-ui, "Microsoft YaHei", sans-serif;
  --site-max: 1280px;
  --site-gutter: 16px;
  --site-width: min(var(--site-max), calc(100% - 2 * var(--site-gutter)));
  --section-gutter: max(var(--site-gutter), calc((100% - var(--site-max)) / 2));
  --section-space: 80px;
  --section-gap: 40px;
  --grid-gap: 24px;
  --card-inset: 32px;
  --reading-width: 730px;
  --nav-height: 84px;
  --type-display: 72px;
  --type-page: 40px;
  --type-section: 40px;
  --type-card: 24px;
  --type-lead: 20px;
  --type-prose: 20px;
  --type-body: 16px;
  --type-small: 14px;
  --body-leading: 1.5;
  --prose-leading: 1.625;
  --heading-leading: 1.25;
  --heading-tracking: 0;
  /* Core swatches from Radix Colors 3.0, plus neutral Viavert tints. */
  --mauve-1: #fdfcfd;
  --mauve-2: #faf9fb;
  --mauve-3: #f2eff3;
  --mauve-5: #e3dfe6;
  --mauve-6: #dbd8e0;
  --mauve-7: #d0cdd7;
  --mauve-10: #84828e;
  --mauve-11: #65636d;
  --mauve-12: #211f26;
  --plum-6: #e9c2ec;
  --plum-11: #953ea3;
  --plum-12: #53195d;
  --plum-dark-7: #734079;
  --red-11: #ce2c31;
  --green-11: #218358;
  --white: #ffffff;
  --smoke: #4c4550;
  --graphite: #211c24;
  --plum-mist: #f4edf5;

  /* Components use role names so the same state reads consistently on every page. */
  --brand-canvas: var(--mauve-1);
  --brand-paper: var(--white);
  --brand-soft: var(--mauve-2);
  --brand-surface: var(--mauve-3);
  --brand-line: var(--mauve-6);
  --brand-control: var(--mauve-10);
  --brand-ink: var(--mauve-12);
  --brand-secondary: var(--smoke);
  --brand-muted: var(--mauve-11);
  --brand-accent: var(--plum-dark-7);
  --brand-hover: var(--plum-12);
  --brand-tint: var(--plum-mist);
  --brand-selected: var(--mauve-5);
  --brand-focus: var(--plum-11);
  --brand-night: var(--graphite);
  --brand-halo: var(--plum-6);
  --brand-on-accent: var(--white);
  --brand-on-dark: var(--mauve-1);
  --brand-dark-muted: var(--mauve-7);
  --brand-danger: var(--red-11);
  --brand-success: var(--green-11);
  --motion-out: cubic-bezier(.22, 1, .36, 1);
}

::selection { color: var(--brand-ink); background: var(--brand-halo); }

.public-nav {
  box-sizing: border-box;
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: var(--site-width);
  min-height: var(--nav-height);
  padding: 4px 32px;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--brand-paper) 92%, transparent);
  border: 1px solid var(--brand-line);
  border-radius: 22px;
  box-shadow: 0 6px 20px #211f260d;
  backdrop-filter: blur(16px);
  font-family: var(--site-type);
}

@media (max-width: 767px) {
  :root {
    --site-gutter: 8px;
    --nav-height: 70px;
    --section-space: 64px;
    --section-gap: 32px;
    --grid-gap: 16px;
    --card-inset: 24px;
    --type-display: 44px;
    --type-page: 32px;
    --type-section: 28px;
    --type-card: 20px;
    --type-lead: 16px;
    --type-prose: 16px;
  }
  .public-nav { width: 90%; gap: 12px; padding: 8px 22px; border-radius: 18px; }
}

.reader-nav { color: var(--brand-ink); }
.reader-nav a { color: inherit; text-decoration: none; }
.reader-nav a:hover { color: var(--brand-accent); }
.reader-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 43px;
  line-height: 1;
  font-weight: 600;
}
.reader-nav .reader-brand { color: var(--brand-ink); }
.reader-brand span {
  width: 37px;
  height: 36px;
  background: currentColor;
  clip-path: polygon(0 8%,26% 8%,48% 56%,75% 8%,100% 8%,49% 100%);
}
.reader-modes, .reader-links { display: flex; align-items: center; }
.reader-modes { padding: 5px; gap: 4px; border-radius: 14px; background: var(--brand-surface); }
.reader-modes a { padding: 11px 14px; border: 1px solid transparent; border-radius: 10px; }
.reader-modes .reader-selected { border-color: var(--brand-line); background: var(--brand-tint); color: var(--brand-accent); }
.reader-links { gap: clamp(14px, 2.25vw, 32px); color: var(--brand-muted); }
.reader-menu { display: none; }

@media (max-width: 850px) {
  .reader-brand { font-size: 34px; }
  .reader-brand span { width: 30px; height: 29px; }
  .reader-modes, .reader-links { display: none; }
  .reader-menu { display: block; }
  .reader-menu summary {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    list-style: none;
    cursor: pointer;
  }
  .reader-menu summary::-webkit-details-marker { display: none; }
  .reader-menu summary span { width: 22px; height: 2px; background: currentColor; box-shadow: 0 -6px currentColor, 0 6px currentColor; }
  .reader-menu nav {
    position: absolute;
    inset: calc(100% + 10px) 0 auto;
    display: grid;
    gap: 12px;
    padding: 20px;
    border: 1px solid var(--brand-line);
    border-radius: 24px;
    background: var(--brand-paper);
    box-shadow: 0 10px 24px #0002;
  }
  .reader-menu:not([open]) nav { display: none; }
}
