/* =============================================================================
   merble.dev
   Two pages, one system: black stock, white ink, and the mauve the halftone
   ring prints in. Nothing here is used by only one element — if a rule stops
   being reachable, delete it.
   ========================================================================== */

/* -----------------------------------------------------------------------------
   Raleway, self-hosted. Google serves this family as a VARIABLE font, so one
   file covers the whole 100–900 range — weights 500 and 700 both come out of
   raleway-latin.woff2 rather than needing a file each.

   Worth self-hosting here specifically because the wordmark texture in
   background.js cannot bake until the font resolves. On Google's CDN that's a
   third-party DNS lookup + TLS handshake + two round trips before the hero can
   draw its type; from our own origin it's already-warm connection reuse, and
   the latin file is preloaded in the HTML on top of that.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/raleway-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: 'Raleway';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/raleway-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;
}

:root {
  /* Pulled straight from CONFIG in background.js — the page and the shader
     have to agree or the canvas edge shows as a seam. */
  --void:       #000000;
  --mauve-lift: #6b5570;   /* lifted from the halftone highlight ink */

  --ink:        #ffffff;
  --ink-soft:   rgba(255, 255, 255, 0.55);
  --ink-faint:  rgba(255, 255, 255, 0.32);
  --rule:       rgba(255, 255, 255, 0.14);

  --f-sans: 'Raleway', system-ui, -apple-system, sans-serif;
  --f-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --gutter: clamp(1.25rem, 5vw, 4rem);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--f-sans);
  font-weight: 500;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

:focus-visible { outline: 1px solid rgba(255, 255, 255, 0.5); outline-offset: 6px; }

/* --- page transition curtain --------------------------------------------
   Only exists when JS is on (.js is set by an inline script in <head>, before
   first paint). Until transition.js builds the bars the container is a solid
   black fill, which is what prevents a flash of uncovered page on load — and
   why a JS failure would leave the screen black rather than half-wiped.
   ---------------------------------------------------------------------- */
.curtain { display: none; }

.js .curtain {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: var(--void);
}
.js .curtain.is-built { background: transparent; }

.curtain b {
  position: absolute;
  left: -1px;
  width: calc(100% + 2px);
  background: var(--void);
  transform: scaleX(1);
  will-change: transform;
}

/* --- film grain ---------------------------------------------------------
   SCREEN, not multiply: multiplying noise into a black page is a no-op, so
   the overlay has to add light rather than subtract it. Keep the opacity low
   — this should read as sensor noise, not texture.
   ---------------------------------------------------------------------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.5'/></svg>");
}

/* --- hero (index.html) --------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;           /* crops the oversized canvas — see background.js */
  isolation: isolate;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  touch-action: none;
  cursor: grab;
}
.hero__canvas.is-grabbing { cursor: grabbing; }

/* =============================================================================
   RÉSUMÉ PAGE
   The ring runs behind, heavily blurred and shoved into a corner, so it reads
   as ambient light rather than a second thing to look at. The document is the
   only bright object on the page.
   ========================================================================== */

.doc {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.doc__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;       /* nothing to drag here — let clicks through */
}

.doc__inner {
  position: relative;
  z-index: 2;
  max-width: 62rem;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.25rem) var(--gutter) clamp(4rem, 10vw, 7rem);
}

/* --- bar ----------------------------------------------------------------- */
.bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--rule);
}

.bar__mark {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.bar__mark span { color: var(--ink-faint); }
.bar__mark:hover span { color: var(--mauve-lift); }

/* --- buttons ------------------------------------------------------------- */
.btn {
  font-family: var(--f-sans);
  font-weight: 500;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.btn:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.45); }
.btn--solid { background: var(--ink); border-color: var(--ink); color: var(--void); }
.btn--solid:hover {
  background: var(--mauve-lift);
  border-color: var(--mauve-lift);
  color: var(--ink);
}

/* --- masthead ------------------------------------------------------------ */
.doc__head { margin: clamp(3.5rem, 10vw, 7rem) 0 clamp(3rem, 7vw, 5rem); }

.doc__title {
  font-weight: 700;
  font-size: clamp(3rem, 1.5rem + 7vw, 7rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin: 0;
}

.contact {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 2rem 0 0;
  padding: 0;
}
.contact a {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.contact a:hover { color: var(--ink); border-bottom-color: var(--mauve-lift); }

/* --- sections ------------------------------------------------------------
   Two columns on desktop: a sticky label rail beside the entries. The label
   riding alongside the content is what keeps a long scroll oriented.
   ---------------------------------------------------------------------- */
.sec {
  display: grid;
  gap: 1.5rem clamp(2rem, 5vw, 4rem);
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  border-top: 1px solid var(--rule);
}
@media (min-width: 820px) {
  .sec { grid-template-columns: 9rem 1fr; }
  .sec__label { position: sticky; top: 2rem; align-self: start; }
}

.sec__label {
  margin: 0;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mauve-lift);
}

.sec__body { display: grid; gap: clamp(2.25rem, 5vw, 3.25rem); }

/* --- entries ------------------------------------------------------------- */
.entry__when {
  margin: 0 0 0.5rem;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.entry__role {
  margin: 0;
  font-weight: 700;
  font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.85rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.entry__org { margin: 0.35rem 0 0; font-size: 0.95rem; color: var(--ink-soft); }
.entry__org em { font-style: normal; color: var(--ink-faint); }

.entry__stack {
  margin: 0.5rem 0 0;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.entry__note { margin: 0.5rem 0 0; font-size: 0.95rem; color: var(--ink-soft); }

.points {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.points li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.62;
  max-width: 46rem;
}
/* A halftone dot for the bullet — the page's one nod to the shader. */
.points li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mauve-lift);
}

/* Metrics, carried over from the bold runs in the PDF. */
.points b, .entry__note b { font-weight: 700; color: var(--ink); }

/* --- skills -------------------------------------------------------------- */
.skills { margin: 0; display: grid; gap: 1.4rem; }
.skills > div { display: grid; gap: 0.4rem; }
@media (min-width: 620px) {
  .skills > div { grid-template-columns: 8rem 1fr; gap: 1.5rem; align-items: baseline; }
}
.skills dt {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.skills dd { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* --- coursework ---------------------------------------------------------- */
.coursework {
  margin: 1.4rem 0 0;
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--ink-faint);
  max-width: 46rem;
}
.coursework span {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mauve-lift);
}

/* --- foot ---------------------------------------------------------------- */
.doc__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.doc__foot a { color: var(--ink-soft); text-decoration: none; }
.doc__foot a:hover { color: var(--ink); }

/* --- print ---------------------------------------------------------------
   Ctrl+P on a black page otherwise burns a cartridge and returns something
   unreadable. Flip to ink-on-paper and drop the chrome.
   ---------------------------------------------------------------------- */
@media print {
  .grain, .doc__canvas, .bar, .doc__foot { display: none !important; }
  html, body { background: #fff !important; color: #000 !important; }
  .doc { overflow: visible; min-height: 0; }
  .doc__inner { max-width: none; padding: 0; }
  .doc__head { margin: 0 0 1.5rem; }
  .doc__title { font-size: 2.2rem; }
  .sec__label, .coursework span { color: #555 !important; }
  .entry__org, .entry__note, .points li, .skills dd, .contact a { color: #222 !important; }
  .entry__when, .entry__stack, .skills dt, .coursework { color: #555 !important; }
  .sec { padding: 0.9rem 0; border-top: 1px solid #ccc; break-inside: avoid; }
  .sec__label { position: static; }
  .entry { break-inside: avoid; }
  .points li::before { background: #888; }
  .points b, .entry__note b { color: #000 !important; }
  a { text-decoration: none; }
}
