/*
 * joinshare.app. The brand tokens are the app's (packages/app/src/design/palette.ts and
 * tokens.ts), copied as values because the site has no build step. If a value changes
 * there, it changes here. The rules are docs/design-system.md: hierarchy from type and
 * space, no cards, no shadows, no gradients, one accent doing work.
 */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/Fraunces-9pt-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/InstrumentSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/InstrumentSans-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

/* Light, on bone. The roles and values are the app's `light` palette. */
:root {
  color-scheme: light dark;
  --surface: #F4EFE4;
  --surface-sunken: #EAE3D4;
  --ink: #16221E;
  --ink-muted: #4E5D55;
  --ink-subtle: #5F6E66;
  --ink-on-accent: #F4EFE4;
  --line: #E3DBCB;
  --line-strong: #C9BFAC;
  --accent: #2F6B54;
  --focus: #2F6B54;
  --watch: #855A08;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --measure: 40rem;
  --gutter: 1.25rem;
}

/* Dark, on dark green: the app's `dark` palette, a role remapping and not a second brand. */
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #16221E;
    --surface-sunken: #101A17;
    --ink: #F4EFE4;
    --ink-muted: #B3BDB5;
    --ink-subtle: #98A49C;
    --ink-on-accent: #0E1613;
    --line: #2E3F39;
    --line-strong: #435A51;
    --accent: #86B09C;
    --focus: #9CC4B4;
    --watch: #E3B955;
  }
}

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

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  font-feature-settings: "kern";
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: var(--gutter); top: -3rem;
  background: var(--surface); color: var(--ink); padding: 0.5rem 0.75rem;
}
.skip:focus { top: 0.75rem; }

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }

/* ---- Header ------------------------------------------------------------- */

.site-header { padding: 1.5rem 0 0; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; }

/* The wordmark is brand/wordmark.svg used as a mask, so it takes the ink colour of the
   theme it sits in: dark green on bone, bone on dark green. */
.wordmark {
  display: block;
  width: 5.5rem;
  aspect-ratio: 322.5 / 123.6;
  background: var(--ink);
  -webkit-mask: url("/assets/wordmark.svg") no-repeat left center / contain;
  mask: url("/assets/wordmark.svg") no-repeat left center / contain;
}
.home-link { display: inline-flex; min-height: 44px; align-items: center; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.site-nav a {
  display: inline-flex; min-height: 44px; align-items: center;
  color: var(--ink-muted); text-decoration: none; font-size: 0.9375rem;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---- Type --------------------------------------------------------------- */

main { padding: 3.5rem 0 4rem; }

h1, .display {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.25rem, 8vw, 3.5rem);
  line-height: 1.07;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}
.page h1 { font-size: clamp(2rem, 6vw, 2.75rem); }

h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 3rem 0 0.5rem;
}
h3 { font-size: 1.0625rem; font-weight: 600; margin: 2rem 0 0.4rem; }

p, ul, ol { margin: 0 0 1rem; }
li { margin-bottom: 0.4rem; }

.lede { font-size: 1.25rem; line-height: 1.5; color: var(--ink-muted); max-width: 34rem; }
.muted { color: var(--ink-muted); }
.small { font-size: 0.9375rem; color: var(--ink-muted); }

.eyebrow {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-subtle); margin: 0 0 0.75rem;
}

/* ---- Home --------------------------------------------------------------- */

.pitch { padding-bottom: 1rem; }

.pillars { margin-top: 4rem; }
.pillar { margin-top: 3.5rem; }
.pillar:first-child { margin-top: 0; }
.pillar h2 { margin-top: 0; font-family: var(--serif); font-size: 1.75rem; line-height: 1.2; letter-spacing: -0.01em; }
.pillar p { color: var(--ink-muted); }

/* The one sentence in the Plan section that is the product: what moved. */
.consequence {
  font-family: var(--serif); font-weight: 600; font-size: 1.375rem; line-height: 1.35;
  color: var(--ink); margin: 1.25rem 0;
}

.waitlist { margin-top: 5rem; }
.waitlist h2 { font-family: var(--serif); font-size: 1.75rem; line-height: 1.2; margin-top: 0; }

.field { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.field label { flex-basis: 100%; font-weight: 600; font-size: 0.9375rem; }
.field input[type="email"] {
  flex: 1 1 14rem;
  min-height: 48px;
  padding: 0.6rem 0.85rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface-sunken);
  /* The field edge must reach 3:1 against the page (WCAG 1.4.11); line-strong does not. */
  border: 1px solid var(--ink-subtle);
  border-radius: 8px;
}
.field input[type="email"]::placeholder { color: var(--ink-muted); opacity: 1; }

.button {
  min-height: 48px;
  padding: 0.6rem 1.4rem;
  font: 600 1rem/1 var(--sans);
  color: var(--ink-on-accent);
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.button[disabled] { opacity: 0.6; cursor: progress; }

/* Off-screen, not display:none, so a bot filling every field fills this one too. */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-error { color: var(--watch); font-size: 0.9375rem; margin: 0.75rem 0 0; }
.form-error:empty { display: none; }
.waitlist form .small { margin-top: 1rem; }

.thanks h2 { margin-bottom: 0.5rem; }
[hidden] { display: none !important; }

/* ---- The glyph language (docs/design-system.md 4a) ----------------------
   The share glyph's own parts, bone and one gold node on a flat forest field, at the
   icon's proportions. The field is brand forest in both themes: it is the icon's ground,
   not a role. Decorative: every motif is aria-hidden and carries no text. No shadow, no
   gradient, no border. */

.motif-panel { background: #2F6B54; border-radius: 14px; line-height: 0; margin: 0 0 1.75rem; }
.pitch .motif-panel { margin: 2.5rem 0 0; }
.motif { display: block; width: 100%; height: auto; }
.motif-panel-about { margin: 2rem 0 2.5rem; }
.motif-panel-about .motif { max-width: 22rem; margin: 0 auto; }

/* What's next: two items side by side on a wide screen, stacked on a phone. The motif
   panel is the anchor; there is no card around either (design-system 1). */
.next { margin-top: 5rem; }
.next h2 { font-family: var(--serif); font-size: 1.75rem; line-height: 1.2; margin-top: 0; }
.next-items { display: grid; grid-template-columns: 1fr; gap: 2.5rem; margin-top: 1.75rem; }
.next-item h3 { font-family: var(--serif); font-size: 1.375rem; line-height: 1.25; margin: 0 0 0.5rem; }
.next-item p { color: var(--ink-muted); margin: 0; }
.next-item .motif-panel { margin-bottom: 1.25rem; }
@media (min-width: 40rem) { .next-items { grid-template-columns: 1fr 1fr; } }

/* A phone, drawn as its outline: the app's own screen inside an ink frame. No shadow, no
   gloss, no device photograph. */
.phone {
  margin: 2.25rem auto 0;
  width: min(16rem, 78%);
  padding: 0.55rem;
  background: var(--ink);
  border-radius: 2.4rem;
}
.phone img { display: block; width: 100%; height: auto; border-radius: 1.9rem; }

/* ---- Legal pages -------------------------------------------------------- */

.draft-banner {
  border-left: 3px solid var(--watch);
  padding: 0.25rem 0 0.25rem 1rem;
  margin: 0 0 2.5rem;
  color: var(--ink);
}
.draft-banner strong { color: var(--watch); }

ol.steps { padding-left: 1.25rem; }
ol.steps li { margin-bottom: 0.75rem; }

address { font-style: normal; }

/* ---- Footer ------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; font-size: 0.9375rem; color: var(--ink-muted); }
.site-footer p { margin: 0 0 0.75rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.site-footer a { color: var(--ink-muted); display: inline-flex; min-height: 44px; align-items: center; }
.site-footer a:hover { color: var(--ink); }

@media (min-width: 48rem) {
  main { padding-top: 5rem; }
  .wordmark { width: 6.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
