/* ═══════════════════════════════════════════════════════════════
   IROH WEB CO
   Paper, ink, and a piece of string. Named after the cat.
   ═══════════════════════════════════════════════════════════════ */

/* ── Fonts ───────────────────────────────────────────────────── */
@font-face {
  font-family: 'Fraunces';
  src: url('assets/fonts/fraunces-560.woff2') format('woff2');
  font-weight: 560 620; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('assets/fonts/fraunces-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('assets/fonts/newsreader-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('assets/fonts/newsreader-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('assets/fonts/ibmplexmono-500.woff2') format('woff2');
  font-weight: 400 500; font-style: normal; font-display: swap;
}
/* size-adjusted local fallbacks so the huge cover headline does not jump */
@font-face {
  font-family: 'Fraunces-fb';
  src: local('Georgia'), local('Times New Roman');
  size-adjust: 104%; ascent-override: 92%; descent-override: 24%;
}
@font-face {
  font-family: 'Newsreader-fb';
  src: local('Georgia'), local('Times New Roman');
  size-adjust: 92%; ascent-override: 88%; descent-override: 26%;
}

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  --paper: #F6F1E7;      /* cream, like the box he sits in */
  --panel: #EDE4D2;      /* mat board */
  --ink: #2A241D;        /* dark tabby stripe */
  --body-ink: #4C443A;   /* soft fur brown */
  --clay: #AE5230;       /* the bowtie */
  --celadon: #7D8C6C;    /* his eyes */
  --hairline: #DCD3C1;

  --serif: 'Fraunces', 'Fraunces-fb', Georgia, serif;
  --body: 'Newsreader', 'Newsreader-fb', Georgia, serif;
  --mono-f: 'IBM Plex Mono', ui-monospace, 'Courier New', monospace;

  --gw: 5rem;                              /* the string gutter */
  --pad: clamp(1.25rem, 4vw, 3rem);        /* page side padding */
  --colgap: clamp(1.5rem, 3vw, 3rem);
  --pb: clamp(5rem, 12vh, 8rem);           /* section breathing room */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Reset and base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--paper);
  color: var(--body-ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.65;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: rgba(174, 82, 48, 0.22); }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 2px; }

.mono {
  font-family: var(--mono-f);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 560;
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: -0.01em;
}
h2 { font-size: clamp(1.9rem, 4.4vw, 3rem); margin-bottom: 1.6rem; text-wrap: balance; }

.body-text { max-width: 42rem; }
.body-text + .body-text, .para-wrap { margin-top: 1.4rem; }

.skip {
  position: fixed; top: -4rem; left: 1rem; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; font-family: var(--mono-f); font-size: 0.8rem;
  text-decoration: none; border-radius: 4px; transition: top 200ms;
}
.skip:focus { top: 1rem; }

/* ── Fixed chrome ────────────────────────────────────────────── */
.chrome {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem clamp(1.25rem, 3vw, 2rem);
  pointer-events: none;
}
/* a soft paper scrim so the fixed text stays legible over passing content */
.chrome::before {
  content: ""; position: absolute; inset: 0 0 -1.8rem 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(246, 241, 231, 0.92), rgba(246, 241, 231, 0.65) 45%, rgba(246, 241, 231, 0));
}
.chrome a {
  pointer-events: auto;
  position: relative; z-index: 1;
  color: var(--ink); text-decoration: none;
  font-size: 0.66rem; letter-spacing: 0.16em;
  border-bottom: 1px solid transparent;
  padding: 0.75rem 0.5rem; margin: -0.75rem -0.5rem;
  visibility: visible;
  transition: color 400ms, opacity 400ms, visibility 0s, border-color 200ms;
}
.chrome a:hover { border-bottom-color: currentColor; }
body.on-cover .chrome-mark {
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: color 400ms, opacity 400ms, visibility 0s 400ms, border-color 200ms;
}
.nojs .chrome { position: absolute; }

/* ── The string ──────────────────────────────────────────────── */
.thread { pointer-events: none; }
.thread path {
  fill: none;
  stroke: var(--clay);
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.65;
}
.thread-seg {
  position: absolute; top: 0; left: var(--pad);
  width: var(--gw); height: 100%;
  z-index: 1;
}
/* armed by JS only when motion is allowed; default is fully unspooled */
.js .thread.arm path { stroke-dasharray: 1; stroke-dashoffset: var(--off, 1); }
.js .thread.arm.drawn path { transition: stroke-dashoffset 1.3s var(--ease); stroke-dashoffset: 0; }

/* ── The cover ───────────────────────────────────────────────── */
.cover {
  min-height: 100vh; min-height: 100svh;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  padding: 2.2rem var(--pad) 2.4rem;
  text-align: center;
  overflow: hidden; overflow: clip;
}
.thread-measured {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;
}
.steam-blob {
  position: absolute; z-index: 0; border-radius: 50%;
  width: 46vmax; height: 46vmax; opacity: 0.55;
  background: radial-gradient(closest-side, rgba(255, 253, 248, 0.95), rgba(246, 241, 231, 0) 70%);
}
.blob-1 { top: -12%; left: -10%; animation: drift-a 56s ease-in-out infinite alternate; }
.blob-2 { bottom: -16%; right: -12%; animation: drift-b 74s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate3d(5vw, 4vh, 0); } }
@keyframes drift-b { to { transform: translate3d(-4vw, -5vh, 0); } }

.imprint {
  display: flex; align-items: center; gap: 1.2rem; z-index: 2;
  color: var(--ink); font-size: 0.7rem; letter-spacing: 0.18em;
}
.imprint-rule { width: 3.5rem; height: 1px; background: var(--hairline); }

.cover-middle { align-self: center; z-index: 2; }
.mark { color: var(--ink); margin-bottom: 1.6rem; }
.mark-tie { fill: var(--clay); }
.cover-title {
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  margin-bottom: 1.8rem;
}
.cover-sub { max-width: 34rem; margin-inline: auto; font-size: 1.15rem; }

.cover-foot { display: flex; flex-direction: column; align-items: center; gap: 1rem; z-index: 2; }
.yarn { color: var(--ink); }
.begin {
  color: var(--clay); text-decoration: none;
  font-size: 0.7rem; letter-spacing: 0.2em;
  padding: 0.6rem 1rem 0.5rem; margin: -0.5rem -1rem;
  border-bottom: 1px solid transparent;
  transition: border-color 200ms;
}
.begin:hover { border-bottom-color: var(--clay); }

/* cover load-in */
.js .ld { opacity: 0; transform: translateY(16px); animation: ld-in 0.8s var(--ease) forwards; }
.js .ld-1 { animation-delay: 0.10s; }
.js .ld-2 { animation-delay: 0.22s; }
.js .ld-3 { animation-delay: 0.38s; }
.js .ld-4 { animation-delay: 0.54s; }
.js .ld-5 { animation-delay: 0.74s; }
@keyframes ld-in { to { opacity: 1; transform: none; } }

/* ── The page grid ───────────────────────────────────────────── */
.chapter, .interlude { position: relative; }
.book {
  position: relative;
  display: grid;
  grid-template-columns: var(--gw) minmax(0, 42rem) 1fr;
  column-gap: var(--colgap);
  max-width: 72rem;
  margin-inline: auto;
  padding: var(--pb) var(--pad);
}
.col { grid-column: 2; position: relative; z-index: 2; }

.label { color: var(--clay); margin-bottom: 1.3rem; }

.dropcap::first-letter {
  font-family: var(--serif); font-weight: 620;
  font-size: 3.3em; line-height: 0.8;
  float: left; color: var(--clay);
  padding: 0.08em 0.12em 0 0;
}

/* ── The gallery: work in mat frames, placards beneath ───────── */
.works {
  grid-column: 1 / -1;
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  gap: clamp(3.5rem, 7vw, 5.5rem);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}
.work {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: clamp(1.75rem, 4.5vw, 3rem) clamp(1.25rem, 4vw, 3rem) clamp(2rem, 4.5vw, 2.75rem);
  box-shadow: 0 20px 50px rgba(42, 36, 29, 0.08);
}
.placard { text-align: center; max-width: 36rem; margin: 6.2rem auto 0; }
.placard h3 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.placard p { color: var(--body-ink); font-size: 1.02rem; line-height: 1.55; }
.placard-link {
  display: inline-block; margin-top: 0.9rem;
  color: var(--clay); text-decoration: none;
  font-size: 0.68rem; letter-spacing: 0.16em;
  padding-bottom: 3px; border-bottom: 1px solid var(--hairline);
  transition: border-color 200ms;
}
.placard-link:hover { border-bottom-color: var(--clay); }

.plate { position: relative; width: min(56rem, 100%); margin-inline: auto; }

.frame-desktop {
  border: 1px solid var(--hairline); border-radius: 10px;
  overflow: hidden; background: #FBF8F1;
  box-shadow: 0 24px 60px rgba(42, 36, 29, 0.12);
  outline: 1px solid var(--hairline); outline-offset: 5px;
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease);
}
@media (hover: hover) {
  .plate:hover .frame-desktop { transform: translateY(-4px); box-shadow: 0 30px 70px rgba(42, 36, 29, 0.16); }
}

.frame-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 11px 14px; position: relative;
  border-bottom: 1px solid var(--hairline);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hairline); }
.frame-url {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 0.64rem; letter-spacing: 0.12em; color: var(--body-ink); text-transform: none;
}

.frame-mobile {
  position: absolute; right: -1%; bottom: -4.5rem;
  width: clamp(120px, 20%, 190px);
  aspect-ratio: 430 / 932;
  border: 1px solid var(--hairline); border-radius: 18px;
  overflow: hidden; background: #FBF8F1;
  box-shadow: 0 18px 50px rgba(42, 36, 29, 0.22);
}
.frame-mobile img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
/* the phone alternates sides down the wall */
.work:nth-of-type(even) .frame-mobile { left: -1%; right: auto; }

/* ── Interlude ───────────────────────────────────────────────── */
.interlude .book { padding-block: clamp(7rem, 18vh, 12rem); }
.interlude-col { grid-column: 1 / -1; text-align: center; z-index: 2; }
.interlude-rule { display: block; width: 3rem; height: 2px; background: var(--celadon); margin: 0 auto 2.2rem; }
.interlude-title {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.8rem, 4.5vw, 3rem); color: var(--ink);
  margin-bottom: 1.6rem; letter-spacing: 0;
  text-wrap: balance;
}
.interlude-body { max-width: 44ch; margin-inline: auto; font-size: 1.15rem; }

/* ── The four steps ──────────────────────────────────────────── */
.steps { list-style: none; margin-top: 2.6rem; }
.step { position: relative; padding: 2rem 0 2.1rem; }
.step + .step { border-top: 1px solid var(--hairline); }
.step h3 { font-size: 1.4rem; margin-bottom: 0.55rem; }
.step-num {
  position: absolute;
  left: calc(-1 * (var(--colgap) + var(--gw) / 2));
  transform: translateX(-50%);
  top: 2.35rem;
  color: var(--clay); opacity: 0.3;
  background: var(--paper);
  padding: 0.45rem 0;
  font-size: 0.8rem;
  transition: opacity 500ms ease;
}
.step-num.lit { opacity: 1; }
.steps-close {
  margin-top: 1.4rem; padding-top: 1.4rem;
  border-top: 1px solid var(--hairline);
  color: var(--body-ink); font-size: 0.66rem;
}

/* ── Fair questions ──────────────────────────────────────────── */
.faq-list { margin-top: 2.6rem; }
.faq-list details {
  background: var(--panel);
  border-top: 1px solid var(--hairline);
  padding-inline: 1.4rem;
}
.faq-list details:last-child { border-bottom: 1px solid var(--hairline); }
.faq-list summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1.2rem;
  padding-block: 1.15rem;
  cursor: pointer; list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.q {
  font-family: var(--serif); font-weight: 560; color: var(--ink);
  font-size: clamp(1.12rem, 2vw, 1.3rem); line-height: 1.3;
}
.plus { position: relative; width: 15px; height: 15px; flex: none; transition: transform 350ms var(--ease); }
.plus::before, .plus::after {
  content: ""; position: absolute; background: var(--clay);
  top: 50%; left: 0; width: 15px; height: 1.5px; margin-top: -0.75px;
}
.plus::after { transform: rotate(90deg); }
details[open] .plus { transform: rotate(45deg); }

/* the open attribute is the one source of truth; JS adds .closing
   only while animating shut (or for one frame to animate open) */
.aw { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 350ms ease; }
.a { overflow: hidden; }
.a .body-text { padding-bottom: 1.35rem; max-width: 38rem; }
details[open] .aw { grid-template-rows: 1fr; }
details.closing .aw { grid-template-rows: 0fr; }
details.closing .plus { transform: none; }

/* ── Say hello ───────────────────────────────────────────────── */
.contact {
  position: relative;
  min-height: 88vh; min-height: 88svh;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center;
  padding: clamp(6rem, 16vh, 11rem) var(--pad) 0;
}
.contact-col { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.contact-body { max-width: 40ch; margin-bottom: 2.6rem; }
.mail-wrap { position: relative; }
.mail-big {
  font-family: var(--serif); font-weight: 560;
  font-size: clamp(1.6rem, 5vw, 3.4rem);
  color: var(--ink); letter-spacing: -0.01em;
  text-decoration: underline;
  text-decoration-color: var(--clay);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
  transition: text-decoration-thickness 200ms;
}
.mail-big:hover, .mail-big:focus-visible { text-decoration-thickness: 4px; }
.about-link {
  display: inline-block; margin-top: 2.6rem;
  color: var(--body-ink); text-decoration: none;
  font-size: 0.7rem; letter-spacing: 0.18em;
  padding-bottom: 3px; border-bottom: 1px solid var(--hairline);
  transition: color 200ms, border-color 200ms;
}
.about-link:hover { color: var(--clay); border-bottom-color: var(--clay); }

.colophon {
  margin-top: clamp(6rem, 14vh, 9rem);
  margin-bottom: 2.6rem;
  width: min(46rem, 100%);
  border-block: 1px solid var(--hairline);
  padding: 1.4rem 1rem;
  font-style: italic; font-size: 0.95rem;
  color: var(--body-ink);
}

/* ── Reveal system ───────────────────────────────────────────── */
.js .rv {
  opacity: 0; transform: translateY(16px);
  transition: opacity 750ms var(--ease), transform 750ms var(--ease);
}
.js .rv.on { opacity: 1; transform: none; }
.js .work.rv { transition-duration: 900ms; }
.js .interlude-title.rv { transition-duration: 1000ms; }

/* ── Reduced motion: everything simply in place ──────────────── */
@media (prefers-reduced-motion: reduce) {
  .js .ld, .js .rv { animation: none; transition: none; opacity: 1; transform: none; }
  .steam-blob { animation: none; }
  .js .thread.arm path { stroke-dasharray: none; stroke-dashoffset: 0; transition: none; }
  .step-num { opacity: 1; transition: none; }
  .aw { transition: none; }
  .plus { transition-duration: 120ms; }
}

/* ── Smaller screens ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .book { grid-template-columns: var(--gw) minmax(0, 1fr); }
}
@media (max-width: 720px) {
  :root { --gw: 1.25rem; --colgap: 1rem; }
  /* the narrow gutter scales the svg x-axis by 0.25; compensate the stroke */
  .thread-seg path { stroke-width: 6; }
  .frame-mobile, .work:nth-of-type(even) .frame-mobile {
    position: static; width: 60%; margin: 1.4rem auto 0;
  }
  .placard { margin-top: 2rem; }
  .step-num { position: static; transform: none; display: inline-block; padding: 0; margin-bottom: 0.4rem; }
  .interlude-col { padding-inline: calc(var(--gw) + var(--colgap) + 0.5rem); }
}
@media (max-width: 480px) {
  body { font-size: 1.0625rem; }
  .chrome a { font-size: 0.6rem; }
  .imprint { gap: 0.8rem; }
  .imprint-rule { width: 2.2rem; }
  /* the imprint already says the name; keep the cover corner quiet */
  .js body.on-cover .chrome-mail {
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: color 400ms, opacity 400ms, visibility 0s 400ms, border-color 200ms;
  }
}

/* ── the editor list ─────────────────────────────────────────── */
.editor-list { list-style: none; margin: 1.8rem 0; max-width: 42rem; }
.editor-list li {
  position: relative; padding: 0.65rem 0 0.65rem 1.6rem;
  border-top: 1px solid var(--hairline);
}
.editor-list li:last-child { border-bottom: 1px solid var(--hairline); }
.editor-list li::before {
  content: ""; position: absolute; left: 0; top: 1.15rem;
  width: 7px; height: 7px; border-radius: 50%; background: var(--celadon);
}
.editor-list strong { color: var(--ink); font-weight: 600; }
