/* ============================================================================
   Bethany Mayes — portfolio
   Design system: A2, 1960s ad-agency print (see /DESIGNS.md)
   Monochrome editorial chrome · one spot colour (red) · work shown in colour.
   ========================================================================== */

/* --- Design tokens --------------------------------------------------------- */
:root {
  /* Colour — one spot colour: red. Aligned to the agent apps so demos drop in. */
  --paper: #f4f1ea;        /* warm newsprint — page background */
  --paper-deep: #ece6d9;   /* insets, dockets, coupons, masthead bar */
  --ink: #1d1a16;          /* near-black body + headlines (not pure black) */
  --ink-soft: #4a463e;     /* secondary text */
  --muted: #6b6459;        /* captions, metadata */
  --rule: #d9d2c5;         /* hairline rules, borders */
  --red: #c8341e;          /* THE spot colour */
  --red-deep: #a62a18;     /* red hover/active */
  --plate-mat: #ffffff;    /* white mount behind full-colour work plates */

  /* Type */
  --font-display: "Futura PT", "Jost", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Newsreader", Georgia, "Times New Roman", serif;

  /* Spacing scale (8px base) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  /* Layout */
  --measure: 66ch;
  --page-max: 1240px;
  --margin: clamp(24px, 6vw, 72px);
}

/* --- Reset / base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  /* faint paper tint — very low contrast, no heavy texture */
  background-image:
    radial-gradient(rgba(29, 26, 22, 0.018) 1px, transparent 1px);
  background-size: 3px 3px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.1875rem;        /* 19px */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* Selection in the spot colour */
::selection { background: var(--red); color: var(--paper); }

/* Skip link */
.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: var(--s2) var(--s4); z-index: 100;
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8125rem;
}
.skip:focus { left: var(--s4); top: var(--s4); }

/* Focus = a printed "registration box" */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* --- Layout ---------------------------------------------------------------- */
.wrap {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--margin);
}
.flow > * + * { margin-top: var(--s5); }

/* --- Header / masthead ----------------------------------------------------- */
.masthead {
  border-bottom: 1px solid var(--rule);
}
.masthead__bar {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s5); flex-wrap: wrap;
  padding-block: var(--s4);
}
.wordmark { text-decoration: none; }
.wordmark__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: block;
  line-height: 1;
}
.wordmark__role {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: var(--s2);
  display: block;
}
.nav { display: flex; gap: var(--s5); flex-wrap: wrap; }
.nav a {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--red); }
.nav a[aria-current="page"] { color: var(--red); }

/* --- Kicker label ---------------------------------------------------------- */
.kicker {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 var(--s4);
  display: inline-flex; align-items: center; gap: var(--s3);
}
.kicker::before {
  content: ""; width: 28px; height: 3px; background: var(--red); display: inline-block;
}

/* --- Headlines ------------------------------------------------------------- */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.25rem, 8vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin: 0;
}
h1, .h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.005em;
  margin: 0;
}
h2, .h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  line-height: 1.1;
  margin: 0;
}
.dek {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.4;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: var(--s5) 0 0;
}

/* --- Body copy ------------------------------------------------------------- */
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 var(--s5); }
.prose p:last-child { margin-bottom: 0; }
.prose em { font-style: italic; }
.prose strong { font-weight: 600; }

/* Drop cap on the first paragraph */
.dropcap > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-weight: 800;
  float: left;
  font-size: 3.6em;
  line-height: 0.8;
  padding: 0.05em 0.08em 0 0;
  color: var(--red);
}

/* Newspaper columns for long narrative */
.columns {
  column-width: 20rem;
  column-gap: var(--s7);
  max-width: 64rem;
}
.columns > p { margin: 0 0 var(--s5); break-inside: avoid-column; }

/* --- Pull quote ------------------------------------------------------------ */
.pull {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  line-height: 1.25;
  border-top: 3px solid var(--red);
  padding-top: var(--s4);
  margin: var(--s7) 0;
  max-width: 28ch;
}

/* --- Rules / ornaments ----------------------------------------------------- */
.rule { border: 0; border-top: 1px solid var(--rule); margin: var(--s7) 0; }
.rule--heavy { border-top-width: 3px; border-color: var(--ink); }
.ornament {
  text-align: center; color: var(--red); margin: var(--s8) 0;
  font-size: 1.2rem; letter-spacing: 0.5em;
}

/* --- Work plate (the colour insert) --------------------------------------- */
.plate { margin: var(--s7) 0; }
.plate__mount {
  background: var(--plate-mat);
  border: 1px solid var(--rule);
  padding: clamp(12px, 2vw, 28px);
  box-shadow: 6px 6px 0 var(--rule);   /* a single hard "registration" offset */
}
.plate__mount img { width: 100%; height: auto; }
.plate__caption {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: var(--s3);
}
.plate__caption::before { content: "— "; color: var(--red); }
.plate--feature .plate__mount { box-shadow: 10px 10px 0 var(--rule); }

/* --- Coupon CTA ------------------------------------------------------------ */
.coupon {
  display: inline-flex; align-items: center; gap: var(--s3);
  font-family: var(--font-display);
  font-size: 0.95rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none; color: var(--ink);
  background: var(--paper-deep);
  border: 2px dashed var(--ink);
  padding: var(--s3) var(--s5);
  position: relative;
  cursor: pointer;
}
.coupon::before { content: "\2702"; color: var(--red); font-size: 1rem; } /* scissors */
.coupon:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.coupon:hover::before { color: var(--paper); }

/* Secondary CTA — underlined link with a red arrow */
.link-arrow {
  font-family: var(--font-display);
  font-size: 0.95rem; letter-spacing: 0.04em; text-transform: uppercase;
  text-decoration: none; border-bottom: 2px solid var(--ink); padding-bottom: 2px;
}
.link-arrow::after { content: " \2192"; color: var(--red); }
.link-arrow:hover { border-bottom-color: var(--red); }

/* --- Docket (the brief, as a job spec) ------------------------------------- */
.docket {
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  padding: var(--s5);
  max-width: 34rem;
}
.docket__title {
  font-family: var(--font-display);
  font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--red); margin: 0 0 var(--s4);
}
.docket dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: var(--s3) var(--s5); }
.docket dt {
  font-family: var(--font-display);
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); padding-top: 0.25em;
}
.docket dd { margin: 0; font-size: 1rem; line-height: 1.45; }

/* --- Stat line ------------------------------------------------------------- */
.stats {
  display: flex; flex-wrap: wrap; gap: var(--s7);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: var(--s5) 0;
}
.stat__value {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 4vw, 3rem); line-height: 1; display: block;
}
.stat__label {
  font-family: var(--font-display);
  font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-top: var(--s2); display: block; max-width: 18ch;
}

/* --- Contents ("In this issue") -------------------------------------------- */
.contents { border-top: 3px solid var(--ink); }
.contents__row {
  display: grid; grid-template-columns: 3rem 1fr auto; align-items: baseline;
  gap: var(--s5); padding: var(--s5) 0; border-bottom: 1px solid var(--rule);
  text-decoration: none; color: var(--ink);
}
.contents__row:hover .contents__title { color: var(--red); }
.contents__no { font-family: var(--font-display); color: var(--red); font-size: 0.9rem; }
.contents__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.4rem, 2.6vw, 2rem); }
.contents__desc { font-style: italic; color: var(--ink-soft); max-width: 34ch; }

/* --- Page-turn (prev / next) ----------------------------------------------- */
.pageturn {
  display: flex; justify-content: space-between; gap: var(--s5);
  border-top: 1px solid var(--rule); margin-top: var(--s8); padding-top: var(--s5);
}
.pageturn a { text-decoration: none; font-family: var(--font-display); max-width: 45%; }
.pageturn a:hover .pageturn__title { color: var(--red); }
.pageturn__dir { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); display: block; }
.pageturn__title { font-weight: 600; font-size: 1.1rem; display: block; margin-top: var(--s2); }
.pageturn .next { text-align: right; margin-left: auto; }

/* --- Footer / colophon ----------------------------------------------------- */
.colophon {
  border-top: 3px solid var(--ink);
  margin-top: var(--s10);
  padding-block: var(--s7) var(--s8);
}
.colophon__grid { display: flex; flex-wrap: wrap; gap: var(--s7); justify-content: space-between; }
.colophon p { margin: 0; }
.colophon__imprint {
  font-family: var(--font-display);
  font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.colophon__imprint strong { color: var(--ink); }
.colophon__set { font-style: italic; color: var(--muted); font-size: 0.95rem; }

/* --- Sections -------------------------------------------------------------- */
.section { padding-block: var(--s9); }
.section--tight { padding-block: var(--s7); }

/* --- Hero (cover) ---------------------------------------------------------- */
.cover { padding-block: var(--s8) var(--s7); }
.cover__issue {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s4);
  font-family: var(--font-display); font-size: 0.8125rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--rule); padding-bottom: var(--s4); margin-bottom: var(--s7);
}

/* --- Motion: ink fade-in (progressive enhancement) ------------------------- */
/* The hidden initial state applies ONLY when JS is confirmed (html.js), so the
   page is fully visible if JS is disabled or fails to load. */
.reveal { transition: opacity 0.5s ease, transform 0.5s ease; }
.js .reveal { opacity: 0; transform: translateY(8px); }
.reveal.is-in { opacity: 1; transform: none; }

/* Cover headline line-by-line strike */
.display .line { display: block; }
.js .display .line { opacity: 0; transform: translateY(0.2em); }
.display.is-in .line { animation: strike 0.5s ease forwards; }
.display.is-in .line:nth-child(2) { animation-delay: 0.12s; }
.display.is-in .line:nth-child(3) { animation-delay: 0.24s; }
@keyframes strike { to { opacity: 1; transform: none; } }

/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 720px) {
  .masthead__bar { flex-direction: column; gap: var(--s4); }
  .nav { gap: var(--s4); }
  .columns { column-width: auto; column-count: 1; }
  .pageturn a { max-width: 48%; }
}

/* --- Reduced motion / data ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .reveal, .js .reveal { opacity: 1; transform: none; transition: none; }
  .display .line, .js .display .line { opacity: 1; transform: none; animation: none; }
}
@media (prefers-reduced-data: reduce) {
  body { background-image: none; }
}

/* ============================================================================
   Agent process diagram + replayable demo console + invite
   ========================================================================== */

/* --- Flow diagram (how an agent works) ------------------------------------ */
.flow-diagram {
  display: flex; align-items: stretch; gap: var(--s2);
  overflow-x: auto; padding-bottom: var(--s3); margin: var(--s5) 0;
}
.flow-step {
  flex: 0 0 auto; max-width: 12rem; line-height: 1.2; text-align: center;
  border: 1px solid var(--ink); background: var(--paper);
  padding: var(--s3) var(--s4);
  font-family: var(--font-display); font-size: 0.72rem;
  letter-spacing: 0.05em; text-transform: uppercase;
  display: flex; align-items: center; justify-content: center;
}
.flow-arrow { flex: 0 0 auto; align-self: center; color: var(--red); font-weight: 700; font-family: var(--font-display); }

/* --- Demo console ---------------------------------------------------------- */
.demo {
  border: 1px solid var(--rule); background: var(--plate-mat);
  box-shadow: 6px 6px 0 var(--rule); margin: var(--s6) 0;
}
.demo__head {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s4);
  border-bottom: 1px solid var(--rule); padding: var(--s3) var(--s4); background: var(--paper-deep);
}
.demo__label { font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.demo__replay {
  font-family: var(--font-display); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase;
  background: none; border: 1px solid var(--ink); padding: var(--s1) var(--s3); cursor: pointer; color: var(--ink);
}
.demo__replay:hover { background: var(--ink); color: var(--paper); }
.demo__replay:disabled { opacity: 0.4; cursor: default; background: none; color: var(--ink); }
.demo__body { padding: var(--s5); }
.demo__io-label { font-family: var(--font-display); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); margin: 0 0 var(--s2); }
.demo__prompt {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.95rem;
  background: var(--paper); border: 1px solid var(--rule); padding: var(--s3);
  min-height: 3.2em; white-space: pre-wrap;
}
.demo__prompt.typing::after { content: "\258b"; color: var(--red); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.demo__status {
  font-family: var(--font-display); font-size: 0.85rem; color: var(--muted);
  margin: var(--s5) 0 var(--s4); min-height: 1.4em; display: flex; align-items: center; gap: var(--s2);
}
.demo__spin { width: 10px; height: 10px; background: var(--red); display: inline-block; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.demo__out { display: flex; flex-direction: column; gap: var(--s4); }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s4); }
.demo-card { border: 1px solid var(--rule); background: var(--paper); padding: var(--s4); }
.demo-card h4 { font-family: var(--font-display); margin: 0 0 2px; font-size: 1.05rem; }
.demo-card .who { font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s3); }
.demo-card p { margin: var(--s2) 0; font-size: 0.95rem; }
.demo-card .gut { font-style: italic; }
.demo-line { font-family: var(--font-display); font-size: 0.8rem; margin: var(--s1) 0; }
.demo-line b { color: var(--muted); font-weight: 600; }
.demo-meta { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin-top: var(--s3); }
.badge { font-family: var(--font-display); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 9px; border-radius: 999px; display: inline-block; }
.badge.pos, .badge.good { background: #dfeede; color: #3f7d4e; }
.badge.mix, .badge.ok  { background: #f3e8c9; color: #9c7518; }
.badge.neg, .badge.high { background: #f3dada; color: #b03b3b; }
.badge.low { background: #dfeede; color: #3f7d4e; }
.badge.med { background: #f3e8c9; color: #9c7518; }
.demo-callout { border: 1px solid var(--rule); border-left: 3px solid var(--red); background: var(--paper-deep); padding: var(--s5); }
.demo-callout h4 { font-family: var(--font-display); margin: 0 0 var(--s3); font-size: 1.1rem; }
.demo-callout ul { margin: var(--s2) 0 0; padding-left: 18px; }
.demo-callout li { font-size: 0.95rem; margin: var(--s1) 0; }
.demo-cols { display: flex; gap: var(--s6); flex-wrap: wrap; }
.demo-cols > div { flex: 1 1 200px; }
.demo-rise { opacity: 0; transform: translateY(6px); transition: opacity 0.4s ease, transform 0.4s ease; }
.demo-rise.is-in { opacity: 1; transform: none; }
.demo__note { font-family: var(--font-display); font-size: 0.75rem; color: var(--muted); margin-top: var(--s3); }

/* --- Try it / invite ------------------------------------------------------- */
.tryit { display: flex; flex-wrap: wrap; gap: var(--s5); align-items: stretch; margin-top: var(--s7); }
.tryit > * { flex: 1 1 320px; }
.tryit__panel { border: 1px solid var(--rule); background: var(--paper-deep); padding: var(--s5); }
.tryit__panel h3 { font-family: var(--font-display); font-size: 0.8125rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--red); margin: 0 0 var(--s3); }
.invite__form { display: flex; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s4); }
.invite__form input {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; flex: 1 1 180px;
  border: 1px solid var(--rule); padding: var(--s3); background: #fff; font-size: 0.95rem;
}
.invite__msg { font-family: var(--font-display); font-size: 0.82rem; margin-top: var(--s3); color: var(--ink-soft); min-height: 1.2em; }

@media (prefers-reduced-motion: reduce) {
  .demo-rise { opacity: 1; transform: none; transition: none; }
  .demo__spin { animation: none; }
  .demo__prompt.typing::after { animation: none; }
}

/* --- Responsive video embed (Vimeo / YouTube) ----------------------------- */
.video-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--ink); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-embed__ph {
  position: absolute; inset: 0; margin: 0;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: var(--s5); color: var(--paper);
  font-family: var(--font-display); font-size: 0.9rem; letter-spacing: 0.06em; text-transform: uppercase;
}

/* --- Cover diptych: the old way / the way I work --------------------------- */
.diptych {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--rule);
  background: var(--card);
  margin: var(--s7) 0;
  box-shadow: 6px 6px 0 var(--rule);
}
.diptych__col { padding: clamp(20px, 3vw, 36px); }
.diptych__col--new { background: var(--paper-deep); border-left: 3px solid var(--red); }
.diptych__head {
  font-family: var(--font-display);
  font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase;
  margin: 0 0 var(--s4);
}
.diptych__col--old .diptych__head { color: var(--muted); }
.diptych__col--new .diptych__head { color: var(--red); }
.diptych ul { list-style: none; margin: 0; padding: 0; }
.diptych li {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
  line-height: 1.2;
  padding: var(--s4) 0;
  border-top: 1px solid var(--rule);
}
.diptych li:first-child { border-top: 0; padding-top: 0; }
.diptych__col--old li { color: var(--ink-soft); }
.diptych__col--new li { color: var(--ink); font-weight: 600; }
@media (max-width: 600px) {
  .diptych { grid-template-columns: 1fr; }
  .diptych__col--new { border-left: 0; border-top: 3px solid var(--red); }
}

/* --- Footer contact lines (email + phone) --------------------------------- */
.contact-lines {
  margin: 0 0 var(--s4);
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1.8;
}
.contact-lines a {
  color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.contact-lines a:hover { color: var(--red); border-bottom-color: var(--red); }

/* "See the demo" CTA — play glyph instead of the coupon scissors */
.coupon--demo::before { content: "\25B6"; } /* ▶ */
