/* ISSL Parent Newsletter
   Brand colours come from the school's "people" mark: orange, red, blue, teal, purple. */

@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/poppins-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/poppins-700.woff2") format("woff2"); }
@font-face { font-family: "Caveat"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/caveat-600.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --paper: #FBF8F3;
  --surface: #FFFFFF;
  --surface-2: #F4EEE4;
  --ink: #121735;
  --ink-2: #353B5E;
  --muted: #646A85;
  --line: #E8E1D5;
  --line-strong: #D9D0C0;

  --orange: #F39320;
  --red: #E8432B;
  --blue: #0098D2;
  --teal: #00A88F;
  --purple: #8B80BA;
  --green: #3FA535;

  /* text-safe versions (AA on paper and on the soft tints) */
  --orange-ink: #A85700;
  --red-ink: #BF2E17;
  --blue-ink: #00699A;
  --teal-ink: #007A68;
  --purple-ink: #5E529A;
  --green-ink: #2A7A22;

  --orange-soft: #FDEEDB;
  --red-soft: #FCE6E1;
  --blue-soft: #DDF1FA;
  --teal-soft: #D9F3EE;
  --purple-soft: #ECE9F6;

  --radius-lg: 28px;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgb(18 23 53 / .05), 0 8px 24px -8px rgb(18 23 53 / .12);
  --shadow-lg: 0 2px 4px rgb(18 23 53 / .05), 0 24px 48px -16px rgb(18 23 53 / .22);

  --footer-bg: #121735;
  --footer-ink: #E6E8F4;
  --footer-muted: #A7ACC8;

  --font: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --script: "Caveat", "Segoe Script", "Bradley Hand", cursive;
  --gutter: clamp(16px, 4vw, 32px);
}

/* dark: follows the device unless the reader picked a mode (data-mode on <html>) */
@media (prefers-color-scheme: dark) {
  :root:not([data-mode]) {
    --paper: #0E1124;
    --surface: #161A33;
    --surface-2: #121630;
    --ink: #EEF0FA;
    --ink-2: #CDD1E6;
    --muted: #9AA0BE;
    --line: #272D50;
    --line-strong: #353C66;

    --orange-ink: #FFB566;
    --red-ink: #FF8A75;
    --blue-ink: #5CC8F2;
    --teal-ink: #4FD8BF;
    --purple-ink: #B9B0E8;
    --green-ink: #7BD66C;

    --orange-soft: #2E2214;
    --red-soft: #33191A;
    --blue-soft: #0F2A3D;
    --teal-soft: #0E2B2B;
    --purple-soft: #221F3D;

    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -8px rgb(0 0 0 / .5);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / .3), 0 24px 48px -16px rgb(0 0 0 / .6);

    --footer-bg: #090B19;

    color-scheme: dark;
  }
}
:root[data-mode="dark"] {
  --paper: #0E1124;
  --surface: #161A33;
  --surface-2: #121630;
  --ink: #EEF0FA;
  --ink-2: #CDD1E6;
  --muted: #9AA0BE;
  --line: #272D50;
  --line-strong: #353C66;

  --orange-ink: #FFB566;
  --red-ink: #FF8A75;
  --blue-ink: #5CC8F2;
  --teal-ink: #4FD8BF;
  --purple-ink: #B9B0E8;
  --green-ink: #7BD66C;

  --orange-soft: #2E2214;
  --red-soft: #33191A;
  --blue-soft: #0F2A3D;
  --teal-soft: #0E2B2B;
  --purple-soft: #221F3D;

  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -8px rgb(0 0 0 / .5);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / .3), 0 24px 48px -16px rgb(0 0 0 / .6);

  --footer-bg: #090B19;

  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font: 400 1rem/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
picture { display: contents; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; }
p, li { text-wrap: pretty; }
a { color: var(--blue-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
strong { color: var(--ink); font-weight: 600; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { 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: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
.wrap.narrow { max-width: calc(720px + 2 * var(--gutter)); }

/* five-colour ribbon, echoing the logo */
.ribbon { display: flex; height: 5px; }
.ribbon i { flex: 1; }
.ribbon i:nth-child(1) { background: var(--orange); }
.ribbon i:nth-child(2) { background: var(--red); }
.ribbon i:nth-child(3) { background: var(--purple); }
.ribbon i:nth-child(4) { background: var(--blue); }
.ribbon i:nth-child(5) { background: var(--teal); }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; gap: .55em;
  min-height: 44px; padding: .6em 1.15em;
  border-radius: 999px; border: 1px solid transparent;
  font: 600 .9375rem/1.2 var(--font); letter-spacing: -0.005em;
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--ink); color: var(--paper); box-shadow: var(--shadow); }
.btn-primary:hover { box-shadow: var(--shadow-lg); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-quiet:hover { background: var(--surface); }
.btn-soft { background: var(--blue-soft); color: var(--blue-ink); }
.btn-soft:hover { background: color-mix(in srgb, var(--blue-soft) 70%, var(--blue) 30%); }
/* dark: follows the device unless the reader picked a mode (data-mode on <html>) */
@media (prefers-color-scheme: dark) {
  :root:not([data-mode]) .btn-soft:hover { background: color-mix(in srgb, var(--blue-soft) 75%, var(--blue) 25%); }
}
:root[data-mode="dark"] .btn-soft:hover { background: color-mix(in srgb, var(--blue-soft) 75%, var(--blue) 25%); }

/* ----------------------------------------------------------------- header */

.site-header { background: color-mix(in srgb, var(--paper) 88%, transparent); position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { width: auto; height: 42px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.015em; }
.brand-sub { font-size: .8125rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-nav { display: flex; align-items: center; gap: 4px; }
.header-nav a { display: inline-flex; align-items: center; gap: .4em; padding: 10px 14px; border-radius: 999px; color: var(--ink); font-weight: 500; font-size: .9375rem; text-decoration: none; white-space: nowrap; }
.header-nav a:hover { background: var(--surface); }
.header-nav a[aria-current="page"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.header-nav .i { width: .95em; height: .95em; opacity: .7; }
.mode-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 .9375rem/1 var(--font); cursor: pointer; }
.mode-btn:hover { border-color: var(--line-strong); }
.mode-btn > span { display: inline-flex; align-items: center; gap: .45em; }
.mode-btn .i { width: 1.05em; height: 1.05em; }
@media (max-width: 640px) {
  .nav-ext { display: none !important; }
  .brand-sub { display: none; }
  .header-inner { min-height: 60px; }
  .brand img { height: 36px; }
  .header-nav a { padding: 8px 12px; font-size: .875rem; }
  .mode-btn { padding: 8px 10px; }
  .mode-label { display: none; }
}

/* ---------------------------------------------------------------- eyebrow */

.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: .5em; font-size: .8125rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 18px; }
.eb-a { color: var(--red-ink); }
.eb-b { color: var(--orange-ink); }
.eb-c { color: var(--blue-ink); }

.motto { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 0; margin: 0; font-size: .8125rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.motto span { display: inline-flex; align-items: center; }
.motto span + span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; margin-inline: 14px; background: var(--dot, var(--orange)); }
.motto span:nth-child(2)::before { --dot: var(--red); }
.motto span:nth-child(3)::before { --dot: var(--blue); }
.motto span:nth-child(4)::before { --dot: var(--teal); }

/* --------------------------------------------------------------- masthead */

.masthead { padding: clamp(32px, 6vw, 72px) 0 0; }
.masthead-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.masthead h1 { font-size: clamp(2.25rem, 1.35rem + 3.4vw, 4rem); line-height: 1.06; letter-spacing: -0.035em; }
.dek { margin-top: 20px; font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem); line-height: 1.6; color: var(--ink-2); max-width: 36em; }
.meta { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .875rem; color: var(--muted); }
.meta li { display: inline-flex; align-items: center; gap: .5em; }
.meta .i { color: var(--orange-ink); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.mosaic { position: relative; display: grid; grid-template-columns: 1.55fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; aspect-ratio: 1.3; isolation: isolate; }
.mosaic .tile { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); background: var(--surface-2); }
.mosaic .tile img { width: 100%; height: 100%; object-fit: cover; }
.mosaic .t1 { grid-row: 1 / span 2; border-radius: var(--radius-lg); }
.mosaic .t3 img { object-position: 50% 30%; }
.mosaic-1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.mosaic-1 .t1 { grid-row: auto; }
.mosaic-2 .t2 { grid-row: 1 / span 2; }
/* the logo's pills and dots, peeking out from behind the photos */
.mosaic .shape { position: absolute; z-index: -1; border-radius: 999px; }
.mosaic .s1 { width: 22%; height: 46%; left: -6%; top: -7%; background: var(--orange); }
.mosaic .s2 { width: 12%; aspect-ratio: 1; height: auto; right: -4%; top: -6%; background: var(--red); }
.mosaic .s3 { width: 16%; height: 40%; right: -5%; bottom: -8%; background: var(--blue); }
.mosaic .s4 { width: 10%; aspect-ratio: 1; height: auto; left: 30%; bottom: -7%; background: var(--teal); }

.masthead .motto { margin-top: clamp(40px, 6vw, 64px); padding: 18px 0; border-block: 1px solid var(--line); }

@media (max-width: 860px) {
  .masthead-grid { grid-template-columns: 1fr; }
  .mosaic { aspect-ratio: 1.15; max-width: 640px; }
  .mosaic .s1 { left: -3%; }
  .mosaic .s3 { right: -3%; }
}
@media (max-width: 520px) {
  .mosaic { gap: 8px; aspect-ratio: 1; }
  .mosaic .tile { border-radius: var(--radius-sm); }
  .mosaic .t1 { border-radius: var(--radius); }
  .motto { font-size: .6875rem; letter-spacing: .12em; }
  .motto span + span::before { margin-inline: 9px; width: 5px; height: 5px; }
}

/* ----------------------------------------------------------- at a glance */

.glance { margin-top: clamp(32px, 5vw, 56px); }
.glance-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); grid-template-areas: "alert alert" "dates houses"; gap: 20px; align-items: start; }
.glance-grid.no-dates { grid-template-areas: "alert alert" "houses houses"; }
.glance .alert { grid-area: alert; }
.glance .houses { grid-area: houses; }
.glance .dates { grid-area: dates; }
@media (max-width: 999px) {
  .glance-grid, .glance-grid.no-dates { grid-template-columns: 1fr; grid-template-areas: "alert" "dates" "houses"; }
}

.card { background: var(--surface); border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 30px); box-shadow: var(--shadow); border: 1px solid var(--line); }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.card-head h3 { font-size: 1.25rem; }
.card-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--orange-soft); color: var(--orange-ink); }
.dates .card-icon { background: var(--blue-soft); color: var(--blue-ink); }
.card-foot { margin-top: 20px; font-size: .9375rem; color: var(--muted); }

/* alert */
.alert { display: flex; align-items: center; gap: 20px; padding: 22px 24px; border-radius: var(--radius-lg); background: var(--red-soft); border: 1px solid color-mix(in srgb, var(--red) 25%, transparent); position: relative; overflow: hidden; }
.alert::after { content: ""; position: absolute; right: -24px; top: -40px; width: 150px; height: 150px; border-radius: 50%; background: var(--red); opacity: .09; }
.alert.tone-info { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 25%, transparent); }
.alert.tone-info::after { background: var(--blue); }
.alert.tone-info .dt-wk, .alert.tone-info .dt-mo { color: var(--blue-ink); }
.date-tile { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 78px; height: 86px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); line-height: 1; }
.dt-wk, .dt-mo { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--red-ink); }
.dt-day { font-size: 2.125rem; font-weight: 700; color: var(--ink); margin: 4px 0 3px; letter-spacing: -0.03em; }
.alert-title { font-size: clamp(1.1875rem, 1rem + .6vw, 1.5rem); font-weight: 700; color: var(--ink); line-height: 1.3; letter-spacing: -0.015em; }
.alert-text { margin-top: 4px; color: var(--ink-2); }

/* house points */
.house-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.house-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.house-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--house); flex: none; }
.house-name { font-weight: 600; color: var(--ink); }
.house-pts { margin-left: auto; font-size: 1.375rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.badge { font-size: .6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--house) 15%, transparent); color: var(--ink); }
.bar { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--house); transform-origin: left; animation: grow 1.1s cubic-bezier(.2, .8, .2, 1) both; }
.house:not(.is-leader) .bar span { opacity: .78; }
@keyframes grow { from { transform: scaleX(0); } }

/* dates */
.date-month { font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.date-month:not(:first-of-type) { margin-top: 18px; }
.date-list { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-template-rows: repeat(var(--rows), auto); grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
.date { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.date.col-top { border-top: 0; padding-top: 2px; }
@media (max-width: 680px) {
  .date-list { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: 1fr; }
  .date.col-top { border-top: 1px solid var(--line); padding-top: 10px; }
  .date:first-child { border-top: 0; padding-top: 2px; }
}
.date-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 54px; border-radius: 14px; background: var(--blue-soft); color: var(--blue-ink); line-height: 1.05; padding: 6px 2px; }
.dc-wk { font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.dc-day { font-size: 1.25rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; white-space: nowrap; }
.kind-closed .date-chip { background: var(--red-soft); color: var(--red-ink); }
.kind-change .date-chip { background: var(--orange-soft); color: var(--orange-ink); }
.date-title { font-weight: 600; color: var(--ink); line-height: 1.35; }
.date-note { font-size: .875rem; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.date-tag { display: inline-block; margin-top: 6px; font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.kind-closed .date-tag { background: var(--red-soft); color: var(--red-ink); }
.kind-change .date-tag { background: var(--orange-soft); color: var(--orange-ink); }
@media (max-width: 480px) {
  .date { grid-template-columns: 52px minmax(0, 1fr); }
  .dc-day { font-size: 1.0625rem; }
}

/* ----------------------------------------------------------------- stories */

.story { --accent: var(--blue); --accent-ink: var(--blue-ink); --accent-soft: var(--blue-soft); padding-top: clamp(56px, 9vw, 112px); scroll-margin-top: 80px; }
.accent-orange { --accent: var(--orange); --accent-ink: var(--orange-ink); --accent-soft: var(--orange-soft); }
.accent-red { --accent: var(--red); --accent-ink: var(--red-ink); --accent-soft: var(--red-soft); }
.accent-teal { --accent: var(--teal); --accent-ink: var(--teal-ink); --accent-soft: var(--teal-soft); }
.accent-purple { --accent: var(--purple); --accent-ink: var(--purple-ink); --accent-soft: var(--purple-soft); }
.accent-green { --accent: var(--green); --accent-ink: var(--green-ink); --accent-soft: var(--teal-soft); }

.kicker { display: inline-flex; align-items: center; gap: 10px; font-size: .8125rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink, var(--blue-ink)); margin-bottom: 14px; }
.kicker .person { width: 9px; height: 20px; fill: var(--accent, var(--blue)); }
.story-head h2 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); letter-spacing: -0.03em; margin-bottom: 22px; }
.story-head p { font-size: 1.0625rem; line-height: 1.8; }
.story-head p + p { margin-top: 1.1em; }
.story-head .lead { font-size: clamp(1.125rem, 1.05rem + .3vw, 1.25rem); line-height: 1.7; color: var(--ink); }
.story-head em { font-style: italic; }

.gallery-block { margin-top: clamp(28px, 4vw, 44px); }
.story-head + .gallery-block { margin-top: clamp(32px, 5vw, 52px); }
.story-head:not(:has(p)) h2 { margin-bottom: 0; }
.gallery-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 14px; }
.gallery-head h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 10px; }
.gallery-head h3::before { content: ""; width: 22px; height: 4px; border-radius: 4px; background: var(--accent); }
.gallery-head .count { font-size: .875rem; color: var(--muted); }

/* Rows are planned at build time so each one fills the width exactly:
   a tile's share of the row is its aspect ratio / the row's ratio sum. */
.gallery { display: flex; flex-direction: column; gap: 10px; }
.g-row { display: flex; gap: 10px; width: 100%; max-width: calc(var(--sum) * 440px); }
.g-item { flex: var(--ar) 1 0; min-width: 0; aspect-ratio: var(--ar); }
.gallery a { display: block; width: 100%; height: 100%; border-radius: var(--radius-sm); overflow: hidden; position: relative; cursor: zoom-in; background: var(--surface-2); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.gallery a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .06); pointer-events: none; }
.gallery a:hover img { transform: scale(1.035); }
.gallery a:focus-visible { outline-offset: 3px; }
@media (max-width: 900px) { .gallery, .g-row { gap: 8px; } }
/* phones: let tiles flow freely, two-ish per row, last row stretches */
@media (max-width: 559px) {
  .gallery { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .g-row { display: contents; }
  .g-item { flex: calc(var(--ar) * 100) 1 calc(var(--ar) * 120px); }
  .gallery a { border-radius: 10px; }
}

/* --------------------------------------------------------------- reminders */

.reminders { margin-top: clamp(64px, 10vw, 120px); padding: clamp(48px, 8vw, 96px) 0; background: var(--surface-2); position: relative; }
.reminders::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); }
.section-head { text-align: center; margin-bottom: clamp(28px, 4vw, 44px); --accent: var(--red); --accent-ink: var(--red-ink); }
.section-head h2 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); letter-spacing: -0.03em; }
.reminder-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.reminder { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(22px, 3vw, 32px); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.reminder-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--orange-soft); color: var(--orange-ink); margin-bottom: 18px; }
.reminder:nth-child(2) .reminder-icon { background: var(--teal-soft); color: var(--teal-ink); }
.reminder:nth-child(3) .reminder-icon { background: var(--purple-soft); color: var(--purple-ink); }
.reminder-icon .i { width: 24px; height: 24px; }
.reminder h3 { font-size: 1.25rem; margin-bottom: 10px; }
.reminder p { line-height: 1.7; }
.reminder-links { margin-top: auto !important; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }

.pull-quote { margin: clamp(40px, 6vw, 64px) auto 0; max-width: 820px; text-align: center; position: relative; }
.pull-quote::before { content: "“"; display: block; font-size: 5.5rem; line-height: .6; height: 2.6rem; font-weight: 700; color: var(--orange); }
.pull-quote blockquote { margin: 0; }
.pull-quote p { font-size: clamp(1.375rem, 1.1rem + 1.2vw, 2rem); line-height: 1.4; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; text-wrap: balance; }

/* ------------------------------------------------------------------ letter */

.letter { padding: clamp(56px, 9vw, 104px) 0 0; }
.letter-card { --accent: var(--purple); --accent-ink: var(--purple-ink); position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(28px, 5vw, 56px); box-shadow: var(--shadow); overflow: hidden; }
.letter-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--orange) 0 20%, var(--red) 20% 40%, var(--purple) 40% 60%, var(--blue) 60% 80%, var(--teal) 80%); }
.letter-card > p:not(.kicker) { font-size: 1.125rem; line-height: 1.8; color: var(--ink); }
.signoff { margin-top: 32px; }
.so-greet { color: var(--muted); }
.so-sig { font-family: var(--script); font-weight: 600; font-size: clamp(2.5rem, 2rem + 2vw, 3.25rem); line-height: 1.1; color: var(--blue-ink); margin: 6px 0 4px; transform: rotate(-2deg); transform-origin: left; }
.so-name { font-weight: 600; color: var(--ink); }
.so-role { font-size: .9375rem; color: var(--muted); }
.contact-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }

/* -------------------------------------------------------------- issue nav */

.issue-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; padding-top: clamp(48px, 7vw, 80px); padding-bottom: clamp(56px, 8vw, 96px); }
.nav-card { display: flex; flex-direction: column; gap: 4px; padding: 22px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); transition: transform .15s ease, box-shadow .15s ease; }
.nav-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.nav-card strong { font-size: 1.125rem; color: var(--ink); letter-spacing: -0.015em; }
.nav-dir { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--blue-ink); }
.nav-title { font-size: .9375rem; color: var(--muted); }
.nav-newer { text-align: right; align-items: flex-end; }
.nav-all { background: var(--ink); border-color: var(--ink); color: var(--footer-muted); }
.nav-all strong { color: var(--paper); }
.nav-all .nav-dir { color: var(--orange); }
.nav-all .nav-title { color: #A7ACC8; }
/* dark: follows the device unless the reader picked a mode (data-mode on <html>) */
@media (prefers-color-scheme: dark) {
  :root:not([data-mode]) .nav-all { background: var(--surface-2); border-color: var(--line-strong); }
  :root:not([data-mode]) .nav-all strong { color: var(--ink); }
}
:root[data-mode="dark"] .nav-all { background: var(--surface-2); border-color: var(--line-strong); }
:root[data-mode="dark"] .nav-all strong { color: var(--ink); }

/* ------------------------------------------------------------------ footer */

.site-footer { background: var(--footer-bg); color: var(--footer-muted); font-size: .9375rem; }
.page-archive .site-footer { margin-top: clamp(56px, 8vw, 96px); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; padding-top: 56px; padding-bottom: 40px; }
.footer-brand { display: flex; gap: 16px; align-items: flex-start; }
.footer-brand img { height: 64px; width: auto; }
.footer-school { color: var(--footer-ink); font-weight: 700; font-size: 1.125rem; line-height: 1.3; letter-spacing: -0.01em; max-width: 14em; }
.motto-footer { justify-content: flex-start; margin-top: 12px; font-size: .6875rem; color: var(--footer-muted); letter-spacing: .14em; }
.motto-footer span + span::before { margin-inline: 8px; width: 5px; height: 5px; }
.footer-h { color: var(--footer-ink); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; margin-bottom: 12px; }
.site-footer address { font-style: normal; line-height: 1.75; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-links a, .footer-base a { display: inline-flex; align-items: center; gap: 10px; color: var(--footer-ink); text-decoration: none; overflow-wrap: anywhere; }
.footer-links a:hover, .footer-base a:hover { text-decoration: underline; }
.footer-links .i { color: var(--footer-muted); }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 20px; padding-bottom: 28px; border-top: 1px solid rgb(255 255 255 / .09); font-size: .8125rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; padding-top: 40px; } }

/* ------------------------------------------------------------- archive */

.home-hero { padding: clamp(40px, 7vw, 88px) 0 clamp(28px, 4vw, 44px); text-align: center; }
.home-hero .eyebrow { justify-content: center; }
.home-hero h1 { font-size: clamp(2.125rem, 1.3rem + 3.4vw, 3.75rem); line-height: 1.08; letter-spacing: -0.035em; max-width: 16em; margin-inline: auto; }
.home-hero .dek { margin: 20px auto 0; max-width: 40em; }
.home-hero .motto { margin-top: 32px; }

.feature-card { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); text-decoration: none; color: var(--ink-2); transition: transform .2s ease, box-shadow .2s ease; }
.feature-card:hover { transform: translateY(-3px); text-decoration: none; }
.feature-card:hover img { transform: scale(1.03); }
.feature-media { position: relative; overflow: hidden; min-height: 300px; background: var(--surface-2); }
.feature-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.feature-body { padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.tag { font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; background: var(--orange-soft); color: var(--orange-ink); }
.feature-date { margin-top: 18px; font-size: .9375rem; color: var(--muted); }
.feature-card h2 { margin-top: 6px; font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.375rem); letter-spacing: -0.03em; }
.feature-dek { margin-top: 14px; line-height: 1.7; }
.feature-card .btn { margin-top: 26px; }
@media (max-width: 860px) { .feature-card { grid-template-columns: 1fr; } .feature-media { aspect-ratio: 16 / 10; min-height: 0; } }

.archive { padding-top: clamp(48px, 7vw, 80px); scroll-margin-top: 80px; }
.archive-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.archive-head h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem); letter-spacing: -0.03em; }
.archive-count { color: var(--muted); font-size: .9375rem; margin-top: 4px; }
.search { position: relative; display: block; width: min(100%, 320px); }
.search .i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; min-height: 46px; padding: 10px 16px 10px 44px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: .9375rem; }
.search input:focus { outline: 3px solid color-mix(in srgb, var(--blue) 40%, transparent); border-color: var(--blue); }
.year-group + .year-group { margin-top: 40px; }
.year-h { font-size: .8125rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.issue-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.issue-card { display: flex; flex-direction: column; height: 100%; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); transition: transform .15s ease, box-shadow .15s ease; }
.issue-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; }
.issue-thumb { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.issue-thumb img { width: 100%; height: 100%; object-fit: cover; }
.issue-card-body { padding: 18px 20px 22px; }
.issue-date { font-size: .8125rem; font-weight: 600; color: var(--blue-ink); }
.issue-card h4 { font-size: 1.125rem; margin-top: 6px; letter-spacing: -0.015em; line-height: 1.3; }
.issue-meta { font-size: .8125rem; color: var(--muted); margin-top: 8px; }
.empty { padding: 40px 0; text-align: center; color: var(--muted); }

/* ----------------------------------------------------------------- lightbox */

.lightbox { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #080A16; color: #fff; overflow: hidden; }
.lightbox::backdrop { background: #080A16; }
.lightbox[open] { display: grid; place-items: center; animation: lb-in .2s ease; }
@keyframes lb-in { from { opacity: 0; } }
.lb-figure { margin: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; align-items: center; gap: 14px; width: 100%; height: 100%; padding: 64px 84px 22px; }
.lb-figure img { max-width: 100%; max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); width: auto; height: auto; object-fit: contain; border-radius: 8px; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.lb-figure figcaption { min-height: 1.5em; display: flex; gap: 16px; align-items: baseline; justify-content: center; flex-wrap: wrap; max-width: 860px; text-align: center; font-size: .9375rem; line-height: 1.5; color: #E6E8F4; }
.lb-count { color: #A7ACC8; font-size: .8125rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-btn { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .16); background: rgb(255 255 255 / .08); color: #fff; cursor: pointer; transition: background-color .15s ease; }
.lb-btn:hover { background: rgb(255 255 255 / .18); }
.lb-btn .i { width: 22px; height: 22px; }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-btn[hidden] { display: none; }
@media (max-width: 640px) {
  .lb-figure { padding: 60px 8px 16px; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; width: 44px; height: 44px; }
  .lb-figure figcaption { padding-inline: 56px; font-size: .875rem; }
}
html:has(.lightbox[open]) { overflow: hidden; }

/* ------------------------------------------------------------------ motion */

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

/* ------------------------------------------------------------------- print */

@media print {
  :root { --paper: #fff; --surface: #fff; --surface-2: #fff; --shadow: none; --shadow-lg: none; }
  body { font-size: 10.5pt; color: #222; }
  .site-header, .actions, .issue-nav, .contact-row, .lightbox, .mosaic .shape, .skip, .reminder-links .i, .card-foot .btn { display: none !important; }
  .masthead { padding-top: 0; }
  .masthead-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .masthead h1 { font-size: 24pt; }
  .glance-grid { grid-template-columns: 1fr 1fr; }
  .card, .reminder, .letter-card, .alert { box-shadow: none; break-inside: avoid; border-color: #ccc; }
  .story { padding-top: 28px; break-inside: auto; }
  .story-head { break-after: avoid; }
  .g-row { break-inside: avoid; max-width: calc(var(--sum) * 200px); }
  .reminders { background: none; margin-top: 28px; padding: 28px 0 0; }
  .letter { padding-top: 28px; }
  a[href^="http"]::after { content: none; }
  .site-footer { background: none; color: #444; border-top: 1px solid #ccc; }
  .site-footer .ribbon { display: none; }
  .footer-school, .footer-h, .footer-links a, .footer-base a { color: #222; }
  .bar span { animation: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ribbon, .date-chip, .house-dot, .bar, .alert { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
