/* Fraunces pinned to SOFT 100 / WONK 0, weights 350-550, Latin only (fontTools instancer + subset): 36 KB */
@font-face { font-family: "Fraunces"; src: url("fonts/Fraunces-Soft.woff2") format("woff2"); font-weight: 350 550; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/Figtree-Variable.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }

/* Warm white, soft charcoal. Fraunces (fully "soft") for headlines, Figtree for the rest. */
:root {
  --bg: #f8f6f1; --surface: #fdfcf9; --ink: #3b3a35; --ink-2: #86837a; --line: #e7e3d9;
  --charcoal: #3b3a35; --on-charcoal: #f8f6f1;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Figtree", ui-sans-serif, system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 64px); --max: 1080px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
h1, h2 { font-family: var(--display); font-weight: 370; font-variation-settings: "SOFT" 100, "WONK" 0; letter-spacing: -.02em; margin: 0; }

/* ---------------------------------------------------------------- bar */
.bar { display: flex; justify-content: space-between; align-items: center; padding: 22px var(--gutter); font-size: 14px; color: var(--ink-2); }
.bar-right { display: flex; align-items: center; gap: 18px; }
.gh { display: grid; place-items: center; width: 32px; height: 32px; margin-right: -7px; border-radius: 50%; color: var(--ink-2); opacity: .55; transition: opacity .2s, color .2s, background .2s, scale .12s ease; }
.gh svg { width: 17px; height: 17px; fill: currentColor; }
.wordmark { transition: opacity .2s, scale .12s ease; display: inline-block; font: 500 24px/1 var(--display); font-variation-settings: "SOFT" 100; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }

/* ---------------------------------------------------------------- hero: the device first */
.hero { display: grid; justify-items: center; text-align: center; padding: 0 var(--gutter); }
.stage { position: relative; width: min(100%, 900px); height: min(60vh, 600px); }
model-viewer { width: 100%; height: 100%; --poster-color: transparent; position: relative; }
/* still image of the opening view, full stage height and centred, exactly where the 3D device will be */
.stage { overflow: hidden; }
.stage-still { position: absolute; top: 0; left: 50%; height: 100%; width: auto; max-width: none; translate: -50% 0; pointer-events: none; transition: opacity .5s ease .1s; }
.stage.ready .stage-still { opacity: 0; }
.ar { position: absolute; right: 0; top: 0; font: 500 14px var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer; transition: background .2s, border-color .2s, scale .12s ease; }

.hold {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 0; cursor: pointer;
  font: 500 16px var(--body); color: var(--on-charcoal); background: var(--charcoal);
  border: 0; border-radius: 999px; padding: 0 24px;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: translate .2s cubic-bezier(.3, 1.6, .5, 1), scale .12s ease, background .2s, box-shadow .2s;
}
.hold { min-width: 150px; justify-content: center; height: 50px; }
.spectrum { display: none; align-items: center; gap: 3px; height: 26px; }
.spectrum i { width: 3px; height: 100%; border-radius: 2px; background: currentColor; transform: scaleY(.12); transform-origin: center; }
.hold.down .spectrum { display: flex; }
.hold.down #hold-label { display: none; }
.hold.busy { cursor: default; }
/* sending: three dots taking turns, in place of the label */
.loader { display: none; align-items: center; gap: 6px; height: 26px; }
.loader i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: hop 1.1s ease-in-out infinite; }
.loader i:nth-child(2) { animation-delay: .15s; }
.loader i:nth-child(3) { animation-delay: .3s; }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }
.hold.busy .loader { display: flex; }
.hold.busy #hold-label { display: none; }
@media (prefers-reduced-motion: reduce) { .loader i { animation: none; opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .spectrum i { transform: scaleY(.45); } }
/* live captions, like subtitles at the bottom of the stage */
.caption {
  width: min(94%, 46ch); height: 2.6em; margin: 4px 0 18px; pointer-events: none;
  display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-end; column-gap: .25em;
  font: 400 clamp(19px, 1.8vw, 24px)/1.3 var(--display); font-variation-settings: "SOFT" 100; letter-spacing: -.015em;
  color: var(--ink); text-wrap: balance; transition: opacity .35s;
}
.caption .w { display: inline-block; animation: word .38s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes word { from { opacity: 0; filter: blur(3px); transform: translateY(5px); } }
.caption.done { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .caption .w { animation: none; } }

/* under the button: a hint, then the memo card */
.cards { width: min(100%, 420px); min-height: 150px; margin-top: 24px; }
.card {
  width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 20px 18px; box-shadow: 0 22px 44px -28px rgb(60 52 30 / .32);
  animation: card .6s cubic-bezier(.3, 1.35, .45, 1) both;
}
.card.leaving { animation: leave .25s ease both; }
@keyframes card { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes leave { to { opacity: 0; transform: translateY(-6px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .card, .card.leaving { animation: none; } }
.card .kind { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); }
.card .kind svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card .kind time { margin-left: auto; }
.card h3 { margin: 6px 0 0; font: 400 25px/1.2 var(--display); font-variation-settings: "SOFT" 100; letter-spacing: -.02em; }
.card .meta { margin: 8px 0 0; display: flex; align-items: center; gap: 7px; font-size: 15px; color: var(--ink); }
.card .meta svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card .meta.wait { color: var(--ink-2); }
.card .said { margin: 10px 0 0; font-size: 14.5px; color: var(--ink-2); }
/* research in progress */
.card .track { height: 3px; margin: 12px 0 2px; border-radius: 3px; background: var(--line); overflow: hidden; }
.card .track i { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 3px; transition: width .35s ease; }
/* the report that comes back */
.card .report { animation: fadein .5s ease both; }
@keyframes fadein { from { opacity: 0; } }
.card .summary { margin: 10px 0 0; font-size: 15.5px; line-height: 1.5; }
.card ul { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.card li { position: relative; padding-left: 16px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.card li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-2); opacity: .7; }
@media (prefers-reduced-motion: reduce) { .card .report { animation: none; } }

.hero h1 { margin-top: 32px; max-width: 16ch; font-size: clamp(38px, 5.2vw, 70px); line-height: 1.06; }
.lede { max-width: 34rem; margin: 22px auto 0; font-size: 18px; color: var(--ink-2); }

/* one load sequence: the device, then the button */
@media (prefers-reduced-motion: no-preference) {
  .stage { animation: rise 1.1s cubic-bezier(.2, .8, .2, 1) backwards; }
  .hold { animation: rise 1s .25s cubic-bezier(.2, .8, .2, 1) backwards; }
}
@keyframes rise { from { opacity: 0; translate: 0 18px; } }

/* ---------------------------------------------------------------- button states: hover lifts, press sinks */
/* hover only where there is a real pointer, so taps on phones don't leave buttons stuck "hovered" */
@media (hover: hover) {
  .hold:hover:not(.busy), .gh-link:hover { translate: 0 -2px; background: #2f2e2a; box-shadow: 0 10px 22px -12px rgb(40 34 20 / .55); }
  .gh-link:hover .star { opacity: 1; rotate: -12deg; scale: 1.15; }
  .gh:hover { opacity: 1; color: var(--ink); background: var(--line); }
  .ar:hover { background: #fff; border-color: var(--ink-2); }
  .wordmark:hover { opacity: .65; }
}
.gh:focus-visible { opacity: 1; color: var(--ink); }
.hold:active:not(.busy), .gh-link:active { translate: 0 1px; scale: .96; background: #24231f; box-shadow: 0 2px 6px -3px rgb(40 34 20 / .5); transition-duration: .06s; }
.gh:active { scale: .88; background: var(--line); opacity: 1; transition-duration: .06s; }
.ar:active { scale: .95; background: var(--line); transition-duration: .06s; }
.wordmark:active { scale: .97; opacity: .5; transition-duration: .06s; }
/* listening and sending: a darker, settled button */
.hold.down, .hold.busy { background: #2a2925; }
.gh-link .star { transition: opacity .2s, rotate .3s cubic-bezier(.3, 1.6, .5, 1), scale .3s cubic-bezier(.3, 1.6, .5, 1); }

/* ---------------------------------------------------------------- steps */
.steps { max-width: var(--max); margin: 96px auto 0; padding: 0 var(--gutter); display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 36px; }
.steps div { padding-top: 0; }
.steps .illus { width: 100%; height: auto; margin: 0 0 14px; }
.steps h2 { font-size: 28px; line-height: 1.15; margin-bottom: 10px; }
.steps p { margin: 0; color: var(--ink-2); font-size: 16px; max-width: 22rem; }

/* ---------------------------------------------------------------- battery */
.battery { max-width: var(--max); margin: 150px auto 0; padding: 0 var(--gutter); text-align: center; }
.battery h2 { font-size: clamp(40px, 5.6vw, 76px); line-height: 1.04; }
.battery p { margin: 18px auto 0; max-width: 30rem; color: var(--ink-2); font-size: 18px; }

/* ---------------------------------------------------------------- app */
.app { max-width: var(--max); margin: 150px auto 0; padding: 0 var(--gutter); text-align: center; }
.app h2, .details h2 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; }
.app p { margin: 16px auto 0; color: var(--ink-2); max-width: 30rem; }
/* laptop and phone, overlapping: big enough to actually read */
.screens { display: grid; max-width: 960px; margin: 56px auto 0; padding-bottom: 72px; }
/* both screenshots share one grid cell, so the section always grows to fit the taller one */
.screens .shot { grid-area: 1 / 1; }
.shot { margin: 0; overflow: hidden; background: var(--surface); }
.shot img { display: block; width: 100%; height: auto; }
.shot-desk { width: 76%; justify-self: start; align-self: start; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 60px -34px rgb(60 52 30 / .25); }
.front-bot { grid-area: 1 / 1; justify-self: start; align-self: end; width: 18%; height: auto; margin: 0 0 -6% 56%; position: relative; z-index: 2; pointer-events: none; }
.shot-phone { width: 30%; justify-self: end; align-self: end; margin-top: 64px; position: relative; z-index: 1; border: 7px solid #2c2b27; border-radius: 38px; box-shadow: 0 30px 50px -24px rgb(40 34 20 / .35); }

/* ---------------------------------------------------------------- free and open source */
.open { max-width: var(--max); margin: 150px auto 0; padding: 0 var(--gutter); text-align: center; }
.open h2 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; }
.open-lede { margin: 16px auto 0; color: var(--ink-2); max-width: 30rem; }
.open-points { margin: 48px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 36px; text-align: left; }
.open-points div { padding-top: 22px; border-top: 1px solid var(--line); }
.open-points h3 { margin: 0 0 8px; font: 400 24px/1.2 var(--display); font-variation-settings: "SOFT" 100; letter-spacing: -.02em; }
.open-points p { margin: 0; color: var(--ink-2); font-size: 16px; max-width: 20rem; }
.open-illus { display: block; width: min(100%, 760px); height: auto; margin: 0 auto 8px; }
.gh-link {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 48px; padding: 0 24px; height: 52px; border-radius: 999px;
  background: var(--charcoal); color: var(--on-charcoal); text-decoration: none; font-size: 16px; font-weight: 500;
  transition: translate .2s cubic-bezier(.3, 1.6, .5, 1), scale .12s ease, background .2s, box-shadow .2s;
}
.gh-link svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.gh-link .star { width: 15px; height: 15px; opacity: .55; }
.gh-note { margin: 12px 0 0; font-size: 14px; color: var(--ink-2); }

/* ---------------------------------------------------------------- details */
.details { max-width: var(--max); margin: 150px auto 0; padding: 0 var(--gutter); display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.3fr); gap: 48px; }
dl { margin: 0; }
dl div { display: grid; grid-template-columns: 7rem 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 16px; }
dl div:last-child { border-bottom: 1px solid var(--line); }
dt { color: var(--ink-2); }
dd { margin: 0; }

/* ---------------------------------------------------------------- footer */
.foot { max-width: var(--max); margin: 150px auto 0; padding: 26px var(--gutter) 40px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; font-size: 14px; color: var(--ink-2); }

/* wide screens: the card lands beside the device instead of under the button */
@media (min-width: 1100px) {
  .hero { position: relative; }
  .hero h1 { margin-top: 88px; }
  .cards { position: absolute; left: calc(50% + 190px); top: calc(min(60vh, 600px) / 2); translate: 0 -50%; width: 360px; min-height: 0; margin: 0; }
  .card { animation-name: card-side; }
  @keyframes card-side { from { opacity: 0; transform: translateX(-28px) scale(.97); } }
}

@media (max-width: 760px) {
  /* phones: device, then the button right under it; the words and the card appear below the button only
     once the demo runs, so nothing reserves empty space while it's idle */
  .stage { height: 46svh; min-height: 300px; }
  .hold { order: 1; margin-top: 4px; }
  .caption { order: 2; height: auto; min-height: 0; margin: 20px 0 0; }
  .caption:empty { display: none; }
  .cards { order: 3; min-height: 0; margin-top: 20px; }
  .cards:empty { display: none; }
  .hero h1 { order: 4; margin-top: 48px; }
  .lede { order: 5; }
  .steps, .details, .open-points { grid-template-columns: 1fr; }
  .open-points div { padding-bottom: 22px; }
  .screens { padding: 0 0 48px; margin-top: 40px; }
  .shot-desk { display: none; }
  .shot-phone { width: min(80%, 320px); justify-self: center; margin-top: 0; }
  .front-bot { width: min(29%, 120px); margin: 0 0 -9% 3%; }
  .steps div { padding-bottom: 26px; }
  dl div { grid-template-columns: 1fr; gap: 0; }
}
