/* ==================================================================
   stevechab.com — the shell
   ==================================================================
   Tokens, base elements, and the parts every page carries: skip link,
   running head, footer, wordmark, focus, motion guard, print. Page
   layout lives in each page's own partial.

   Contrast ratios in comments are measured. WCAG 2.2 AA asks 4.5:1
   for body text, 3:1 for large text and non-text UI.
   ================================================================== */

/* ------------------------------------------------------------------
   Fonts, self-hosted
   ------------------------------------------------------------------
   Variable builds: one file per family per subset carries the whole
   100 to 900 axis. unicode-range keeps latin-ext unfetched until a
   page sets a character in it, so an English page takes the two latin
   files and stops.

   Licence and provenance: web/fonts/LICENSE.txt
   ------------------------------------------------------------------ */

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/roboto-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/roboto-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Roboto Slab';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/roboto-slab-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Roboto Slab';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/roboto-slab-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}


:root {
  color-scheme: light dark;

  /* --- primitives: ink and paper --- */
  --black: #000;
  --white: #fff;
  --ink-900: #111;          /* body text on light */
  --paper-50: #fcfbfa;      /* light surface */
  --ink-050: #f2f0ee;       /* body text on dark */
  --paper-950: #0a0a0a;     /* dark surface */

  /* --- primitives: the accent ramp, one hue family --- */
  --accent-300: #f89;       /* 9.23:1 on #000, hover on dark */
  --accent-400: #f67;       /* 7.42:1 on #000, 6.99:1 on #0a0a0a */
  --accent-600: #d24;       /* 4.79:1 on #fff, 4.55:1 on #fcfbfa */
  --accent-800: #b23;       /* 6.20:1 on #fff, hover on light */

  /* --- semantic: light surface (default) --- */
  --surface: var(--paper-50);
  --surface-raised: var(--white);
  --text: var(--ink-900);
  --rule: rgba(17, 17, 17, .14);
  --link: var(--accent-600);
  --link-hover: var(--accent-800);
  --focus-ring: var(--accent-600);
  --selection: #f89;

  /* --- type --- */
  --font-slab: 'Roboto Slab', Georgia, 'Times New Roman', serif;
  --font-sans: 'Roboto', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --text-xs:   .75rem;
  --text-sm:   .875rem;
  --text-base: 1.0625rem;
  --text-lg:   1.25rem;
  --text-xl:   1.5625rem;
  --text-2xl:  1.953rem;
  --text-3xl:  2.441rem;
  --text-4xl:  3.052rem;
  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-normal: 1.75;
  --measure: 65ch;

  /* --- spacing, 4px base --- */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* --- borders and radius --- */
  --border-width: 1px;
  --border-width-thick: 2px;
  --radius-sm: 2px;

  /* --- z-index, no magic numbers --- */
  --z-base: 0;
  --z-raised: 10;
  --z-sticky: 100;
  --z-header: 1000;
  --z-overlay: 10000;

  /* --- motion --- */
  --duration-fast: .18s;
  --duration-slow: 1s;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);

  /* --- shell --- */
  --shell-max: 1560px;
  --shell-pad: 2.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: var(--paper-950);
    --surface-raised: var(--black);
    --text: var(--ink-050);
    --rule: rgba(242, 240, 238, .18);
    --link: var(--accent-400);
    --link-hover: var(--accent-300);
    --focus-ring: var(--accent-400);
    --selection: #d24;
  }
}

@media (max-width: 767px) {
  :root { --shell-pad: 1.25rem; }
}

/* ==================================================================
   Base
   ================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  padding-bottom: var(--space-8);
}

::selection { background: var(--selection); color: var(--ink-900); }

img, svg, video, canvas, iframe { max-width: 100%; vertical-align: middle; }

/* The width and height attributes reserve the box before the file
   lands; height: auto lets it shrink with the column and keep the
   ratio. A <video> needs it said out loud, or the height attribute is
   taken as a pixel height and the frame stretches. */
img, video { height: auto; }

h1, h2, h3, h4 { font-family: var(--font-slab); font-weight: 700; }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: .22em;
  text-decoration-skip-ink: none;
  transition: text-decoration-thickness var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--link-hover);
  text-decoration-thickness: 3px;
}

/* One ring, measured over 3:1 on both surfaces. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@supports not selector(:focus-visible) {
  a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
  }
}

.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 link — first in tab order on every page
   ================================================================== */

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: var(--space-2);
  z-index: var(--z-overlay);
  padding: var(--space-2) var(--space-4);
  background: var(--surface-raised);
  color: var(--text);
  border: var(--border-width-thick) solid var(--focus-ring);
  text-decoration: none;
  transform: translateY(-250%);
  transition: transform var(--duration-fast) var(--ease-out);
}

.skip-link:focus { transform: translateY(0); }

/* Jump targets. js/jump.js moves the keyboard to whatever a same-page
   link points at. The target is out of the Tab order and only ever
   focused on purpose, so it draws no ring. */

[tabindex="-1"]:focus { outline: none; }

/* ==================================================================
   Shell: running head, footer
   ================================================================== */

.shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding-left: var(--shell-pad);
  padding-right: var(--shell-pad);
}

/* Nav flush left, ב״ה in the right corner. The auto margin does that,
   not space-between: narrow screens wrap the blessing onto a line of
   its own, where space-between would drop it back to the left. */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4) var(--space-8);
  flex-wrap: wrap;
  padding-top: 1.1rem;
  padding-bottom: 1.3rem;
}

.masthead__baruch {
  margin: 0;
  margin-inline-start: auto;
  font-size: 16px;
  font-family: system-ui, sans-serif;
  letter-spacing: .1em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: .9rem 1.6rem;
  align-items: baseline;
}

.nav__link {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  border-bottom: var(--border-width) solid var(--rule);
  padding-bottom: 2px;
  /* The box measures 22px, under WCAG 2.2's 24px target floor. The 3px
     goes on top so the rule under the word stays put: hover and current
     trade the same 3px between padding and border. */
  padding-top: 3px;
}

.nav__link:hover {
  color: var(--text);
  border-bottom-color: var(--link);
  border-bottom-width: 3px;
  padding-bottom: 0;
}

.nav__link[aria-current="page"] {
  border-bottom: 3px solid var(--link);
  padding-bottom: 0;
}

.wordmark {
  text-align: center;
  padding: var(--space-6) 0 1.6rem;
}

.wordmark__mark {
  display: block;
  width: 100%;
  max-width: 900px;
  min-width: 180px;
  margin: 0 auto calc(var(--space-6));
}

.site-footer {
  margin-top: var(--space-8);
  padding-top: var(--space-8);
  border-top: var(--border-width) solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
  font-weight: 400;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  font-size: .8rem;
}

.site-footer__place {
  margin: 0;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ==================================================================
   Page head — every page after the homepage
   ==================================================================
   /work, /fun, and /resume all open the same way: a slab title at the
   homepage's h1 size, one lede at the homepage's lede size, both flush
   with the shell's left margin.
   ================================================================== */

.sheet-head {
  padding-top: var(--space-8);
  padding-bottom: var(--space-4);
}

.sheet-head__title {
  margin: 0 0 .9rem;
  font-size: 2.2rem;
  line-height: var(--leading-tight);
  letter-spacing: -.015em;
}

.sheet-head__lede {
  margin: 0 0 1.2rem;
  font-size: 1.32rem;
  line-height: 1.62;
}

/* ==================================================================
   Section label
   ==================================================================
   The small uppercase heading that names a column, a group, or a
   resume section. Sizes and margins belong to the page that uses it.
   Both the label and its gloss sit at full ink; a muted gray here
   measures near 2.5:1 and fails AA.
   ================================================================== */

.label {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text);
  text-align: left;
}

.label__gloss { font-weight: 400; }

/* ==================================================================
   The empty slot
   ==================================================================
   Placeholder. Every .slot is a hole waiting for a real <img> or
   <video>, and nothing else in the stylesheet depends on it.
   ================================================================== */

.slot {
  display: grid;
  align-content: center;
  gap: var(--space-2);
  padding: var(--space-6);
  border: var(--border-width-thick) dashed var(--rule);
  border-radius: var(--radius-sm);
  aspect-ratio: 16 / 10;
  text-align: left;
}

.slot--video { aspect-ratio: 16 / 9; }
.slot--tall { aspect-ratio: 4 / 5; }

.slot__kind {
  margin: 0;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.slot__note {
  margin: 0;
  font-size: .9rem;
  line-height: var(--leading-snug);
}

/* ==================================================================
   Motion guard
   ==================================================================
   This site ships strobing and flashing work on purpose. A reduced
   motion setting stops every animation, including ones declared in a
   page's own <style> block.
   ================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
    transition-delay: 0ms !important;
  }

  video, canvas { animation-play-state: paused !important; }
}

/* ==================================================================
   Print
   ==================================================================
   Every page prints as a document.
   ================================================================== */

@media print {
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
    padding-bottom: 0;
  }

  a { color: #000; }

  /* The running head is chrome; the page's own h1 carries the identity. */
  .skip-link,
  .masthead,
  .slot { display: none; }
}
