/* =========================================================================
   THE SLOW BUILDS - editorial system v2 (2026-06-14 PM)
   Two movements:
   1) THE PREMISE - a quiet first-person aside about the day job.
   2) THE LAB - a sticky-stack "syllabus" of builds that probe the future;
      each card's big text is its thesis, the name rides the peeking spine;
      experimentswith.tech is the inverted finale. Brick wanders, quietly.
   Paper + ink, ONE warm rust accent. Color = emphasis, not decoration.
   ========================================================================= */

:root {
  --paper:    #fbfbf9;   /* elegant near-white, a whisper of warmth */
  --paper-2:  #ffffff;   /* raised surfaces - cards, defined by hairline + shadow */
  --ink:      #191713;
  --ink-2:    #514c44;
  --ink-3:    #948e84;
  --line:     rgba(20, 18, 14, 0.09);
  --line-2:   rgba(20, 18, 14, 0.17);
  --accent:   #c0502c;   /* warm rust - the one accent */
  --accent-2: #9c3d1f;
  --finale:   #d98a3d;   /* warm amber - only on the inverted finale card */

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

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

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.62;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: 0.18; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); position: relative; z-index: 1; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; margin: 0; }
::selection { background: var(--accent); color: var(--paper-2); }

/* keyboard focus - visible only when tabbing, invisible to mouse users.
   (accessibility + clear feedback, no aesthetic cost.) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.btn-go:focus-visible { outline-offset: 4px; }
:focus:not(:focus-visible) { outline: none; }

/* clean anchor landings - the "see what I build" jump and any #slug deep
   link stop with breathing room, not jammed under the sticky spine. */
#lab { scroll-margin-top: 1.5rem; }
.deck-card { scroll-margin-top: 5.5rem; }

.skip-link { position: absolute; left: -999px; top: 0; z-index: 50; background: var(--ink); color: var(--paper-2); padding: .6rem 1rem; border-radius: 0 0 8px 0; font-family: var(--font-mono); font-size: .8rem; }
.skip-link:focus { left: 0; }

/* ---------- atoms ---------------------------------------------------- */
.kicker { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); display: inline-block; }

.lnk {
  display: inline-flex; align-items: center; gap: .35em;
  font-family: var(--font-mono); font-size: .82rem; letter-spacing: .02em;
  color: var(--ink-2); text-decoration: none; padding-bottom: 2px;
  border-bottom: 1px solid var(--line-2);
  transition: color .18s ease, border-color .18s ease, gap .18s ease;
}
.lnk:hover { color: var(--accent); border-color: var(--accent); gap: .55em; }
.lnk--primary { color: var(--ink); border-color: var(--ink); font-weight: 500; }
.lnk--primary:hover { color: var(--accent); border-color: var(--accent); }
.lnk .arr { font-size: .9em; transition: transform .18s ease; }
.lnk:hover .arr { transform: translate(1px, -1px); }

/* ---------- nav ------------------------------------------------------ */
.nav { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1.6rem 0 1.4rem; border-bottom: 1px solid var(--line); }
.nav__brand { font-family: var(--font-mono); font-size: 1.02rem; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; color: var(--ink); font-weight: 600; }
.nav__brand b { color: var(--accent); font-weight: 500; }
.nav__links { display: flex; align-items: baseline; gap: 1.6rem; }
.nav__links a { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .04em; text-decoration: none; color: var(--ink-2); transition: color .18s ease; }
.nav__links a:hover { color: var(--accent); }

/* ---------- the premise: quiet, understated. story starts here ------- */
.intro { padding: clamp(2.6rem, 7vw, 5rem) 0 clamp(1.2rem, 3vw, 2rem); max-width: 60ch; }
.intro__name { margin-bottom: 1.3rem; }
.intro__lead { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(1.75rem, 3.8vw, 2.7rem); line-height: 1.1; letter-spacing: -0.018em; color: var(--ink); max-width: 24ch; overflow-wrap: break-word; }

/* the "curiosity" thread - one rust word that links the lead to the headline.
   In the headline it also draws a rust underline left-to-right on scroll-in. */
.cur { color: var(--accent); }
.bridge .cur {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 92%;
  background-size: 0% 0.09em;
  padding-bottom: 0.06em;
  transition: background-size 1s cubic-bezier(.2,.7,.2,1) .25s;
}
.bridge .cur.is-underlined { background-size: 100% 0.09em; }
@media (prefers-reduced-motion: reduce) { .bridge .cur { transition: none; } }

/* the guide button - elegant, with a gently nudging arrow that invites the
   scroll into the lab. (curious.pm energy, editorial-white restraint.) */
.intro__cta { margin-top: 1.9rem; display: flex; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap; }
.intro__links { display: inline-flex; align-items: baseline; gap: 1.5rem; flex-wrap: wrap; }
.btn-go {
  display: inline-flex; align-items: center; gap: .6em;
  background: var(--accent); color: #fff;
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase;
  padding: .82rem 1.4rem; border-radius: 999px; text-decoration: none;
  box-shadow: 0 12px 24px -12px rgba(192,80,44,.6);
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}
.btn-go:hover { background: var(--accent-2); transform: translateY(-2px); box-shadow: 0 18px 32px -12px rgba(192,80,44,.7); }
.btn-go .dn { display: inline-block; animation: nudge 1.7s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

/* ---------- the real headline (the pivot to the lab) ----------------- */
.bridge { padding: clamp(0.5rem, 2vw, 1.5rem) 0 clamp(3rem, 7vw, 5rem); }
.bridge h2 { margin: 0; max-width: 44ch; font-family: var(--font-display); font-weight: 500; font-size: clamp(1.25rem, 2.4vw, 1.7rem); line-height: 1.4; letter-spacing: -0.004em; color: var(--ink-2); overflow-wrap: break-word; }
.bridge h2 em { font-style: italic; color: var(--accent); }
/* word-by-word reveal as the bridge scrolls in (JS wraps words in .w) */
.bridge h2 .w { display: inline-block; opacity: .13; transform: translateY(.12em); transition: opacity .55s ease, transform .55s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--wi) * 36ms); }
.bridge.is-lit h2 .w { opacity: 1; transform: none; }

/* Staggered entrance - guides the eye top-to-bottom on load instead of
   presenting everything at once (lower cognitive load). Reduced-motion
   users get it instantly via the global rule below. */
@keyframes rise { from { opacity: 0; transform: translateY(13px); } to { opacity: 1; transform: none; } }
.intro__name, .intro__lead, .intro__cta, .bridge h2 { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
.intro__name { animation-delay: .04s; }
.intro__lead { animation-delay: .15s; }
.intro__cta  { animation-delay: .27s; }
.bridge h2   { animation-delay: .42s; }

/* ---------- movement 2: the lab (sticky-stack syllabus) -------------- */
.lab { padding: clamp(1.5rem, 4vw, 3rem) 0 0; position: relative; }
.lab__head { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: end; margin-bottom: clamp(2rem, 4vw, 3rem); position: relative; }
.lab__head .kicker { margin-bottom: 1rem; }
.lab__head h2 { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.05; letter-spacing: -0.015em; color: var(--ink); max-width: 16ch; }
.lab__note p { margin: 0; max-width: 40ch; color: var(--ink-2); }
.lab__note .soft { font-style: italic; color: var(--ink); }

.deck { position: relative; --stick: 80px; --bar: 50px; }

.deck-card {
  position: sticky;
  top: calc(var(--stick) + (var(--i) - 1) * var(--bar));
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: 0 26px 54px -38px rgba(27,25,21,.55);
  overflow: hidden;
  margin-bottom: 1.4rem;
  transition: opacity .45s ease, filter .45s ease, box-shadow .45s ease;
}

/* Focus: the frontmost (active) card stays crisp; the receding spine takes
   a subtle blur + brightness dip. NB: never use opacity here - these cards
   overlap, and any translucency lets siblings ghost through. Opaque only. */
.deck.is-focusing .deck-card { filter: blur(1.4px); }
.deck.is-focusing .deck-card.is-active { filter: none; box-shadow: 0 30px 66px -34px rgba(27,25,21,.62); }
/* fade the receding spine's name (keeps it opaque - no ghosting) so the
   active card clearly owns the focus */
.deck.is-focusing .deck-card:not(.is-active) .deck-card__name { color: var(--ink-3); }
.deck.is-focusing .deck-card:not(.is-active) .deck-card__num { opacity: .55; }
/* the peeking spine: number + name, always at the card top */
.deck-card__bar {
  height: var(--bar); display: flex; align-items: center; gap: .9rem;
  padding: 0 1.5rem; border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.deck-card__num { font-family: var(--font-mono); font-size: .82rem; color: var(--accent); letter-spacing: .04em; }
.deck-card__name { font-family: var(--font-display); font-size: 1.18rem; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.deck-card__status { margin-left: auto; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }

.deck-card__body { display: grid; grid-template-columns: 1fr minmax(0, 19rem); gap: clamp(1.4rem, 3vw, 2.8rem); align-items: center; padding: clamp(1.7rem, 3.2vw, 2.6rem) 1.5rem clamp(1.7rem, 3.2vw, 2.6rem); }
.deck-card__probe { font-family: var(--font-display); font-size: clamp(1.5rem, 2.7vw, 2.25rem); line-height: 1.12; letter-spacing: -0.01em; color: var(--ink); max-width: 18ch; }
.deck-card__probe em { font-style: italic; color: var(--accent); }
.deck-card__line { margin: 1rem 0 0; max-width: 48ch; color: var(--ink-2); }
.deck-card__meta { margin: 1.1rem 0 0; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .03em; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; }
.deck-card__meta .dot { color: var(--line-2); }
.deck-card__links { margin-top: 1.3rem; display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; }
.deck-card__lesson { margin: 1.6rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--line); max-width: 52ch; color: var(--ink-2); font-size: .95rem; line-height: 1.55; }
.deck-card__lesson-label { display: block; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: .45rem; }

.deck-card__media { border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); aspect-ratio: 4 / 3; }
.deck-card__media img, .deck-card__media video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* the finale - experimentswith.tech, inverted */
.deck-card--finale { background: var(--ink); border-color: var(--ink); }
.deck-card--finale .deck-card__bar { background: var(--ink); border-bottom-color: rgba(250,247,239,.14); }
.deck-card--finale .deck-card__num { color: var(--finale); }
.deck-card--finale .deck-card__name { color: var(--paper-2); }
.deck-card--finale .deck-card__status { color: rgba(250,247,239,.55); }
.deck-card--finale .deck-card__probe { color: var(--paper-2); }
.deck-card--finale .deck-card__probe em { font-style: italic; color: var(--finale); }
.deck-card--finale .deck-card__line { color: rgba(250,247,239,.72); }
.deck-card--finale .deck-card__meta { color: rgba(250,247,239,.5); }
.deck-card--finale .deck-card__meta .dot { color: rgba(250,247,239,.3); }
.deck-card--finale .deck-card__lesson { color: rgba(250,247,239,.72); border-top-color: rgba(250,247,239,.14); }
.deck-card--finale .deck-card__lesson-label { color: var(--finale); }
.deck-card--finale .lnk { color: rgba(250,247,239,.82); border-color: rgba(250,247,239,.3); }
.deck-card--finale .lnk:hover { color: var(--finale); border-color: var(--finale); }
.deck-card--finale .lnk--primary { color: var(--paper-2); border-color: var(--paper-2); }
.deck-card--finale .deck-card__media { border-color: rgba(250,247,239,.18); background: #2a2620; }

/* ---------- closing -------------------------------------------------- */
.closing { position: relative; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: clamp(3.5rem, 8vw, 6rem) 0; margin-top: clamp(2.5rem, 6vw, 4rem); }

/* Brick - one quiet appearance, standing on the closing baseline by the
   say-hello link. Small, idle, never loud. */
.brick { position: absolute; right: clamp(4px, 3vw, 40px); bottom: -2px; width: clamp(70px, 8vw, 96px); z-index: 2; animation: brick-wander 13s ease-in-out infinite; }
.brick img { width: 100%; height: auto; display: block; cursor: pointer; filter: drop-shadow(0 8px 12px rgba(27,25,21,.16)); animation: brick-idle 5.5s ease-in-out infinite; transform-origin: 50% 100%; transition: transform .2s ease; }
.brick img:hover { transform: scale(1.06); animation-play-state: paused; }
@keyframes brick-idle { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-4px) rotate(-1.4deg); } }
/* he drifts a little around his corner, never far */
@keyframes brick-wander { 0%,100% { transform: translateX(0); } 30% { transform: translateX(-14px); } 55% { transform: translateX(8px); } 80% { transform: translateX(-5px); } }
/* mobile: keep Brick, but smaller and without the sideways drift (no room to roam) */
@media (max-width: 620px) {
  .brick { width: 56px; right: 8px; animation: none; }
}
.closing .kicker { margin-bottom: 1.4rem; }
.closing h2 { font-size: clamp(1.7rem, 3.6vw, 2.7rem); line-height: 1.12; letter-spacing: -0.01em; max-width: 22ch; color: var(--ink); }
.closing h2 em { font-style: italic; color: var(--accent); }
.closing p { margin: 1.4rem 0 0; max-width: 56ch; color: var(--ink-2); }
.closing__cta { margin-top: 2.2rem; display: flex; gap: 1.8rem; flex-wrap: wrap; }

/* ---------- footer --------------------------------------------------- */
.foot { padding: 3rem 0 3.5rem; }
.foot__inner { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: baseline; }
.foot__brand { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); }
.foot__meta { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .04em; color: var(--ink-3); margin-top: .3rem; }
.foot__links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.foot__links a { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .04em; color: var(--ink-2); text-decoration: none; transition: color .18s ease; }
.foot__links a:hover { color: var(--accent); }

/* ---------- motion --------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .brick, .brick img { animation: none; }
  .bridge h2 .w { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { animation-duration: 0.001ms !important; }
}

/* ---------- responsive ----------------------------------------------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 2.2rem; }
  .glance { order: 2; }
  .lab__head { grid-template-columns: 1fr; align-items: start; gap: 1.4rem; }
  .lab__head h2 { max-width: 18ch; }
  .lab__note p { max-width: 52ch; }
  .deck-card__body { grid-template-columns: 1fr; }
  .deck-card__media { order: -1; max-width: 360px; justify-self: center; width: 100%; }
  /* On mobile the cards are tall (stacked media + copy + lesson), so the
     sticky-stack overlaps and clips the bottom text on deeper cards. Switch
     to plain flow: each card is a full block you scroll through, nothing cut. */
  .deck-card { position: static; margin-bottom: 1.25rem; box-shadow: 0 16px 36px -28px rgba(27,25,21,.42); }
  .deck-card:last-child { margin-bottom: 0; }
  .deck.is-focusing .deck-card,
  .deck.is-focusing .deck-card.is-active { filter: none; }
}
@media (max-width: 600px) {
  /* NB: do NOT add overflow-x:hidden on html/body - it forces overflow-y
     to auto and breaks position:sticky (the deck stops stacking on iOS).
     Horizontal overflow is prevented at the source by capping widths below. */
  .intro { max-width: 100%; }
  .intro__lead { max-width: 100%; font-size: clamp(2rem, 8.6vw, 2.7rem); line-height: 1.08; }
  .intro__cta { align-items: flex-start; }
  .intro__links { width: 100%; gap: 1.65rem; }
  .bridge h2 { max-width: 100%; font-size: 1.2rem; line-height: 1.4; }
  .lab__head h2 { max-width: 100%; }
  .closing h2 { max-width: 100%; }
  .deck-card__probe { max-width: 100%; }
}

@media (max-width: 520px) {
  .deck-card__bar {
    min-height: var(--bar); height: auto; padding: .72rem 1.1rem;
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .05rem .7rem;
    align-items: baseline;
  }
  .deck-card__num { grid-row: 1 / span 2; }
  .deck-card__status {
    grid-column: 2; margin-left: 0; justify-self: start;
    font-size: .56rem; letter-spacing: .12em; white-space: normal;
  }
  .deck-card__body { padding-inline: 1.1rem; }
  /* tap targets (Fitts): keep the primary button comfortably large */
  .btn-go { padding: .9rem 1.5rem; }
}
