:root {
  --night: #081827;
  --white: #ecf5f7;
  --glow: #a8e9ed;
  --paper: #e9f2f3;
  --ink: #102b3b;
  --muted: #3b5865;
  --gutter: clamp(1.375rem, 5vw, 4.5rem);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body { margin: 0; background: var(--night); color: var(--white); line-height: 1.65; }
a { color: inherit; text-underline-offset: .32em; }
a:focus-visible, summary:focus-visible, #scroll-thumb:focus-visible {
  outline: 3px solid #428da7;
  outline-offset: 4px;
}
a:hover { text-decoration-thickness: .14em; }

.frame { width: min(calc(100% - 2 * var(--gutter)), 78rem); margin-inline: auto; }
.masthead, .site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-block: 1.25rem;
}
.brand { font-size: 1.23rem; font-weight: 750; letter-spacing: -.025em; text-decoration: none; }
nav { display: flex; align-items: center; gap: clamp(.75rem, 2.5vw, 2rem); }
nav a { display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; }
nav a:hover { text-decoration: underline; }

.hero { padding-block: clamp(4.25rem, 9vw, 8rem) clamp(4rem, 8.2vw, 7rem); }
.hero-title {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  column-gap: clamp(1rem, 2.2vw, 2.25rem);
  margin: 0;
  font-size: clamp(3rem, 9.2vw, 8.75rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.06em;
}
.hero-photo {
  display: block;
  width: 100%;
  height: 1.04em;
  object-fit: cover;
  object-position: 50% 48%;
  background: #0b263b;
  animation: reveal-photo .65s ease-out both;
}
@keyframes reveal-photo {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.125rem 2rem;
  margin-top: clamp(1.75rem, 4.25vw, 3.75rem);
}
.hero-meta p { margin: 0; color: #c8dde4; font-size: clamp(1.125rem, 1.5vw, 1.25rem); }
.primary {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 3.125rem;
  padding: .7rem 1.1rem;
  flex: none;
  background: var(--glow);
  color: var(--night);
  font-weight: 700;
  text-decoration: none;
  transition: background-color .18s ease;
}
.primary:hover { background: var(--white); }

.notes { background: var(--paper); color: var(--ink); scroll-margin-block-start: 0; }
.notes-layout {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
  column-gap: clamp(2rem, 5.5vw, 5.5rem);
  padding-block: clamp(3.25rem, 6.7vw, 6rem);
}
.notes-intro h2 {
  margin: 0 0 .7rem;
  font-size: clamp(2.25rem, 4vw, 3.55rem);
  line-height: 1.1;
  letter-spacing: -.04em;
}
.notes-intro p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.note-list { list-style: none; padding: 0; margin: 0; }
.note-link {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr) 1.5rem;
  align-items: start;
  gap: 1rem;
  padding: 1rem .625rem;
  text-decoration: none;
  transition: background-color .18s ease;
}
.note-link:hover, .note-link:focus-visible { background: #d8e8eb; }
.topic { color: var(--muted); font-size: .88rem; padding-top: .35rem; }
.note-copy { display: grid; gap: .18rem; }
.note-copy strong { font-size: clamp(1.12rem, 1.65vw, 1.4rem); line-height: 1.45; }
.note-copy span { color: var(--muted); }
.arrow { justify-self: end; font-size: 1.25rem; line-height: 1.5; transition: transform .18s ease; }
.note-link:hover .arrow { transform: translate(.15em, -.15em); }

.site-footer { min-height: 6.5rem; color: var(--white); }
.site-footer > :last-child { font-size: .95rem; }

.reading { background: var(--paper); color: var(--ink); }
.reading-inner {
  width: min(calc(100% - 2 * var(--gutter)), 46rem);
  min-height: 60svh;
  margin-inline: auto;
  padding-block: clamp(3rem, 7vw, 6.5rem);
  font-size: 1.125rem;
}
.reading-inner h1, .reading-inner h2 { line-height: 1.15; letter-spacing: -.035em; }
.reading-inner h1 { margin: .8rem 0 1.6rem; font-size: clamp(2.5rem, 6vw, 4rem); }
.reading-inner h2 { margin: 2.5rem 0 .7rem; font-size: clamp(1.5rem, 3vw, 2rem); }
.reading-inner p { margin: 0 0 1.15rem; }
.reading-inner .back { color: var(--muted); font-size: 1rem; }
.reading-inner pre, .reading-inner details { padding: 1.125rem; background: #dce9ec; }
.reading-inner pre { overflow: auto; }
.reading-inner pre code { font-size: .95rem; }
.reading-inner summary { min-height: 2.75rem; cursor: pointer; font-weight: 650; }
.reading-inner details p { margin: .5rem 0 0; }

#scroll-track { position: fixed; right: 0; top: 0; bottom: 0; width: 12px; z-index: 10; }
#scroll-track[hidden] { display: none; }
#scroll-thumb {
  position: absolute; right: 2px; width: 6px; background: #6193a4;
  border-radius: 6px; cursor: grab; touch-action: none;
}
#scroll-track:hover #scroll-thumb { width: 9px; }

@media (max-width: 43rem) {
  .masthead { padding-block: .65rem; }
  .hero { padding-block: 2rem 3.25rem; }
  .hero-title { grid-template-columns: 1fr; row-gap: .18em; font-size: clamp(3.55rem, 16vw, 6rem); }
  .hero-title span:last-child { justify-self: end; }
  .hero-photo { height: auto; aspect-ratio: 2.12; max-height: 14rem; }
  .hero-meta { flex-wrap: wrap; margin-top: 1.6rem; }
  .hero-meta p { flex-basis: 100%; }
  .hero-break { display: none; }
  .notes-layout { grid-template-columns: 1fr; gap: 1.15rem; }
  .note-link { grid-template-columns: 3.3rem minmax(0, 1fr) 1.2rem; gap: .45rem; padding-inline: 0; }
  .note-copy span { font-size: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

