/* The release site (docs/design/release-site.md). Colours follow the app: theme #315e50 on #f8f9f5. No scripts run here
   (the CSP allows none), so everything that moves or switches is CSS. The one ornament is the stripe: a school day's bell
   schedule, lessons in ink and the breaks (课间) left as paper. */
:root {
  --bg: #f1f3ee; --paper: #fbfcf9; --field: #e4e9e2; --ink: #1b2420; --soft: #4f5c55;
  --brand: #315e50; --brand-deep: #23463b; --on-brand: #f6faf7; --sheet: #ffffff; --sheet-ink: #1d2420; --sheet-soft: #5b6660; --sheet-line: #d9dfd8;
  --mark: #dbe8c9;
  --gap: 12px; --margin: clamp(24px, 5.4vw, 80px); --inset: calc(var(--margin) - var(--gap));
  --step-display: clamp(32px, 3.8vw, 56px); --step-head: clamp(24px, 2vw, 30px); --step-lead: 19px; --step-body: 17px; --step-small: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #121815; --paper: #19211d; --field: #222c27; --ink: #e8eee9; --soft: #a9b5ae;
    --brand: #2f5a4c; --brand-deep: #8fc3ae; --on-brand: #f1f7f3; --mark: #34472a; }
}
:root[data-theme="dark"] { --bg: #121815; --paper: #19211d; --field: #222c27; --ink: #e8eee9; --soft: #a9b5ae;
  --brand: #2f5a4c; --brand-deep: #8fc3ae; --on-brand: #f1f7f3; --mark: #34472a; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* The display face: 霞鹜文楷 (LXGW WenKai, SIL OFL 1.1), the kind of 楷体 a teacher writes on the board, cut down at build time to
   the characters the headings use. Anything else falls back to the system face. */
@font-face { font-family: "Kejian Kai"; src: url(/fonts/kejian-wenkai.woff2) format("woff2"); font-weight: 500 700; font-display: swap; }
body { margin: 0; overflow-x: clip; background: var(--bg); color: var(--ink);
  font: var(--step-body)/1.6 system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
h1, h2, .sheet-names label, .letter .sign, .wordmark { font-family: "Kejian Kai", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif; font-synthesis: none; }
h1, h2 { letter-spacing: 0; line-height: 1.2; font-weight: 500; }
h1 { font-size: var(--step-display); color: var(--brand-deep); }
h2 { font-size: var(--step-head); }
h3 { font-size: var(--step-body); line-height: 1.4; }
a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 55%, transparent); text-underline-offset: .22em; text-decoration-thickness: 2px; transition: text-decoration-color .2s; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
code { font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; font-size: .88em; background: var(--field); padding: .1em .35em; overflow-wrap: anywhere; }
.small { font-size: var(--step-small); color: var(--soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The stripe: one school day by the bell. Lessons are ink, the breaks between them stay paper. */
.stripe { display: flex; gap: 0; height: 56px; background: var(--paper); }
:is(.stripe, .bell) i { display: block; }
:is(.stripe, .bell) .lesson { flex: 45 1 0; background: var(--brand); }
:is(.stripe, .bell) .break { flex: 10 1 0; }
:is(.stripe, .bell) .long { flex: 25 1 0; }
:is(.stripe, .bell) .lunch { flex: 70 1 0; }
.stripe.thin { height: 8px; }
.times { display: flex; padding-top: 8px; font-size: var(--step-small); color: var(--soft); font-variant-numeric: tabular-nums; }
.times span { overflow: hidden; white-space: nowrap; padding-left: 8px; }
.times .lesson { flex: 45 1 0; } .times .break { flex: 10 1 0; } .times .long { flex: 25 1 0; } .times .lunch { flex: 70 1 0; }

/* Buttons: square, one fill. The stripe runs through on hover. */
.button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 14px 26px;
  background: var(--brand); color: var(--on-brand); font-weight: 650; text-decoration: none; overflow: hidden; isolation: isolate;
  transition: transform .18s var(--ease); }
.button .bell { display: flex; position: absolute; inset: auto 0 0 0; height: 6px; opacity: 0; transform: translateX(-24px); transition: opacity .2s, transform .6s var(--ease); }
.button .bell .lesson { background: var(--on-brand); }
.button:hover { color: var(--on-brand); }
.button:hover .bell { opacity: .55; transform: none; }
.button:active { transform: translateY(1px) scale(.99); }
.button.quiet { background: var(--field); color: var(--ink); }
.button.quiet .bell .lesson { background: var(--brand); }

/* ---- Home: the split stage ---- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); padding: var(--gap) var(--gap) 0; align-items: start; }
.reading { display: grid; gap: var(--gap); min-width: 0; }
.card { background: var(--paper); display: flex; flex-direction: column; min-height: calc(100svh - 2 * var(--gap)); }
.card-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: 56px var(--inset) 40px; }
.wordmark { display: flex; align-items: center; gap: 14px; font-size: var(--step-head); font-weight: 500; color: var(--ink); text-decoration: none; letter-spacing: .04em; }
.wordmark img { width: 48px; height: 48px; }
.card h1 span { display: inline-block; }
.card .lead { font-size: var(--step-lead); max-width: 30em; }
.card-links { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 0 var(--inset) 32px; font-size: var(--step-small); color: var(--soft); }
.card-links a { text-decoration-color: transparent; }
.card-links a:hover { color: var(--ink); text-decoration-color: currentColor; }

.stage { position: sticky; top: var(--gap); height: calc(100svh - 2 * var(--gap)); background: var(--brand); overflow: hidden; }
.stage figure { position: absolute; inset: 0; padding: clamp(40px, 6vh, 72px) 0 clamp(64px, 9vh, 88px) clamp(32px, 4vw, 64px); }
.stage video, .stage .still { display: block; width: 100%; height: 100%; object-fit: cover; object-position: left top; background: var(--paper); }
.stage .still { display: none; }
@media (prefers-reduced-motion: reduce) { .stage video { display: none; } .stage .still { display: block; } }
.stage figcaption { position: absolute; left: clamp(32px, 4vw, 64px); bottom: 28px; right: 28px; color: var(--on-brand); font-size: var(--step-small); }

.features { background: var(--paper); padding: clamp(56px, 8vw, 120px) var(--inset); display: grid; gap: clamp(64px, 8vw, 112px); }
.features > h2 { margin-bottom: -16px; }
.module { display: grid; gap: 18px; max-width: 620px; }
.module .proof { background: var(--field); padding: clamp(12px, 2vw, 24px); }
.module .proof img { width: 100%; height: auto; }
.module > div:last-child { max-width: 34em; }
.module h3 { font-size: var(--step-lead); margin-bottom: 8px; }
.module p { font-size: var(--step-body); }

/* ---- Showcase: the sheets it prints (radio buttons and :has, no script) ---- */
.sheets { margin-top: clamp(120px, 14vw, 200px); padding: 0 var(--margin); display: grid; grid-template-columns: 5fr 7fr; gap: clamp(24px, 4vw, 64px); align-items: start; }
.sheets-index { position: sticky; top: 48px; display: grid; gap: 28px; padding-top: 72px; }
.sheets-index p { max-width: 26em; }
.sheets > * { min-width: 0; }
.sheet-names { display: grid; gap: 4px; min-width: 0; }
.sheet-names input { position: absolute; opacity: 0; pointer-events: none; }
.sheet-names label { font-size: var(--step-display); font-weight: 500; line-height: 1.15; letter-spacing: -.02em; color: color-mix(in srgb, var(--ink) 58%, var(--bg));
  cursor: pointer; width: fit-content; transition: color .2s, transform .25s var(--ease); }
.sheet-names label:hover { color: color-mix(in srgb, var(--ink) 70%, var(--bg)); transform: translateX(6px); }
.sheet-names input:checked + label { color: var(--ink); }
.sheet-names input:focus-visible + label { outline: 3px solid var(--brand); outline-offset: 4px; }
.sheet-stage { position: relative; background: var(--field); height: 88svh; min-height: 640px; overflow: hidden; }
.sheet-stage .sheet { position: absolute; top: 72px; left: clamp(24px, 4vw, 64px); opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .2s, transform .35s var(--ease), visibility 0s .2s; }
.sheets:has(#out-cover:checked) .sheet.cover, .sheets:has(#out-seats:checked) .sheet.seats,
.sheets:has(#out-feedback:checked) .sheet.feedback, .sheets:has(#out-week:checked) .sheet.week { opacity: 1; visibility: visible; transform: none; transition: opacity .2s, transform .35s var(--ease); }

/* The sheets themselves: real documents at true size (data-ui keeps their own lines). */
.sheet { width: 560px; background: var(--sheet); color: var(--sheet-ink); padding: 40px 44px 56px; font-size: 14px; line-height: 1.5; }
.sheet.feedback { width: 440px; }
.sheet .s-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 14px; border-bottom: 2px solid var(--sheet-ink); margin-bottom: 18px; }
.sheet .s-head strong { font-size: 20px; }
.sheet .s-head span, .sheet .s-soft { color: var(--sheet-soft); }
.sheet table { width: 100%; border-collapse: collapse; }
.sheet th, .sheet td { text-align: left; vertical-align: top; padding: 9px 8px 9px 0; border-bottom: 1px solid var(--sheet-line); }
.sheet th { font-weight: 600; color: var(--sheet-soft); font-size: 13px; }
.sheet td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sheet .num { text-align: right; font-variant-numeric: tabular-nums; }
.sheet tfoot td { font-weight: 700; border-bottom: 0; }
.sheet .s-note { margin-top: 18px; padding: 12px 14px; background: #eef3ec; }
.room { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 8px; }
.room span { background: #eef3ec; padding: 10px 4px; text-align: center; font-size: 13px; }
.room .empty { background: transparent; outline: 1px dashed var(--sheet-line); }
.room .front { grid-column: 1 / -1; background: var(--sheet-ink); color: var(--sheet); }
.week-plan th:last-child { text-align: right; }
.week-plan td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- About: a letter ---- */
.letter { width: min(560px, 100% - 2 * var(--margin)); margin: clamp(140px, 16vw, 220px) auto 0; display: grid; gap: 22px; }
.letter .by { display: flex; align-items: center; gap: 14px; }
.letter .by img { width: 44px; height: 44px; border-radius: 50%; }
.letter p { font-size: var(--step-body); line-height: 1.75; }
.letter mark { background: var(--mark); color: inherit; padding: 0 .15em; }
.letter .sign { font-size: var(--step-lead); font-weight: 600; margin-top: 4px; }

/* ---- How to get it: an itinerary slip on a field ---- */
.getting { margin: clamp(140px, 16vw, 220px) var(--gap) 0; grid-template-columns: 1fr 1fr; background: var(--brand); color: var(--on-brand); padding: clamp(64px, 9vw, 128px) var(--inset);
  display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
.getting h2 { font-size: var(--step-display); max-width: 7em; }
.getting .intro { display: grid; gap: 24px; max-width: 30em; }
.getting .latest { display: grid; gap: 10px; margin-top: 16px; }
.getting .latest ul { padding-left: 1.2em; display: grid; gap: 6px; }
.getting .intro p, .getting .latest li { font-size: var(--step-lead); }
.slip { justify-self: end; width: 100%; background: var(--paper); color: var(--ink); max-width: 480px; padding: 36px 36px 64px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px),
  95% 100%, 90% calc(100% - 14px), 85% 100%, 80% calc(100% - 14px), 75% 100%, 70% calc(100% - 14px), 65% 100%, 60% calc(100% - 14px), 55% 100%,
  50% calc(100% - 14px), 45% 100%, 40% calc(100% - 14px), 35% 100%, 30% calc(100% - 14px), 25% 100%, 20% calc(100% - 14px), 15% 100%, 10% calc(100% - 14px), 5% 100%, 0 calc(100% - 14px)); }
.slip h3 { font-size: var(--step-lead); margin-bottom: 18px; }
.slip ol { list-style: none; padding: 0; display: grid; gap: 0; }
.slip li { display: grid; grid-template-columns: 4.5em 1fr; gap: 12px; padding: 14px 0; }
.slip li b { color: var(--brand-deep); }
.slip li.later { color: var(--soft); }
.slip .button { margin-top: 24px; width: 100%; }

/* ---- Footer: one quiet line under the day's stripe ---- */
.foot { margin-top: clamp(72px, 7vw, 104px); }
.foot .line { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: baseline; padding: 22px var(--margin) 30px; font-size: var(--step-small); color: var(--soft); }
.foot nav { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.foot nav a { color: var(--ink); }
.foot .line > :last-child { justify-self: end; }

/* ---- Download pages (friends only) ---- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px var(--margin); }
.bar .wordmark { font-size: 20px; }
.bar .wordmark img { width: 36px; height: 36px; }
.bar nav { display: flex; gap: 24px; flex-wrap: wrap; font-size: var(--step-small); }
.bar nav a { text-decoration-color: transparent; color: var(--soft); }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--ink); text-decoration-color: var(--brand); }
.page { width: min(880px, 100% - 2 * var(--margin)); margin: clamp(48px, 7vw, 96px) auto 0; display: grid; gap: 28px; }
.page > h1 { color: var(--brand-deep); }
.page .lead { font-size: var(--step-lead); max-width: 34em; }
.page h2 { margin-top: 24px; }
.page ol, .page ul { padding-left: 1.3em; display: grid; gap: 8px; }
.release { background: var(--paper); padding: clamp(24px, 4vw, 48px); display: grid; gap: 18px; }
.release .meta { color: var(--soft); font-size: var(--step-small); }
.platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); margin-top: 8px; }
.platform { background: var(--field); padding: 24px; display: grid; gap: 10px; align-content: start; }
.platform h3 { font-size: var(--step-lead); }
.platform.later { background: transparent; outline: 2px dashed var(--field); outline-offset: -2px; color: var(--soft); }
.release .hash { font-size: var(--step-small); color: var(--soft); }
.note { background: var(--mark); padding: 16px 20px; }
.versions { list-style: none; padding: 0 !important; gap: 0 !important; }
.versions li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px; }
.versions li:nth-child(odd) { background: var(--paper); }
.versions li .latest { color: var(--brand-deep); font-weight: 600; }
.guide { display: grid; gap: 14px; }
.guide h1 { font-size: var(--step-display); color: var(--brand-deep); margin-bottom: 8px; }
.guide h2 { margin-top: 28px; }
.guide h3 { margin-top: 12px; }
.guide table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.guide th, .guide td { border: 1px solid var(--field); padding: 8px 10px; text-align: left; vertical-align: top; } /* taste-skill-ignore: a real table */
.guide th { background: var(--field); }

/* ---- Motion (transform and opacity only; CSS only, the CSP allows no script) ---- */
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes stripe-in { from { transform: scaleY(0); } }
@media (prefers-reduced-motion: no-preference) {
  .card .stripe i { transform-origin: top; animation: stripe-in .7s var(--ease) both; }
  .card .stripe i:nth-child(2n) { animation-delay: .05s; } .card .stripe i:nth-child(3n) { animation-delay: .1s; } .card .stripe i:nth-child(4n) { animation-delay: .15s; }
  .card-body > * { animation: rise .8s var(--ease) both; }
  .card-body > :nth-child(2) { animation-delay: .08s; } .card-body > :nth-child(3) { animation-delay: .16s; } .card-body > :nth-child(4) { animation-delay: .24s; }
  .card-links { animation: rise .8s .32s var(--ease) both; }
  .page > * { animation: rise .7s var(--ease) both; }
  .page > :nth-child(2) { animation-delay: .06s; } .page > :nth-child(3) { animation-delay: .12s; } .page > :nth-child(n+4) { animation-delay: .18s; }
  .stage { animation: rise 1s .1s var(--ease) both; }
  @supports (animation-timeline: view()) {
    .reveal > *, .module > *, .slip li { animation: rise linear forwards; animation-timeline: view(); animation-range: entry 0% entry 45%; }
    .module > :nth-child(2), .reveal > :nth-child(2) { animation-range: entry 6% entry 51%; }
    .reveal > :nth-child(3) { animation-range: entry 12% entry 57%; }
  }
}

/* ---- Tablet and phone ---- */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .stage { position: relative; top: 0; height: 48svh; order: -1; }
  .card { min-height: 0; margin-top: -24px; position: relative; margin-inline: var(--gap); }
  .module { max-width: none; }
  .reading { gap: 0; }
  .features { margin-top: var(--gap); }
  .sheets { grid-template-columns: 1fr; }
  .sheets-index { position: static; padding-top: 0; }
  .sheet-names { display: flex; overflow-x: auto; gap: 24px; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .sheet-names label { font-size: 24px; white-space: nowrap; scroll-snap-align: start; }
  .sheet-stage { height: auto; min-height: 0; display: grid; padding: 16px 16px 0; }
  .sheet-stage .sheet { position: relative; grid-area: 1 / 1; top: auto; left: auto; width: auto; padding: 28px 24px 40px; }
  .getting { grid-template-columns: 1fr; }
  .foot .line { grid-template-columns: 1fr; gap: 8px; }
  .foot nav { justify-content: flex-start; }
  .foot .line > :last-child { justify-self: start; }
}
@media (max-width: 560px) {
  /* Lessons are about 30px wide here: each time runs on into the break after it, and the last one ends on its bar. */
  .times { font-size: 13px; letter-spacing: -.02em; }
  .times span { overflow: visible; padding-left: 4px; }
  .times .lesson:last-child { text-align: right; padding: 0 4px 0 0; direction: rtl; }
  :root { --margin: 24px; }
  .card { margin-inline: 0; }
  .stripe { height: 40px; }
  .card-body { padding: 40px 24px 28px; text-align: left; }
  .card h1 { font-size: 8vw; }
  .module { grid-template-columns: 1fr; gap: 16px; }
  .getting h2 { font-size: 34px; }
  .slip { padding: 28px 22px 56px; }
  .slip li { grid-template-columns: 3.6em 1fr; }
}

/* ---- Invite (public): two fields and a button ---- */
.invite { background: var(--paper); padding: clamp(24px, 4vw, 40px); display: grid; gap: 18px; max-width: 34em; }
.invite label { display: grid; gap: 6px; font-weight: 600; }
.invite input { font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 2px solid var(--field); border-radius: 0; padding: 12px 14px; min-height: 52px; width: 100%; }
.invite input:focus-visible { outline: 3px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.invite input[name="code"] { font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.invite .button { border: 0; font: inherit; font-weight: 650; cursor: pointer; width: 100%; }
