/* Riprova's marketing site: its only stylesheet.
   "Brass at night" (openspec/changes/redesign-marketing-site): brass on warm
   near-black, with a paper-and-ink light scheme; Instrument Sans for text,
   IBM Plex Mono for labels and readouts, both served from /fonts. The site
   follows the OS theme only: it runs no script of its own, so there is no
   in-page toggle. Tokens are the product's brass palette
   (docs/dependencies.md has the font entries). */

@font-face {
  font-family: 'Instrument Sans';
  src: url('/fonts/instrument-sans-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Light: warm paper, ink text, a deeper brass for text and links. */
  --bg: #f6f2ea;
  --surface: #fffdf8;
  --surface-2: #ede7da;
  --text: #1c1a16;
  --muted: #5f594d;
  --border: #dcd4c4;
  --accent: #8a5a14;
  --accent-hover: #6e4709;
  --accent-weak: #efe3cb;
  --brass: #d9a45c;
  --on-brass: #1f1508;
  --glow: rgba(217, 164, 92, 0.22);
  --line: rgba(138, 90, 20, 0.14);
  --frame: linear-gradient(155deg, #e9c98f 0%, #b88a4a 45%, #8a6a3a 100%);
  --head-text: linear-gradient(180deg, #1c1a16 0%, #3d382d 100%);

  --step--1: 0.8rem;
  --step-0: 1rem;
  --step-1: 1.15rem;
  --step-2: 1.45rem;
  --step-3: 1.95rem;
  --step-4: 2.6rem;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 20px;

  --sans: 'Instrument Sans', system-ui, 'Segoe UI', Roboto, -apple-system,
    sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', 'Cascadia Code', Consolas,
    monospace;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0c0a;
    --surface: #171512;
    --surface-2: #1d1a15;
    --text: #efece4;
    --muted: #a09a8c;
    --border: #2a2721;
    --accent: #d9a45c;
    --accent-hover: #efc27f;
    --accent-weak: #2a2113;
    --glow: rgba(217, 164, 92, 0.2);
    --line: rgba(217, 164, 92, 0.1);
    --frame: linear-gradient(155deg, #5a4b30 0%, #2a241a 38%, #171512 100%);
    --head-text: linear-gradient(180deg, #f7f1e4 0%, #d8d2c4 100%);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* The front page: warm light behind the hero. */
body.home {
  background:
    radial-gradient(
      ellipse 90rem 38rem at 50% -14rem,
      var(--glow),
      transparent 70%
    ),
    var(--bg);
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---- Header and footer ---- */

.site-head {
  padding: 1.25rem 0;
}

.brand {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand img {
  width: 1.75rem;
  height: 1.75rem;
}

.site-foot {
  margin-top: 4rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--step--1);
}

.site-foot a {
  display: inline-block;
  min-height: 2.75rem;
  line-height: 2.75rem;
  color: var(--muted);
}

.site-foot a:hover {
  color: var(--accent);
}

.site-foot address {
  margin-top: 0.5rem;
  font-style: normal;
}

/* ---- Content ---- */

h1 {
  margin: 1.5rem 0 1rem;
  font-size: var(--step-3);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

h3 {
  margin: 0 0 0.25rem;
  font-size: var(--step-0);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.lede {
  color: var(--muted);
  font-size: var(--step-1);
}

/* ---- Front page ---- */

.display {
  margin: 3rem 0 1.25rem;
  font-size: clamp(2.6rem, 11vw, 5rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: var(--text);
}

.display .stop {
  color: var(--brass);
}

/* The headline fades from bright to a little dimmer, where clipping text to a
   gradient is supported; elsewhere it stays plain, at full contrast. */
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .display {
    background: var(--head-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }

  .display .stop {
    -webkit-text-fill-color: var(--brass);
  }
}

/* High-contrast mode replaces colours; text clipped to a gradient would
   vanish, so give it back its own colour there. */
@media (forced-colors: active) {
  .display,
  .display .stop {
    background: none;
    -webkit-text-fill-color: CanvasText;
    color: CanvasText;
  }
}

.display + .lede {
  max-width: 34rem;
  color: var(--text);
}

.eyebrow {
  display: none;
  margin: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.5rem 0 0;
  padding: 0.4rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--step--1);
}

.status::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  flex: none;
  background: var(--brass);
  border-radius: 50%;
  box-shadow: 0 0 0.7rem var(--brass);
}

/* A section heading set small, on a rule: the page reads as a list, not as
   a stack of panels. */
.rule {
  margin: 5rem 0 0;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---- Front page: product first, built for a phone ----
   One column; the screenshot sits under the form so the first screen of a
   360px phone is the headline, the form and the top of the product. */

.hero {
  position: relative;
  display: grid;
  gap: 1.25rem;
  /* The glow behind a phone may not widen the page. */
  overflow-x: clip;
}

.hero .display {
  margin: 1rem 0 0.75rem;
  font-size: clamp(2.3rem, 10vw, 5rem);
}

/* The lede reads at body size on a phone so the product shows sooner. */
.hero .lede {
  margin: 0;
  font-size: var(--step-0);
}

.hero .status {
  margin-top: 0.75rem;
}

.join {
  margin-top: 1rem;
}

.join .btn {
  width: 100%;
  margin-top: 0.75rem;
}

/* A phone: brass-edged frame, a glow behind it. */
.shot {
  position: relative;
  display: block;
  justify-self: center;
  width: min(17rem, 74%);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1.6rem;
}

.hero-shot,
.row .shot {
  padding: 0.4rem;
  background: var(--frame);
  border-radius: 2rem;
  box-shadow:
    0 2.5rem 4rem -2rem rgba(0, 0, 0, 0.55),
    0 0 0 1px var(--glow);
}

.hero-shot::before,
.row .shot::before {
  content: '';
  position: absolute;
  inset: -2.5rem;
  z-index: -1;
  background: radial-gradient(closest-side, var(--glow), transparent 72%);
}

.facts {
  margin: 3rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.facts li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.5;
}

.facts li:last-child {
  border-bottom: 0;
}

.facts li::before {
  content: '';
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.7rem;
  background: var(--brass);
  border-radius: 50%;
  vertical-align: 0.05em;
}

/* A browser view: a wider frame, squarer corners than a phone. */
.row .shot.wide {
  width: 100%;
  padding: 0.3rem;
  border-radius: 1.1rem;
}

.shot.wide img {
  border-radius: 0.8rem;
}

/* Each feature: its words, then its screen. */
.row {
  display: grid;
  overflow-x: clip;
  gap: 2rem;
  padding: 3.5rem 0 0;
  counter-increment: feature;
}

.row-copy::before {
  content: '0' counter(feature) '  /';
  display: block;
  margin-bottom: 1rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.16em;
}

.row h3 {
  margin: 0;
  font-size: clamp(1.9rem, 7vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.row-copy p,
.also p {
  margin: 1.1rem 0 0;
  max-width: 30em;
  color: var(--muted);
}

.row-copy p {
  font-size: var(--step-1);
}

.also {
  margin: 4rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0 3rem;
}

.also li {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.also li:first-child {
  border-top: 2px solid var(--brass);
}

/* ---- Waitlist form and the Worker's pages ---- */

.card {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

/* The closing waitlist: a lit panel. */
.rule + .card {
  position: relative;
  margin-top: 1.5rem;
  overflow: hidden;
  padding: 1.5rem;
  background:
    radial-gradient(
      circle 14rem at 100% 0,
      var(--glow),
      transparent 70%
    ),
    var(--surface);
  border-radius: var(--r-lg);
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

input[type='email'] {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.9rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font: inherit;
}

input[type='email']:focus {
  border-color: var(--accent);
}

/* interaction-only: empty until the challenge needs the visitor. */
.cf-turnstile {
  margin: 0.75rem 0 0;
}

.btn {
  min-height: 2.75rem;
  padding: 0.5rem 1.4rem;
  background: linear-gradient(180deg, #e6b46c 0%, #d9a45c 55%, #c8924a 100%);
  color: var(--on-brass);
  border: 0;
  border-radius: var(--r);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 0.6rem 1.8rem -0.7rem rgba(217, 164, 92, 0.6);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.06);
}

.small {
  color: var(--muted);
  font-size: var(--step--1);
}

.address {
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition:
      transform 0.18s ease,
      filter 0.18s ease;
  }

  .btn:hover {
    transform: translateY(-1px);
  }

  .hero > div > *,
  .hero-shot {
    animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero > div > :nth-child(2) {
    animation-delay: 0.08s;
  }

  .hero > div > :nth-child(3) {
    animation-delay: 0.16s;
  }

  .hero > div > :nth-child(n + 4) {
    animation-delay: 0.24s;
  }

  .hero-shot {
    animation-delay: 0.24s;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(0.8rem);
    }
  }
}

@media (min-width: 40rem) {
  .eyebrow {
    display: block;
  }

  h1 {
    font-size: var(--step-4);
  }

  .display {
    margin-top: 5rem;
    font-size: 5rem;
  }

  input[type='email'] {
    max-width: 26rem;
  }

  .join .btn {
    width: auto;
  }

  .also {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The front page uses the width of a desktop on purpose: a wide frame, copy
   and phone as two real columns, bands that alternate. */
@media (min-width: 52rem) {
  .wrap {
    max-width: 46rem;
  }

  body.home .wrap {
    max-width: 78rem;
    padding: 0 2.5rem;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 25rem;
    align-items: center;
    gap: 5rem;
    padding-top: 1.5rem;
  }

  .hero .display {
    font-size: clamp(4.5rem, 8.6vw, 8.5rem);
  }

  .hero .lede {
    font-size: var(--step-1);
  }

  .hero-shot,
  .row .shot {
    width: 100%;
  }

  /* Stave lines behind the headline, fading out to both sides. */
  .hero::before {
    content: '';
    position: absolute;
    left: -2.5rem;
    right: -2.5rem;
    top: 7rem;
    height: 8.5rem;
    z-index: -1;
    background: repeating-linear-gradient(
      180deg,
      var(--line) 0,
      var(--line) 1px,
      transparent 1px,
      transparent 1.75rem
    );
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 60%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 25%, #000 60%, transparent);
  }

  .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .facts li {
    padding: 1.6rem 1.5rem;
    border-bottom: 0;
    border-right: 1px solid var(--border);
  }

  .facts li:first-child {
    padding-left: 0;
  }

  .facts li:last-child {
    padding-right: 0;
    border-right: 0;
  }

  .row {
    grid-template-columns: minmax(0, 1fr) 24rem;
    align-items: center;
    gap: 6rem;
    padding-top: 7rem;
  }

  .row:nth-of-type(even) {
    grid-template-columns: 24rem minmax(0, 1fr);
  }

  .row:nth-of-type(even) .shot {
    order: -1;
  }

  .row-wide {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr);
    gap: 4.5rem;
  }

  .row-wide:nth-of-type(even) {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr);
  }

  .row-wide:nth-of-type(even) .shot {
    order: -1;
  }

  .row h3 {
    font-size: clamp(2.6rem, 4vw, 3.8rem);
  }

  .also {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 7rem;
  }

  .rule + .card {
    padding: 3rem 3.5rem;
  }
}
