/* ==========================================================================
   pages.css — About, Contact, the free reading, and the legal set.
   Feature layer only. Colour and type come from tokens.css; component
   primitives (.panel .btn .field .note .prose …) come from dea.css.
   Nothing here hard-codes a colour.
   ========================================================================== */

/* ------------------------------------------------------------------ hero */
.pg-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--color-haze);
  padding-block: clamp(2.75rem, 8vw, var(--space-9)) clamp(2.25rem, 5vw, var(--space-8));
}
.pg-hero__inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: var(--space-4);
  max-width: 54rem;
}
.pg-hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); }

/* The single crimson bolt. One per composition — do not add a second. */
.pg-hero__mark {
  position: absolute; top: 50%; right: -1.5vw; translate: 0 -50%;
  width: clamp(7rem, 19vw, 17rem); aspect-ratio: 1 / 2;
  background: var(--color-bolt);
  opacity: .12;
  clip-path: polygon(72% 0, 26% 0, 6% 53%, 42% 53%, 26% 100%, 98% 41%, 58% 41%);
  pointer-events: none;
}
@media (max-width: 44rem) { .pg-hero__mark { opacity: .07; right: -14vw; } }

/* --------------------------------------------------------------- columns */
.pg-cols {
  display: grid;
  gap: clamp(var(--space-5), 4vw, var(--space-7));
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 62rem) {
  .pg-cols { grid-template-columns: minmax(0, 1fr) minmax(21rem, 26rem); }
}
/* Pinned only when it fits. The free-reading form is 874px tall; pinned under the
   masthead its submit button sat at 901px — below the fold on every laptop screen
   up to ~960px tall — and stayed there while the rest of the page scrolled past. A
   column that cannot show its own button should scroll with the page instead. */
@media (min-width: 62rem) and (min-height: 61rem) {
  .pg-sticky { position: sticky; top: calc(var(--masthead-h, 4.25rem) + 1.25rem); }
}

/* ------------------------------------------------------------------ form */
.pg-form { display: flex; flex-direction: column; gap: var(--space-4); }
.pg-form__head {
  display: flex; flex-direction: column; gap: .3rem;
  padding-bottom: var(--space-3); border-bottom: 1px solid var(--color-haze);
}
.pg-form__head h2 { font-size: var(--scale-step-2); }
.pg-row { display: grid; gap: var(--space-3); grid-template-columns: 1fr 1fr; }
@media (max-width: 30rem) { .pg-row { grid-template-columns: 1fr; } }
/* Carries the support address on /contact as bare text rather than a link, so
   the mailto rule in dea.css does not reach it — and tracked-out uppercase mono
   makes the address wider still. It spilled its panel by 12px at 320px. */
.pg-optional {
  font-family: var(--font-mono); font-size: .62rem;
  letter-spacing: var(--tracking-mono-label); text-transform: uppercase;
  color: var(--color-dusk); overflow-wrap: anywhere;
}

/* Off-screen, not display:none — a bot fills it, a person never sees it. */
.pg-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.pg-consent {
  display: grid; grid-template-columns: auto 1fr; gap: .7rem; align-items: start;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-haze); border-radius: var(--radius-sm);
  background: var(--color-sand);
  font-size: .9rem; line-height: 1.5; color: var(--color-ink);
}
.pg-consent input[type="checkbox"] { width: auto; margin: .2rem 0 0; accent-color: var(--color-bolt); }
.pg-consent--invalid { border-color: var(--color-bolt); }

.pg-trust { list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .35rem .9rem;
  font-family: var(--font-mono); font-size: .62rem;
  letter-spacing: var(--tracking-mono-label); text-transform: uppercase;
  color: var(--color-dusk);
}
.pg-trust li { display: flex; align-items: center; gap: .9rem; }
.pg-trust li + li::before { content: "·"; color: var(--color-sun-ink); }

/* ----------------------------------------------------- form texture band */
/* terracotta-grain is a 960x408 band, so it is used as one. It sits BEHIND the
   form panel as a cap: a couple of rem of it show above the panel's top edge
   and the rest runs underneath, where the panel's opaque --color-shell hides
   it completely. Nothing is ever set over the texture, and no input is asked
   to be legible on top of a photograph. Forcing this image into a tall frame
   instead crops it to roughly a fifth of its width and it stops being a
   texture — it becomes a flat orange block. */
.pg-formband { position: relative; isolation: isolate; padding-top: 2.25rem; }
.pg-formband__grain {
  position: absolute;
  inset: 0 0 auto 0;
  height: 7rem;
  z-index: -1;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--color-dune);   /* what shows before the texture decodes */
}
.pg-formband__grain img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 42%;
  display: block;
}
/* A little of the page's own ground mixed back in, so the band reads as a
   warm note under the panel rather than a second brand colour. */
.pg-formband__grain::after {
  content: "";
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--color-sand) 22%, transparent);
}
/* Stacked, the column gap is the only thing between the prose above and the
   band's exposed cap, and the last line of the FAQ was measured sitting 3px
   into it. Clearance so no body copy ever lands on the texture. */
@media (max-width: 62rem) {
  .pg-formband { margin-top: var(--space-5); }
}

/* --------------------------------------------------------- texture strip */
/* The contact page's entire photographic budget: one narrow band of terracotta
   grain, set to the content measure rather than full bleed so it reads as a
   rule with a texture in it instead of a coloured bar across the browser.
   Nothing is ever set over it, so there is no contrast case to answer. */
.pg-strip {
  position: relative;
  width: min(72rem, 100% - 2.5rem);
  margin-inline: auto;
  height: clamp(0.9rem, 1.7vw, 1.3rem);
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-dune);   /* what shows before the texture decodes */
  /* Hugs the hero's bottom hairline rather than floating in the gap below
     it, so it reads as the close of the header and not as a bar of its own. */
  margin-block: 0 clamp(1.5rem, 4vw, 2.5rem);
}
.pg-strip img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 30%;
  display: block;
}
/* Same wash as the form band, for the same reason: the raw terracotta is
   louder than anything else in this palette and would read as a second brand
   colour rather than a warm note. */
.pg-strip::after {
  content: "";
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--color-sand) 30%, transparent);
}

/* ----------------------------------------------------------- confirmation */
.pg-confirm {
  border: 1px solid var(--color-sun); border-radius: var(--radius-md);
  background: linear-gradient(160deg, var(--color-dune), var(--color-shell));
  padding: clamp(var(--space-5), 4vw, var(--space-7));
  display: flex; flex-direction: column; gap: var(--space-5);
  max-width: 46rem;
}
.pg-confirm h1 { font-size: clamp(2rem, 5vw, var(--scale-step-4)); }
.pg-confirm hr { border: none; border-top: 1px solid var(--color-haze); margin: 0; width: 100%; }

/* ----------------------------------------------------------------- steps */
.pg-steps {
  list-style: none; margin: 0; padding: 0; counter-reset: pgstep;
  display: flex; flex-direction: column; gap: var(--space-4);
}
.pg-steps li {
  counter-increment: pgstep;
  display: grid; grid-template-columns: 2.2rem 1fr; gap: var(--space-4); align-items: start;
}
.pg-steps li::before {
  content: counter(pgstep, decimal-leading-zero);
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .1em;
  color: var(--color-bolt); border-top: 1px solid var(--color-sun);
  padding-top: .45rem;
}
.pg-steps p { margin: 0; }

/* ------------------------------------------------------------ small facts */
.pg-facts { margin: 0; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.pg-facts dt {
  font-family: var(--font-mono); font-size: .64rem;
  letter-spacing: var(--tracking-mono-label); text-transform: uppercase;
  color: var(--color-sun-ink); margin-bottom: .3rem;
}
.pg-facts dd { margin: 0; color: var(--color-ink); font-size: .95rem; }

/* ------------------------------------------------------------- pull quote */
.pg-pull {
  margin: 0; padding-left: var(--space-5);
  border-left: 2px solid var(--color-sun);
  font-family: var(--font-display); font-weight: var(--weight-display-regular);
  font-size: clamp(1.35rem, 3.2vw, 1.95rem); line-height: 1.25;
  color: var(--color-ink); max-width: 24ch;
}

/* --------------------------------------------------------------- portrait */
/* The only photograph on this site that is actually of Corrine. Its aspect ratio
   is declared because something always follows it directly — the biography when
   the columns are stacked, the pull quote when they are not — and a portrait that
   reserves no space shoves whichever it is down the page the moment it decodes.
   The source is 4:5 and is never cropped to anything else; object-fit is there to
   survive a future replacement of a different shape, not to crop this one.
   break-inside because the prose above it is still a placeholder: when the real
   biography lands the page break moves, and the one thing that must not straddle
   two sheets is her face. */
.pg-portrait {
  display: block; width: 100%; height: auto;
  aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--color-dune);
  break-inside: avoid; page-break-inside: avoid;
}
/* Stacked, the photograph leads, and the cap stops it filling the column. Below
   about a 424px viewport the column is already narrower than 24rem and the cap
   does nothing; from there up to the 62rem breakpoint it is what keeps a 4:5
   slab from growing taller than the screen and pushing the writing off it. */
.pg-cols--portrait > .pg-portrait-fig { max-width: 24rem; }

/* The figure is the grid child; it carries the placement and the cap, and the img
   inside it keeps the 4:5 box. The credit is quiet on purpose — mono, dusk, small —
   but it is text on flat sand, not on the photograph, so dusk holds its 5.4:1. */
.pg-portrait-fig { margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.pg-portrait-fig figcaption {
  font-family: var(--font-mono); font-size: .62rem;
  letter-spacing: var(--tracking-mono-label); text-transform: uppercase;
  color: var(--color-dusk);
}
.pg-portrait-fig figcaption a { color: inherit; text-underline-offset: .2em; }
.pg-portrait-fig figcaption a:hover { color: var(--color-ink); }

/* Two columns: the prose spans both rows on the left, the portrait takes the
   top of the right-hand column with the aside beneath it. Placement is
   explicit rather than source-ordered because source order is what makes the
   stacked layout right, and the two orders are not the same. */
@media (min-width: 62rem) {
  .pg-cols--portrait { grid-template-rows: auto 1fr; }
  .pg-cols--portrait > .prose     { grid-column: 1; grid-row: 1 / span 2; }
  .pg-cols--portrait > .pg-portrait-fig { grid-column: 2; grid-row: 1; max-width: none; }
  .pg-cols--portrait > aside      { grid-column: 2; grid-row: 2; }
}

/* ------------------------------------------------------------- link cards */
.pg-links { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.pg-link {
  display: flex; flex-direction: column; gap: .45rem;
  padding: var(--space-5); text-decoration: none;
  background: var(--color-shell); border: 1px solid var(--color-haze); border-radius: var(--radius-md);
  transition: border-color .15s ease, background-color .15s ease;
}
.pg-link:hover { border-color: var(--color-sun); background: var(--color-dune); }
.pg-link em {
  font-style: normal; font-family: var(--font-mono); font-size: .62rem;
  letter-spacing: var(--tracking-mono-label); text-transform: uppercase; color: var(--color-sun-ink);
}
.pg-link strong {
  font-family: var(--font-display); font-weight: var(--weight-display-semi);
  font-size: max(1.25rem, var(--scale-step-1)); color: var(--color-ink);
}
.pg-link span { color: var(--color-ink); font-size: .92rem; line-height: 1.5; }

/* ------------------------------------------------------------------- faq */
.pg-faq { border-top: 1px solid var(--color-haze); }
.pg-faq details { border-bottom: 1px solid var(--color-haze); }
.pg-faq summary {
  cursor: pointer; list-style: none; padding-block: var(--space-4);
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-4);
  color: var(--color-ink); font-weight: var(--weight-body-bold);
}
.pg-faq summary::-webkit-details-marker { display: none; }
.pg-faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--color-bolt); flex: 0 0 auto; }
.pg-faq details[open] summary::after { content: "\2013"; }
.pg-faq details > *:not(summary) {
  margin: 0 0 var(--space-4); color: var(--color-ink); font-size: .95rem; max-width: 58ch;
}

/* ----------------------------------------------------------------- legal */
.legal {
  display: grid; align-items: start;
  gap: clamp(var(--space-5), 4vw, var(--space-7));
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 62rem) {
  .legal { grid-template-columns: 14rem minmax(0, 1fr); }
  .legal__toc { position: sticky; top: calc(var(--masthead-h, 4.25rem) + 1.25rem); }
}
.legal__toc { font-size: .86rem; }
.legal__toc h2 {
  font-family: var(--font-mono); font-size: .64rem; font-weight: var(--weight-mono-medium);
  letter-spacing: var(--tracking-mono-label); text-transform: uppercase;
  color: var(--color-sun-ink); margin-bottom: var(--space-3);
}
.legal__toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; counter-reset: toc; }
.legal__toc li { counter-increment: toc; display: grid; grid-template-columns: 1.6rem 1fr; gap: .3rem; }
.legal__toc li::before {
  content: counter(toc); font-family: var(--font-mono); font-size: .7rem; color: var(--color-sun-ink);
  padding-top: .12rem;
}
.legal__toc a { color: var(--color-ink); text-decoration: none; line-height: 1.4; }
.legal__toc a:hover { color: var(--color-bolt); }

.legal__body { display: flex; flex-direction: column; gap: var(--space-6); max-width: 44rem; counter-reset: sec; }
.legal__body section { display: flex; flex-direction: column; gap: var(--space-3); }
.legal__body h2 { font-size: var(--scale-step-2); }
.legal__body h2::before {
  counter-increment: sec; content: counter(sec) ".";
  font-family: var(--font-mono); font-size: .62em; color: var(--color-sun-ink); margin-right: .55rem;
}
.legal__body h3 { font-family: var(--font-body); font-size: 1rem; font-weight: var(--weight-body-bold); color: var(--color-bolt); }
.legal__body p, .legal__body li { color: var(--color-ink); }
.legal__body ul { margin: 0; padding-left: 1.15rem; display: flex; flex-direction: column; gap: .45rem; }
.legal__body li::marker { color: var(--color-sun-ink); }
.legal__body dl { margin: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.legal__body dt { color: var(--color-ink); font-weight: var(--weight-body-bold); font-size: .95rem; }
.legal__body dd { margin: .2rem 0 0; color: var(--color-ink); font-size: .95rem; }

.legal__updated {
  font-family: var(--font-mono); font-size: .66rem;
  letter-spacing: var(--tracking-mono-label); text-transform: uppercase; color: var(--color-dusk);
}
