/* ==========================================================================
   Ricardo de Deijn - design system
   Editorial engineering: serif display, mono metadata, one accent, no cards.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  --paper:      #fbfaf8;
  --paper-2:    #f3f0ea;
  --paper-3:    #ebe7de;
  --ink:        #16130f;
  --ink-2:      #4c4740;
  --ink-3:      #8b857a;
  --line:       rgba(22, 19, 15, 0.13);
  --line-soft:  rgba(22, 19, 15, 0.07);
  --accent:     #1668c4;
  --accent-2:   #12a37a;
  --accent-ink: #ffffff;
  --accent-bg:  rgba(22, 104, 196, 0.10);
  --grad:       linear-gradient(102deg, var(--accent), var(--accent-2));

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans:  "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --wrap: 1120px;
  --gut: clamp(1.25rem, 5vw, 4rem);
  --measure: 64ch;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 260ms;
}

:root[data-theme="dark"] {
  --paper:      #100f0d;
  --paper-2:    #191713;
  --paper-3:    #23201b;
  --ink:        #f3f0ea;
  --ink-2:      #b6afa2;
  --ink-3:      #7f786c;
  --line:       rgba(243, 240, 234, 0.15);
  --line-soft:  rgba(243, 240, 234, 0.08);
  --accent:     #6aa9ff;
  --accent-2:   #3ed7a4;
  --accent-ink: #0d1117;
  --accent-bg:  rgba(106, 169, 255, 0.15);
}

/* --- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.62;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

/* Author display rules (.talk-next is a grid) outrank the UA stylesheet's
   [hidden] rule, so el.hidden = true would silently do nothing without this */
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; padding: 0; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: 0.5rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: 0.65rem 1rem; border-radius: 4px; font-size: 0.9rem;
  transition: top 160ms var(--ease);
}
.skip-link:focus { top: 0.5rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* --- Typographic primitives --------------------------------------------- */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

.display {
  font-size: clamp(2.55rem, 7.2vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.026em;
}

h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h3 { font-size: 1.3rem; letter-spacing: -0.012em; }

p { text-wrap: pretty; }
.measure { max-width: var(--measure); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}

.lede {
  font-size: clamp(1.05rem, 1.9vw, 1.24rem);
  line-height: 1.55;
  color: var(--ink-2);
}

a { color: inherit; text-decoration: none; }

/* Gradient text, with a solid fallback where background-clip is unsupported */
.grad-text { color: var(--accent); }
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .grad-text {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

/* Underline that grows from the left */
.link {
  color: var(--ink);
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  padding-bottom: 1px;
  transition: background-size 300ms var(--ease), color var(--dur) var(--ease);
}
.link:hover, .link:focus-visible { background-size: 100% 1px; }

.link--accent { color: var(--accent); }

/* --- Layout ------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.section + .section { border-top: 1px solid var(--line-soft); }

.section__head {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: clamp(2.25rem, 4vw, 3.5rem);
}
.section__head .eyebrow { color: var(--accent); }
.section__head p { color: var(--ink-2); max-width: 56ch; }

/* --- Masthead ----------------------------------------------------------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.masthead.is-stuck {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--line-soft);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 4.25rem;
}

/* The wordmark is the only masthead item allowed to give up space: it
   truncates rather than squeezing the nav or the buttons beside it. */
.wordmark {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wordmark b { font-weight: 600; }
.wordmark span { color: var(--ink-3); }

.masthead nav ul {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2rem);
}
.masthead nav a {
  font-size: 0.875rem;
  color: var(--ink-2);
  position: relative;
  padding-block: 0.25rem;
  transition: color 180ms var(--ease);
}
.masthead nav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform 300ms var(--ease);
}
.masthead nav a:hover { color: var(--ink); }
.masthead nav a.is-active { color: var(--accent); }
.masthead nav a:hover::after, .masthead nav a.is-active::after { transform: scaleX(1); }

.masthead__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: none;
}

@media (max-width: 780px) {
  .masthead nav { display: none; }
}

/* Measured: the full wordmark overflows the masthead below ~1040px, which is
   what pushed the arrow off the "back to portfolio" button. Drop the job
   title first; the ellipsis above is the remaining safety net. */
@media (max-width: 1040px) {
  .wordmark span { display: none; }
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.62rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  /* Never let a squeezed flex parent break a label onto two lines or eat
     the trailing padding (e.g. the "back arrow + Portfolio" masthead button) */
  white-space: nowrap;
  flex: none;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease),
              color 180ms var(--ease), transform 180ms var(--ease);
}
.btn:hover { border-color: var(--ink); transform: translateY(-1px); }

.btn--solid {
  background: var(--grad);
  color: var(--accent-ink);
  border-color: transparent;
}
.btn--solid:hover {
  border-color: transparent;
  filter: brightness(1.07) saturate(1.06);
}

.btn--sm { padding: 0.45rem 0.9rem; font-size: 0.82rem; }

.icon-btn {
  width: 2.25rem; height: 2.25rem;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease);
}
.icon-btn:hover { border-color: var(--ink); background: var(--paper-2); }
.icon-btn svg {
  width: 1rem; height: 1rem; stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
:root[data-theme="dark"] .icon-btn .moon { display: none; }
:root:not([data-theme="dark"]) .icon-btn .sun { display: none; }

/* --- Hero --------------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  padding-top: clamp(3.5rem, 8vw, 6.5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

/* Soft blue-to-green wash behind the hero. Full-bleed and edgeless: it must
   span the whole viewport, not the 1120px column, or it ends in a hard seam.
   The negative top inset lets it rise behind the transparent masthead. */
.hero::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12rem;
  bottom: -14%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.2;
  background:
    radial-gradient(50% 48% at 20% 42%, var(--accent), transparent 72%),
    radial-gradient(46% 46% at 82% 18%, var(--accent-2), transparent 72%);
  /* Fade the bottom out so the wash dissolves instead of stopping */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 58%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 58%, transparent 100%);
}
:root[data-theme="dark"] .hero::before { opacity: 0.3; }

.hero__grid {
  display: grid;
  gap: clamp(2.25rem, 5vw, 4rem);
  align-items: end;
}

/* Avatar sits beside the status line on mobile, where the 300px portrait
   would otherwise be orphaned below the buttons. Hidden on desktop. */
.hero__intro {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.hero__avatar {
  flex: none;
  width: 68px;
  height: 68px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.hero__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.hero__title { margin-bottom: 1.4rem; }
.hero__title em { font-style: italic; color: var(--accent); }
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .hero__title em {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.hero__lede { max-width: 54ch; margin-bottom: 2.25rem; }

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.hero__portrait { position: relative; max-width: 100%; }
.hero__portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 22%;
  border-radius: 3px;
  filter: saturate(0.92);
}
.hero__caption {
  margin-top: 0.75rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.6;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  text-transform: uppercase;
}

@media (min-width: 900px) {
  /* Fluid so it grows to 340px on wide screens without crushing the
     headline measure at the breakpoint itself */
  .hero__grid { grid-template-columns: minmax(0, 1fr) clamp(240px, 27vw, 340px); }
  .hero__avatar { display: none; }
}
@media (max-width: 899px) {
  .hero__portrait { display: none; }
}

/* --- Proof strip -------------------------------------------------------- */
.proof {
  position: relative;
  isolation: isolate;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.proof::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.07;
  background: var(--grad);
}
:root[data-theme="dark"] .proof::before { opacity: 0.11; }
.proof__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 820px) {
  .proof__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.proof__item {
  padding: clamp(1.5rem, 3vw, 2.25rem) 1.5rem clamp(1.5rem, 3vw, 2.25rem) 0;
}
.proof__item + .proof__item {
  border-left: 1px solid var(--line-soft);
  padding-left: 1.5rem;
}
@media (max-width: 819px) {
  .proof__item:nth-child(odd) { border-left: 0; padding-left: 0; }
  .proof__item:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
}

.proof__num {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  display: block;
  width: fit-content;
  margin-bottom: 0.6rem;
  color: var(--accent);
}
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .proof__num {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
.proof__label {
  font-size: 0.85rem;
  color: var(--ink-2);
  line-height: 1.45;
  max-width: 22ch;
}

/* --- Work list ---------------------------------------------------------- */
.work-list { border-top: 1px solid var(--line); }

.work {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem 1.5rem;
  padding-block: clamp(1.75rem, 3.4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 880px) {
  .work {
    grid-template-columns: 4rem minmax(0, 1fr) auto;
    gap: 2rem;
    align-items: start;
  }
}

.work__idx {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  padding-top: 0.45rem;
  transition: color 180ms var(--ease);
}
.work:hover .work__idx { color: var(--accent); }
.work:hover .work__org { color: var(--accent); border-color: var(--accent); }

.work__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.6rem;
}
.work__org {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  white-space: nowrap;
}

.work__body p { color: var(--ink-2); max-width: 62ch; font-size: 1rem; }
.work__body { min-width: 0; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.tags li { white-space: nowrap; }

.work__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 1.1rem;
  font-size: 0.875rem;
}
@media (max-width: 879px) {
  .work__links { grid-column: 2; }
}
@media (min-width: 880px) {
  .work__links {
    margin-top: 0;
    flex-direction: column;
    align-items: flex-end;
    padding-top: 0.3rem;
  }
}
.work__links a {
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 180ms var(--ease);
}
.work__links a:hover { color: var(--accent); }
.work__links a::after {
  content: "\2197";
  font-size: 0.85em;
  transition: transform 220ms var(--ease);
}
.work__links a:hover::after { transform: translate(3px, -3px); }
.work__links .is-static { color: var(--ink-3); }

/* --- Stack columns ------------------------------------------------------ */
.stack { display: grid; gap: clamp(2rem, 4vw, 3rem); }
@media (min-width: 720px) { .stack { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.stack__col h3 {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 0.85rem;
  margin-bottom: 1.1rem;
  background-image: var(--grad);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 2px;
}
.stack__col li {
  font-size: 0.95rem;
  color: var(--ink-2);
  padding-block: 0.3rem;
}
.stack__col li b { font-weight: 500; color: var(--ink); }

/* --- Publications ------------------------------------------------------- */
.pubs { border-top: 1px solid var(--line); }

.pub {
  display: grid;
  gap: 0.4rem 2rem;
  padding-block: 1.6rem;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 760px) {
  .pub { grid-template-columns: 5.5rem minmax(0, 1fr) auto; align-items: baseline; }
}

.pub__year {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
.pub__title {
  font-family: var(--sans);
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.008em;
  max-width: 60ch;
  margin-bottom: 0.35rem;
}
.pub__meta { font-size: 0.9rem; color: var(--ink-3); }
.pub__meta .award { color: var(--accent); font-weight: 500; }

.pub__action {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink-2);
  transition: color 180ms var(--ease);
}
a.pub__action:hover { color: var(--accent); }
.pub__action.is-static { color: var(--ink-3); }

/* --- Writing ------------------------------------------------------------ */
.writing { display: grid; gap: 0; border-top: 1px solid var(--line); }

.post {
  display: block;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
  transition: padding-left 260ms var(--ease);
}
.post:hover { padding-left: 0.6rem; }
.post h3 {
  font-family: var(--sans);
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: -0.008em;
  line-height: 1.4;
  margin-bottom: 0.35rem;
  transition: color 180ms var(--ease);
}
.post:hover h3 { color: var(--accent); }
.post p { font-size: 0.92rem; color: var(--ink-3); max-width: 68ch; }

.skeleton { padding-block: 1.5rem; border-bottom: 1px solid var(--line); }
.skeleton span {
  display: block;
  height: 0.7rem;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--paper-2), var(--paper-3), var(--paper-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skeleton span:first-child { width: 45%; height: 1rem; margin-bottom: 0.7rem; }
.skeleton span:last-child { width: 70%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.feed-error { padding-block: 2rem; color: var(--ink-3); font-size: 0.95rem; }

/* --- Speaking ----------------------------------------------------------- */
.talk-next {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 1.25rem 2.5rem;
  padding: clamp(1.5rem, 3vw, 2rem);
  padding-left: clamp(1.75rem, 3.5vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-2);
  align-items: center;
  margin-bottom: 2.5rem;
}
.talk-next::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--grad);
}
@media (min-width: 680px) { .talk-next { grid-template-columns: auto minmax(0, 1fr); } }

.talk-next__date { text-align: center; min-width: 5.5rem; }
.talk-next__date .m {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent); display: block;
}
.talk-next__date .d {
  font-family: var(--serif); font-size: 2.8rem; line-height: 1.05;
  letter-spacing: -0.03em; display: block; color: var(--accent);
}
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .talk-next__date .d {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
.talk-next__date .y {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em;
  color: var(--ink-3); display: block;
}
.talk-next__body p { color: var(--ink-2); font-size: 0.98rem; margin-top: 0.35rem; }
.talk-next__where {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3); margin-top: 0.75rem; display: block;
}

.past-talks { display: grid; gap: 0; border-top: 1px solid var(--line-soft); }
.past-talks li {
  display: grid;
  gap: 0.15rem 2rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.95rem;
}
@media (min-width: 680px) {
  .past-talks li { grid-template-columns: 9rem minmax(0, 1fr); align-items: baseline; }
}
.past-talks .when {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--ink-3);
}
.past-talks .what { color: var(--ink-2); }
.past-talks .what b { font-weight: 500; color: var(--ink); }

/* --- About -------------------------------------------------------------- */
.about-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (min-width: 900px) {
  .about-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
}

.about-copy p + p { margin-top: 1.15rem; }
.about-copy p { color: var(--ink-2); max-width: 60ch; }
.about-copy strong { color: var(--ink); font-weight: 500; }

.about-figures { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.about-figures figure:first-child { grid-column: 1 / -1; }
.about-figures img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: 3px; filter: saturate(0.9);
}
.about-figures figcaption {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3); margin-top: 0.5rem; line-height: 1.5;
}

/* --- Contact ------------------------------------------------------------ */
.contact-grid { display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: start; }
@media (min-width: 900px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.contact-pitch h2 { margin-bottom: 1.1rem; }
.contact-pitch p { color: var(--ink-2); max-width: 42ch; }

.elsewhere { margin-top: 2rem; display: grid; gap: 0; }
.elsewhere a {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.95rem;
  transition: color 180ms var(--ease);
}
.elsewhere a:first-child { border-top: 1px solid var(--line-soft); }
.elsewhere a:hover { color: var(--accent); }
.elsewhere .handle { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-3); }
.elsewhere a:hover .handle { color: inherit; }

.form { display: grid; gap: 0.9rem; }
.field { display: grid; gap: 0.4rem; }
.field label {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-3);
}
.form input, .form textarea {
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.75rem 0.9rem;
  font-size: 0.98rem;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease);
}
.form input:focus, .form textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--paper-2);
}
.form textarea { resize: vertical; min-height: 8rem; line-height: 1.55; }
.form button { justify-content: center; margin-top: 0.35rem; }
.form button[disabled] { opacity: 0.6; cursor: progress; }

.form-note {
  font-size: 0.88rem;
  padding: 0.7rem 0.9rem;
  border-radius: 3px;
  border: 1px solid var(--line);
}
.form-note.ok { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }
.form-note.bad { color: #b3261e; border-color: #b3261e; background: rgba(179, 38, 30, 0.07); }
:root[data-theme="dark"] .form-note.bad { color: #f2837b; border-color: #f2837b; }

/* --- Footer ------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); padding-block: 2.5rem 3rem; }
.footer__inner {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em;
  color: var(--ink-3); text-transform: uppercase;
}
.footer__inner a:hover { color: var(--ink); }

/* --- Scroll reveal ------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
  transition-delay: var(--delay, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

/* Mobile visitors move through the page quickly and have less room for an
   off-screen section to enter the observer viewport. Keep every section
   available immediately rather than risking an empty stretch of page. */
@media (max-width: 680px) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --- Sub-page (stories) ------------------------------------------------- */
.page-head { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2rem, 4vw, 3rem); }
.page-head .display { margin-block: 1.25rem 1.25rem; }

.chapter { padding-block: clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--line-soft); }
.chapter__grid { display: grid; gap: clamp(1.75rem, 4vw, 3.5rem); align-items: start; }
@media (min-width: 900px) {
  .chapter__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
}
.chapter__figure img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 3px; filter: saturate(0.9);
}
.chapter__body h2 { margin-bottom: 1.1rem; }
.chapter__body p { color: var(--ink-2); max-width: 60ch; }
.chapter__body p + p { margin-top: 1.1rem; }
.chapter__body h3 {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  margin-top: 2.5rem; padding-bottom: 0.85rem; border-bottom: 1px solid var(--line);
}

.talk-log { display: grid; gap: 0; }
.talk-log li { padding-block: 1.25rem; border-bottom: 1px solid var(--line-soft); }
.talk-log .when {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 0.4rem;
}
.talk-log h4 {
  font-family: var(--sans); font-size: 1rem; font-weight: 500;
  letter-spacing: -0.008em; margin-bottom: 0.35rem;
}
.talk-log p { font-size: 0.93rem; color: var(--ink-2); max-width: 62ch; }
.talk-log a { display: inline-block; margin-top: 0.6rem; font-size: 0.85rem; color: var(--ink-2); }
.talk-log a:hover { color: var(--accent); }

/* --- Talk page ---------------------------------------------------------- */
.talk-head { padding-block: clamp(3rem, 7vw, 5rem) 0; }
.talk-head .eyebrow { display: block; margin-bottom: 1.35rem; }

.talk-title {
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.022em;
  max-width: 20ch;
  margin-bottom: 1.35rem;
}

.talk-lede { max-width: 62ch; }

.talk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.talk-figure { margin-block: clamp(2.5rem, 6vw, 4rem); }
.talk-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.talk-figure figcaption {
  margin-top: 0.75rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.more-talks { display: grid; gap: 0; border-top: 1px solid var(--line); }
.more-talks a {
  display: grid;
  gap: 0.2rem 2rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--line-soft);
  transition: padding-left 260ms var(--ease), color 180ms var(--ease);
}
@media (min-width: 680px) {
  .more-talks a { grid-template-columns: 11rem minmax(0, 1fr) auto; align-items: baseline; }
}
.more-talks a:hover { padding-left: 0.5rem; color: var(--accent); }
.more-talks .when {
  font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.08em; color: var(--ink-3);
}
.more-talks a:hover .when, .more-talks a:hover .go { color: inherit; }
.more-talks .what { font-size: 0.98rem; }
.more-talks .go {
  font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.08em; color: var(--ink-3); white-space: nowrap;
}

.talk-empty { padding-block: clamp(3rem, 8vw, 6rem); }
.talk-empty h1 { margin-bottom: 1.1rem; }
.talk-empty p { color: var(--ink-2); max-width: 52ch; margin-bottom: 1.75rem; }

/* --- Reduced motion / print --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .masthead, .footer, .form, .icon-btn { display: none; }
  body { background: #fff; color: #000; }
  .reveal { opacity: 1; transform: none; }
}
