/* Graham Theodore — a Bazaar-style spread.
   Photograph poses on the left page; type answers on the right.
   One seam runs down the centre, and the type crosses it. */

@font-face {
  font-family: "Bodoni Moda";
  src: url("../fonts/bodoni-moda-latin-opsz-normal.woff2") format("woff2-variations"),
       url("../fonts/bodoni-moda-latin-opsz-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bodoni Moda";
  src: url("../fonts/bodoni-moda-latin-opsz-italic.woff2") format("woff2-variations"),
       url("../fonts/bodoni-moda-latin-opsz-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Jost";
  src: url("../fonts/jost-latin-wght-normal.woff2") format("woff2-variations"),
       url("../fonts/jost-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f7f5f1;
  --fog: #d9d6d1;
  --gravure: #6f6e6b;      /* secondary text; 4.7:1 on paper */
  --charcoal: #2f2f2f;
  --ink: #0b0b0b;
  --lipstick: #b11e2a;     /* the one live colour */

  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --label: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;

  --gutter: clamp(1rem, 4vw, 4.5rem);
  --seam: 1px solid var(--fog);
  --step: clamp(4.5rem, 9vw, 8rem);   /* vertical rhythm between spreads */
  --seam-inset: clamp(2.5rem, 5vw, 6rem);
  --title-size: clamp(6rem, 11.5vw, 12rem);  /* desktop display titles */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--charcoal) var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-optical-sizing: auto;
  font-size: clamp(1.0625rem, 0.98rem + 0.3vw, 1.1875rem);
  line-height: 1.55;
  caret-color: var(--lipstick);
  text-rendering: optimizeLegibility;
}

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

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

cite { font-style: italic; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--lipstick);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--lipstick);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0.75rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--label);
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; }


/* Labels: Jost, small, tracked capitals */
.masthead-nav a,
.button,
.text-link,
.particulars dt,
.caption,
.copy-button,
.colophon {
  font-family: var(--label);
  font-size: 0.8125rem;
  font-weight: 450;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ---------- Spread scaffolding ---------- */

.spread {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.page {
  position: relative;
  padding-inline: var(--gutter);
}

.rule {
  display: block;
  width: 2.25rem;
  height: 2px;
  background: var(--lipstick);
}

/* ---------- Cover spread ---------- */

.cover-photo {
  margin: 0;
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 88svh;
  width: 100%;
  overflow: hidden;
  background: var(--fog);
}

.cover-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 53% 45%;
}

.spread--cover .page--answer {
  display: flex;
  flex-direction: column;
}

.masthead-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
}

/* The underline is a 1px lipstick rule that draws in from the left on hover. */
.masthead-nav a {
  display: inline-block;
  padding-block: 0.75rem;
  text-decoration: none;
  background: linear-gradient(var(--lipstick), var(--lipstick)) left bottom / 0 1px no-repeat;
}

.masthead-nav a:hover,
.masthead-nav a:focus-visible { background-size: 100% 1px; }

.nameplate {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-variation-settings: "opsz" 96;
  line-height: 0.86;
  letter-spacing: -0.025em;
}

.nameplate span { display: block; }

.cover-line {
  margin: 0 0 1.25rem;
  font-style: italic;
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.75rem);
  line-height: 1.3;
  max-width: 32ch;
  text-wrap: pretty;
}

.cover-copy .rule { margin-bottom: 1.75rem; }

.cover-actions {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
}

.button {
  display: inline-block;
  padding: 1.05rem 1.9rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
  transition: border-color 160ms ease-out, background-color 160ms ease-out;
}

.button:hover { border-bottom-color: var(--lipstick); background: var(--charcoal); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding-block: 0.75rem;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.5em;
}

.arrow { width: 0.45rem; height: 0.6rem; fill: var(--lipstick); }

/* The address, quietly, for visitors whose mail app doesn't open. */
.cover-address {
  margin: 0.5rem 0 0;
  font-size: 1rem;
  color: var(--charcoal);
}

.cover-address a {
  display: inline-block;
  padding-block: 0.6rem;
  overflow-wrap: anywhere;
}

.caption {
  margin: 0;
  color: var(--gravure);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
}

/* Phone and small tablet: photograph leads, name set into its sky.
   (Phones held sideways are too short for this; they get a small spread below.) */
@media (max-width: 59.99rem) and (orientation: portrait),
       (max-width: 59.99rem) and (min-height: 32.01rem) {
  .spread--cover { padding-bottom: var(--step); }

  .cover-photo { max-height: none; aspect-ratio: 4 / 5; }

  .spread--cover .page--answer { display: contents; }

  .masthead-nav {
    order: -1;
    padding: 0.5rem var(--gutter);
    border-bottom: var(--seam);
  }

  .masthead-nav ul { justify-content: space-between; gap: 0.5rem 1rem; }

  .nameplate {
    position: absolute;
    top: calc(var(--nav-h, 3.1rem) + 1.25rem);
    left: var(--gutter);
    right: var(--gutter);
    font-size: clamp(3.2rem, 18vw, 7rem);
  }

  .nameplate-last { padding-left: 0.12em; }

  .cover-copy { padding: 1.75rem var(--gutter) 0; }

  .caption { padding: 1rem var(--gutter) 0; order: 0; }
  .cover-photo { order: -1; }
  .masthead-nav { order: -2; }
}

/* Phones held sideways: the cover becomes a small two-page spread, photograph
   left and name right, so the name, the line and the button share one screen.
   The surname still steps back across the seam onto the sky. */
@media (max-width: 59.99rem) and (orientation: landscape) and (max-height: 32rem) {
  .spread--cover {
    --seam-inset: 2rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100svh;
  }

  .cover-photo { aspect-ratio: auto; max-height: none; }
  .cover-photo img { position: absolute; inset: 0; }

  .spread--cover .page--answer {
    display: flex;
    flex-direction: column;
    padding: 0.25rem 1rem 1rem var(--seam-inset);
  }

  .masthead-nav ul { justify-content: flex-end; gap: 0 1rem; }

  .nameplate {
    margin-top: 0.25rem;
    font-size: clamp(2.75rem, 13svh, 4rem);
  }

  .nameplate-first { padding-left: 0.4em; }

  .nameplate-last {
    margin-left: calc(-1 * var(--seam-inset) - 1.1em);
    position: relative;
  }

  .cover-copy { padding-top: 0.75rem; }
  .cover-line { margin-bottom: 0.5rem; }
  .cover-copy .rule { margin-bottom: 1rem; }
  .cover-actions { gap: 0.25rem 1rem; }
  .button { padding: 0.85rem 1.4rem; }
  .cover-address { margin-top: 0; }

  .caption { margin-top: auto; padding-top: 0.5rem; }
}

/* Upright tablets: shorten the photograph so the line and the button make the first screen. */
@media (min-width: 36rem) and (max-width: 59.99rem) and (orientation: portrait) {
  .cover-photo { max-height: 64svh; }
  .cover-photo img { object-position: 53% 30%; }
}

/* Desktop: a true two-page spread */
@media (min-width: 60rem) {
  .spread {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .spread::after {
    content: "";
    position: absolute;
    inset-block: 0;
    left: 50%;
    border-left: var(--seam);
    pointer-events: none;
  }

  .spread--cover {
    height: min(100svh, 62rem);
    min-height: 36rem;
  }

  .spread--cover::after { display: none; }

  .cover-photo {
    aspect-ratio: auto;
    max-height: none;
    min-height: 0;
  }

  .cover-photo img {
    position: absolute;
    inset: 0;
  }

  .spread--cover .page--answer {
    padding-top: 2rem;
    padding-bottom: 2.5rem;
    padding-left: var(--seam-inset);
  }

  .masthead-nav ul { justify-content: flex-end; }

  /* Capped by height too, so on short laptop windows the surname stays in the sky
     instead of dropping onto the rooftops. */
  .nameplate {
    margin-top: clamp(0.5rem, 3svh, 2.5rem);
    font-size: clamp(4.5rem, min(9.2vw, 16svh), 10.5rem);
  }

  .nameplate-first { padding-left: 0.4em; }

  /* The signature move: the surname steps back across the seam onto the photograph's sky. */
  .nameplate-last {
    margin-left: calc(-1 * var(--seam-inset) - 1.1em);
    position: relative;
  }

  .cover-copy {
    padding-top: clamp(2rem, 7svh, 4.5rem);
    max-width: 32rem;
  }

  .caption {
    margin-top: auto;
    padding-top: 2rem;
  }
}

/* ---------- The novel ---------- */

.spread--novel,
.spread--about,
.spread--contact {
  padding-block: var(--step);
  border-top: var(--seam);
}

.novel-title,
.contact-title {
  margin: 0 0 2rem;
  font-weight: 400;
  font-variation-settings: "opsz" 96;
  font-size: clamp(3.6rem, 15vw, 9.5rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
}

/* Arrival mark: when a visitor jumps to a spread, a short lipstick rule
   draws under its title, so they can see where they landed. */
.novel-title::after,
.section-title::after,
.contact-title::after {
  content: "";
  display: block;
  width: 2.25rem;
  height: 2px;
  margin-top: 1.1rem;
  background: var(--lipstick);
  transform: scaleX(0);
  transform-origin: left center;
}

[data-arrived] .novel-title::after,
[data-arrived] .section-title::after,
[data-arrived] .contact-title::after { transform: none; }

.particulars {
  margin: 0 0 3rem;
  display: grid;
  gap: 0;
  max-width: 22rem;
}

.particulars div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  column-gap: 1rem;
  align-items: baseline;
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--fog);
}

.particulars div:first-child { border-top: 1px solid var(--ink); }

.particulars dt { color: var(--gravure); font-size: 0.75rem; }
.particulars dd { margin: 0; font-size: 1.0625rem; }

.hook {
  margin: 0 0 2.5rem;
  font-variation-settings: "opsz" 60;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.prose { max-width: 34rem; }
.prose p { margin: 0 0 1.1em; text-wrap: pretty; }
.prose p:last-child { margin-bottom: 0; }

/* Margin notes, written as the novel's billing entries */
.entry {
  margin: 2.5rem 0 0;
  max-width: 30rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--fog);
  color: var(--charcoal);
  font-style: italic;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.entry-head {
  color: var(--charcoal);
  font-family: var(--label);
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.entry-head:first-child { margin-right: 0.5em; }
/* No left margin: when the head wraps to its own line it must not start indented. */
.entry-head:last-child:not(:first-child) { color: var(--lipstick); }

@media (min-width: 60rem) {
  .spread--novel .page--pose { padding-right: 0; }

  /* The title runs across the seam, as a headline crosses the gutter. */
  .novel-title {
    position: relative;
    z-index: 1;
    width: max-content;
    max-width: none;
    font-size: var(--title-size);
    padding-left: 0.05em;
  }

  .spread--novel .page--answer {
    padding-top: clamp(9rem, 15vw, 15rem);
    padding-left: var(--seam-inset);
  }

  .spread--novel .particulars { margin-top: 1rem; }
}

/* ---------- About ---------- */

.section-title {
  margin: 0 0 1.75rem;
  font-weight: 400;
  font-variation-settings: "opsz" 96;
  font-size: clamp(2.75rem, 2rem + 3.5vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

@media (min-width: 60rem) {
  .spread--about .page--pose { padding-right: var(--seam-inset); }
  .spread--about .page--answer {
    padding-top: 0.6rem;
    padding-left: var(--seam-inset);
  }
}

/* ---------- Contact ---------- */

.contact-lead { margin: 0 0 0.5rem; text-wrap: pretty; }

.contact-address {
  margin: 0 0 1.25rem;
  font-variation-settings: "opsz" 48;
  font-size: clamp(1.35rem, 0.9rem + 2.4vw, 2.6rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.contact-address a {
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background-color 700ms ease-out, color 700ms ease-out;
}

/* On a successful copy the address inks in, as if just selected, then fades back. */
.contact-address a.is-copied {
  background-color: var(--ink);
  color: var(--paper);
  transition: none;
}

.contact-tools {
  margin: 0 0 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  min-height: 2.75rem;
}

.copy-button {
  appearance: none;
  margin: 0;
  padding: 0.85rem 1.4rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  transition: border-color 160ms ease-out, color 160ms ease-out;
}

.copy-button:hover { border-color: var(--lipstick); }
.copy-button[data-state="done"] { border-color: var(--lipstick); color: var(--lipstick); }

.copy-status {
  font-style: italic;
  color: var(--charcoal);
}

/* Success is announced to screen readers; the button already shows it. */
.copy-status.is-quiet {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 60rem) {
  .spread--contact .page--pose { padding-right: 0; }

  /* "Contact" sets flush to the seam and its last letters step across it,
     over the space the answer leaves open. */
  .contact-title {
    position: relative;
    z-index: 1;
    width: max-content;
    max-width: none;
    margin-left: auto;
    margin-right: -1.15em;
    font-size: var(--title-size);
  }

  .spread--contact .page--answer {
    padding-top: calc(var(--title-size) * 0.9 + 3.5rem);
    padding-left: var(--seam-inset);
  }

  .contact-address { font-size: clamp(1.35rem, 1.9vw, 2.1rem); }
}

/* ---------- Colophon ---------- */

.colophon {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 1.5rem var(--gutter) 2rem;
  border-top: 1px solid var(--ink);
  color: var(--gravure);
  font-size: 0.6875rem;
}

.colophon p { margin: 0; }

/* ---------- Motion ----------
   Movement only where it explains something: where you landed, what you're
   pointing at. Colour changes stay under reduced motion; movement does not. */

@media (prefers-reduced-motion: no-preference) {
  .masthead-nav a { transition: background-size 280ms var(--ease-out); }

  .arrow { transition: transform 200ms var(--ease-out); }
  .text-link:hover .arrow,
  .text-link:focus-visible .arrow { transform: translateX(0.25rem); }

  [data-arrived] .novel-title::after,
  [data-arrived] .section-title::after,
  [data-arrived] .contact-title::after {
    transition: transform 520ms var(--ease-out);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
