/* Coming-soon pages only (build.mjs --mode=coming-soon), loaded on every page after site.css.
   The look matches the iPhone app's reskin (docs/work-orders/RESKIN-PLAN.md): the sky is the
   opening only. On the home page the hero keeps the WebGL sky, the name on the horizon and its
   measured ink; everything below it, and every other page, is off-white with near-black text,
   white cards with a hairline edge and a soft shadow, Instrument Sans headers and Inter for the
   rest. Lime is only ever a fill under near-black content. The off-white look stays light in a
   dark colour scheme, as the app's does; the hero sky still turns to night. */

@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-stretch: 75% 100%; font-display: swap;
  src: url(/fonts/InstrumentSans-Variable.ttf) format("truetype");
}

:root {
  --paper: #f3f3f1;      /* page */
  --card: #ffffff;       /* cards: 1.11:1 on paper, so they carry an edge and a shadow */
  --ink: #161616;        /* text: 16.3:1 on paper, 18.1:1 on white */
  --ink-2: #666665;      /* secondary text, black at 58% on paper: 5.17:1 on paper, 5.75:1 on white */
  --edge: rgb(22 22 22 / .1);
  --control: #7a7a76;    /* field and chip borders: 3.88:1 on paper, 4.31:1 on white */
  --lime: #e6fa5a;       /* fill only, under near-black content: 15.7:1 */
  --red: #b3261e;        /* warnings and errors: 5.88:1 on paper, 6.54:1 on white */
  --head: "Instrument Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 1px 2px rgb(22 22 22 / .05), 0 8px 24px -12px rgb(22 22 22 / .14);
  --wrap: 68rem;
  color-scheme: light;
}

/* ---------- page ---------- */
body.cs { background: var(--paper); }
@media (prefers-color-scheme: dark) { body.cs { background: var(--paper); } }
.cs .paper, .cs-sub { color: var(--ink); }
.cs .paper { background: var(--paper); position: relative; }
.cs-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.cs h1, .cs h2, .cs h3 { font-family: var(--head); font-weight: 500; letter-spacing: -0.015em; }
.cs .card h2, .cs .card h3, .cs .step h2 { font-weight: 600; }
.cs .paper a, .cs-sub a { color: var(--ink); }
.cs .paper :focus-visible, .cs-sub :focus-visible, .cs-footer :focus-visible { outline-color: var(--ink); }

.card {
  background: var(--card); color: var(--ink); border: 1px solid var(--edge); border-radius: 1.25rem;
  box-shadow: var(--shadow); padding: clamp(1.25rem, 3vw, 2rem);
}

/* Lime fill with near-black text: the one primary action on a page. */
.cs .btn { background: var(--lime); color: var(--ink); font-weight: 500; }
.cs .btn:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
/* Secondary action: a near-black outline. */
.btn-line {
  display: inline-flex; align-items: center; min-height: 3rem; padding: .7rem 1.35rem; border-radius: 999px;
  border: 1.5px solid var(--ink); color: var(--ink); text-decoration: none; font-weight: 500;
}
.cs .btn-line:hover { background: var(--ink); color: var(--card); }
.btn-line::after { content: "\2192"; margin-left: .5rem; }

/* ---------- header links ---------- */
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.site-nav a { display: inline-block; padding: .55rem 0; text-decoration: none; font-size: .9375rem; }
.site-nav a:hover { text-decoration: underline; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }

/* On the home hero the links sit in the deep sky above the copy, white (sky.js measures them). */
.cs-top { position: absolute; top: 0; left: 0; right: 0; padding: clamp(.75rem, 2.5vh, 1.5rem) var(--gutter) 0; display: flex; justify-content: flex-end; z-index: 1; }
.site-nav.on-sky[data-ink]::before { inset: -1em -2em; }

/* Sub pages: wordmark left, links right, on off-white. */
.cs-head { padding-top: clamp(.75rem, 2.5vh, 1.5rem); }
.cs-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 2rem; }
.wordmark { font-weight: 300; text-transform: uppercase; letter-spacing: .42em; margin-right: -.42em; text-decoration: none; font-size: 1.0625rem; padding: .55rem 0; }

/* ---------- the home hero (sky) ---------- */
/* The two lines sit centred above the name, high enough to stay in deep sky (clear of the bright
   haze over the horizon, so they keep white ink), and the name keeps its place on the horizon. */
.coming .hero-copy { order: 1; align-self: end; justify-self: center; text-align: center; max-width: 36rem; padding-bottom: clamp(2.5rem, 11lvh, 6rem); }
.coming h1 { margin: 0 auto; font-family: var(--head); font-weight: 500; }
.coming .sub { margin: 1rem auto 0; max-width: 26em; }
@media (min-width: 80em) { .coming.hero { padding-right: 8vw; } }
/* The blurred scrims (site.css [data-ink]::before) reach past the right edge and would widen the
   page on phones; clip them at the edge of the hero. */
.coming { overflow-x: clip; }
/* The clouds fade into the off-white page below, as the app's opening does. The sky is fixed, so
   once scrolled the fade becomes the soft top edge of the page sliding over it. */
.cs-home .hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: clamp(3rem, 12vh, 7rem); pointer-events: none;
  background: linear-gradient(rgb(243 243 241 / 0), var(--paper));
}

/* ---------- home sections (off-white) ---------- */
.paper { padding: clamp(3rem, 8vw, 6rem) 0 0; }
.paper > .cs-wrap > h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); line-height: 1.12; max-width: 22em; }
.cards { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40em) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64em) { .cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cards-4 { max-width: 56rem; } }
.cards h3 { font-size: 1.25rem; line-height: 1.25; }
.cards p { margin-top: .6rem; color: var(--ink-2); }
.early-card { max-width: 46rem; }
.early-card h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; }
.early-card p { margin-top: .9rem; }
.early-card .more { margin-top: 1.5rem; }
.made { padding-bottom: clamp(3rem, 8vw, 6rem); }
.made-by { color: var(--ink-2); font-size: .9375rem; }

/* ---------- sub pages ---------- */
.cs-main { padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(3rem, 8vw, 6rem); }
.page-head { max-width: 46rem; margin-bottom: clamp(2rem, 5vw, 3rem); }
.page-head h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); line-height: 1.08; }
.page-head .intro { margin-top: 1.1rem; font-size: clamp(1.0625rem, 1.5vw, 1.25rem); color: var(--ink-2); max-width: 36em; }
.sheet { background: var(--card); border: 1px solid var(--edge); border-radius: 1.25rem; box-shadow: var(--shadow); padding: clamp(1.25rem, 4vw, 3rem); max-width: 50rem; }
.sheet section { max-width: 40rem; }
.sheet section + section { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--edge); }
.sheet h2 { font-size: 1.375rem; line-height: 1.25; margin-bottom: .75rem; }
.updated { color: var(--ink-2); font-size: .9375rem; margin-bottom: 1.5rem; }
.draft { border: 1.5px solid var(--red); color: var(--red); background: var(--card); border-radius: .75rem; padding: .75rem 1rem; margin-bottom: 1.5rem; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; max-width: 50rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.step h2 { font-size: 1.25rem; line-height: 1.25; margin-top: 1rem; }
.step p { margin-top: .6rem; color: var(--ink-2); }
.tag {
  display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 .6rem; border-radius: 999px;
  background: var(--lime); color: var(--ink); font-family: var(--head); font-weight: 600; font-size: .9375rem;
}
.cs-sub .cta-row { margin-top: 2rem; }
.qa { margin-top: 2.5rem; max-width: 50rem; padding-top: .25rem; padding-bottom: .25rem; }
.qa details + details { border-top: 1px solid var(--edge); }
.qa summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr 1rem; gap: 1.25rem; align-items: center;
  padding: 1.1rem 0; font-family: var(--head); font-weight: 600; font-size: 1.125rem; line-height: 1.3;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: ""; width: 1rem; height: 1rem; justify-self: end;
  background: linear-gradient(var(--ink), var(--ink)) center / 100% 1.5px no-repeat, linear-gradient(var(--ink), var(--ink)) center / 1.5px 100% no-repeat;
  transition: transform .3s var(--ease);
}
.qa details[open] summary::after { transform: rotate(45deg); }
.qa .answer { padding: 0 2.25rem 1.25rem 0; color: var(--ink-2); }

.contact-card { max-width: 50rem; margin-bottom: 1rem; font-size: 1.125rem; }
.contact-card a { font-weight: 500; }

/* ---------- footer (every page) ---------- */
.cs-footer { background: var(--paper); color: var(--ink); border-top: 1px solid var(--edge); padding: 2.5rem 0 3rem; font-size: .9375rem; }
.cs-footer .cs-wrap { display: grid; gap: .75rem; }
.cs-footer p + p { margin-top: 0; }
.cs-footer a { color: var(--ink); }
.cs-footer .foot-name { font-weight: 300; text-transform: uppercase; letter-spacing: .42em; font-size: 1.125rem; }
.cs-footer nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 2rem; }
.cs-footer nav a { display: inline-block; padding: .4rem 0; }
.cs-footer .fine { color: var(--ink-2); font-size: .875rem; max-width: 46rem; }

@media (max-width: 47.99em) {
  .cs-top { justify-content: center; }
  .site-nav ul { gap: .1rem 1.1rem; }
}
@media print {
  .cs-top, .cs-head nav { display: none !important; }
}
