/* Nuark — pages from an old book nobody finished. Mobile-first, no framework.
   One scroll; each section is meant to feel like a leaf of a book:
   wide margins, a small-caps running head, hairline rules, no boxes. */

:root {
  --bg: #0f0e0d;
  --bg-vignette: #141210;
  --gold: #c9a96a;
  --gold-tarnished: #9f8c68;
  --gold-dim: #b9975b;
  --cream: #e7e0cd;
  --muted: #a89a82;
  --brown: #4d4234;
  --brown-line: #6e5f48;
  --rule: rgba(110, 95, 72, 0.5);
  --error: #c98a6a;
  --focus: #d8ba7e;
  --gutter: 20px;
  --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --caps: 'Cormorant SC', 'EB Garamond', Georgia, serif;
}

/* Dark is the only mode this brand has: declared always, so form controls,
   scrollbars and autofill paint dark whatever the visitor's system prefers. */
:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  /* plain ground everywhere; the soft vignette belongs to the cover only */
  background-color: var(--bg);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
}

main {
  position: relative;
  z-index: 1;
  display: block;
}

/* ---------- the cover ---------- */

.cover {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px var(--gutter) 28px;
  /* The place the book comes from: a moonlit wood (Anthonie Waterloo, after 1648,
     Cleveland Museum of Art 2019.16, CC0), dimmed so the type stays readable. */
  background:
    linear-gradient(to bottom, rgba(15,14,13,0.30) 0%, rgba(15,14,13,0.72) 34%, rgba(15,14,13,0.90) 66%, var(--bg) 100%),
    url("img/world-forest-m.jpg") center top / cover no-repeat,
    var(--bg);
}

@media (min-width: 700px) {
  .cover {
    background:
      linear-gradient(to bottom, rgba(15,14,13,0.34) 0%, rgba(15,14,13,0.74) 40%, rgba(15,14,13,0.92) 72%, var(--bg) 100%),
      url("img/world-forest.jpg") center top / cover no-repeat,
      var(--bg);
  }
}

.cover-inner {
  width: 100%;
  min-width: 0;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.mark {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

.sigil {
  width: min(34vw, 116px);
  height: auto;
  display: block;
  margin: 0 0 22px;
}

.wordmark {
  width: min(72vw, 260px);
  height: auto;
  display: block;
}

.lede {
  width: 100%;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--cream);
  max-width: 38ch;
  overflow-wrap: break-word;
  text-wrap: balance;
  margin: 0 0 32px;
}

.cover-note {
  margin: 20px 0 0;
  font-size: 1rem;
  font-style: italic;
  color: var(--muted);
}

.picked-note {
  margin: 10px 0 0;
  font-size: 1rem;
  color: var(--muted);
}

.picked-note a {
  color: var(--gold);
  text-underline-offset: 3px;
}

/* the small "turn the page" cue under the cover */
.turn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 26px;
  padding: 8px 14px 0;
  font-family: var(--caps);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  color: var(--gold-tarnished);
  text-decoration: none;
  transition: color 0.25s ease;
}

.turn::after {
  content: "";
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--gold-tarnished), rgba(159, 140, 104, 0));
}

.turn:hover {
  color: var(--gold);
}

/* ---------- forms (opening + "join the list" share all of this) ---------- */

.join {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.join-wrap {
  width: 100%;
  max-width: 340px;
}

.join-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
}

.field {
  width: 100%;
}

.email {
  width: 100%;
  min-height: 52px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--brown-line);
  border-radius: 0;
  color: var(--cream);
  font-family: inherit;
  font-size: 1.1rem;
  font-style: italic;
  padding: 14px 2px 15px;
  text-align: center;
  transition: border-color 0.25s ease;
}

.email::placeholder {
  color: var(--muted);
  opacity: 0.9;
}

.email:hover {
  border-bottom-color: var(--gold-tarnished);
}

.email:focus {
  outline: none;
  border-bottom-color: var(--gold);
}

/* browser autofill paints a pale box by default; keep the field on the dark ground.
   Two separate rules on purpose: a browser that does not know one selector would
   otherwise throw away the whole rule. */
.email:-webkit-autofill {
  -webkit-text-fill-color: var(--cream);
  caret-color: var(--cream);
  box-shadow: 0 0 0 100px var(--bg) inset;
  transition: background-color 99999s ease-out 0s;
}

.email:autofill {
  -webkit-text-fill-color: var(--cream);
  caret-color: var(--cream);
  box-shadow: 0 0 0 100px var(--bg) inset;
  transition: background-color 99999s ease-out 0s;
}

/* Honeypot: in the DOM for bots, off-screen, unreachable by tab,
   hidden from assistive tech. Never shown to real visitors. */
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  left: -9999px;
  top: -9999px;
}

button[type="submit"] {
  appearance: none;
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: 0;
  color: var(--gold);
  font-family: var(--caps);
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  min-height: 50px;
  padding: 13px 20px;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}

button[type="submit"]:hover {
  border-color: var(--gold);
  background: rgba(201, 169, 106, 0.08);
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: default;
}

.email:focus-visible,
button:focus-visible,
a:focus-visible,
.strip:focus-visible,
.choice input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.form-status {
  min-height: 1.3em;
  margin: 14px 0 0;
  font-size: 0.98rem;
  color: var(--muted);
  text-align: center;
}

.form-status[data-tone="error"] {
  color: var(--error);
}

.success {
  margin: 0;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--gold);
  max-width: 32ch;
  text-align: center;
}

.success:focus {
  outline: none;
}

/* the optional question: quiet radios, no default */

.ask {
  min-width: 0;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.ask legend {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 6px;
  text-align: center;
  font-size: 1.18rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--cream);
}

.opt {
  display: inline-block;
  margin-left: 0.5em;
  font-family: var(--caps);
  font-style: normal;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  color: var(--gold-tarnished);
}

.choices {
  margin: 0 auto;
  max-width: 20rem;
}

.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(110, 95, 72, 0.35);
  text-align: left;
  cursor: pointer;
}

.choice:last-child {
  border-bottom: 0;
}

.choice input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  display: grid;
  place-content: center;
  width: 20px;
  height: 20px;
  margin: 0;
  background: transparent;
  border: 1px solid var(--gold-tarnished);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.choice input::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  transform: scale(0);
  transition: transform 0.2s ease;
}

.choice input:checked {
  border-color: var(--gold);
}

.choice input:checked::before {
  transform: scale(1);
}

.choice span {
  transition: color 0.2s ease;
}

.choice:hover span,
.choice input:checked + span {
  color: var(--gold);
}

.ask-why {
  margin: 12px 0 0;
  font-size: 1rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.clear-choice {
  display: block;
  margin: 2px auto 0;
  min-height: 44px;
  padding: 8px 14px;
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 1rem;
  color: var(--gold-tarnished);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.clear-choice:hover {
  color: var(--gold);
}

/* ---------- a leaf of the book (every section after the cover) ---------- */

.folio {
  padding: clamp(72px, 16vw, 136px) var(--gutter) 0;
  max-width: 62rem;
  margin: 0 auto;
}

.folio-last {
  padding-bottom: clamp(72px, 14vw, 120px);
}

/* the running head: small caps between two hairlines, like the top of a page */
.runhead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0 0 30px;
  font-family: var(--caps);
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 1.3;
  letter-spacing: 0.15em;
  text-align: center;
  white-space: nowrap;
  color: var(--gold-tarnished);
}

.runhead::before,
.runhead::after {
  content: "";
  /* the hairlines give way first, so a heading never wraps just to keep them */
  flex: 0 100 56px;
  min-width: 0;
  height: 1px;
  background: var(--rule);
}

.lead {
  max-width: 22ch;
  margin: 0 auto 0.9em;
  font-size: clamp(1.45rem, 5.6vw, 1.95rem);
  font-style: italic;
  line-height: 1.3;
  text-align: center;
  text-wrap: balance;
  color: var(--cream);
}

.prose {
  max-width: 34rem;
  margin: 0 auto;
  text-align: center;
  text-wrap: pretty;
}

/* ---------- the four pages ---------- */

.pages {
  margin-top: clamp(44px, 9vw, 72px);
}

/* One page of the book: title, line, picture, caption. The title sits close above its
   own picture (22px) and a long way (72-112px) below the previous picture, so a title can
   never read as the label of the picture above or below it. */
.leaf {
  display: flex;
  flex-direction: column;
  max-width: 30rem;
  margin: 0 auto clamp(72px, 16vw, 112px);
  scroll-margin-top: 28px;
}

.leaf-fig {
  margin: 0;
}

.leaf-fig img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #1a1815;
}

.plate-cap {
  margin: 10px 0 0;
  font-size: 0.95rem;
  font-style: italic;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.leaf-text {
  margin: 0 0 22px;
  text-align: center;
}

.leaf-title {
  margin: 0 0 0.4em;
  font-family: var(--caps);
  font-weight: 500;
  font-size: clamp(1.7rem, 7.4vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: var(--gold);
}

.leaf-line {
  max-width: 27ch;
  margin: 0 auto;
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.5;
  text-wrap: balance;
  color: var(--cream);
}

/* a quiet next step under each page, for a visitor who landed on one page from a link */
.leaf-join {
  margin: 4px 0 0;
}

.leaf-join a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  font-family: var(--caps);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  color: var(--gold-tarnished);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: color 0.25s ease;
}

.leaf-join a:hover {
  color: var(--gold);
}

/* ?page=<slug>: a small eight-point gold star beside the title */
.leaf.is-picked .leaf-title::before {
  content: "";
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  margin-right: 0.5em;
  vertical-align: 0.06em;
  background: var(--gold);
  clip-path: polygon(50.0% 0.0%, 53.1% 42.6%, 71.9% 28.1%, 57.4% 46.9%, 100.0% 50.0%, 57.4% 53.1%, 71.9% 71.9%, 53.1% 57.4%, 50.0% 100.0%, 46.9% 57.4%, 28.1% 71.9%, 42.6% 53.1%, 0.0% 50.0%, 42.6% 46.9%, 28.1% 28.1%, 46.9% 42.6%);
}

/* ---------- a little closer (detail strip) ---------- */

.closer {
  margin-top: clamp(8px, 4vw, 32px);
}

.closer-h {
  margin: 0;
  font-family: var(--caps);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--gold);
}

.closer-note {
  margin: 4px 0 26px;
  font-size: 1rem;
  font-style: italic;
  text-align: center;
  color: var(--muted);
}

/* phone: a swipeable strip, the next print peeks in from the right */
.strip {
  display: flex;
  gap: 14px;
  margin: 0 calc(var(--gutter) * -1);
  padding: 4px var(--gutter) 22px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--brown-line) transparent;
}

.strip figure {
  flex: 0 0 74%;
  max-width: 20rem;
  margin: 0;
  scroll-snap-align: start;
}

.strip img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #1a1815;
}

.strip figcaption {
  margin-top: 8px;
  font-size: 0.98rem;
  font-style: italic;
  color: var(--muted);
}

/* ---------- the shirt (a calm list, hairlines between) ---------- */

.spec {
  max-width: 32rem;
  margin: clamp(32px, 7vw, 48px) auto 0;
  border-bottom: 1px solid var(--rule);
}

.spec > div {
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1fr);
  column-gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
}

.spec dt {
  padding-top: 0.12em;
  font-family: var(--caps);
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  color: var(--gold-tarnished);
}

.spec dd {
  margin: 0;
}

/* ---------- join the list ---------- */

.join-main {
  margin-top: clamp(30px, 7vw, 44px);
}

.join-main .join-wrap {
  max-width: 360px;
}

/* ---------- after you join ---------- */

.plain {
  max-width: 32rem;
  margin: 0 auto;
}

.plain p {
  margin: 0 0 1.3em;
}

.plain p:last-child {
  margin-bottom: 0;
}

.plain strong {
  font-family: var(--caps);
  font-weight: 600;
  font-size: 1.12em;
  letter-spacing: 0.06em;
  color: var(--gold);
}

/* ---------- footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  padding: 8px var(--gutter) 40px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted);
}

.site-footer .fine {
  margin: 0;
}

.site-footer .links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer .links li + li::before {
  content: "·";
  padding: 0 2px;
  color: var(--brown-line);
}

.site-footer .links li {
  display: flex;
  align-items: center;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.25s ease;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--gold);
}

/* ---------- utility ---------- */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- motion (all of it respects prefers-reduced-motion) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .fade-in {
    animation: fadeUp 1.3s ease-out both;
  }

  /* leaves ease in as they enter the screen; browsers without
     scroll-driven animations simply show everything at once */
  @supports (animation-timeline: view()) {
    .reveal {
      animation: fadeUp linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- small screens: keep the footer links on their own tidy lines ---------- */

@media (max-width: 359px) {
  .runhead {
    gap: 10px;
    font-size: 1rem;
    letter-spacing: 0.1em;
  }

  .spec > div {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2px;
  }
}

/* ---------- tablet ---------- */

@media (min-width: 640px) {
  :root { --gutter: 28px; }

  .cover {
    padding: 64px var(--gutter) 40px;
  }

  .cover-inner {
    max-width: 560px;
  }

  .sigil {
    width: 128px;
    margin-bottom: 26px;
  }

  .wordmark {
    width: 300px;
  }

  .lede {
    font-size: 1.2rem;
    margin-bottom: 38px;
  }

  .join-wrap {
    max-width: 380px;
  }

  .strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 24px;
    margin: 0;
    padding: 0;
    overflow: visible;
    scroll-snap-type: none;
  }

  .strip figure {
    max-width: none;
  }
}

/* ---------- desktop: a two-page spread, alternating sides ---------- */

@media (min-width: 900px) {
  .leaf {
    display: grid;
    grid-template-columns: minmax(0, 27rem) minmax(0, 1fr);
    column-gap: clamp(3rem, 6vw, 5.5rem);
    align-items: center;
    max-width: 58rem;
  }

  .leaf-fig {
    grid-column: 1;
    grid-row: 1;
  }

  .leaf-text {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    text-align: left;
  }

  .leaf-line {
    margin: 0;
  }

  .leaf:nth-child(even) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 27rem);
  }

  .leaf:nth-child(even) .leaf-fig {
    grid-column: 2;
  }

  .leaf:nth-child(even) .leaf-text {
    grid-column: 1;
    text-align: right;
  }

  .leaf:nth-child(even) .leaf-line {
    margin-left: auto;
  }

  .strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
  }
}

/* ---------- plain pages (privacy.html) share this stylesheet ---------- */

.doc {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: 56px var(--gutter) 40px;
  text-align: left;
  line-height: 1.7;
}

.doc h1 {
  margin: 0 0 0.9em;
  font-family: var(--caps);
  font-weight: 500;
  font-size: 1.9rem;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.doc h2 {
  margin: 2em 0 0.5em;
  font-family: var(--caps);
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: 0.12em;
  color: var(--gold-tarnished);
}

.doc p,
.doc ul {
  margin: 0 0 1.1em;
}

.doc ul {
  padding-left: 1.2em;
}

.doc li {
  margin-bottom: 0.4em;
}

.doc a {
  color: var(--gold);
  text-underline-offset: 3px;
}

.doc .back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 1.4em;
  color: var(--muted);
}

.doc .back:hover,
.doc .back:focus-visible {
  color: var(--gold);
}
