/* ngkirby51.com design system: "Jersey and foolscap" (Direction D)
   See design/DESIGN.md for the rules behind these values.
   Fonts (load in <head>):
   https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@700;800;900&family=Newsreader:ital,opsz,wght@0,6..72,400..600;1,6..72,400..500&display=swap
*/

/* ---------- 1. Tokens ---------- */
:root{
  /* colour: the existing navy/ice scheme, nothing else */
  --navy:#182352;        /* headings, rules, buttons on paper */
  --navy-dark:#0E173B;   /* jersey (hero, contact band, footer), body text */
  --ice:#E9EEFA;         /* text on navy, keyword highlight, buttons on navy */
  --ice-soft:#F5F7FC;    /* quiet fills */
  --ink:#2A3149;         /* secondary text on paper */
  --mid:#5C6D9A;         /* margin notes, captions, meta */
  --ruling:#E1E7F5;      /* foolscap lines */
  --rule:#C9D3EA;        /* separators */
  --white:#fff;

  /* type */
  --display:'Big Shoulders Display','Arial Narrow',sans-serif;
  --text:'Newsreader',Georgia,serif;
  --zh-text:'PingFang SC','Noto Serif SC','Songti SC','Microsoft YaHei',serif;

  /* rhythm: everything on paper sits on a 32px ruled line */
  --line:32px;
  --margin:clamp(150px,18vw,240px);   /* foolscap margin column */
  --gutter:clamp(20px,4vw,56px);
  --measure:68ch;
}
@media(max-width:760px){:root{--margin:28px}}

/* ---------- 2. Base ---------- */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
body{font-family:var(--text);font-optical-sizing:auto;font-size:1.15rem;line-height:var(--line);color:var(--navy-dark);background:var(--white);-webkit-font-smoothing:antialiased}
/* Chinese fragments inside English pages */
html[lang="en"] [lang="zh-Hans"]{font-family:var(--zh-text)}
/* Chinese pages: Latin keeps the two families, Chinese characters fall back to system CJK fonts */
html[lang="zh-Hans"]{
  --display:'Big Shoulders Display','PingFang SC','Noto Sans SC','Microsoft YaHei',sans-serif;
  --text:'Newsreader','Songti SC','Noto Serif SC','PingFang SC','Microsoft YaHei',serif;
}
html[lang="zh-Hans"] body{font-size:1.1rem}
html[lang="zh-Hans"] .h1{font-size:clamp(2.6rem,6vw,5.2rem);line-height:1.1;max-width:none;letter-spacing:0}
html[lang="zh-Hans"] .h1 .name{font-size:.42em}
html[lang="zh-Hans"] :is(.h2,.h3,.pull,.btn,.text-link,.nav-links a,.nav-cta,.choices a,.note-links a,.faq summary){letter-spacing:0}
html[lang="zh-Hans"] :is(.h2,.pull){line-height:1.35}
html[lang="zh-Hans"] .h2{padding:12px 0}
/* Chinese has no italics: never slant it */
html[lang="zh-Hans"] :is(.note,.small,.print figcaption,.links .meta,.h3 .code,.swipe-hint,.postit .src,.quote .who){font-style:normal}
img{display:block;max-width:100%;height:auto}
a{color:inherit;text-underline-offset:4px}
:focus-visible{outline:3px solid var(--navy);outline-offset:3px}
.jersey :focus-visible{outline-color:var(--ice)}
.skip{position:absolute;left:-999px;top:8px;background:var(--ice);color:var(--navy-dark);padding:8px 14px;font-family:var(--display);font-weight:700;z-index:10}
.skip:focus{left:8px}

/* ---------- 3. Type ---------- */
.h1{font-family:var(--display);font-weight:900;font-size:clamp(3rem,7.4vw,6.6rem);line-height:.9;letter-spacing:.005em}
.h1 .name{display:block;font-weight:700;font-size:.38em;line-height:1.1;margin-bottom:.35em;letter-spacing:.03em}
.h2{font-family:var(--display);font-weight:900;font-size:2.6rem;line-height:calc(var(--line) * 2);letter-spacing:.005em;color:var(--navy)}
@media(max-width:760px){.h2{font-size:2.1rem}}
.h3{display:block;font-family:var(--display);font-weight:800;font-size:1.25rem;line-height:var(--line);letter-spacing:.02em;color:var(--navy)}
.h3 .code{font-family:var(--text);font-weight:400;font-style:italic;font-size:1rem;letter-spacing:0;color:var(--mid);margin-left:6px}
.pull{font-family:var(--display);font-weight:800;font-size:1.9rem;line-height:var(--line);color:var(--navy);padding-top:6px}
.small{font-size:1rem;color:var(--mid)}
mark{background:linear-gradient(to top,var(--ice) 0 52%,transparent 52%);color:inherit;padding:0 .08em}

/* ---------- 4. Actions ---------- */
.btn{display:inline-block;font-family:var(--display);font-weight:800;font-size:1.15rem;letter-spacing:.02em;line-height:1;text-decoration:none;padding:15px 26px;background:var(--navy);color:var(--white)}
.btn:hover{background:var(--navy-dark)}
.jersey .btn{background:var(--ice);color:var(--navy-dark)}
.jersey .btn:hover{background:var(--white)}
.text-link{font-family:var(--display);font-weight:700;font-size:1.15rem;letter-spacing:.02em;text-decoration-thickness:2px;color:var(--navy)}
.jersey .text-link{color:var(--white)}
.actions{display:flex;flex-wrap:wrap;gap:12px 26px;align-items:center}

/* ---------- 5. Jersey: navy blocks (hero, contact) ---------- */
.jersey{position:relative;background:var(--navy-dark);color:var(--ice);overflow:hidden}

/* top bar: stays on screen, so "Enrol" is always one tap away */
.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:8px 24px;padding:10px var(--gutter);background:var(--navy-dark);color:var(--ice);border-bottom:1px solid rgba(233,238,250,.12);font-family:var(--display);font-weight:700;font-size:1.1rem;letter-spacing:.02em}
.topbar .brand{font-weight:800;font-size:1.5rem;text-decoration:none;color:var(--white);margin-right:auto}
.nav-links{display:flex;gap:22px;list-style:none}
.nav-links a,.lang a,.nav-menu summary{display:inline-block;padding:10px 0;text-decoration:none;color:rgba(233,238,250,.75)}
.nav-links a:hover,.lang a:hover,.lang a[aria-current]{color:var(--white)}
.lang .sep{color:rgba(233,238,250,.4)}
.nav-cta{background:var(--ice);color:var(--navy-dark);text-decoration:none;font-weight:800;padding:10px 18px}
.nav-cta:hover{background:var(--white)}
.nav-menu{display:none;position:relative}
.nav-menu summary{list-style:none;cursor:pointer;color:var(--white);padding:10px 4px}
.nav-menu summary::-webkit-details-marker{display:none}
.nav-menu ul{position:absolute;right:0;top:calc(100% + 10px);min-width:210px;list-style:none;background:var(--navy-dark);border:1px solid rgba(233,238,250,.2);padding:6px 0}
.nav-menu li a{display:block;padding:12px 20px;color:var(--ice);text-decoration:none}
@media(max-width:860px){
  .nav-desktop{display:none}
  .nav-menu{display:block}
  .topbar{gap:4px 14px}
  .lang a[aria-current],.lang .sep{display:none}   /* on phones only the other language is offered */
}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

.numeral{position:absolute;z-index:0;left:calc(var(--gutter) * 2.2);top:8px;font-family:var(--display);font-weight:900;font-size:clamp(14rem,30vw,27rem);line-height:.8;letter-spacing:-.03em;color:var(--navy);user-select:none;pointer-events:none}
.hero-grid{position:relative;z-index:1;display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:clamp(24px,4vw,64px);align-items:end;padding:clamp(24px,5vw,64px) var(--gutter) 0}
.hero-text{padding-bottom:clamp(48px,7vw,96px)}
/* proof line: real facts only, above the H1 */
.proof{max-width:52ch;margin-bottom:18px;font-size:1.05rem;line-height:1.5;color:rgba(233,238,250,.85)}
.proof a{color:var(--white);font-weight:600;white-space:nowrap}
.hero-text .h1{color:var(--white);max-width:9ch}
.hero-text .h1 .name{color:var(--ice)}
.hero-text .lede{margin-top:28px;max-width:50ch;font-size:1.2rem;line-height:1.6;color:rgba(233,238,250,.92)}
.hero-text .lede-2{margin-top:12px;max-width:50ch;line-height:1.6;color:rgba(233,238,250,.72)}
.hero-text .actions{margin-top:32px}
.hero-photo{position:relative;align-self:stretch;min-height:440px;margin-top:clamp(0px,3vw,40px)}
.hero-photo img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 38%}
@media(max-width:860px){
  .hero-grid{grid-template-columns:1fr}
  .hero-photo{min-height:0;aspect-ratio:4/5;max-height:72vh;margin:0 calc(var(--gutter) * -1)}
  .hero-text{padding-bottom:40px}
}

.band{scroll-margin-top:60px;padding:clamp(56px,8vw,96px) var(--gutter)}
.band .h2{color:var(--white)}
.band p{max-width:56ch;line-height:1.6;color:rgba(233,238,250,.85);margin-top:12px}
.band .actions{margin-top:28px}
.band .note-line{margin-top:20px;font-size:1rem;color:rgba(233,238,250,.75)}
.band .choices+.note-line{margin-top:32px}
/* the three ways to enrol, one per level */
.choices{list-style:none;margin-top:28px;max-width:820px;border-top:1px solid rgba(233,238,250,.2)}
.choices li{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:2px 24px;padding:14px 0;border-bottom:1px solid rgba(233,238,250,.2)}
.choices a{font-family:var(--display);font-weight:800;font-size:clamp(1.6rem,3vw,2.1rem);line-height:1.2;color:var(--white);text-decoration-thickness:2px;text-underline-offset:6px}
.choices a:hover{color:var(--ice)}
.choices span{font-size:1rem;color:rgba(233,238,250,.75)}
.band .note-line a{color:var(--white)}

.footer{background:var(--navy-dark);border-top:1px solid rgba(233,238,250,.14);color:rgba(233,238,250,.65);padding:22px var(--gutter);font-size:.95rem;line-height:1.5}
.footer strong{color:var(--ice);font-weight:600}

/* ---------- 6. Paper: foolscap sheets on an ice desk, below the jersey ---------- */
/* Each section is its own sheet. The ice gaps between sheets separate the sections. */
.desk{background:var(--ice);padding:28px clamp(0px,2.5vw,32px)}
.sheet{
  background-color:var(--white);
  background-image:
    linear-gradient(to right,transparent calc(var(--margin) - 2px),var(--navy) calc(var(--margin) - 2px),var(--navy) var(--margin),transparent var(--margin)),
    repeating-linear-gradient(to bottom,transparent 0 calc(var(--line) - 1px),var(--ruling) calc(var(--line) - 1px) var(--line));
  border:1px solid var(--rule);
  padding:calc(var(--line) * 2) var(--gutter) calc(var(--line) * 2) 0;
  scroll-margin-top:72px;   /* clears the sticky top bar */
}
.sheet+.sheet{margin-top:28px}
.sheet p{margin-bottom:var(--line)}
@media(max-width:760px){.desk{padding:16px 0}.sheet{border-left:0;border-right:0}.sheet+.sheet{margin-top:16px}}

/* a row = margin column + body column */
.row{display:grid;grid-template-columns:var(--margin) minmax(0,1fr)}
.row+.row{margin-top:0}
.row.gap,.row.head{margin-bottom:var(--line)}   /* head = a section's heading + intro */
.note{font-style:italic;color:var(--mid);font-size:1rem;padding:0 22px 0 var(--gutter);text-align:right}
.body{padding-left:clamp(20px,3vw,40px);max-width:calc(var(--measure) + 40px)}
.body.wide{max-width:1120px}
.body.wide p{max-width:var(--measure)}   /* wide rows hold photos and lists, never long lines */
.body p:last-child{margin-bottom:0}
@media(max-width:760px){
  .note{grid-column:2;grid-row:2;text-align:left;padding:0 0 0 clamp(20px,3vw,40px);border-left:2px solid var(--ice);margin-left:clamp(20px,3vw,40px);margin-bottom:var(--line)}
  .note{grid-row:1;margin-bottom:8px}
  .row>.body{grid-column:2;grid-row:2}
  .note:empty{display:none}
}

/* numbered steps: a real sequence, numbers written large in the margin */
.steps{list-style:none}
.step-num{font-family:var(--display);font-style:normal;font-weight:900;font-size:2.6rem;line-height:calc(var(--line) * 2);color:var(--navy)}
@media(max-width:760px){.step-num{font-size:2rem;line-height:var(--line);border-left:0;margin-bottom:4px}}

/* split: text + a print (photo) */
.split{display:grid;grid-template-columns:minmax(0,1fr) clamp(260px,32vw,440px);gap:clamp(24px,4vw,56px);align-items:start}
.split.photo-left{grid-template-columns:clamp(200px,24vw,320px) minmax(0,1fr)}
@media(max-width:760px){.split,.split.photo-left{grid-template-columns:1fr}}

/* a print: a photo laid on the paper */
.print{border:1px solid var(--navy);background:var(--white);padding:8px 8px 0}
.print img{width:100%;object-fit:cover}
.print figcaption{font-style:italic;color:var(--mid);font-size:.95rem;line-height:var(--line);padding:0 4px}
.print.no-cap{padding-bottom:8px}
.ratio-wide img{aspect-ratio:16/10;object-position:40% 50%}
.ratio-tall img{aspect-ratio:4/5;object-position:50% 35%}
@media(max-width:760px){.print.ratio-tall{max-width:260px}}

/* entries: a heading + text + link, separated by one blank line */
.entry{margin-bottom:var(--line)}
.entry p{margin-bottom:0}
.entry .btn{margin-top:12px}
.entry a.go{font-family:var(--display);font-weight:700;font-size:1.1rem;letter-spacing:.02em;color:var(--navy)}

/* post-it notes: student reviews stuck on the sheet (Kirby's request, 16 Oct).
   The one place with a tilt and a shadow; colours are lighter steps of the ice blue. */
/* grid, not CSS columns, so notes read left to right in the order written */
/* one sideways-scrolling row on every screen size; arrow buttons appear when JavaScript runs */
.postits{list-style:none;display:flex;align-items:flex-start;gap:24px;overflow-x:auto;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;scrollbar-width:none;
  margin-right:calc(var(--gutter) * -1);padding:14px var(--gutter) 26px 6px;scroll-padding-left:6px}
.postits::-webkit-scrollbar{display:none}
.postit{flex:0 0 300px;scroll-snap-align:start;display:block;padding:18px 20px 20px;
  background:linear-gradient(#D6DFF5 0 14px,#E4EAF8 14px);color:var(--navy-dark);
  font-size:1.02rem;line-height:1.55;transform:rotate(var(--tilt,0deg));
  box-shadow:0 14px 14px -14px rgba(14,23,59,.55)}
.postit:nth-child(3n+1){--tilt:-1.1deg}
.postit:nth-child(3n+2){--tilt:.8deg}
.postit:nth-child(3n){--tilt:-.4deg}
.postit .src{display:block;font-size:.9rem;font-style:italic;color:var(--ink);margin:4px 0 8px}
.postit p{margin:0 0 10px}
.postit .extra{font-size:.95rem;color:var(--ink)}
.postit .who{display:block;font-size:.92rem;line-height:1.45;color:var(--ink)}
.postit .who b{color:var(--navy-dark)}
.postit .who a{color:var(--ink)}
.postit details summary{list-style:none;cursor:pointer;font-family:var(--display);font-weight:700;font-size:1.05rem;letter-spacing:.02em;color:var(--navy);text-decoration:underline;text-underline-offset:3px;margin-bottom:10px}
.postit .when-open,.postit details[open] .when-closed{display:none}
.postit details[open] .when-open{display:inline}
.postit:has(details[open]) .excerpt{display:none}
.postit details summary::-webkit-details-marker{display:none}
.carousel-bar{display:flex;justify-content:space-between;align-items:center;gap:16px}
.swipe-hint{font-size:1rem;font-style:italic;color:var(--mid);margin:0}
.carousel-controls{display:flex;gap:10px}
.carousel-controls[hidden]{display:none}
.arrow{width:46px;height:46px;border:1.5px solid var(--navy);background:var(--white);color:var(--navy);font-size:1.3rem;line-height:1;cursor:pointer}
.arrow:hover:not(:disabled){background:var(--navy);color:var(--white)}
.arrow:disabled{opacity:.3;cursor:default}
@media(max-width:760px){
  .postits{gap:16px}
  .postit{flex-basis:82%}
  .postit:nth-child(n){--tilt:0deg}.postit:nth-child(odd){--tilt:-.6deg}.postit:nth-child(even){--tilt:.5deg}
}

/* small post-it links (bilingual section) */
.note-links{list-style:none;display:flex;flex-wrap:wrap;gap:18px 22px;padding:6px 0 10px}
.note-links a{display:block;min-width:150px;padding:10px 16px 12px;background:linear-gradient(#D6DFF5 0 8px,#E4EAF8 8px);
  font-family:var(--display);font-weight:800;font-size:1.25rem;letter-spacing:.02em;line-height:1.2;color:var(--navy);text-decoration:none;
  transform:rotate(-1.2deg);box-shadow:0 12px 12px -12px rgba(14,23,59,.55)}
.note-links li:nth-child(2) a{transform:rotate(.9deg)}
.note-links li:nth-child(3) a{transform:rotate(-.5deg)}
.note-links a span{display:block;font-family:var(--text);font-weight:400;font-size:.95rem;letter-spacing:0;color:var(--ink)}
.note-links a:hover{transform:none;text-decoration:underline}

/* link lists: guides, posts, tools */
.links{list-style:none}
.links li{display:flex;justify-content:space-between;gap:16px;align-items:baseline}
.links a{color:var(--navy-dark);text-decoration-color:var(--rule)}
.links a:hover{text-decoration-color:var(--navy)}
.links .meta{flex-shrink:0;font-size:.95rem;font-style:italic;color:var(--mid)}
@media(max-width:560px){.links li{flex-direction:column;gap:0;margin-bottom:var(--line)}.links .meta{line-height:1.4}}

@media(max-width:760px){.links.posts li:nth-child(n+5){display:none}}

/* disclosure: native <details>, works without JavaScript */
.more>summary{cursor:pointer;list-style:none;font-family:var(--display);font-weight:700;font-size:1.15rem;letter-spacing:.02em;color:var(--navy);text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:4px}
.more>summary::-webkit-details-marker{display:none}
.more>summary::before{content:"+ ";}
.more[open]>summary::before{content:"\2212  ";}
.more[open]>summary{margin-bottom:var(--line)}

/* FAQ: one native <details> per question */
.faq details{border-bottom:1px solid transparent}
.faq summary{cursor:pointer;list-style:none;font-family:var(--display);font-weight:800;font-size:1.25rem;letter-spacing:.02em;color:var(--navy);display:flex;justify-content:space-between;gap:16px}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{content:"+";font-weight:700;color:var(--mid)}
.faq details[open] summary::after{content:"\2212"}
.faq details p{margin:0 0 var(--line)}
.faq details a{color:var(--navy)}
