/* Banner Day */
:root {
  --chalk: rgba(244, 242, 232, .93);
  --chalk-dim: rgba(244, 242, 232, .62);
  --slate: #26332d;
  --wood: #8b5a2f;
  --red: #c8202b;
  --ink: #1c2730;
  --muted: #66717a;
  --nylon: #fbfaf5;
  --ab-fg: var(--ink);
  --ab-muted: var(--muted);
  --ab-accent: var(--red);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #8fbfe8; color: var(--ink); -webkit-text-size-adjust: 100%; }
body { font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; overscroll-behavior: none; }
button { font: inherit; color: inherit; }

/* ------------------------------------------------------------------ the beach */
#world { position: fixed; inset: 0; overflow: hidden; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#beach { position: absolute; pointer-events: none; }
#strip { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
#arm { position: absolute; pointer-events: none; }

/* ------------------------------------------------------------------ the flight line chalkboard */
/* folded, it's a small sign on the sand by the lifeguard stand; a click opens the full board in its place */
#board { display: none; position: fixed; right: max(18px, 2.2vw); bottom: 0; z-index: 3; width: auto; padding-bottom: 22px; transform-origin: 100% 100%; }
#board.open { display: block; animation: board-up .22s ease-out; }
@keyframes board-up { from { opacity: 0; translate: 0 12px; } }
#board .board-frame::after { content: ""; position: absolute; left: 4%; right: 4%; bottom: -34px; height: 18px; z-index: -1; background: radial-gradient(ellipse at 50% 50%, rgba(60, 40, 20, .38), transparent 70%); filter: blur(2px); }
@media (max-height: 760px) and (min-width: 900px) { #board, #board-tab { scale: .9; } }
@media (max-height: 680px) and (min-width: 900px) { #board, #board-tab { scale: .8; } }
@media (min-width: 1600px) and (min-height: 900px) { #board, #board-tab { scale: 1.15; } }
#board::before, #board::after { content: ""; position: absolute; bottom: 0; width: 8px; height: 30px; background: linear-gradient(90deg, #6f4422, #9a6939 45%, #6f4422); border-radius: 2px; box-shadow: 0 2px 3px rgba(0,0,0,.25); }
#board::before { left: 34px; } #board::after { right: 34px; }
.board-frame {
  position: relative; z-index: 1; padding: 11px 15px 9px; border-radius: 4px;
  border: 8px solid var(--wood);
  border-image: linear-gradient(160deg, #a46d3b, #7b4c26 40%, #9c6534 70%, #6b411f) 1;
  background:
    radial-gradient(ellipse at 22% 30%, rgba(255,255,255,.07), transparent 55%),
    radial-gradient(ellipse at 78% 72%, rgba(255,255,255,.055), transparent 50%),
    radial-gradient(ellipse at 60% 15%, rgba(255,255,255,.04), transparent 40%),
    var(--slate);
  box-shadow: 0 10px 24px rgba(0,0,0,.28), inset 0 0 30px rgba(0,0,0,.35);
  font-family: Caveat, "Comic Sans MS", cursive;
  color: var(--chalk);
}
.board-head { margin: 0 0 5px; font: 700 24px/1 Caveat, cursive; letter-spacing: .02em; text-transform: uppercase; color: var(--chalk); text-shadow: 0 0 1px rgba(255,255,255,.5); }
.board-head::after { content: ""; display: block; height: 2px; margin-top: 5px; width: 86%; background: linear-gradient(90deg, var(--chalk-dim), rgba(244,242,232,.35) 60%, transparent); border-radius: 2px; transform: rotate(-.6deg); }
#board-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-rows: repeat(13, auto); grid-auto-flow: column; grid-auto-columns: max-content; column-gap: 20px; }
#board-list button, .chalk-link {
  display: block; width: 100%; text-align: left; border: 0; background: none; cursor: pointer; padding: 1px 0 1px 15px; position: relative;
  font: 500 17.5px/1.1 Caveat, cursive; color: var(--chalk); text-shadow: 0 0 1px rgba(255,255,255,.35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#board-list button::before { content: ""; position: absolute; left: 1px; top: 50%; width: 7px; height: 2px; background: var(--chalk-dim); border-radius: 2px; transform: rotate(-8deg); }
#board-list button:hover, #board-list button:focus-visible, .chalk-link:hover, .chalk-link:focus-visible { color: #fff; outline: none; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.55); }
#board-list button.up { color: #fff6c9; }
#board-list button.up::before { width: 10px; height: 10px; top: calc(50% - 5px); left: 0; background: none; border: 2px solid rgba(255,246,201,.8); border-radius: 50%; transform: none; }
.chalk-link { margin-top: 4px; padding-left: 0; font-size: 17px; color: var(--chalk-dim); width: auto; }
.board-close { position: absolute; z-index: 2; top: 13px; right: 15px; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--chalk-dim); font: 28px/34px system-ui, sans-serif; cursor: pointer; }
.board-close:hover, .board-close:focus-visible { color: #fff; background: rgba(255, 255, 255, .08); outline: none; }
#board-tab {
  position: fixed; z-index: 3; right: max(18px, 2.2vw); bottom: 0; width: 184px; padding: 0 0 26px; border: 0; background: none; cursor: pointer;
  transform-origin: 100% 100%; color: var(--chalk); font: 700 27px/1 Caveat, cursive;
}
#board-tab span {
  position: relative; z-index: 1; display: block; padding: 17px 0 19px; text-align: center; border: 7px solid var(--wood);
  border-image: linear-gradient(160deg, #a46d3b, #7b4c26 40%, #9c6534 70%, #6b411f) 1;
  background: radial-gradient(ellipse at 28% 30%, rgba(255,255,255,.08), transparent 60%), var(--slate);
  box-shadow: 0 8px 18px rgba(0,0,0,.26), inset 0 0 18px rgba(0,0,0,.3); text-shadow: 0 0 1px rgba(255,255,255,.4);
  transition: translate .18s ease;
}
#board-tab::before, #board-tab::after { content: ""; position: absolute; bottom: 0; width: 7px; height: 34px; background: linear-gradient(90deg, #6f4422, #9a6939 45%, #6f4422); border-radius: 2px; box-shadow: 0 2px 3px rgba(0,0,0,.25); }
#board-tab::before { left: 26px; } #board-tab::after { right: 26px; }
#board-tab:hover span, #board-tab:focus-visible span { translate: 0 -3px; }
#board-tab:focus-visible { outline: none; }
#board-tab:focus-visible span { outline: 2px solid #fff; outline-offset: 3px; }
#board.open + #board-tab { visibility: hidden; }
body[data-look="gold"] #board-tab span { filter: sepia(.18) saturate(1.1); }
body[data-look="dusk"] #board-tab span { filter: brightness(.82) saturate(.9); }

/* evening light on the board */
body[data-look="gold"] .board-frame { filter: sepia(.18) saturate(1.1); }
body[data-look="dusk"] .board-frame { filter: brightness(.82) saturate(.9); }

/* ------------------------------------------------------------------ sound */
#snd { position: fixed; z-index: 4; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); width: 42px; height: 42px; padding: 9px; border: 0; border-radius: 50%; background: rgba(20, 40, 60, .22); cursor: pointer; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
#snd svg { display: block; width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#snd .spk { fill: #fff; }
#snd .off { display: none; }
#snd[aria-pressed="false"] .on { display: none; }
#snd[aria-pressed="false"] .off { display: inline; }
#snd:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ------------------------------------------------------------------ the case study, beside the beach */
#study {
  position: fixed; z-index: 5; top: 0; right: 0; bottom: 0; width: min(640px, 48vw);
  background: var(--nylon); box-shadow: -18px 0 40px rgba(0, 0, 0, .18);
  transform: translateX(104%); transition: transform .7s cubic-bezier(.2, .7, .2, 1);
  display: flex; flex-direction: column;
}
#study.open { transform: none; }
#study[hidden] { display: none; }
.study-bar { flex: none; display: flex; justify-content: flex-end; padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 0 10px; background: var(--nylon); }
#study-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(28, 39, 48, .08); color: var(--ink); font: 30px/44px system-ui, sans-serif; cursor: pointer; }
#study-close:hover { background: rgba(28, 39, 48, .14); }
#study-close:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.study-scroll { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 34px 56px; }
.study-head { margin: -4px 0 22px 0; }

/* the title, flown as a letter banner */
.letters { --ls: 52px; position: relative; display: flex; margin: 6px 0 10px 34px; padding: 0; font: 400 var(--ls)/1 Anton, Impact, "Arial Narrow", sans-serif; color: var(--red); letter-spacing: 0; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .12)); }
.letters::before { content: ""; position: absolute; right: 100%; top: 18%; width: 34px; height: 64%; background:
  linear-gradient(to top right, transparent calc(50% - .6px), #6e6e6e 50%, transparent calc(50% + .6px)) top / 100% 50% no-repeat,
  linear-gradient(to bottom right, transparent calc(50% - .6px), #6e6e6e 50%, transparent calc(50% + .6px)) bottom / 100% 50% no-repeat; }
.letters::after { content: ""; position: absolute; left: -3px; top: -4%; bottom: -4%; width: 3px; background: linear-gradient(90deg, #9aa1a6, #e6e9eb, #8d9499); border-radius: 2px; }
.letters .l { display: block; min-width: .5em; padding: .12em .07em .06em; text-align: center; background: #fff; border-left: 1px solid rgba(0, 0, 0, .07); box-shadow: inset 0 -1px 0 rgba(0,0,0,.04), inset 0 1px 0 rgba(0,0,0,.04); }
.letters .l:first-child { border-left: 0; }
.letters .sp { min-width: .34em; }
.study-client { margin: 0; font: 600 12px/1.4 Inter, system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
#study-box { font-size: 15.5px; }
#study-box .ab-lede { font-size: 18px; line-height: 1.5; color: var(--ink); }
#study-box .ab-heading { font: 600 13px/1.4 Inter, system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
#study-box .ab-credits { padding-top: 14px; border-top: 1px solid rgba(0, 0, 0, .08); }
#about-box { display: grid; gap: 14px; font-size: 16px; }
#about-box[hidden] { display: none; }
.about-title { margin: 0; font-weight: 600; font-size: 18px; }
.about-bio { margin: 0; white-space: pre-line; line-height: 1.6; }
.about-contact { margin: 0; }
.about-contact a { color: var(--red); font-weight: 500; }
.about-loc { margin: 0; color: var(--muted); }

/* ------------------------------------------------------------------ loading: a banner being rolled out */
#loader { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: linear-gradient(#5f9be0, #b8d9f2 70%, #e9d8b4 70.2%, #e2cfa6); transition: opacity .6s ease; }
#loader.gone { opacity: 0; pointer-events: none; }
#loader .ld { width: min(440px, 82vw); overflow: visible; }
#loader .ld-plane { animation: bob 3.2s ease-in-out infinite; }
#ld-fill { transition: width .35s ease; }
@keyframes bob { 50% { transform: translateY(2px); } }

/* ------------------------------------------------------------------ phones and small windows */
@media (max-width: 899px), (max-height: 559px) {
  #board { inset: 0; width: auto; padding: 0; z-index: 6; scale: none; }
  #board::before, #board::after { display: none; }
  #board.open .board-frame { position: absolute; inset: 0; border-width: 12px; border-radius: 0; overflow: auto; padding: max(18px, env(safe-area-inset-top)) 20px 28px; }
  #board.open .board-head { font-size: 32px; margin-bottom: 10px; }
  #board.open #board-list { grid-template-rows: none; grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); }
  #board.open #board-list button { font-size: 25px; line-height: 1.3; padding-left: 18px; }
  #board.open .chalk-link { font-size: 23px; margin-top: 12px; }
  .board-close { top: max(16px, env(safe-area-inset-top)); right: 18px; width: 44px; height: 44px; background: rgba(255, 255, 255, .12); color: var(--chalk); font: 30px/44px system-ui, sans-serif; }
  #board-tab {
    right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); width: 128px; height: 64px; padding: 0; scale: none;
    border: 6px solid var(--wood); border-image: linear-gradient(160deg, #a46d3b, #7b4c26 40%, #9c6534 70%, #6b411f) 1;
    background: radial-gradient(ellipse at 30% 30%, rgba(255,255,255,.08), transparent 60%), var(--slate);
    box-shadow: 0 8px 18px rgba(0,0,0,.3); font: 700 22px/1 Caveat, cursive;
  }
  #board-tab span, body[data-look] #board-tab span { display: inline; padding: 0; border: 0; background: none; box-shadow: none; filter: none; translate: none; }
  #board-tab::before, #board-tab::after { display: none; }
  body[data-look="gold"] #board-tab { filter: sepia(.18) saturate(1.1); }
  body[data-look="dusk"] #board-tab { filter: brightness(.85); }
  #study { width: 100vw; box-shadow: none; }
  .study-scroll { padding: 0 18px 48px; }
  .letters { margin-left: 26px; }
  .letters::before { width: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  #study { transition: none; }
  #board.open { animation: none; }
  #loader .ld-plane { animation: none; }
}
.study-scroll:focus { outline: none; }
