/* Highlight website prototype. One lamp (the dot of the first i) lights the page.
   Night is where the lamp works; paper is what it lights. Yellow is only ever a mark or the lamp. */

:root {
  --night: #050505;
  --night-2: #151412;
  --paper: #f2f1ee;
  --paper-2: #e7e6e2;
  --ink: #0b0b0a;
  --ink-2: #55534e;
  --moon: #f4f3f0;
  --moon-2: #a9a69e;
  --lamp: #ffc83d;
  /* The lit edge of the app's review window: hottest at the square corner, cooling along the glass. */
  --edge-light: linear-gradient(90deg, #fff9dc 0, #ffe98f 2.5%, #ffc83d 11%, #f0961a 36%, #8c4e0b 68%, #3a2105 100%);
  --mark-fill: rgba(255, 204, 0, .45);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  --display: clamp(2.125rem, 4.2vw, 3.5rem);
  --title: clamp(1.375rem, 2.1vw, 1.75rem);
  --body: 1.0625rem;
  --small: .875rem;
  --fine: .8125rem;

  --gutter: clamp(20px, 4vw, 56px);
  --max: 1160px;
  --gap: clamp(32px, 5vw, 80px);
  --section: clamp(96px, 12vw, 176px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--body)/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
a { color: inherit; }
button { font: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }    /* every control here shows its own answer to a tap */
q { quotes: "“" "”"; }
::selection { background: var(--mark-fill); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.slab :focus-visible, .nav :focus-visible { outline-color: var(--lamp); }

h1, h2 {
  font-size: var(--display);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.035em;
}
h3 { font-size: var(--body); font-weight: 600; }
h1, h2, h3, dt { text-wrap: balance; }
p, dd { text-wrap: pretty; }                               /* no last line of one word */
.lede { font-size: var(--title); line-height: 1.32; letter-spacing: -.012em; }
.fine { font-size: var(--fine); color: var(--ink-2); }
kbd {
  font: inherit;
  font-weight: 500;
  color: var(--moon);
  padding: .1em .46em;
  margin: 0 .08em;
  border-radius: .32em;
  background: rgba(255, 255, 255, .11);
}
mark {
  color: inherit;
  /* One flat colour, set as an image so the app's highlighter pass can draw it from left to right. */
  background: linear-gradient(var(--fill, var(--mark-fill)), var(--fill, var(--mark-fill))) 0 0 / 100% 100% no-repeat;
}
/* As in the app, the yellow fill is the whole mark. An underline joins it only when colour cannot be relied on. */
@media (prefers-contrast: more), (forced-colors: active) {
  mark { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
}

.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; z-index: 30; top: 12px; left: 12px; padding: 10px 14px; border-radius: 10px; background: var(--moon); color: var(--ink); transform: translateY(-200%); }
.skip:focus { transform: none; }

/* ---------- Navigation: dark glass, lit faintly from the side the wordmark sits on ---------- */
.nav {
  position: fixed;
  z-index: 20;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(700px, 100% - 24px);
  height: 56px;
  padding: 0 8px 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 16px;
  color: var(--moon);
  /* Mostly opaque: the bar has to stay dark, and its links readable, when paper scrolls beneath it. */
  background: rgba(16, 15, 14, .86);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .1), 0 12px 32px -14px rgba(0, 0, 0, .65);
}
.nav__brand { display: flex; margin-right: auto; border-radius: 10px; }
.nav__brand img { height: 46px; width: auto; margin-left: -8px; transition: opacity .9s ease; }
/* The opening is dark everywhere: the bar's own wordmark and button come up with the lamp. */
.intro .nav__brand img { opacity: 0; }
.intro .nav .btn { opacity: .5; }
.nav .btn { transition: transform .15s var(--ease), background-color .2s, opacity .9s ease; }
.nav__links { display: flex; gap: 2px; margin-right: 6px; }
.nav__links a {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: var(--small);
  font-weight: 500;
  color: #c9c6be;
  text-decoration: none;
  transition: color .2s, background-color .2s;
}
.nav__links a:hover { color: var(--moon); background: rgba(255, 255, 255, .07); }

/* ---------- Buttons: one shape. The dot is an unlit lamp until you reach for it. ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px 0 18px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .15s var(--ease), background-color .2s;
}
.btn::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8d8a82;
  transition: background-color .25s, box-shadow .4s;
}
.btn:hover::before, .btn:focus-visible::before {
  background: var(--lamp);
  box-shadow: 0 0 0 3px rgba(255, 200, 61, .3), 0 0 16px 3px rgba(255, 170, 40, .8);
}
.btn:active { transform: scale(.975); }
.btn--moon { background: var(--moon); color: var(--ink); }
.btn--moon:hover { background: #fff; }
.btn--small { height: 40px; padding: 0 16px 0 13px; font-size: var(--small); }

/* ---------- Slab: a dark block with the review window's geometry.
   Square lower-left corner, rounded lower-right, and a lit edge that wraps the round corner. ---------- */
.slab {
  --edge: 6px;
  --corner: clamp(28px, 4.5vw, 64px);
  position: relative;
  padding-bottom: var(--edge);
  border-radius: 0 0 var(--corner) 0;
  /* Painted only behind the lower edge and the corner it wraps. At full height the amber also fringed the top edge. */
  background: var(--edge-light) 0 100% / 100% calc(var(--corner) + var(--edge)) no-repeat;
}
.slab::after {            /* the edge's light falling on the paper below */
  content: "";
  position: absolute;
  left: 0;
  top: calc(100% - 1px);
  width: min(72%, 980px);
  height: 150px;
  background: radial-gradient(100% 100% at 0 0, rgba(255, 176, 46, .36), rgba(255, 176, 46, .1) 46%, rgba(255, 176, 46, 0) 72%);
  pointer-events: none;
}
.slab__body {
  position: relative;
  overflow: hidden;
  border-radius: inherit;
  background: var(--night);
  color: var(--moon);
}
.slab__body::after {      /* film grain, so the dark never bands */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: .05;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.slab .fine { color: var(--moon-2); }
.slab--panel { --corner: 28px; border-radius: var(--corner) var(--corner) var(--corner) 0; }
.slab--panel::after {     /* this block stands inside the page, so its light also spills past its left corner */
  left: -96px;
  width: calc(min(72%, 980px) + 96px);
  background: radial-gradient(100% 100% at 96px 0, rgba(255, 176, 46, .36), rgba(255, 176, 46, .1) 46%, rgba(255, 176, 46, 0) 72%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 96px);
  mask-image: linear-gradient(90deg, transparent, #000 96px);
}

/* ---------- The wordmark and its lamp ---------- */
.mark { position: relative; aspect-ratio: 1680 / 700; --lx: 24.4%; --ly: 38.36%; }
.mark__lit { position: absolute; inset: 0; width: 100%; height: 100%; }
/* The raster's haze stops short at its right edge. Here it runs out over a longer distance instead. */
.mark__fade {
  position: absolute;
  inset: 0;
  -webkit-mask-image: linear-gradient(90deg, #000 84.5%, transparent 98%);
  mask-image: linear-gradient(90deg, #000 84.5%, transparent 98%);
}
.mark__ghost { position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; }
.mark__ghost i { position: absolute; inset: 0; background: url(assets/wordmark-ghost.webp) 0 0 / 100% 100% no-repeat; }
.mark__glow {
  position: absolute;
  left: var(--lx);
  top: var(--ly);
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255, 196, 84, .5), rgba(255, 150, 30, .2) 26%, rgba(255, 140, 20, .07) 52%, rgba(255, 140, 20, 0) 78%);
  opacity: .3;
  pointer-events: none;
  transition: opacity .6s ease, transform .7s var(--ease);
}
.mark__lamp {
  position: absolute;
  left: var(--lx);
  top: var(--ly);
  width: 2.5%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, #fff 0 40%, #ffefc0 58%, rgba(255, 190, 80, 0) 100%);
  box-shadow: 0 0 22px 8px rgba(255, 186, 74, .5);
  animation: breathe 5s ease-in-out infinite alternate;
}
.mark__caret {
  position: absolute;
  left: 8.57%;
  top: 35.14%;
  width: max(2px, .22%);
  height: 34.57%;
  border-radius: 1px;
  background: #fff;
  opacity: 0;
  transition: opacity .2s linear;
}
/* Dark from the first paint, before the script has had a chance to switch the lamp off. */
.intro .mark--hero:not(.is-lamp) :is(.mark__lit, .mark__glow, .mark__lamp) { opacity: 0; transition: none; animation: none; }
.mark.is-typing .mark__caret { opacity: 1; }      /* steady while it types, as in the logo animation */
.mark.is-typing .mark__ghost { opacity: 1; transition: none; }
.mark.is-typing .mark__ghost i { opacity: 0; }
.mark.is-dim .mark__ghost { opacity: .34; }
.mark.is-off .mark__lit { opacity: 0; }
.mark.is-off .mark__glow { opacity: 0; transform: translate(-50%, -50%) scale(.5); }
.mark.is-off .mark__lamp { opacity: 0; animation: none; }
/* The lamp is on and the word is not yet: the script masks the lit wordmark down to a small pool around the dot,
   and what that pool shows of the nearest strokes is amber, as in the logo animation. */
.mark.is-lamp.is-off .mark__lit { opacity: 1; filter: brightness(.6) sepia(1) saturate(4); }
.mark.is-lamp .mark__lamp { opacity: 1; animation: click .32s var(--ease) both; }

@keyframes breathe { from { opacity: .25; } to { opacity: .8; } }
@keyframes click {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); }
  40% { opacity: 1; transform: translate(-50%, -50%) scale(2.2); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes ribbon { from { background-position-x: 100%; } to { background-position-x: 0%; } }

/* ---------- Hero ---------- */
.hero {
  --lx: 38%;
  --ly: 36%;
  position: relative;
  padding: 96px var(--gutter) 40px;         /* no full-height hero: the app's window has to reach the first screen */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero::before {           /* what the lamp throws on the room once it is on */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(44vmax 30vmax at var(--lx) var(--ly), rgba(255, 168, 46, .13), rgba(255, 168, 46, 0) 70%),
    radial-gradient(96vmax 62vmax at var(--lx) var(--ly), rgba(255, 150, 30, .055), rgba(255, 150, 30, 0) 72%);
  transition: opacity 1.4s ease;
}
.intro .hero::before { opacity: 0; }
.mark--hero {
  --w: min(780px, 104vw);
  flex: none;
  width: var(--w);
  margin: calc(var(--w) * -.09) 0 calc(var(--w) * -.04);
}
.hero__copy { position: relative; display: grid; justify-items: center; gap: 20px; max-width: 44rem; }
/* The words are in the room from the first frame, unlit. The lamp brings them up. */
.hero__copy > * { transition: opacity .9s ease; }
.hero__copy > :nth-child(2) { transition-delay: .08s; }
.hero__copy > :nth-child(3) { transition-delay: .16s; }
.intro .hero__copy > * { opacity: .5; }
.hero h1 .unlit { color: #7b7973; }
.hero__sub { max-width: 34rem; color: var(--moon-2); }
.hero__action { display: grid; justify-items: center; gap: 12px; margin-top: 8px; }

/* ---------- Demo: the review window, at its real size, doing its job ---------- */
.demo { padding: clamp(32px, 4vw, 56px) 0 clamp(80px, 10vw, 144px); }
.demo__grid { display: grid; grid-template-columns: 5fr 7fr; gap: var(--gap); align-items: start; }
.demo__intro { display: grid; gap: 20px; justify-items: start; }
.demo__intro p { max-width: 30rem; color: var(--moon-2); }
.demo__samples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.demo__samples button {
  height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  font-size: var(--small);
  font-weight: 500;
  color: var(--moon-2);
  background: var(--night-2);
  cursor: pointer;
  transition: color .2s, background-color .2s;
}
.demo__samples button:hover { color: var(--moon); }
.demo__samples button[aria-pressed="true"] { color: var(--ink); background: var(--moon); }

.demo__stage { display: grid; gap: 28px; align-content: start; }
.doc { font-family: var(--serif); font-size: var(--title); line-height: 1.42; color: var(--moon); }
.doc__sel {
  padding: .1em 0;
  background: #373736;                      /* opaque, so wrapped lines do not darken where they overlap */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.doc--paper { color: var(--ink); }
.doc--paper .doc__sel { background: #cfcecb; }
.demo .doc { min-height: 2.84em; transition: opacity .16s ease; }
.demo .doc.is-swapping { opacity: .25; }

.demo__slot { display: grid; }
.demo__slot > * { grid-area: 1 / 1; }
.demo__prompt { display: grid; gap: 16px; align-content: start; justify-items: start; transition: opacity .2s ease; }
.demo__check .keys { display: inline-flex; gap: 8px; }
.demo__check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: -8px;
  padding: 8px 16px 8px 8px;
  border: 0;
  border-radius: 18px;
  background: none;
  color: var(--moon);
  font-weight: 500;
  cursor: pointer;
}
.demo__check-label { margin-left: 10px; }
.demo__done { display: none; color: var(--moon-2); }
[data-state="done"] .demo__done { display: block; }
[data-state="checking"] .demo__prompt, [data-state="ready"] .demo__prompt { opacity: 0; visibility: hidden; }
.demo__live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.demo__legend { display: flex; gap: 8px; min-height: 36px; margin: -8px 0 0 -10px; visibility: hidden; opacity: 0; transition: opacity .2s ease; }
[data-state="ready"] .demo__legend { visibility: visible; opacity: 1; }
.demo__legend button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  font-size: var(--small);
  color: var(--moon-2);
  cursor: pointer;
  transition: color .2s, background-color .2s;
}
.demo__legend button:hover { color: var(--moon); background: rgba(255, 255, 255, .06); }
.demo__legend kbd { margin: 0; }

/* Keycaps */
.key {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 11px;
  background: #1c1b19;
  color: var(--moon);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -3px 0 rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .06), 0 8px 16px -8px rgba(0, 0, 0, .9);
  transition: transform .09s ease, box-shadow .09s ease, color .15s, background-color .15s, text-shadow .15s;
}
.key b { font-size: var(--body); font-weight: 600; line-height: 1; }
.key small { font-size: var(--fine); line-height: 1; }
.demo__check:hover .key { background: #272622; }
.key.is-down, .demo__check:active .key {
  transform: translateY(2px);
  color: var(--lamp);
  text-shadow: 0 0 14px rgba(255, 190, 70, .85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 -1px 0 rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 200, 61, .25), 0 3px 8px -6px rgba(0, 0, 0, .9);
}

/* The review window, measured from Highlight 1.7.4 (ReviewChrome.swift and Review-Dark.png): 520 pt wide,
   116 pt at its shortest, 15 pt corners, a square lower-left corner, and a 4 pt amber edge that wraps the
   lower-right corner and drifts once every 4.8 s. */
.review {
  --win: #1e1e1e;
  width: min(520px, 100%);
  padding-bottom: 4px;
  border-radius: 15px 15px 15px 0;
  background: linear-gradient(90deg, #ff940a, #ffd933, #ffa814, #ff940a, #ffd933, #ffa814, #ff940a) 85% 0 / 200% 100%;
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .7), 0 24px 52px -14px rgba(0, 0, 0, .8);    /* the app's window casts a plain shadow */
  font: 16px/22px var(--sans);
  text-align: left;
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px) scale(.985);
  transform-origin: 0 0;
  transition: opacity .18s ease, transform .24s var(--ease), visibility 0s .2s;
}
[data-state="checking"] .review, [data-state="ready"] .review { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; animation: ribbon 4.8s linear infinite paused; }
.demo__stage.is-seen .review { animation-play-state: running; }      /* like the app, it only moves while you can see it */
html:not(.js) .demo__samples, html:not(.js) .demo__legend { display: none; }    /* controls that need the script */
.review__card {
  min-height: 112px;
  display: grid;
  grid-template-rows: 1fr auto;
  border: 1px solid rgba(255, 255, 255, .28);
  border-bottom: 0;
  border-radius: 15px 15px 15px 0;
  background: var(--win);
}
.review__text {
  padding: 14px 15px 10px;
  color: rgba(255, 255, 255, .88);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  outline: 0;
  caret-color: var(--lamp);
}
.review__text mark { --fill: rgba(255, 204, 0, .32); }
.review__foot {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  margin: 0 1px;
  padding: 0 12px 0 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}
.review__gear { width: 17px; height: 17px; fill: rgba(255, 255, 255, .55); }
.review__assistant { font-size: 11px; color: rgba(255, 255, 255, .55); }
.review__busy { display: none; align-items: center; gap: 6px; font-size: 10px; color: rgba(255, 255, 255, .55); }
[data-state="checking"] .review__busy { display: inline-flex; }
.review__busy i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .25);
  border-top-color: rgba(255, 255, 255, .85);
  animation: spin .8s linear infinite;
}
.review__replace {
  width: 76px;
  height: 26px;
  margin-left: auto;
  border: 0;
  border-radius: 6px;
  font: 500 12px var(--sans);
  color: #fff;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
}
.review__replace:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.review__replace:disabled { opacity: .45; cursor: default; }

/* ---------- Paper sections ---------- */
.voice, .menu-plate, .care { padding-top: var(--section); }

.voice__split { display: grid; grid-template-columns: 5fr 7fr; gap: var(--gap); align-items: start; margin-top: clamp(40px, 5vw, 72px); }
.proof { display: grid; gap: 44px; }
.proof__after { font-family: var(--serif); font-size: var(--title); line-height: 1.34; }
.proof__after mark { padding: 0 .05em; }
.proof__before { margin-top: 12px; color: var(--ink-2); }

.lede--narrow { max-width: 28rem; margin-top: 24px; color: var(--ink-2); }
.plate { display: grid; grid-template-columns: 1fr auto 1fr; gap: 36px clamp(28px, 4.5vw, 72px); align-items: center; margin-top: clamp(48px, 6vw, 88px); }
/* The two lists share the plate's rows, so each note sits level with the one across the menu. */
.notes { display: grid; grid-row: span 3; grid-template-rows: subgrid; gap: 36px; }
.notes--left { text-align: right; }
.notes li { color: var(--ink-2); cursor: default; transition: color .2s; }
.notes li.is-active { color: var(--ink); }
/* The dot hangs outside the text, on the menu's side, so a heading and its paragraph share an edge. */
.notes h3 { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 6px -18px; vertical-align: top; }
.notes--left h3 { flex-direction: row-reverse; margin: 0 -18px 6px 0; }
.notes h3::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9c5ba;
  transition: background-color .2s, box-shadow .3s;
}
.notes li.is-active h3::before {
  background: var(--lamp);
  box-shadow: 0 0 0 3px rgba(255, 200, 61, .3), 0 0 12px 2px rgba(255, 170, 40, .55);
}

.menu {
  grid-row: span 3;
  width: 292px;
  padding: 6px;
  border-radius: 10px;
  background: #262626;
  color: #ececec;
  font: 14px/1 var(--sans);
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 0 0 .5px rgba(0, 0, 0, .9), 0 26px 50px -16px rgba(30, 22, 8, .5), 0 8px 18px -8px rgba(30, 22, 8, .35);
}
.menu li { display: flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 6px; white-space: nowrap; transition: background-color .12s, color .12s; }
.menu li span { margin-left: auto; padding-left: 24px; color: rgba(255, 255, 255, .55); }
.menu li.is-off { color: rgba(255, 255, 255, .3); }
.menu li.is-active { background: var(--lamp); color: #15120a; }
.menu li.is-active span { color: rgba(21, 18, 10, .62); }
.menu li.menu__gap { height: 11px; padding: 0; background: linear-gradient(rgba(255, 255, 255, .13), rgba(255, 255, 255, .13)) 12px 5px / calc(100% - 24px) 1px no-repeat; }
.menu__more { font-size: 17px; line-height: 0; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px clamp(24px, 3vw, 48px); margin-top: clamp(40px, 5vw, 72px); }
/* Headings share one row and their texts the next, so a heading that wraps does not push its text below its neighbours'. */
.facts > div { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; }
.facts dt { align-self: end; margin-bottom: 8px; font-weight: 600; }
.facts dd { color: var(--ink-2); }
.care__fine { max-width: 34rem; margin-top: 36px; }

.how { margin-top: var(--section); padding: clamp(72px, 9vw, 128px) var(--gutter); background: var(--paper-2); }
.how > .wrap { width: min(var(--max), 100%); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-top: clamp(40px, 5vw, 72px); }
.steps__art { display: flex; align-items: flex-end; gap: 10px; min-height: 124px; margin-bottom: 28px; }
.steps h3 { margin-bottom: 8px; font-size: var(--title); letter-spacing: -.02em; }
.steps li > p { max-width: 22rem; color: var(--ink-2); }
.steps .key {
  width: 76px;
  height: 76px;
  border-radius: 14px;
  background: #fbfaf7;
  color: var(--ink);
  box-shadow: inset 0 1px 0 #fff, inset 0 -5px 0 #d8d4ca, 0 0 0 1px rgba(11, 11, 10, .1), 0 14px 22px -14px rgba(40, 30, 10, .45);
}
.steps .key--mod { place-items: end start; padding: 12px; }
.steps .key--mod b { position: absolute; top: 12px; right: 12px; }
.steps .key--wide { width: 132px; place-items: end; padding: 12px; }
.steps .key--wide b { position: absolute; top: 12px; right: 12px; }
.steps .key.is-down {
  transform: translateY(3px);
  background: #ffd45a;
  color: var(--ink);
  text-shadow: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -2px 0 #d9a21c, 0 0 0 1px rgba(120, 80, 0, .25), 0 0 26px 2px rgba(255, 190, 70, .65);
}

/* ---------- Close: the review window again, at the size of a room ---------- */
.close { padding: var(--section) 0 clamp(64px, 8vw, 112px); }
.close__body { --pad: clamp(24px, 4.5vw, 64px); display: grid; padding: var(--pad) var(--pad) 0; }
.mark--close {
  --w: min(116%, 1000px); /* capped: the wordmark is a 1680 px raster and softens when stretched further */
  width: var(--w);
  margin: calc(var(--w) * -.115) 0 calc(var(--w) * -.04) calc(var(--w) * -.082);
}
.close h2 { position: relative; }
.close__foot {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin: clamp(36px, 5vw, 72px) calc(var(--pad) * -1) 0;
  padding: 20px var(--pad);
  background: var(--night-2);
}
.close__foot .fine { flex: 1 1 18rem; max-width: 32rem; }

.foot { padding-bottom: 48px; }
.foot__row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 14px 32px; }
.foot nav { display: flex; gap: 24px; }
.foot a { text-underline-offset: 4px; text-decoration-color: rgba(11, 11, 10, .3); transition: text-decoration-color .2s; }
.foot a:hover { text-decoration-color: currentColor; }

/* ---------- Entrances. Content is only ever hidden when the script that reveals it is running. ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .8s var(--ease), transform .8s var(--ease);
    transition-delay: calc(var(--i, 0) * 80ms);
  }
  .js [data-reveal].in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .mark__lamp { animation: none; opacity: .6; }
}

/* Fingers get 44 px. The drawing of the app's window keeps its real size; only its button's reach grows. */
@media (pointer: coarse) {
  .btn--small, .demo__samples button { height: 44px; }
  .demo__legend button { min-height: 44px; }
  .nav__links a { padding-block: 12px; }
  .foot a { padding-block: 12px; margin-block: -12px; }
  .review__replace { position: relative; }
  .review__replace::after { content: ""; position: absolute; inset: -9px 0; }
}

/* ---------- Smaller screens ---------- */
@media (max-width: 900px) {
  .hero { padding-bottom: 72px; }          /* stacked, the hero's last line must not read as a label for the next heading */
  .demo { padding-top: 72px; }
  .demo__grid, .voice__split { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .plate { grid-template-columns: 1fr 1fr; align-items: start; }
  .menu { grid-column: 1 / -1; grid-row: auto; justify-self: center; order: -1; }
  .notes--left { text-align: left; }
  .notes h3 { flex-direction: row; margin: 0 0 6px; }      /* no channel beside the menu to hang the dot in */
  .steps { grid-template-columns: 1fr; gap: 56px; }
  .steps li { display: grid; grid-template-columns: 280px 1fr; column-gap: var(--gap); align-items: center; }
  .steps__art { grid-row: span 2; min-height: 0; margin-bottom: 0; }
  .steps h3 { align-self: end; }
  .steps li > p { align-self: start; }
}
@media (max-width: 600px) {
  .nav { padding-left: 10px; }
  .nav__links { display: none; }
  .plate, .facts { grid-template-columns: 1fr; }
  .notes { display: contents; }                            /* stacked, the notes follow the menu's own order */
  .notes [data-for="setup"], .notes [data-for="rules"] { order: 1; }
  .notes [data-for="assistant"], .notes [data-for="cache"] { order: 2; }
  .notes [data-for="appearance"] { order: 3; }
  .menu { width: min(292px, 100%); }
  .key { width: 48px; height: 48px; }
  .steps li { display: block; }
  .steps__art { margin-bottom: 24px; }
  .close__foot .btn { width: 100%; justify-content: center; }
}
