/* Peach Studio portal — brand stylesheet.
 *
 * Palette and type tokens mirror the Peach Studio brand (`--ps-*`, from the same source as the logo),
 * so a future restyle is one file. Two constraints shape everything here:
 *
 *   1. no inline style or script anywhere (the spec's strict CSP is `style-src 'self'`), so all
 *      presentation lives in this file and the logo is an external asset;
 *   2. usable at 400 px with JavaScript off, so layout is one column, no hover-only affordances and
 *      no layout that depends on the Turnstile widget loading.
 *
 * The webfonts the brand uses (Newsreader, Hanken Grotesk, IBM Plex Mono, Silkscreen) are named first
 * in each stack but not fetched: the CSP allows no third-party font origin, so browsers fall back to
 * Georgia / the system sans / a system mono. Self-hosting them is the way to get the exact faces.
 */

:root {
  --ps-cream: #f3f0e9;
  --ps-cream-deep: #ece7dc;
  --ps-surface: #fbfaf6;
  --ps-surface-2: #ffffff;
  --ps-ink: #211d18;
  --ps-ink-soft: #57514a;
  --ps-ink-faint: #8a847b;
  --ps-line: #ded7c9;
  --ps-line-soft: #e7e1d5;
  --ps-clay: #c2603a;
  --ps-clay-deep: #a84e2c;
  --ps-clay-bright: #d9693e;
  --ps-clay-tint: #eddfd4;
  --ps-leaf: #5e7c2f;
  --ps-on-clay: #ffffff;
  --ps-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --ps-sans: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ps-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --ps-pixel: "Silkscreen", "IBM Plex Mono", ui-monospace, monospace;
  --ps-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --rule: 1px solid var(--ps-line);
  --lift: 4px 4px 0 var(--ps-ink);
}

/* The same palette inverted, for readers who ask their system for dark. */
@media (prefers-color-scheme: dark) {
  :root {
    --ps-cream: #1b1714;
    --ps-cream-deep: #241f1a;
    --ps-surface: #211c18;
    --ps-surface-2: #2a2420;
    --ps-ink: #f3f0e9;
    --ps-ink-soft: #c9c0b4;
    --ps-ink-faint: #94897c;
    --ps-line: #3a332c;
    --ps-line-soft: #312b25;
    --ps-clay: #d9693e;
    --ps-clay-deep: #c2603a;
    --ps-clay-tint: #3a2a21;
    --ps-leaf: #8fae5c;
    --ps-on-clay: #1b1714;
    --lift: 4px 4px 0 #0e0c0a;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ps-cream);
  color: var(--ps-ink);
  font-family: var(--ps-sans);
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

/* the sheet grows, so the footer sits at the bottom even on a short error page */
.sheet { flex: 1 0 auto; }
.site-footer { flex: none; }

a { color: var(--ps-clay-deep); text-underline-offset: 2px; }
a:hover { color: var(--ps-clay); }

:focus-visible {
  outline: 2px solid var(--ps-clay);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ masthead */
.masthead {
  background: var(--ps-surface);
  border-bottom: var(--rule);
}
.masthead-inner {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.mark { display: block; width: 36px; height: 33px; flex: none; }
.wordmark {
  font-family: var(--ps-pixel);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.masthead .tagline {
  margin-left: auto;
  color: var(--ps-ink-faint);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------ sheet */
.sheet {
  max-width: 62rem;
  margin: 0 auto;
  padding: 2.25rem 1.25rem 3.5rem;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  align-content: start;        /* .sheet grows to fill the page; keep the rows packed, not spread out */
}
.sheet > * { min-width: 0; }

/* One centred column for the pages that are a single flow (sign-in, verify, errors): a narrow measure
   reads better and the whole page sits centred instead of leaving a half-empty second column. */
.sheet-single { max-width: 44rem; grid-template-columns: minmax(0, 1fr); }

.eyebrow {
  font-family: var(--ps-pixel);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ps-clay);
  margin: 0 0 0.6rem;
}

h1 {
  font-family: var(--ps-serif);
  font-weight: 500;
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  max-width: 30ch;
}
h2 {
  font-family: var(--ps-serif);
  font-weight: 500;
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}
h3 { font-size: 0.95rem; margin: 1.25rem 0 0.4rem; }

.lede { font-size: 1.05rem; color: var(--ps-ink-soft); max-width: 46ch; margin: 0 0 1.5rem; }
.muted { color: var(--ps-ink-faint); font-size: 0.85rem; }

/* ------------------------------------------------------------------ panels */
.panel {
  background: var(--ps-surface);
  border: var(--rule);
  border-radius: 2px;
  padding: 1.5rem;
  box-shadow: var(--lift);
}
.panel + .panel { margin-top: 1.5rem; }
.sheet > .panel + .panel { margin-top: 0; }          /* the grid gap spaces these; a margin misaligns columns */
.panel-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  border-bottom: var(--rule);
  padding-bottom: 0.6rem;
  margin-bottom: 1.1rem;
}
.panel-head h2 { margin: 0; }
.panel-head .muted { margin-left: auto; }

/* ------------------------------------------------------------------ forms */
.field { margin-bottom: 1rem; }
label { display: block; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em;
        text-transform: uppercase; color: var(--ps-ink-soft); margin-bottom: 0.35rem; }

input[type="email"], input[name="code"] {
  width: 100%;
  padding: 0.7rem 0.8rem;
  font-family: var(--ps-sans);
  font-size: 1rem;
  color: var(--ps-ink);
  background: var(--ps-surface-2);
  border: var(--rule);
  border-radius: 2px;
}
input[name="code"] {
  font-family: var(--ps-mono);
  font-size: 1.35rem;
  letter-spacing: 0.5em;
  text-align: center;
  padding-left: 0.8rem;
}

button {
  font-family: var(--ps-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ps-on-clay);
  background: var(--ps-clay-deep);
  border: 1px solid var(--ps-clay-deep);
  border-radius: 2px;
  padding: 0.7rem 1.3rem;
  cursor: pointer;
  transition: background 120ms var(--ps-ease), transform 120ms var(--ps-ease);
}
button:hover { background: var(--ps-clay); border-color: var(--ps-clay); }
button:active { transform: translate(2px, 2px); }
button.quiet {
  color: var(--ps-ink-soft);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  font-weight: 500;
  letter-spacing: 0;
}
button.quiet:hover { color: var(--ps-clay); background: none; }
button.quiet:active { transform: none; }

.inline { display: inline; margin: 0; }

.checkbox {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.92rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ps-ink);
  margin: 0 0 1rem;
}
.checkbox input { margin-top: 0.28rem; flex: none; }

/* Turnstile renders a 65 px widget inside this container a moment after the page loads; reserving the
   height keeps the form from jumping (and leaves a deliberate gap when the script is blocked). */
.cf-turnstile { min-height: 65px; margin: 0 0 1rem; max-width: 100%; }
.cf-turnstile iframe { max-width: 100%; }
/* the widget is at least 300 px wide; on a 320 px phone the panel is narrower, so let it scroll inside
   its own box instead of dragging the whole page sideways */
.cf-turnstile { overflow-x: auto; overflow-y: hidden; }

/* ------------------------------------------------------------------ notices */
.alert, .ok {
  border-left: 3px solid var(--ps-clay);
  background: var(--ps-clay-tint);
  padding: 0.7rem 0.9rem;
  margin: 0 0 1.2rem;
  font-size: 0.92rem;
}
.alert { font-weight: 600; }
.ok { border-left-color: var(--ps-leaf); background: var(--ps-cream-deep); }

/* ------------------------------------------------------------- disclosure */
/* A native <details> because the portal has to work with JavaScript off: the "+" opens the panel,
   the keyboard can toggle it, and a screen reader announces it as a disclosure. */
.disclosure { padding: 0; }
.disclosure > summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.1rem 1.5rem;
  cursor: pointer;
  list-style: none;
  border-radius: 2px;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::marker { content: ""; }
.disclosure > summary:hover .summary-label { color: var(--ps-clay); }
.info-mark {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--ps-clay);
  border-radius: 2px;
  color: var(--ps-clay);
  font-family: var(--ps-mono);
  font-size: 1rem;
  line-height: 1;
}
.info-mark::before { content: "+"; }
.disclosure[open] .info-mark { background: var(--ps-clay); color: var(--ps-on-clay); }
.disclosure[open] .info-mark::before { content: "\2212"; }        /* the minus sign */
.summary-label { font-family: var(--ps-serif); font-size: 1.08rem; }
.disclosure > summary .muted { margin-left: auto; }
.disclosure-body { padding: 0 1.5rem 1.25rem; animation: slide-in 180ms var(--ps-ease); }
@keyframes slide-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .disclosure-body { animation: none; }
}

/* ------------------------------------------------------------------ steps */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 1fr);
  gap: 0.5rem 0.75rem;
  padding: 0.7rem 0;
  border-top: var(--rule);
  font-size: 0.92rem;
  color: var(--ps-ink-soft);
}
.steps li:first-child { border-top: 0; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--ps-pixel);
  font-size: 0.7rem;
  color: var(--ps-ink-faint);
  padding-top: 0.2rem;
}
.steps strong { color: var(--ps-ink); font-weight: 600; }

/* ------------------------------------------------------------------ terms */
.terms {
  max-height: 20rem;
  overflow-y: auto;
  background: var(--ps-surface-2);
  border: var(--rule);
  border-radius: 2px;
  padding: 0.25rem 1.1rem 1rem;
  margin-bottom: 1.25rem;
  font-family: var(--ps-serif);
  font-size: 0.95rem;
  scrollbar-gutter: stable;
}
.terms h1 {
  font-family: var(--ps-pixel);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ps-ink-faint);
  margin: 1rem 0 0.5rem;
}
.terms h2, .terms h3 { font-family: var(--ps-serif); margin: 1rem 0 0.4rem; }
.terms p { margin: 0.7rem 0; }
.terms strong { font-weight: 600; }

/* ------------------------------------------------------------------ files */
.files { list-style: none; padding: 0; margin: 0; }
.files li {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-top: var(--rule);
}
.files li:first-child { border-top: 0; }
.files a { font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--ps-clay-tint); }
.files a:hover { border-bottom-color: var(--ps-clay); }
.files .name { min-width: 0; }
.files .meta { margin-left: auto; color: var(--ps-ink-faint); font-family: var(--ps-mono);
               font-size: 0.75rem; text-align: right; }

.event-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 1.5rem 0 0.25rem;
  border-bottom: 2px solid var(--ps-ink);
  padding-bottom: 0.35rem;
}
.event-head h3 { margin: 0; font-family: var(--ps-serif); font-size: 1.05rem; }
.event-head .muted { margin-left: auto; }

/* ------------------------------------------------------------------ hero art */
.hero { display: flex; align-items: flex-start; gap: 1.25rem; }
.hero-copy { min-width: 0; flex: 1 1 auto; }
.hero-art { width: 96px; height: 72px; flex: none; image-rendering: pixelated; }

/* ------------------------------------------------------------------ footer */
.site-footer {
  border-top: var(--rule);
  background: var(--ps-surface);
  color: var(--ps-ink-faint);
  font-size: 0.8rem;
  text-align: center;
  padding: 1.25rem;
}
.site-footer a { color: var(--ps-ink-soft); }

/* ------------------------------------------------------------------ narrow */
@media (max-width: 34rem) {
  .sheet { padding: 1.5rem 1rem 2.5rem; gap: 1.5rem; }
  h1 { font-size: 1.6rem; }
  .panel { padding: 1.1rem; box-shadow: 3px 3px 0 var(--ps-ink); }
  .disclosure { padding: 0; }
  .disclosure > summary { padding: 1rem 1.1rem; }
  .disclosure-body { padding: 0 1.1rem 1rem; }
  /* the art sits above the copy: beside it, it squeezed the lede to ~14 characters per line */
  .hero { flex-direction: column-reverse; gap: 0.75rem; }
  .hero-art { width: 48px; height: 36px; }
  .masthead .tagline { display: none; }
  .files li { flex-wrap: wrap; }
  .files .meta { margin-left: 0; width: 100%; text-align: left; }
  button { width: 100%; }
}

/* very small phones: reclaim gutter so the 300 px Turnstile widget fits inside the panel */
@media (max-width: 24rem) {
  .sheet { padding-inline: 0.75rem; }
  .panel { padding: 0.9rem 0.75rem; }
  .disclosure > summary { padding: 0.9rem 0.75rem; }
  .disclosure-body { padding: 0 0.75rem 0.9rem; }
  .masthead-inner { padding-inline: 0.75rem; }
}

@media (min-width: 52rem) {
  .sheet:not(.sheet-single) { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2.5rem; }
  .sheet > .span-all { grid-column: 1 / -1; }        /* /files: terms and files side by side */
}
