/* glass.css: the shared liquid-glass system (from design option 04), used by every page.
 * Holds the tokens, the field behind the glass, the glass sheet, the top bar, the phone dock and the
 * poster headline (from option 03). Page layout lives elsewhere: home-glass.css for the home page,
 * glass-skin.css for the pages carried over from the paper-and-ink site.
 * Daylight is the default; html.noir turns the glass dark. glass-head.js sets the class before first paint. */

@font-face { font-family: "Jost"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../assets/fonts/jost-latin.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../assets/fonts/archivo-latin.woff2") format("woff2"); }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/space-mono-latin.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --ground: #e9edf1; --ink: #101215; --dim: #33383f; --red: #d22a1f; --hot: #e0382a;
  --hair: rgba(16, 18, 21, .14);
  /* Glass tint. Text sits on the padding box, whose tint never drops below .7 in Daylight
     (dim ink on glass over pure black: 5.6 to 1) or .78 in Noir (dim ink over pure white: 5.6 to 1). */
  --g: 255, 255, 255; --g-hi: .78; --g-lo: .7;
  --rim1: rgba(255, 255, 255, .62); --rim2: rgba(255, 255, 255, .12); --rim3: rgba(255, 255, 255, .4);
  --edge: rgba(255, 255, 255, .95); --spec1: rgba(255, 255, 255, 1); --spec2: rgba(255, 255, 255, .7);
  --drop: 17, 25, 40; --drop-a: .3; --bb: 1.05;
  --ring: rgba(16, 18, 21, .09);
  --pool1: rgba(255, 255, 255, .95); --pool2: rgba(172, 185, 200, .7); --pool3: rgba(210, 42, 31, .075);
  --photo: none; --ghost: #7d8590;
  --sea: #e4e9ee; --land: #fbfcfd; --cl: rgba(16, 18, 21, .2);
  --font-d: "Jost", "Avenir Next", Futura, "Helvetica Neue", Arial, sans-serif;
  --font-s: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-m: "Space Mono", ui-monospace, Menlo, monospace;
  --gut: clamp(18px, 5vw, 72px);
}
html.noir {
  --ground: #08090b; --ink: #f4f3f0; --dim: #c9ccd1; --red: #e0382a;
  --hair: rgba(244, 243, 240, .17);
  --g: 16, 17, 20; --g-hi: .78; --g-lo: .86;
  --rim1: rgba(255, 255, 255, .22); --rim2: rgba(255, 255, 255, .03); --rim3: rgba(255, 255, 255, .11);
  --edge: rgba(255, 255, 255, .26); --spec1: rgba(255, 255, 255, .8); --spec2: rgba(255, 255, 255, .3);
  --drop: 0, 0, 0; --drop-a: .75; --bb: .8;
  --ring: rgba(244, 243, 240, .07);
  --pool1: rgba(70, 76, 88, .5); --pool2: rgba(38, 42, 50, .8); --pool3: rgba(224, 56, 42, .13);
  --photo: brightness(.72) contrast(1.06); --ghost: rgba(244, 243, 240, .65);
  --sea: #0d0f12; --land: #1d2025; --cl: rgba(244, 243, 240, .2);
}

/* ---------- The field behind the glass: rings of equal potential and slow pools of light ---------- */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--ground); }
html.noir .sky {
  background-image:
    radial-gradient(1.2px 1.2px at 46px 72px, rgba(255, 255, 255, .8) 50%, transparent 56%),
    radial-gradient(1px 1px at 212px 38px, rgba(255, 255, 255, .6) 50%, transparent 56%),
    radial-gradient(1.4px 1.4px at 318px 246px, rgba(255, 255, 255, .7) 50%, transparent 56%),
    radial-gradient(1px 1px at 128px 322px, rgba(255, 255, 255, .5) 50%, transparent 56%),
    radial-gradient(1px 1px at 388px 150px, rgba(255, 255, 255, .45) 50%, transparent 56%);
  background-size: 430px 390px;
}
.sky::after { content: ""; position: absolute; inset: 0; background: repeating-radial-gradient(circle at 76% 44%, transparent 0 61px, var(--ring) 62px 63px, transparent 64px); }
.sky .pool { position: absolute; border-radius: 50%; }
.sky .pool.a { left: -12vw; top: -22vh; width: 72vw; height: 72vw; background: radial-gradient(closest-side, var(--pool1), transparent); }
.sky .pool.b { right: -22vw; top: 26vh; width: 84vw; height: 84vw; background: radial-gradient(closest-side, var(--pool2), transparent); }
.sky .pool.c { left: 30vw; top: 4vh; width: 58vw; height: 58vw; background: radial-gradient(closest-side, var(--pool3), transparent); }
@keyframes glass-drift { to { transform: translate3d(7vw, 6vh, 0) scale(1.1); } }
@keyframes glass-drift2 { to { transform: translate3d(-8vw, -5vh, 0) scale(.94); } }
@media (min-width: 900px) {
  html:not(.still) .sky .pool.a, html:not(.still) .sky .pool.c { animation: glass-drift 26s ease-in-out infinite alternate; }
  html:not(.still) .sky .pool.b { animation: glass-drift2 32s ease-in-out infinite alternate; }
}

/* ---------- Glass ---------- */
/* Without backdrop-filter: a nearly solid sheet. */
.glass {
  --r: 30px; --rimw: 9px;
  position: relative; border: var(--rimw) solid transparent; border-radius: var(--r); color: var(--ink);
  background:
    linear-gradient(rgba(var(--g), .95), rgba(var(--g), .91)) padding-box,
    linear-gradient(135deg, var(--rim1), var(--rim2) 38%, var(--rim2) 62%, var(--rim3)) border-box;
  box-shadow: 0 1px 1px rgba(var(--drop), .06), 0 10px 24px -14px rgba(var(--drop), .2), 0 34px 70px -34px rgba(var(--drop), var(--drop-a));
}
/* With it: a tinted reading zone inside a clearer bevelled rim that shows what is behind. */
@supports ((-webkit-backdrop-filter: blur(2px)) or (backdrop-filter: blur(2px))) {
  .glass {
    background:
      linear-gradient(rgba(var(--g), var(--g-hi)), rgba(var(--g), var(--g-lo))) padding-box,
      linear-gradient(135deg, var(--rim1), var(--rim2) 38%, var(--rim2) 62%, var(--rim3)) border-box;
    -webkit-backdrop-filter: blur(var(--blur, 20px)) saturate(1.5) brightness(var(--bb));
    backdrop-filter: blur(var(--blur, 20px)) saturate(1.5) brightness(var(--bb));
  }
}
/* Edge light: a one-pixel rim that is brightest at two opposite corners and turns with the pointer. */
.glass::before {
  content: ""; position: absolute; inset: calc(var(--rimw) * -1); border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(calc(128deg + var(--px, 0) * 34deg), var(--spec1), transparent 30%, transparent 64%, var(--spec2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: calc(var(--r) - var(--rimw)); pointer-events: none;
  box-shadow: inset 0 1px 0 var(--edge), inset 0 0 0 1px var(--hair), inset 0 -20px 30px -26px rgba(var(--drop), .28);
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .glass { --g-hi: .97; --g-lo: .96; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (max-width: 899px) { .glass { --blur: 12px; } }
.glass.pad { padding: clamp(20px, 2.6vw, 34px); }

/* ---------- Top bar and phone dock (the same on every page) ---------- */
.bar { --r: 999px; --rimw: 5px; --blur: 16px; position: fixed; z-index: 60; top: 12px; left: 12px; right: 12px; max-width: 1120px; margin: 0 auto; height: 58px; padding: 0 4px 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--font-s); }
.bar .brand { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; min-width: 0; flex: 0 1 auto; color: var(--ink); text-decoration: none; font: 500 1.02rem var(--font-d); letter-spacing: .01em; text-transform: none; white-space: nowrap; }
.bar .brand svg { width: 32px; height: 20px; flex: none; overflow: visible; }
.bar .brand span { overflow: hidden; text-overflow: ellipsis; }
.bar .links { display: none; }
.bar .links a, .dock a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; border-radius: 999px; color: var(--ink); text-decoration: none; font: 500 .88rem var(--font-s); letter-spacing: 0; text-transform: none; }
.bar .links a:hover, .dock a:hover { background: var(--hair); }
.bar .links a[aria-current], .dock a[aria-current] { background: var(--ink); color: var(--ground); }
.bar .switches { display: flex; gap: 6px; flex: none; }
.sw { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; min-width: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--hair); background: rgba(var(--g), .5); color: var(--ink); font: 500 .8rem var(--font-s); cursor: pointer; }
.sw b { font-weight: 500; }
.sw i { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--ink); flex: none; }
.bar #schemeBtn i { background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); }
#motionBtn i { background: var(--ink); }
#motionBtn[aria-pressed="true"] i { border-radius: 2px; }
@keyframes glass-pulse { 50% { transform: scale(.45); } }
html:not(.still) #motionBtn i { animation: glass-pulse 1.6s ease-in-out infinite; }
.dock { --r: 999px; --rimw: 5px; --blur: 14px; position: fixed; z-index: 60; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); max-width: 440px; margin: 0 auto; display: flex; justify-content: space-between; padding: 2px 4px; }
.dock a { flex: 1 1 auto; padding: 0 6px; font-size: .8rem; }
.bar :focus-visible, .dock :focus-visible, .sw:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; box-shadow: none; }
@media (max-width: 899px) { .bar .sw { gap: 6px; padding: 0 10px; font-size: .76rem; } }
@media (max-width: 419px) { .bar .sw b { display: none; } }
@media (max-width: 359px) { .bar .brand span { display: none; } }
@media (min-width: 900px) { .bar .links { display: flex; gap: 2px; } .dock { display: none; } .bar .sw { min-width: 96px; } }
@media print { .bar, .dock, .sky { display: none !important; } }

/* ---------- Poster headlines (from option 03): heavy capitals sized to their container.
   kinetic.js splits them into letters and moves each letter's weight. ---------- */
.cq { container-type: inline-size; }
.poster { display: block; margin: 0; font-family: var(--font-s); font-weight: 900; line-height: .88; text-transform: uppercase; letter-spacing: 0; color: var(--ink);
  font-size: calc((100vw - 2 * var(--gut)) / 10.45); font-size: calc(100cqw / 10.15); }
.poster.t2 { font-size: calc((100vw - 2 * var(--gut)) / 11.3); font-size: calc(100cqw / 11); }
.poster.name { font-size: calc((100vw - 2 * var(--gut)) / 7.4); font-size: calc(100cqw / 7.15); }
@media (max-width: 759px) {
  .poster, .poster.t2 { font-size: calc((100vw - 2 * var(--gut)) / 8.05); font-size: calc(100cqw / 7.8); }
  .poster.name { font-size: calc((100vw - 2 * var(--gut)) / 7.4); font-size: calc(100cqw / 7.15); }
}
.poster .ln { display: block; }
.poster .red { color: var(--red); }
.k-w { display: inline-block; white-space: nowrap; }
.k-c { display: inline-block; text-align: center; }
.k-measure { position: fixed; left: 0; top: 0; width: 0; height: 0; overflow: hidden; visibility: hidden; pointer-events: none; font-family: var(--font-s); font-weight: 900; font-size: 200px; line-height: 1; letter-spacing: 0; text-transform: none; white-space: pre; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
