/* recipibox.com
 *
 * One stylesheet, no scripts, no fonts or files from anyone else: the site for
 * a product whose point is that nothing phones home should not phone anyone
 * either. Type is the reader's own system faces, in the same order the app
 * asks for them, so the site and the box read as one thing.
 *
 * Colour comes from two places. The greens are the app's own "Herb" theme, and
 * in dark mode its "Midnight" one. The brass is the gold of the contacts on the
 * board inside the box, and it is used for the same job here: the few small
 * points where something connects — the caret, the focus ring, the pins.
 */

:root {
  --paper: #F1F4F0;
  --tint: #E5ECE6;
  --card: #FFFFFF;
  --ink: #1A2622;
  --muted: #5A6963;
  --line: #D0DAD3;
  --brand: #2E5E52;
  --brand-hover: #234A41;
  --brand-ink: #234A41;
  --brass: #A87B1E;
  --bezel: #1A2622;
  --foot: #1F453B;
  --foot-ink: #DDE9E3;

  --display: "Avenir Next", "Segoe UI Variable Display", Seravek, "Segoe UI", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Consolas, Menlo, monospace;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --wide: 68rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121614;
    --tint: #181D1B;
    --card: #1D2422;
    --ink: #E7ECE9;
    --muted: #97A59F;
    --line: #2D3632;
    --brand: #3E7A68;
    --brand-hover: #4A8B77;
    --brand-ink: #8FC6B4;
    --brass: #D9B25A;
    --bezel: #060807;
    --foot: #0C0F0E;
    --foot-ink: #B9C7C1;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1.5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
p, figure, dl, dd { margin: 0; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

a { color: var(--brand-ink); text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2.5px; }

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

code { font-family: var(--mono); font-size: 0.92em; }

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

.skip {
  position: absolute; left: var(--gutter); top: -4rem;
  padding: 0.6rem 1rem; border-radius: 0 0 10px 10px;
  background: var(--brand); color: #fff; font-weight: 700; text-decoration: none;
}
.skip:focus { top: 0; }

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

.site-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem;
  padding-block: 1.25rem;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font: 800 1.2rem/1 var(--display); letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}
.wordmark img { width: 2rem; height: 2rem; border-radius: 0.5rem; }
.site-nav { display: flex; gap: clamp(1rem, 3vw, 1.75rem); font-weight: 600; font-size: 0.98rem; }
.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.4em;
  text-decoration-color: var(--brass);
}

/* ---- Hero ----
   The first thing on the page is the thing itself: the address you type to
   reach the box. It is set as an address bar because that is what it is, and
   the house stands where a browser would put its padlock. */

.hero {
  display: grid; align-items: start;
  gap: clamp(2.5rem, 6vw, 4rem);
  padding-block: clamp(1.5rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem);
}
@media (min-width: 58rem) {
  .hero { grid-template-columns: minmax(0, 1fr) 19rem; padding-bottom: 0; }
}

.address {
  display: inline-flex; align-items: center; gap: 0.7em;
  max-width: 100%;
  padding: 0.62em 1.15em 0.62em 0.95em;
  background: var(--card);
  border: 1.5px solid var(--line); border-radius: 999px;
  font: 500 clamp(1.02rem, 3.7vw, 2.05rem)/1.2 var(--mono);
  color: var(--ink);
}
.address svg { flex: none; width: 1.15em; height: 1.15em; color: var(--brand-ink); }
/* A monospace face, so 22ch is exactly the twenty-two characters of the address. */
.address-text {
  display: inline-block; width: 22ch;
  overflow: hidden; white-space: nowrap;
  border-right: 0.09em solid var(--brass);
}
.address-scheme { color: var(--muted); }
.address-note { margin-top: 0.85rem; padding-left: 0.5rem; color: var(--muted); font-size: 0.98rem; }

@media (prefers-reduced-motion: no-preference) {
  /* The one piece of motion on the site: the address is typed, once. */
  .address-text { animation: type 1.25s steps(22, end) 0.45s both, caret 0.9s steps(1, end) 1.8s 5 both; }
}
@keyframes type { from { width: 0; } }
@keyframes caret { 50% { border-right-color: transparent; } }

.hero h1 {
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
  font-size: clamp(2.15rem, 5.3vw, 3.7rem);
  line-height: 1.03; letter-spacing: -0.035em;
  max-width: 17ch;
}
.lede { margin-top: 1.4rem; max-width: 33rem; font-size: clamp(1.1rem, 1.55vw, 1.25rem); line-height: 1.55; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.6rem; margin-top: 2rem; }
.button {
  display: inline-flex; align-items: center; min-height: 3rem; padding: 0 1.5rem;
  border-radius: 999px; background: var(--brand); color: #fff;
  font-weight: 700; text-decoration: none;
}
.button:hover { background: var(--brand-hover); }
.actions a:not(.button) { font-weight: 600; }

/* ---- Screens ----
   Real screenshots of the app, in the plainest frame that says "phone". */

.phone {
  padding: 0.5rem; border-radius: 2.3rem;
  background: var(--bezel);
  box-shadow: 0 2.2rem 3rem -2rem rgba(14, 34, 28, 0.55);
}
.phone img { width: 100%; height: auto; aspect-ratio: 1 / 2; border-radius: 1.85rem; background: var(--paper); }

@media (min-width: 58rem) {
  /* The hero's phone hangs over the edge of the band below it. */
  .hero > div { padding-bottom: clamp(3.5rem, 6vw, 5rem); }
  .hero .phone { align-self: end; margin-bottom: -4.5rem; position: relative; z-index: 1; }
}
@media (max-width: 57.99rem) {
  .hero .phone { width: min(17rem, 78vw); margin-inline: auto; }
}

/* ---- Bands ---- */

.band { padding-block: clamp(3.5rem, 9vw, 6.5rem); }
.band-tint { background: var(--tint); }
.band h2 { font-size: clamp(1.75rem, 3.7vw, 2.6rem); letter-spacing: -0.03em; max-width: 20ch; }
.band h2 + p { margin-top: 1.1rem; }
.band p { max-width: var(--measure); }
.band p + p { margin-top: 1em; }
.large { font-size: clamp(1.1rem, 1.5vw, 1.2rem); line-height: 1.55; }

.screens {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(16rem, 72vw);
  gap: clamp(1.25rem, 3.5vw, 3rem);
  margin: 3rem calc(var(--gutter) * -1) 0; padding: 0 var(--gutter) 3rem;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.screens figure { scroll-snap-align: center; }
.screens figcaption { margin-top: 2.25rem; }
.screens figcaption strong { display: block; font: 700 1.2rem/1.3 var(--display); letter-spacing: -0.01em; }
.screens figcaption span { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.98rem; line-height: 1.5; }
@media (min-width: 58rem) {
  .screens {
    grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 16.5rem));
    justify-content: space-between;
    margin-inline: 0; padding: 0; overflow: visible;
  }
}

.also {
  list-style: none; margin: 3rem 0 0; padding: 1.5rem 0 0;
  border-top: 1.5px solid var(--line);
  display: grid; gap: 0.6rem 3rem;
}
@media (min-width: 44rem) { .also { grid-template-columns: 1fr 1fr; } }
.also li { padding-left: 1.4rem; position: relative; }
.also li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 0.5rem; height: 0.5rem; border-radius: 2px; background: var(--brand);
}

/* ---- Inside the box ----
   A drawing with three numbered parts and a list that says what each one is.
   The numbers are the link between the two, so they look the same in both. */

.inside { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; margin-top: 3rem; }
@media (min-width: 58rem) { .inside { grid-template-columns: 1.1fr 1fr; } }

.board { width: 100%; height: auto; color: var(--ink); }
.board .pcb { fill: var(--card); stroke: currentColor; stroke-width: 2; }
.board .part { fill: var(--tint); stroke: currentColor; stroke-width: 1.5; }
.board .chip { fill: currentColor; opacity: 0.86; }
.board .hole { fill: var(--tint); stroke: currentColor; stroke-width: 1.5; }
/* Two rows of twenty pins, drawn as two dotted lines: a zero-length dash with a
   round cap is a dot. */
.board .pins { fill: none; stroke: var(--brass); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 0 10.6; }
.board .stick { fill: var(--brand); stroke: none; }
.board .stick-plug { fill: var(--tint); stroke: currentColor; stroke-width: 1.5; }
.board .cable { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; }
.board .lead { fill: none; stroke: var(--muted); stroke-width: 1.25; }
.board .tag { fill: var(--ink); stroke: var(--paper); stroke-width: 2.5; }
.board .tag-text { fill: var(--paper); font: 800 15px var(--display); text-anchor: middle; }

.parts { list-style: none; margin: 0; padding: 0; counter-reset: part; display: grid; gap: 1.75rem; }
.parts li { counter-increment: part; display: grid; grid-template-columns: 1.9rem 1fr; gap: 1rem; }
.parts li::before {
  content: counter(part);
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  font: 800 0.95rem/1 var(--display);
}
.parts strong { display: block; font: 700 1.2rem/1.3 var(--display); letter-spacing: -0.01em; }
.parts span { display: block; margin-top: 0.3rem; color: var(--muted); }
.spec { margin-top: 2.5rem; color: var(--muted); font-size: 0.98rem; }

/* ---- Terms ----
   A list of things and what is true of them. Rules between the rows because
   it is read across, like a table. */

.terms { margin-top: 2.75rem; border-top: 1.5px solid var(--line); }
.terms > div { display: grid; gap: 0.4rem 3rem; padding-block: 1.5rem; border-bottom: 1.5px solid var(--line); }
@media (min-width: 50rem) { .terms > div { grid-template-columns: 17rem 1fr; } }
.terms dt { font: 700 1.2rem/1.3 var(--display); letter-spacing: -0.01em; }
.terms dd { max-width: var(--measure); }
.terms-title { margin-top: 3.5rem; font-size: 1.35rem; letter-spacing: -0.015em; }

/* ---- Updates page ---- */

.page-head { padding-block: clamp(2rem, 6vw, 4rem) clamp(2.5rem, 6vw, 4.5rem); }
.page-head h1 { font-size: clamp(2.4rem, 6.2vw, 4.2rem); line-height: 1.02; letter-spacing: -0.04em; }
.page-head p { margin-top: 1.25rem; max-width: var(--measure); }
.released { color: var(--muted); }

/* Numbered, because it is a sequence: each line happens after the one above. */
.steps { list-style: none; margin: 2.5rem 0 0; padding: 0; counter-reset: step; max-width: 46rem; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 2.5rem 1fr; gap: 0.5rem 1rem;
  padding-block: 1.15rem; border-top: 1.5px solid var(--line);
}
.steps li:last-child { border-bottom: 1.5px solid var(--line); }
.steps li::before { content: counter(step); font: 800 1.45rem/1.25 var(--display); color: var(--brand-ink); }
.steps strong { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; }

.manifest {
  margin: 2rem 0 0; padding: 1.3rem 1.4rem; max-width: 52rem;
  border-radius: 14px; background: #14201C; color: #D8E3DD;
  font: 400 0.88rem/1.65 var(--mono);
  white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2;
}
.manifest .j-key { color: #9AD0BD; }
.manifest .j-str { color: #EFD9A2; }
.manifest .j-num { color: #F0B48A; }
.band .manifest-link { margin-top: 0.9rem; font-size: 0.98rem; }

.releases { margin-top: 2.5rem; max-width: 46rem; }
.release { padding-block: 1.9rem; border-top: 1.5px solid var(--line); scroll-margin-top: 1.5rem; }
.release:last-child { border-bottom: 1.5px solid var(--line); }
.release-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1rem; }
.release-head h3 { font-size: 1.6rem; letter-spacing: -0.025em; }
.release-head time { color: var(--muted); }
.pill {
  align-self: center; padding: 0.15rem 0.7rem; border-radius: 999px;
  border: 1.5px solid var(--brass); font-size: 0.82rem; font-weight: 700;
}
.release .release-summary { margin-top: 0.8rem; font-size: 1.12rem; }
/* Each release's notes fold away under a "Show 5 changes" line. */
.release-more { margin-top: 0.7rem; }
.release-more > summary {
  display: inline-flex; align-items: center; gap: 0.55rem;
  min-height: 2.75rem; cursor: pointer; list-style: none;
  color: var(--brand-ink); font-weight: 600; font-size: 0.98rem;
}
.release-more > summary::-webkit-details-marker { display: none; }
.release-more > summary::before {
  content: ""; flex: none; width: 0.42rem; height: 0.42rem; margin-left: 0.1rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}
.release-more[open] > summary::before { transform: translateY(-0.12rem) rotate(45deg); }
.release-more > summary:hover span { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
.release-more:not([open]) .when-open,
.release-more[open] .when-shut { display: none; }
.release-more .release-notes { margin-top: 0.3rem; }

.release-notes { margin: 0.8rem 0 0; padding-left: 1.2rem; max-width: var(--measure); }
.release-notes li + li { margin-top: 0.35rem; }
.release-none { color: var(--muted); padding-block: 1.5rem; border-block: 1.5px solid var(--line); }

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

.site-foot { background: var(--foot); color: var(--foot-ink); padding-block: 2.75rem 3.25rem; }
.site-foot .wrap { display: grid; gap: 1.5rem; }
@media (min-width: 50rem) { .site-foot .wrap { grid-template-columns: 1fr auto; align-items: end; } }
.site-foot .wordmark { color: #fff; }
.site-foot p { margin-top: 0.9rem; max-width: 30rem; font-size: 0.98rem; }
.site-foot nav { display: flex; gap: 1.5rem; font-weight: 600; }
.site-foot a { color: #fff; }

/* ---- Not found ---- */

.lost { padding-block: clamp(3rem, 12vw, 8rem); }
.lost h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.03em; max-width: 18ch; }
.lost p { margin-top: 1.25rem; max-width: var(--measure); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
