/* ══════════════════════════════════════════════════════════════════════════
   styles.css — Leo J. Chung
   ══════════════════════════════════════════════════════════════════════════

   DESIGN SYSTEM — "Bento"

     Structure   Flat filled cards on a plain ground, laid out in a bento
                 grid of mixed spans. No card borders, no card shadows —
                 the fill alone separates a card from the page. Shadow is
                 spent in exactly one place: the floating dock.

     Type        Inter, heavy. Display headlines are set in two tones —
                 the opening clause in near-black, the rest in grey (see
                 TWO-TONE below). JetBrains Mono for data and labels.

     Light       White page, light grey cards.
     Dark        Near-black page, slightly-lifted grey cards.

     Blue        #1E6EF4  fill  — primary action, active dock item
                #1559D0  text  — links (darker, so it passes AA on a card)
     Amber       #F0A23C  fill  — secondary action. Always with INK text,
                                  never white: white on amber is ~2:1 and
                                  fails badly. Ink on amber is 9.4:1.
     Green       #2FA84F  live  — the "currently held" dot. Never alone;
                                  always beside a text label.

   ── TWO-TONE DISPLAY TEXT ─────────────────────────────────────────────────
   The signature move of this design. In content.js, <em> inside a headline
   marks the GREY half of the sentence — it is not italic here. <b> inside
   grey body copy marks the words that come back to near-black. Both are
   plain weight/colour changes, so a headline reads as one sentence with two
   voices rather than two sentences.

   ── TO RESKIN THE WHOLE SITE ──────────────────────────────────────────────
   Change the :root block below and the two dark-theme blocks under it.
   Every colour on the page reads from those tokens. Do not hard-code a
   colour anywhere else — it will look right in one theme and broken in
   the other.

   The exception, and the only one: text sitting on a surface that is
   deliberately the SAME in both themes must name its colour literally,
   because a token would flip it and break the pairing. That is #fff on
   --accent, #0A0A0A on --cta, the play button and badge over a photograph,
   and the print block. Adding a literal anywhere else is a bug.

   ── CONTRAST ──────────────────────────────────────────────────────────────
   Ratios were computed, not eyeballed. The rule that matters: --ink-mute
   is for DISPLAY TEXT ONLY (>=24px, or >=19px bold), where AA is 3:1. It
   measures 3.3:1 on a card and would fail as body copy. Anything small or
   body-sized uses --ink-2, which is 5.0:1.
   ══════════════════════════════════════════════════════════════════════════ */


/* ══════════════════ TOKENS — LIGHT (the base) ══════════════════ */
:root{
  --page:#FFFFFF;           /* page ground                                */
  --card:#F7F7F7;           /* card fill — the whole layout is these      */
  --card-2:#EFEFEF;         /* a panel recessed inside a card             */
  --card-3:#E6E6E6;         /* chips, the faux-notebook chrome            */

  --ink:#0A0A0A;            /* display + primary text                     */
  --ink-mute:#888888;       /* the grey half of a two-tone headline.
                               DISPLAY SIZES ONLY — 3.3:1 on a card       */
  --ink-2:#5F5F5F;          /* body copy, labels, captions. Dark enough to
                               clear 4.5:1 on --card-3, which is where the
                               chips sit — the tightest pairing on the page */

  --accent:#7C3AED;         /* violet, as a FILL (white on it = 5.7:1)    */
  --accent-ink:#6D28D9;     /* violet, as TEXT (6.6:1 on a card)          */
  --accent-soft:rgba(124,58,237,.10);
  --cta:#F0A23C;            /* amber fill — pairs with --ink, never white */
  --live:#1E8E3E;           /* the currently-held dot — 3.9:1 on a card   */


  --f-sans:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
  --f-mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace;

  --max:1120px;

  --r:30px;                 /* card radius                                */
  --r-sm:18px;              /* nested panel radius                        */
  --r-btn:16px;             /* dock button radius                         */
  --gap:16px;               /* the bento gutter                           */
  --pad:clamp(22px,2.8vw,38px);  /* card padding. Anything that bleeds off
                               a card edge offsets by exactly this, so the
                               bleeding thing still lines up with the text
                               above it — see .panel and .bleed-row       */

  --dock-shadow:0 10px 34px rgba(10,10,10,.13),0 2px 8px rgba(10,10,10,.06);
  --dock-edge:transparent;  /* dark mode gives the dock a hairline        */
  --pin:#FFFFFF;            /* the plain pins in the "Based in" card       */
  --logo-plate:transparent; /* behind org logos (UBC, JHU, STEMCELL). Dark
                               mode sets it white: the marks are navy and
                               grey, and vanish on a dark card otherwise   */
  --logo-pad:0px;
}

/* ══════════════════ TOKENS — DARK ══════════════════
   Two blocks, deliberately. The media query catches viewers on "system"
   (nothing stamped on <html>); the [data-theme] block catches the toggle.
   Guarding the media query with :not([data-theme="light"]) means an explicit
   light choice still beats a dark OS. Change a token in one — change it in
   both, or the toggle and the OS default will disagree.

   --accent stays #1E6EF4 in dark: white-on-blue is 4.6:1 regardless of
   what is behind the button, and lightening the fill would break that.
   --accent-ink lightens instead, because it sits on a dark card.        */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --page:#0B0B0C;
    --card:#16171A;
    --card-2:#1F2024;
    --card-3:#282A2F;
    --ink:#F5F5F7;
    --ink-mute:#7E7E86;
    --ink-2:#A0A0A8;
    --accent-ink:#A78BFA;
    --accent-soft:rgba(167,139,250,.14);
    --live:#3ED166;
    --dock-shadow:0 10px 34px rgba(0,0,0,.6);
    --dock-edge:#26272C;
    --pin:#23252A;
    --logo-plate:#FFFFFF;
    --logo-pad:4px 7px;
  }
}
:root[data-theme="dark"]{
  --page:#0B0B0C;
  --card:#16171A;
  --card-2:#1F2024;
  --card-3:#282A2F;
  --ink:#F5F5F7;
  --ink-mute:#7E7E86;
  --ink-2:#A0A0A8;
  --accent-ink:#A78BFA;
  --accent-soft:rgba(167,139,250,.14);
  --live:#3ED166;
  --dock-shadow:0 10px 34px rgba(0,0,0,.6);
  --dock-edge:#26272C;
  --pin:#23252A;
  --logo-plate:#FFFFFF;
  --logo-pad:4px 7px;
}


/* ══════════════════ BASE ══════════════════ */
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *{animation-duration:.001ms!important;transition-duration:.001ms!important}
}

body{
  margin:0;
  padding-top:clamp(28px,5vw,64px);
  padding-bottom:132px;            /* clears the floating dock */
  background:var(--page);
  color:var(--ink);
  font-family:var(--f-sans);
  font-size:16px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

a{color:inherit}
img,svg{max-width:100%}
:focus-visible{outline:2.5px solid var(--accent-ink);outline-offset:3px;border-radius:4px}

.sr-only{
  position:absolute;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:-9999px;top:0;z-index:99;
  background:var(--ink);color:var(--page);padding:10px 16px;
  font-family:var(--f-mono);font-size:12px;text-decoration:none;border-radius:8px;
}
.skip:focus{left:12px;top:12px}

/* One place sets the side gutter. Vertical padding is padding-block only,
   never a shorthand that would zero the sides. */
.shell{max-width:var(--max);margin:0 auto;padding-inline:clamp(16px,4vw,28px)}


/* ══════════════════ THE BENTO GRID ══════════════════
   A 12-column grid so cards can take uneven widths, which is what stops the
   page reading as a uniform list of boxes. Spans collapse in two steps:
   at 860px everything halves, at 620px everything is full width.        */
.bento{display:grid;grid-template-columns:repeat(12,1fr);gap:var(--gap)}
.sp-4{grid-column:span 4}
.sp-5{grid-column:span 5}
.sp-6{grid-column:span 6}
.sp-7{grid-column:span 7}
.sp-8{grid-column:span 8}
.sp-12{grid-column:span 12}
.rows-2{grid-row:span 2}

/* Uniform sets (Right Now, Principles, media tiles) size themselves. */
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(270px,100%),1fr));gap:var(--gap)}

@media (max-width:860px){
  .bento{grid-template-columns:repeat(6,1fr)}
  .sp-4,.sp-5{grid-column:span 3}
  .sp-6,.sp-7,.sp-8,.sp-12{grid-column:span 6}
  .rows-2{grid-row:auto}
}
@media (max-width:620px){
  .bento{grid-template-columns:1fr}
  .sp-4,.sp-5,.sp-6,.sp-7,.sp-8,.sp-12{grid-column:1/-1}
}


/* ══════════════════ THE CARD ══════════════════
   Fill only. No border, no shadow — that restraint is the whole look, and
   adding either makes the page read as a form rather than a layout.
   overflow:hidden is what lets a mockup or an icon row bleed off the edge
   and be clipped by the radius instead of escaping the card.            */
.card{
  background:var(--card);border-radius:var(--r);
  padding:var(--pad);
  display:flex;flex-direction:column;
  position:relative;overflow:hidden;min-width:0;
}
/* A card whose last child bleeds off the bottom edge. Its text is wrapped
   in one <div>, so space-between pins the text to the top and the bleeding
   panel to the bottom however tall the grid row turns out to be. */
.card.flush{padding-bottom:0;justify-content:space-between}
.card.center{align-items:center;text-align:center}

/* Only cards that actually go somewhere respond to the cursor. */
a.card,button.card{text-decoration:none;cursor:pointer;border:0;font:inherit;color:inherit;text-align:left;width:100%}
a.card,button.card{transition:transform .32s cubic-bezier(.34,1.4,.64,1),background .2s ease}
a.card:hover,button.card:hover{transform:translateY(-3px);background:var(--card-2)}


/* ══════════════════ TYPE ══════════════════ */

/* The two-tone display headline. <em> is the grey half — deliberately not
   italic; see the note at the top of this file. */
.display,.display-sm{
  margin:0;font-weight:800;
  line-height:1.06;letter-spacing:-.032em;
  text-wrap:balance;overflow-wrap:break-word;
}
.display{font-size:clamp(30px,4.4vw,54px)}
.display-sm{font-size:clamp(24px,2.8vw,34px);line-height:1.12;letter-spacing:-.025em}
/* The grey half of a two-tone headline. <em> is NOT italic here. */
.display em,.display .mute,
.display-sm em,.display-sm .mute{font-style:normal;color:var(--ink-mute)}

/* The small grey label that sits above a value inside a card. */
.label{
  margin:0 0 8px;font-size:12.5px;font-weight:500;line-height:1.4;
  color:var(--ink-2);letter-spacing:.01em;
}
.label.caps{
  font-family:var(--f-mono);font-size:10.5px;font-weight:500;
  letter-spacing:.14em;text-transform:uppercase;
}
/* The bold answer under a .label. */
.value{
  margin:0;font-weight:700;
  font-size:clamp(20px,2.2vw,27px);
  line-height:1.2;letter-spacing:-.02em;text-wrap:balance;
}

/* Body copy. Grey by default; <b> brings a phrase back to near-black,
   which is the two-tone idea applied to a paragraph. */
.body{margin:0;color:var(--ink-2);font-size:15.5px;line-height:1.62;max-width:64ch}
.body + .body{margin-top:14px}
/* First paragraph after a headline, and the form's first field row — set
   here rather than inline so spacing stays in one file. */
.display + .body,.display-sm + .body,.card h2 + .body{margin-top:17px}
.display-sm + .fieldrow{margin-top:22px}
.body b{font-weight:600;color:var(--ink)}
.body em{font-style:italic;color:var(--ink)}
.body a{color:var(--accent-ink);text-decoration:none;border-bottom:1px solid var(--accent-soft)}
.body a:hover{border-bottom-color:var(--accent-ink)}


/* ══════════════════ SECTION HEADER ══════════════════
   Centered: a small grey eyebrow, then the two-tone headline, with an
   optional pill action pushed to the right on wide screens.            */
.section{margin-top:clamp(56px,8vw,104px)}
/* The Home bento is the first block on that page and needs no top margin;
   on every other page the first section is the top of the content. */
main .shell > *:first-child{margin-top:0}
.sec-head{
  display:flex;align-items:flex-end;justify-content:space-between;
  gap:20px;margin-bottom:clamp(20px,2.6vw,30px);
}
.sec-head-text{flex:1 1 auto;min-width:0;text-align:center}
.sec-head.has-action .sec-head-text{text-align:left}
.eyebrow{
  display:block;margin:0 0 6px;font-family:var(--f-mono);
  font-size:10.5px;font-weight:500;letter-spacing:.16em;text-transform:uppercase;
  color:var(--ink-2);
}
.sec-head h2{
  margin:0;font-weight:800;font-size:clamp(28px,4vw,48px);
  line-height:1.08;letter-spacing:-.032em;text-wrap:balance;
}
.sec-head h2 em{font-style:normal;color:var(--ink-mute)}
.sec-hint{
  margin:10px auto 0;max-width:56ch;color:var(--ink-2);
  font-size:14.5px;line-height:1.6;
}
.sec-head.has-action .sec-hint{margin-inline:0}
@media (max-width:700px){
  .sec-head{flex-direction:column;align-items:stretch}
  .sec-head.has-action .sec-head-text{text-align:center}
  .sec-head.has-action .sec-hint{margin-inline:auto}
  .sec-head .pill{align-self:center}
}


/* ══════════════════ PILLS ══════════════════
   Amber never takes white text — see the contrast note at the top.     */
.pill{
  display:inline-flex;align-items:center;gap:8px;flex:none;
  font-family:var(--f-sans);font-size:14.5px;font-weight:700;letter-spacing:-.005em;
  padding:13px 26px;border-radius:999px;text-decoration:none;border:0;cursor:pointer;
  background:var(--card-3);color:var(--ink);
  transition:transform .28s cubic-bezier(.34,1.4,.64,1),filter .2s ease,background .2s ease;
}
.pill:hover{transform:translateY(-2px)}
.pill.blue{background:var(--accent);color:#fff}
.pill.blue:hover{filter:brightness(1.08)}
.pill.amber{background:var(--cta);color:#0A0A0A}
.pill.amber:hover{filter:brightness(1.06)}
.pill.ghost{background:transparent;color:var(--ink);box-shadow:inset 0 0 0 1.5px var(--card-3)}
.pill.ghost:hover{background:var(--card-3)}
.pill.sm{font-size:13px;padding:10px 18px}

.pill-row{display:flex;flex-wrap:wrap;gap:10px;margin-top:22px}

/* Small static chips — meta, affiliations, identity words. */
.chips{display:flex;flex-wrap:wrap;gap:7px;margin:0;padding:0;list-style:none}
.chip{
  display:inline-flex;align-items:center;gap:6px;
  font-family:var(--f-mono);font-size:10.5px;letter-spacing:.06em;
  color:var(--ink-2);background:var(--card-3);
  border-radius:999px;padding:6px 12px;
}


/* ══════════════════ THE DOCK ══════════════════
   The page switcher. There is no top header on this design — the dock is
   the whole navigation, with the theme toggle parked at its right end
   behind a divider. Fixed, so `body` carries bottom padding to clear it.  */
.dock{
  position:fixed;left:50%;bottom:20px;transform:translateX(-50%);z-index:50;
  display:flex;align-items:center;gap:8px;
  padding:9px;border-radius:26px;
  background:var(--page);box-shadow:var(--dock-shadow);
  box-shadow:var(--dock-shadow),inset 0 0 0 1px var(--dock-edge);
  max-width:calc(100vw - 24px);
}
.dock-btn{
  position:relative;display:grid;place-items:center;flex:none;
  width:54px;height:54px;border-radius:var(--r-btn);
  background:var(--card);color:var(--ink-2);
  text-decoration:none;border:0;cursor:pointer;padding:0;
  transition:transform .3s cubic-bezier(.34,1.5,.64,1),background .2s ease,color .2s ease;
}
.dock-btn svg{width:23px;height:23px;display:block;fill:currentColor}
/* The theme toggle is the one stroked glyph in the dock — main.js paints it
   with the sun/moon paths, which have no fill. */
.dock-btn svg.stroke{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.dock-btn:hover{transform:translateY(-3px);color:var(--ink);background:var(--card-2)}
.dock-btn.active{background:var(--accent);color:#fff}
.dock-btn.active:hover{color:#fff}
.dock-sep{width:1px;height:34px;background:var(--card-3);flex:none;margin-inline:2px}

/* Name-on-hover, so an icon-only dock is still readable. */
.dock-btn .tip{
  position:absolute;bottom:calc(100% + 11px);left:50%;
  transform:translateX(-50%) translateY(4px);
  background:var(--ink);color:var(--page);
  font-family:var(--f-mono);font-size:10.5px;letter-spacing:.04em;
  padding:6px 11px;border-radius:999px;white-space:nowrap;
  pointer-events:none;opacity:0;transition:opacity .16s ease,transform .16s ease;
}
.dock-btn:hover .tip,.dock-btn:focus-visible .tip{opacity:1;transform:translateX(-50%) translateY(0)}

@media (max-width:440px){
  .dock{gap:6px;padding:7px;border-radius:22px}
  .dock-btn{width:46px;height:46px;border-radius:14px}
  .dock-btn svg{width:20px;height:20px}
  .dock-sep{height:28px;margin-inline:0}
}


/* ══════════════════ HERO ══════════════════ */
.hero-card{justify-content:space-between;min-height:min(74vh,560px)}
.hero-name{
  margin:0 0 16px;font-family:var(--f-mono);font-size:11px;font-weight:500;
  letter-spacing:.18em;text-transform:uppercase;color:var(--ink-2);
}
.hero-card .display{margin-bottom:8px}
/* Credit under a quoted headline. Small, quiet, and never omitted when the
   headline is somebody else's words — see the note in content.js. */
/* The UBC badge — the letters in a disc until Leo supplies the official
   logo file, which then replaces the disc. See content.js. */
.credential{
  display:inline-flex;align-items:center;gap:11px;align-self:flex-start;
  margin:16px 0 0;padding:5px 18px 5px 5px;
  background:var(--card-3);border-radius:999px;
  font-size:13px;line-height:1.35;color:var(--ink-2);max-width:100%;
}
.uni-mark{
  display:inline-flex;align-items:center;justify-content:center;flex:none;
  width:34px;height:34px;border-radius:50%;
  background:var(--accent);color:#fff;
  font-family:var(--f-mono);font-size:10.5px;font-weight:700;letter-spacing:.02em;
}

.uni-logo{
  display:block;flex:none;height:34px;width:auto;max-width:120px;object-fit:contain;
  background:var(--logo-plate);padding:var(--logo-pad);border-radius:9px;
}

.hero-cite{margin:14px 0 0;font-size:13px;color:var(--ink-2);line-height:1.5}
.hero-cite cite{font-style:normal}
.hero-cite cite em{font-style:italic}

/* The portrait sits at the bottom of the hero card, large, centered — the
   position Kellie Ho's illustration occupies. Circular, because it is the
   one non-rectangle in a page made of rounded rectangles. */
.hero-portrait{
  align-self:center;margin-top:auto;padding-top:28px;
  width:min(230px,58%);aspect-ratio:1;object-fit:cover;
  border-radius:50%;display:block;
}

/* "Based in" card — a row of pins with the marked one in the middle, as in
   Kellie Ho's reference. Pure decoration (aria-hidden): the card states the
   city in text right above it. */
.pins{
  display:flex;align-items:center;justify-content:center;
  gap:clamp(18px,1.88vw,27px);
  margin-top:auto;padding-top:30px;color:var(--pin);
}
.pins svg{height:auto;flex:none;fill:currentColor}
.pins .far{width:clamp(30px,3.13vw,45px)}
.pins .here{width:clamp(58px,6vw,86px);color:var(--accent)}

/* The faux notebook panel — the analogue of Kellie's code-editor mockup.
   It bleeds off the bottom of its card, which is what makes the card feel
   designed rather than filled. Real content, not lorem: the lines are the
   record rows from content.js. */
.panel{
  margin:26px calc(-1 * var(--pad)) 0;background:var(--card-2);
  border-radius:var(--r-sm) var(--r-sm) 0 0;overflow:hidden;
}
.panel-bar{display:flex;gap:6px;padding:14px 18px}
.panel-bar i{width:9px;height:9px;border-radius:50%;background:var(--card-3);display:block}
.panel-body{
  padding:4px 18px 22px;font-family:var(--f-mono);font-size:11.5px;line-height:2;
  color:var(--ink-2);overflow-x:auto;
}
.panel-body div{white-space:nowrap}
.panel-body .k{color:var(--accent-ink)}
.panel-body .v{color:var(--ink)}

/* The record — label/value rows, tabular. */
.record{margin:0;padding:0;list-style:none;display:flex;flex-direction:column}
.record li{
  display:grid;grid-template-columns:96px 1fr;gap:14px;align-items:baseline;
  padding-block:11px;font-family:var(--f-mono);font-size:11.5px;line-height:1.55;
}
.record li + li{border-top:1px solid var(--card-3)}
.record .k{color:var(--ink-2);letter-spacing:.09em;text-transform:uppercase;font-size:10px}
.record .v{color:var(--ink)}
.record .live-dot{color:var(--live);font-size:9px;vertical-align:.12em;margin-right:5px}
@media (max-width:420px){ .record li{grid-template-columns:1fr;gap:2px} }

/* The rotating "I also like ___" card. main.js swaps .like-word on an
   interval; the list rides along in data-list, pipe-separated. */
.like-card{justify-content:center}
/* --ink-2, not --ink-mute: this runs as small as 17px, below the size where
   the 3:1 large-text allowance applies. */
.like-lead{margin:0 0 6px;font-size:clamp(17px,2vw,22px);color:var(--ink-2);font-weight:600;letter-spacing:-.02em}
.like-word{
  display:block;font-weight:800;font-size:clamp(28px,3.6vw,44px);
  line-height:1.1;letter-spacing:-.03em;color:var(--ink);
  transition:opacity .22s ease;
}

/* The live-weather card: current conditions on the left, Vancouver's local
   time on the right, and a seven-hour strip along the bottom. Everything but
   the labels is written by main.js. */
.wx{justify-content:space-between;gap:22px}
.wx-top{display:flex;justify-content:space-between;gap:18px;flex-wrap:wrap}
.wx-time{text-align:right}
.wx .value{display:flex;align-items:center;gap:10px}
.wx-time .value{justify-content:flex-end}
.wx-icon{font-size:.9em;line-height:1}
.wx-cond{margin:8px 0 0;font-size:14px;color:var(--ink-2);line-height:1.5;min-height:1.5em}
.wx-hours{
  display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;
  margin:0;padding:0;list-style:none;
}
.wx-hours li{
  display:flex;flex-direction:column;align-items:center;gap:10px;
  padding:16px 2px;border-radius:16px;
}
/* The current hour sits on a recessed chip — the page's usual way of
   marking "this one", with no new colour. */
.wx-hours li.now{background:var(--card-2)}
.wx-hours .h{font-family:var(--f-mono);font-size:10px;letter-spacing:.02em;color:var(--ink-2);white-space:nowrap}
.wx-hours .now .h{color:var(--ink)}
.wx-hours .i{font-size:clamp(20px,2.2vw,26px);line-height:1}
.wx-hours .t{font-size:clamp(14px,1.5vw,17px);font-weight:700;letter-spacing:-.01em}
@media (max-width:420px){ .wx-hours .h{font-size:9px} }

/* ── THE SKILLS MARQUEE ───────────────────────────────────────────────────
   The track holds the chip list twice and slides by exactly -50%, which
   puts copy two where copy one began — so it loops with no visible seam.

   The spacing has to be margin-right on each chip, NOT a flex `gap`. With
   a gap, the track is 2N chips and 2N-1 gaps, so half its width lands half
   a gap short of the loop point and the row visibly stutters once per
   cycle. A trailing margin on every chip makes each copy exactly
   N*(chip+space) wide, and half of that is exactly one copy.

   The mask fades both ends, so chips enter and leave instead of being
   sliced off at the card edge.                                          */
.marquee{
  display:flex;overflow:hidden;
  margin:0 calc(-1 * var(--pad)) 24px;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 7%,#000 93%,transparent);
          mask-image:linear-gradient(90deg,transparent,#000 7%,#000 93%,transparent);
}
.mq-copy{display:contents}
.marquee-track{display:flex;flex:none;animation:marquee 70s linear infinite}
.marquee-track .chip{flex:none;margin-right:9px}
.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track{animation-play-state:paused}
@keyframes marquee{from{transform:translateX(0)}to{transform:translateX(-50%)}}

/* The global reduced-motion rule only shortens durations, which would turn
   this into a flicker. Kill the animation outright and show one static,
   scrollable copy instead. */
@media (prefers-reduced-motion:reduce){
  .marquee{overflow-x:auto;scrollbar-width:none}
  .marquee::-webkit-scrollbar{display:none}
  .marquee-track{animation:none}
  .mq-copy + .mq-copy{display:none}
}


/* The "trained in" list under the marquee card's headline: a broad area in
   near-black, what it covers in grey — the two-tone idea as a list. */
.trained{
  margin:22px 0 0;padding:0;list-style:none;
  display:flex;flex-direction:column;
}
.trained li{
  display:grid;grid-template-columns:minmax(140px,30%) 1fr;gap:14px;align-items:baseline;
  padding-block:8px;font-size:13.5px;line-height:1.45;
}
.trained li + li{border-top:1px solid var(--card-3)}
.trained .t{font-weight:700;color:var(--ink);letter-spacing:-.01em}
.trained .d{color:var(--ink-2)}
@media (max-width:420px){ .trained li{grid-template-columns:1fr;gap:2px} }


/* ══════════════════ SOCIAL BUTTONS ══════════════════ */
.social-row{display:flex;gap:11px;flex-wrap:wrap;margin-top:22px}
.social-btn{
  position:relative;width:56px;height:56px;border-radius:17px;
  display:grid;place-items:center;font-size:23px;text-decoration:none;
  background:var(--card-3);color:var(--ink);
  transition:transform .3s cubic-bezier(.34,1.5,.64,1);
}
/* A plain mark follows the theme. A brand mark carries its own colours and
   must not be repainted — hence :not(.brand). */
.social-btn .mark{width:27px;height:27px;display:block}
.social-btn .mark:not(.brand){fill:currentColor}
.social-btn .mark.brand{width:29px;height:29px}
.card .social-btn{background:var(--card-2)}
.social-btn:hover,.social-btn:focus-visible{transform:translateY(-3px)}
.social-btn .tip{
  position:absolute;bottom:calc(100% + 9px);left:50%;
  transform:translateX(-50%) translateY(4px);
  background:var(--ink);color:var(--page);font-family:var(--f-mono);font-size:10px;
  padding:5px 10px;border-radius:999px;white-space:nowrap;
  pointer-events:none;opacity:0;transition:opacity .15s ease,transform .15s ease;
}
.social-btn:hover .tip,.social-btn:focus-visible .tip{opacity:1;transform:translateX(-50%) translateY(0)}


/* ══════════════════ "RIGHT NOW" CARDS ══════════════════ */
.now-tag{
  display:inline-flex;align-items:center;gap:7px;margin:0 0 14px;
  font-family:var(--f-mono);font-size:10px;letter-spacing:.13em;text-transform:uppercase;
  color:var(--ink-2);
}
.now-tag::before{
  content:"";width:7px;height:7px;border-radius:50%;background:var(--live);flex:none;
}
/* An organization's mark at the top of a card. The slot has a fixed height
   whether or not a logo is in it, so the text lines up across the row. */
.now-logo{height:46px;margin:0 0 18px;display:flex;align-items:center}
.now-logo img{
  display:block;height:100%;width:auto;max-width:190px;
  object-fit:contain;object-position:left center;
  background:var(--logo-plate);padding:var(--logo-pad);border-radius:10px;
}
.now-role{margin:0;font-size:19px;font-weight:700;line-height:1.28;letter-spacing:-.018em}
.now-org{margin:7px 0 0;font-size:14px;color:var(--ink-2);line-height:1.5}
.now-since{
  margin:18px 0 0;padding-top:14px;border-top:1px solid var(--card-3);
  font-family:var(--f-mono);font-size:10.5px;letter-spacing:.05em;color:var(--ink-2);
}


/* Featured reuses the Right Now card, as a link. The green dot is dropped:
   --live means a currently-held post, and a write-up is not one. The date
   line is pushed to the bottom so the row's footers line up. */
.feat .now-tag::before{display:none}
.feat .now-since{margin-top:auto}
.feat .now-org{margin-bottom:18px}


/* ══════════════════ PRINCIPLES ══════════════════ */
.principle-word{
  margin:0 0 10px;font-size:clamp(22px,2.4vw,28px);font-weight:800;
  letter-spacing:-.028em;line-height:1.1;
}


/* ══════════════════ ENTRY CARDS — research, teaching, notes ══════════════
   The big-title-plus-grey-body treatment from the reference's project
   cards. The amber pill only appears when the entry actually links out. */
.entry-idx{
  margin:0 0 12px;font-family:var(--f-mono);font-size:10px;font-weight:500;
  letter-spacing:.16em;text-transform:uppercase;color:var(--ink-2);
  display:flex;flex-wrap:wrap;gap:10px;align-items:baseline;
}
.entry-idx .when{letter-spacing:.06em}
.entry-title{
  margin:0 0 14px;font-weight:800;
  font-size:clamp(21px,2.3vw,29px);line-height:1.14;letter-spacing:-.028em;
  text-wrap:balance;overflow-wrap:break-word;
}
.entry .chips{margin-bottom:14px}
.entry .pill-row{margin-top:auto;padding-top:22px}

/* one employer, several roles */
.subroles{margin:16px 0 0;padding:0;list-style:none;display:flex;flex-direction:column;gap:14px}
.subroles li{padding-top:14px;border-top:1px solid var(--card-3)}
.subroles .t{font-weight:650;font-size:16px;line-height:1.35;letter-spacing:-.012em}
.subroles .d{font-size:13.5px;color:var(--ink-2);margin-top:4px;line-height:1.5}


/* ══════════════════ THE RAIL — Featured ══════════════════
   A horizontal scroll-snap row, so adjacent cards peek in from the edges
   the way the reference's project carousel does. The overflow lives on
   this container, never on the page: `body` must not scroll sideways.
   The negative margin + matching padding is what lets the first and last
   card sit flush with the shell while still scrolling edge to edge.     */
.rail{
  display:flex;gap:var(--gap);overflow-x:auto;
  scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;
  margin-inline:calc(-1 * clamp(16px,4vw,28px));
  padding-inline:clamp(16px,4vw,28px);
  padding-bottom:6px;
  scrollbar-width:none;-ms-overflow-style:none;
}
.rail::-webkit-scrollbar{display:none}
.rail > *{flex:0 0 min(420px,82%);scroll-snap-align:start}
.rail-note{
  margin:14px 0 0;text-align:center;font-family:var(--f-mono);
  font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-2);
}


/* ══════════════════ LIST CARD — the reading list ══════════════════ */
.list-card{padding-block:clamp(14px,2vw,22px)}
.linklist{margin:0;padding:0;list-style:none}
.linklist li + li{border-top:1px solid var(--card-3)}
.linklist a,.linklist span{
  display:block;padding-block:clamp(15px,2vw,21px);padding-inline:clamp(6px,2vw,22px);
  font-size:clamp(15px,1.6vw,18px);line-height:1.45;color:var(--ink-2);
  text-decoration:none;transition:color .18s ease;
}
.linklist a:hover{color:var(--ink)}
.linklist a::after{content:" ↗";opacity:.5;font-size:.85em}


/* ══════════════════ MEDIA TILES — Fun, In the lab ══════════════════
   Videos are click-to-play: the tile is a button showing a poster, and the
   YouTube iframe is only inserted once someone clicks. Nothing is
   requested from a third party for a visitor who merely scrolls past.   */
.tile{margin:0;display:flex;flex-direction:column;min-width:0}
.media{
  position:relative;width:100%;aspect-ratio:16/10;display:block;
  border-radius:var(--r);background:var(--card);overflow:hidden;
  transition:transform .32s cubic-bezier(.34,1.4,.64,1);
}
.media:has(img){aspect-ratio:1}
.tile:hover .media{transform:translateY(-3px)}
.media img{width:100%;height:100%;object-fit:cover;display:block}
.media iframe{width:100%;height:100%;border:0;display:block}

button.media{padding:0;cursor:pointer;border:0;background-size:cover;background-position:center}
button.media::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(180deg,rgba(8,8,10,.10) 0%,rgba(8,8,10,.48) 100%);
  transition:background .2s;
}
button.media:hover::after{background:linear-gradient(180deg,rgba(8,8,10,.02) 0%,rgba(8,8,10,.38) 100%)}
.tri{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:2;
  width:56px;height:56px;border-radius:50%;background:rgba(255,255,255,.95);
  display:grid;place-items:center;transition:transform .2s;
}
.tri::before{
  content:"";border-style:solid;border-width:9px 0 9px 15px;
  border-color:transparent transparent transparent #0A0A0A;margin-left:4px;
}
button.media:hover .tri{transform:translate(-50%,-50%) scale(1.07)}

a.media.linkcard{
  aspect-ratio:auto;min-height:170px;text-decoration:none;
  display:flex;align-items:flex-end;padding:22px;background:var(--card);
}
.media .lk{font-size:16px;font-weight:650;color:var(--ink);line-height:1.4;overflow-wrap:anywhere}
a.media.linkcard:hover .lk{color:var(--accent-ink)}

.media .badge{
  position:absolute;top:12px;left:12px;z-index:2;
  font-family:var(--f-mono);font-size:9px;letter-spacing:.14em;text-transform:uppercase;
  font-weight:500;padding:5px 10px;border-radius:999px;
  background:var(--page);color:var(--ink);
}
button.media .badge{background:rgba(255,255,255,.95);color:#0A0A0A}

.media.slot{
  display:grid;place-items:center;text-align:center;padding:18px;
  background:var(--card-2);font-family:var(--f-mono);font-size:10.5px;
  color:var(--ink-2);line-height:1.7;
}
.tile figcaption{margin-top:13px;padding-inline:4px;display:flex;flex-direction:column;gap:4px}
.tile .ft{font-size:15.5px;font-weight:650;line-height:1.35;letter-spacing:-.01em}
.tile .fc{font-size:13px;color:var(--ink-2);line-height:1.55}


/* ══════════════════ CONTACT ══════════════════ */
.contact-value{
  margin:0;font-weight:700;font-size:clamp(18px,2vw,26px);
  line-height:1.25;letter-spacing:-.02em;overflow-wrap:anywhere;
}
a.contact-value{color:var(--accent-ink);text-decoration:none}
a.card:hover .contact-value{color:var(--accent-ink)}
/* UBC blue is a literal, not a token — it names one institution's brand,
   not a role in this site's palette. Two shades so it still passes AA in
   both themes: official UBC Blue on a light card, a lighted tint on dark. */
.contact-value.ubc{display:block;margin-top:2px;font-size:clamp(14px,1.3vw,18px);font-weight:600;color:#002145}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]) .contact-value.ubc{color:#7DAEEA}}
:root[data-theme="dark"] .contact-value.ubc{color:#7DAEEA}

.field{display:flex;flex-direction:column;gap:7px;margin-bottom:14px}
.fieldrow{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.field span{
  font-family:var(--f-mono);font-size:10px;letter-spacing:.13em;text-transform:uppercase;
  color:var(--ink-2);
}
.field input,.field textarea{
  font-family:var(--f-sans);font-size:15.5px;color:var(--ink);
  background:var(--page);border:0;box-shadow:inset 0 0 0 1.5px var(--card-3);
  padding:13px 16px;width:100%;border-radius:var(--r-sm);
}
.field textarea{resize:vertical;min-height:130px;line-height:1.55}
.field input:focus,.field textarea:focus{outline:none;box-shadow:inset 0 0 0 2px var(--accent-ink)}

/* honeypot — a field only a bot will fill in. Hidden from people and from
   screen readers, which is why it is aria-hidden and out of the tab order. */
#f-gotcha{position:absolute;left:-9999px;width:1px;height:1px;opacity:0}

.formfoot{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-top:8px}
.formnote{margin:0;font-size:12.5px;line-height:1.6;color:var(--ink-2);max-width:42ch}
@media (max-width:620px){ .fieldrow{grid-template-columns:1fr;gap:0} }


/* ══════════════════ FOOTER ══════════════════
   Bento, like the rest of the page — not a thin rule with a copyright on
   it. Mirrors the reference's footer: an identity card beside a card of
   link columns, with the fine print along its bottom edge.             */
.site-foot{margin-top:clamp(56px,8vw,104px)}
.foot-id{align-items:center;text-align:center;justify-content:center}
.foot-id .t{margin:0;font-size:16px;font-weight:700;letter-spacing:-.015em}
.foot-id .s{margin:5px 0 0;font-size:15px;color:var(--ink-2);font-weight:600;letter-spacing:-.01em;line-height:1.4}
.foot-id img{width:min(150px,62%);aspect-ratio:1;object-fit:cover;border-radius:50%;margin-top:22px;display:block}

.foot-cols{display:flex;flex-wrap:wrap;gap:clamp(30px,7vw,80px)}
.foot-col h3{
  margin:0 0 14px;font-size:14px;font-weight:500;color:var(--ink-2);letter-spacing:.01em;
}
.foot-col ul{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:9px}
.foot-col a{
  font-size:17px;font-weight:700;letter-spacing:-.018em;text-decoration:none;
  transition:color .18s ease;
}
.foot-col a:hover{color:var(--accent-ink)}
.foot-fine{
  display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;
  margin-top:auto;padding-top:clamp(28px,5vw,56px);
  font-size:13px;color:var(--ink-2);
}
.foot-fine a{text-decoration:none}
.foot-fine a:hover{color:var(--ink)}


/* ══════════════════ SCROLL REVEAL ══════════════════
   Gated behind .has-reveal, which main.js adds only if IntersectionObserver
   exists — a no-JS visitor gets full opacity immediately instead of content
   stuck invisible. prefers-reduced-motion (top of this file) already zeroes
   the duration, so it still appears, just without the animation.        */
.has-reveal .reveal{opacity:0;transform:translateY(22px);transition:opacity .6s cubic-bezier(.22,1,.36,1),transform .6s cubic-bezier(.22,1,.36,1)}
.has-reveal .reveal.in{opacity:1;transform:none}

/* Cards inside a revealed block fade in on their own, staggered. Opacity
   only, never transform: the hover-lift rules set transform on these same
   elements, and .stagger-item.in would out-specificity a plain :hover and
   silently cancel the lift if this touched transform too. */
.has-reveal .stagger-item{opacity:0;transition:opacity .48s ease}
.has-reveal .stagger-item.in{opacity:1}
.stagger-item:nth-child(2){transition-delay:.07s}
.stagger-item:nth-child(3){transition-delay:.14s}
.stagger-item:nth-child(4){transition-delay:.21s}
.stagger-item:nth-child(5){transition-delay:.28s}
.stagger-item:nth-child(6){transition-delay:.35s}


/* ══════════════════ PRINT ══════════════════
   So the page prints as a clean document if anyone hits Cmd-P.          */
@media print{
  .dock,.pins,.panel,.hero-portrait,.social-row,.pill-row,.foot-id img{display:none}
  body{background:#fff;color:#000;padding:0;font-size:11pt}
  .card{background:#fff;padding:0 0 14pt;border-radius:0;break-inside:avoid}
  .rail{display:block;overflow:visible;margin:0;padding:0}
  .rail > *{flex:none;width:auto}
  .bento,.cards{display:block}
  .display,.sec-head h2{font-size:18pt}
  .display em,.sec-head h2 em{color:#444}
}
