/* Transeen site.
   StupidMirror's family: one near-black ground, Geist, large type, the product first.
   Transeen's own colours come from its icon: the mint card is the translation, the ivory card
   the original, the tile green the field. The motif is the ⌃⌥2 selection, a hard rectangle:
   page surfaces are square, and only the product's own fragments (marked data-ui) keep
   macOS corners, strokes and shadows. */

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-1.8.2.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0a0d0c;
  --surface: #131916;
  --ink: #edf3ee;
  --muted: #a6b1aa;
  --accent: #b5e3b8;
  --accent-ink: #0c2417;
  --paper: #eef4e2;
  --paper-ink: #132a1f;
  --paper-muted: #44574b;
  --green: #173a2d;
  --green-ink: #e8f2e9;
  --green-muted: #b7cbbd;

  --sans: "Geist", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;

  --margin: clamp(20px, 2.2vw, 32px);
  --gutter: clamp(12px, 1.4vw, 24px);
  --frame: max(var(--margin), calc((100% - 1760px) / 2));

  --small: clamp(14px, 0.84rem + 0.1vw, 15px);
  --body: clamp(17px, 0.98rem + 0.2vw, 19px);
  --lead: clamp(19px, 1.02rem + 0.5vw, 24px);
  --head: clamp(34px, 1.3rem + 2.7vw, 64px);
  --display: clamp(36px, 0.3rem + 7.6vw, 128px);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--body);
  line-height: 1.55;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p,
ul,
ol,
figure,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  font-weight: 560;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

kbd {
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sr-only,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip:focus {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
}

.prose-link,
.text-link {
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
  transition: color 0.2s ease;
}

.prose-link:hover,
.text-link:hover {
  color: var(--accent);
}

.nowrap {
  white-space: nowrap;
}

/* One button on the whole page: a filled rectangle, the selection's shape. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--body);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, transform 0.16s var(--ease-out);
}

.button:hover {
  background: #cdf0cf;
}

.button:active {
  transform: scale(0.97);
}

/* ---------- navigation ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px var(--frame) 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--body);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark img {
  width: 30px;
  height: 30px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 32px);
  font-size: var(--small);
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
}

/* ---------- hero: a fragment on a shaped stage ---------- */

.hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding: clamp(72px, 10vh, 112px) var(--frame) 0;
}

.hero-title {
  grid-column: 1 / -1;
  font-size: var(--display);
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin-left: -0.04em;
}

.hero-copy {
  grid-column: 1 / span 4;
  padding-top: 48px;
}

.hero-lead {
  max-width: 34ch;
  font-size: var(--lead);
  line-height: 1.4;
}

.hero-copy .button {
  margin-top: 36px;
}

.hero-note {
  margin-top: 16px;
  max-width: 34ch;
  color: var(--muted);
  font-size: var(--small);
}

.stage {
  --tab: 52px;
  grid-column: 5 / -1;
  position: relative;
  margin: 48px calc(-1 * var(--frame)) 0 0;
  padding: calc(var(--tab) + 56px) 0 64px 56px;
  background: var(--accent);
  color: var(--accent-ink);
  clip-path: polygon(0 0, calc(2 * (100% - 8 * var(--gutter)) / 8 + var(--gutter)) 0, calc(2 * (100% - 8 * var(--gutter)) / 8 + var(--gutter)) var(--tab), 100% var(--tab), 100% 100%, 0 100%);
  overflow: hidden;
}

.stage-label {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  height: var(--tab);
  padding: 0 18px;
  font-size: var(--small);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The live demo: a sample page under the ⌃⌥2 selection, at the size the app shows it. */
[data-ui].demo {
  --l: 204px;
  --t: 66px;
  --w: 500px;
  --h: 264px;
  --r: 10px;
  --bar-x: 160px;
  --bar-y: 330px;
  position: relative;
  width: 720px;
  max-width: none;
}

[data-ui] .demo-screen {
  position: relative;
  width: 720px;
  height: 500px;
  overflow: hidden;
  cursor: crosshair;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  outline-offset: 4px;
}

[data-ui] .demo-screen img {
  position: absolute;
  inset: 0;
  width: 720px;
  height: 500px;
  max-width: none;
  pointer-events: none;
}

[data-ui] .demo-translation {
  position: absolute;
  inset: 0;
  clip-path: inset(var(--t) calc(720px - var(--l) - var(--w)) calc(500px - var(--t) - var(--h)) var(--l) round var(--r));
  transition: opacity 0.3s var(--ease-out);
}

[data-ui] .demo-translation img {
  opacity: 0;
}

[data-ui] .demo-translation.is-swapping {
  opacity: 0;
}

[data-ui] .demo-translation img.is-on {
  opacity: 1;
}

[data-ui].demo.is-dragging .demo-translation,
[data-ui].demo.is-original .demo-translation {
  opacity: 0;
}

[data-ui] .demo-selection {
  position: absolute;
  left: var(--l);
  top: var(--t);
  width: var(--w);
  height: var(--h);
  border-radius: var(--r);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.28), 0 0 0 1.5px rgba(0, 0, 0, 0.35), inset 0 0 0 1.5px rgba(255, 255, 255, 0.92);
  pointer-events: none;
}

[data-ui].demo.is-original .demo-selection {
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.38), inset 0 0 0 1.5px rgba(255, 255, 255, 0.95);
}

[data-ui] .demo-selection i {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 0 solid #0a84ff;
  opacity: 0;
  transition: opacity 0.12s ease;
}

[data-ui].demo.is-dragging .demo-selection i {
  opacity: 1;
}

[data-ui] .demo-selection i:nth-child(1) { top: 2px; left: 2px; border-width: 2.5px 0 0 2.5px; border-top-left-radius: 2px; }
[data-ui] .demo-selection i:nth-child(2) { top: 2px; right: 2px; border-width: 2.5px 2.5px 0 0; border-top-right-radius: 2px; }
[data-ui] .demo-selection i:nth-child(3) { bottom: 2px; left: 2px; border-width: 0 0 2.5px 2.5px; border-bottom-left-radius: 2px; }
[data-ui] .demo-selection i:nth-child(4) { bottom: 2px; right: 2px; border-width: 0 2.5px 2.5px 0; border-bottom-right-radius: 2px; }

[data-ui] .demo-chip {
  position: absolute;
  left: var(--chip-x, 0);
  top: var(--chip-y, 0);
  padding: 8px 12px;
  border-radius: 11px;
  background: #f4f4f4;
  box-shadow: 0 0 0 0.75px rgba(0, 0, 0, 0.12), 0 6px 18px rgba(0, 0, 0, 0.18);
  color: #1d1d1f;
  font: 500 12px/18px -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: pre;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

[data-ui].demo.is-dragging .demo-chip {
  opacity: 1;
}

[data-ui] .demo-bar {
  position: absolute;
  left: var(--bar-x);
  top: var(--bar-y);
  width: 552px;
  height: 93px;
  transition: opacity 0.18s ease;
}

[data-ui].demo.is-dragging .demo-bar {
  opacity: 0;
  pointer-events: none;
}

[data-ui] .demo-bar img {
  width: 552px;
  height: 93px;
  max-width: none;
}

[data-ui] .demo-compare {
  position: absolute;
  top: 15px;
  width: 40px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

[data-ui] .demo-compare:hover {
  background: rgba(0, 0, 0, 0.045);
}

[data-ui] .demo-compare:focus-visible {
  outline: 2px solid #0a84ff;
  outline-offset: 0;
}

[data-ui] .demo-compare[data-show="original"] {
  left: 18px;
}

[data-ui] .demo-compare[data-show="translation"] {
  left: 62px;
}

/* ---------- compare: one control, blown up ---------- */

.compare {
  position: relative;
  min-height: 92svh;
  padding: clamp(56px, 9vh, 96px) var(--frame);
  overflow: hidden;
  background: var(--accent);
  color: var(--accent-ink);
  transition: background-color 0.45s var(--ease-in-out), color 0.45s var(--ease-in-out);
}

.compare[data-show="original"] {
  background: var(--paper);
  color: var(--paper-ink);
}

.compare-copy {
  position: relative;
  z-index: 1;
  max-width: min(520px, 38%);
}

.compare-copy h2 {
  font-size: var(--head);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.compare-copy p {
  margin-top: 20px;
  max-width: 36ch;
}

/* The toolbar's own segmented control, set in em and enlarged through its font size. */
[data-ui].segmented {
  --u: clamp(12px, min(3vh, 2.6vw), 30px);
  position: absolute;
  left: 45%;
  bottom: calc(-3 * var(--u));
  display: flex;
  gap: calc(0.4 * var(--u));
  padding: calc(1.6 * var(--u));
  border-radius: calc(2 * var(--u));
  background: #ffffff;
  box-shadow: 0 0 0 calc(0.075 * var(--u)) rgba(0, 0, 0, 0.2), 0 calc(3 * var(--u)) calc(9 * var(--u)) rgba(10, 30, 20, 0.16);
  color: #1d1d1f;
}

[data-ui].segmented button {
  width: calc(4 * var(--u) * 4);
  height: calc(3 * var(--u) * 4);
  padding: 0;
  border: 0;
  border-radius: calc(0.6 * var(--u) * 4);
  background: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: calc(1.1 * var(--u) * 4);
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.14s ease-out;
}

[data-ui].segmented button[aria-checked="true"] {
  background: rgba(0, 0, 0, 0.065);
  font-weight: 600;
}

[data-ui].segmented button:hover:not([aria-checked="true"]) {
  background: rgba(0, 0, 0, 0.045);
}

[data-ui].segmented button:focus-visible {
  outline: calc(0.15 * var(--u) * 4) solid #0a84ff;
  outline-offset: calc(-0.15 * var(--u) * 4);
}

/* ---------- how it works: drag through the stages ---------- */

.how {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 88svh;
}

.how-copy,
.how-picture {
  position: relative;
  display: grid;
}

.how-copy {
  align-content: start;
  padding: clamp(56px, 9vh, 96px) var(--gutter) 200px var(--frame);
  background: var(--green);
  color: var(--green-ink);
}

.how-picture {
  place-items: center;
  padding: clamp(48px, 8vh, 88px) var(--margin) 200px;
  background: var(--surface);
}

.how-copy > *,
.how-picture > * {
  grid-area: 1 / 1;
}

.how-step {
  transition: opacity 0.2s ease, visibility 0.2s;
}

.how-step h3 {
  max-width: 13ch;
  font-size: var(--head);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.how-step p {
  margin-top: 24px;
  max-width: 34ch;
  color: var(--green-muted);
}

.how-shot {
  transition: opacity 0.2s ease, visibility 0.2s;
}

.how-shot img {
  width: min(644px, 100%);
}

.js .how-step:not(.is-on),
.js .how-shot:not(.is-on) {
  opacity: 0;
  visibility: hidden;
}

html:not(.js) .how-step:not(:first-child),
html:not(.js) .how-shot:not(:first-child),
html:not(.js) .how-control {
  display: none;
}

.how-control {
  position: absolute;
  left: var(--frame);
  right: var(--frame);
  bottom: 40px;
}

.how-track {
  position: relative;
  height: 40px;
}

.how-track::before,
.how-fill {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  height: 8px;
  pointer-events: none;
}

.how-track::before {
  right: 0;
  background: rgba(237, 243, 238, 0.22);
}

.how-fill {
  width: var(--p, 0%);
  background: var(--ink);
  transition: width 0.2s var(--ease-out);
}

.how-range {
  position: relative;
  display: block;
  width: 100%;
  height: 40px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.how-range::-webkit-slider-runnable-track {
  height: 8px;
  background: transparent;
}

.how-range::-moz-range-track {
  height: 8px;
  background: transparent;
}

.how-range::-webkit-slider-thumb {
  width: 32px;
  height: 32px;
  margin-top: -12px;
  border: 0;
  border-radius: 0;
  background: var(--accent);
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.16s var(--ease-out);
}

.how-range::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 0;
  background: var(--accent);
}

.how-range:active::-webkit-slider-thumb {
  transform: scale(1.12);
}

.how-range:focus-visible {
  outline-offset: 6px;
}

.how-names {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 10px;
  font-size: var(--body);
}

.how-names li {
  color: var(--muted);
  transition: color 0.2s ease;
}

.how-names li:nth-child(2) { text-align: center; translate: -16.66% 0; }
.how-names li:nth-child(3) { text-align: center; translate: 16.66% 0; }
.how-names li:last-child { text-align: right; }

.how-names li.is-on {
  color: var(--ink);
}

.how-names button {
  padding: 4px 0;
  border: 0;
  background: none;
  cursor: pointer;
}

/* ---------- tools: close-ups on a board ---------- */

.board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 104px;
  gap: 8px;
  padding: clamp(120px, 16vh, 200px) var(--frame) 0;
}

.tile {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  color: #1d1d1f;
}

.tile.is-dark {
  background: #262626;
  color: #f2f2f2;
}

.tile-head {
  grid-column: span 6;
  grid-row: span 2;
  padding: 28px;
  background: var(--surface);
  color: var(--ink);
}

.tile-head h2 {
  font-size: var(--head);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.tile img {
  position: absolute;
  width: var(--w);
  max-width: none;
  left: var(--x, auto);
  right: var(--rx, auto);
  top: var(--y, auto);
  bottom: var(--by, auto);
  transition: transform 0.8s var(--ease-out);
}

.tile:hover img {
  transform: scale(1.03);
}

.tile figcaption {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  display: grid;
  gap: 2px;
}

.tile figcaption strong {
  font-size: var(--body);
  font-weight: 560;
}

.tile figcaption span {
  max-width: 40ch;
  font-size: var(--small);
  opacity: 0.74;
}

.tile-6x4 { grid-column: span 6; grid-row: span 4; }
.tile-6x2 { grid-column: span 6; grid-row: span 2; }
.tile-3x4 { grid-column: span 3; grid-row: span 4; }
.tile-3x2 { grid-column: span 3; grid-row: span 2; }

/* ---------- the band: the motif, full width ---------- */

.band {
  padding: clamp(120px, 18vh, 220px) var(--frame);
}

/* Both lines share one cell, so the selection always covers the wider of the two. */
.band-line {
  --p: 1;
  display: grid;
  width: max-content;
  max-width: calc(100% + 0.36em);
  margin-left: -0.18em;
  font-size: var(--display);
  font-weight: 560;
  line-height: 1;
  letter-spacing: -0.045em;
}

.band-line span {
  grid-area: 1 / 1;
  padding: 0.12em 0.18em 0.16em;
}

.band-target {
  background: var(--accent);
  color: var(--accent-ink);
  clip-path: inset(0 calc((1 - var(--p)) * 100%) 0 0);
}

/* ---------- languages: one item per poster line ---------- */

.languages {
  padding: 80px var(--frame);
  background: var(--green);
  color: var(--green-ink);
}

.language-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  font-size: var(--display);
  font-weight: 560;
  line-height: 0.98;
  letter-spacing: -0.04em;
  transition: color 0.2s ease;
}

.language-list li:hover {
  color: var(--accent);
}

.language-list small {
  flex: none;
  font-size: var(--body);
  font-weight: 500;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--green-muted);
}

.languages-note {
  margin-top: 40px;
  max-width: 52ch;
  color: var(--green-muted);
}

/* ---------- activation: the ticket ---------- */

.activate {
  padding: clamp(120px, 18vh, 220px) var(--frame) 0;
}

.ticket {
  --notch: 28px;
  position: relative;
  display: grid;
  grid-template-columns: 7fr 3fr;
  width: min(64vw, 1180px);
  aspect-ratio: 2.3;
  margin-inline: auto;
  background: var(--paper);
  color: var(--paper-ink);
}

.ticket-stub::before,
.ticket-stub::after {
  content: "";
  position: absolute;
  left: calc(var(--notch) / -2);
  width: var(--notch);
  height: var(--notch);
  border-radius: 50%;
  background: var(--bg);
}

.ticket-stub::before { top: calc(var(--notch) / -2); }
.ticket-stub::after { bottom: calc(var(--notch) / -2); }

.ticket-main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 40px;
}

.ticket-main h2 {
  font-size: var(--head);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.ticket-terms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 32px;
}

.ticket-terms li {
  max-width: 34ch;
}

.ticket-stub {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 40px 28px;
  text-align: center;
}

.perforation {
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: -3px;
  width: 6px;
  height: calc(100% - 44px);
  fill: var(--bg);
}

.ticket-code {
  font-size: var(--display);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.ticket-format {
  font-size: var(--small);
  font-variant-numeric: tabular-nums;
  color: var(--paper-muted);
  overflow-wrap: anywhere;
}

.ticket-action {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-height: 56px;
  margin-top: 20px;
  background: var(--green);
  color: var(--green-ink);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.16s var(--ease-out);
}

.ticket-action:hover {
  background: #21503e;
}

.ticket-action:active {
  transform: scale(0.98);
}

.activate-note {
  width: min(64vw, 1180px);
  margin: 32px auto 0;
  color: var(--muted);
}

/* ---------- questions: an accordion of filled tiles ---------- */

.faq {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding: clamp(120px, 18vh, 220px) var(--frame) clamp(120px, 18vh, 220px);
}

.faq-title {
  grid-column: 1 / span 4;
  align-self: start;
  position: sticky;
  top: 96px;
  font-size: var(--head);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.faq-list {
  grid-column: 5 / -1;
  display: grid;
  gap: 8px;
}

.faq-item {
  background: var(--surface);
  transition: background-color 0.25s ease, color 0.25s ease;
}

.faq-item[open] {
  background: var(--accent);
  color: var(--accent-ink);
}

.faq-item summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 18px 72px 18px 24px;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before,
.faq-item summary::after {
  content: "";
  position: absolute;
  right: 28px;
  top: 50%;
  width: 16px;
  height: 3px;
  margin-top: -1.5px;
  background: currentColor;
  transition: transform 0.25s var(--ease-out);
}

.faq-item summary::after {
  transform: rotate(90deg);
}

.faq-item[open] summary::after {
  transform: rotate(0deg);
}

.faq-item h3 {
  font-size: var(--lead);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.faq-item p {
  max-width: 52ch;
  padding: 0 24px 26px;
}

.faq-item a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ---------- closing: the object returns ---------- */

.closing {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  min-height: 90svh;
  padding: 0 var(--frame);
  overflow: hidden;
  background: var(--accent);
  color: var(--accent-ink);
}

.closing-object {
  grid-column: 1 / span 8;
  position: relative;
  min-height: 560px;
}

.closing-object img {
  position: absolute;
  left: -22%;
  bottom: -1%;
  width: 130%;
  max-width: none;
}

.closing-copy {
  grid-column: 10 / -1;
  align-self: center;
  padding: 80px 0;
}

.closing-copy h2 {
  font-size: var(--head);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.closing-copy p {
  margin-top: 18px;
}

.closing-fact {
  font-size: var(--lead);
  font-weight: 560;
}

.closing-copy .button {
  margin-top: 28px;
  background: var(--accent-ink);
  color: var(--accent);
}

.closing-copy .button:hover {
  background: #183a29;
}

/* ---------- footer: the mark, built large ---------- */

.footer {
  padding: 56px var(--frame) 32px;
  background: var(--green);
  color: var(--green-ink);
}

.mark {
  display: block;
  width: 100%;
  height: auto;
}

.mark-stack {
  display: none;
}

.mark-block {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 32px;
  margin-top: 56px;
  font-size: var(--small);
}

.footer-grid nav {
  grid-column: span 2;
}

.footer-grid h2 {
  margin-bottom: 12px;
  font-size: var(--small);
  font-weight: 600;
}

.footer-grid li + li {
  margin-top: 6px;
}

.footer-grid a {
  color: var(--green-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-grid a:hover {
  color: var(--green-ink);
}

.footer-contact {
  grid-column: 9 / -1;
  color: var(--green-muted);
}

.footer-contact p + p {
  margin-top: 6px;
}

.footer-contact a {
  color: var(--green-ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.footer-end {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  font-size: var(--small);
  color: var(--green-muted);
}

.footer-end .button {
  min-height: 44px;
  padding: 0 18px;
  font-size: var(--small);
}

/* ---------- guide pages ---------- */

.guide-hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding: clamp(72px, 10vh, 112px) var(--frame) 0;
}

.guide-hero h1 {
  grid-column: 1 / span 9;
  font-size: var(--display);
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin-left: -0.04em;
}

.guide-hero .hero-lead {
  grid-column: 1 / span 5;
  grid-row: 3;
  margin-top: 32px;
}

.guide-hero figure {
  grid-column: 7 / -1;
  grid-row: 3 / span 3;
  margin-top: 40px;
}

.guide-hero .button {
  grid-column: 1 / span 5;
  grid-row: 4;
  justify-self: start;
  margin-top: 28px;
}

.breadcrumb {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: var(--small);
}

.breadcrumb a {
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--ink);
}

.guide-toc {
  grid-column: 1 / span 5;
  grid-row: 5;
  margin-top: 40px;
  font-size: var(--body);
}

.guide-toc ol {
  display: grid;
  gap: 8px;
}

.guide-toc a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.guide-toc a:hover {
  color: var(--ink);
}

.guide-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding: clamp(80px, 11vh, 128px) var(--frame) 0;
  scroll-margin-top: 24px;
}

.guide-row > h2 {
  grid-column: 1 / span 4;
  align-self: start;
  position: sticky;
  top: 32px;
  font-size: var(--head);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.guide-body {
  grid-column: 6 / -1;
  max-width: 68ch;
}

.guide-body > * + * {
  margin-top: 20px;
}

.guide-body h3 {
  margin-top: 40px;
  font-size: var(--lead);
  font-weight: 560;
  letter-spacing: -0.01em;
}

.guide-body ol.steps {
  counter-reset: step;
  display: grid;
  gap: 14px;
}

.guide-body ol.steps > li {
  position: relative;
  padding-left: 40px;
  counter-increment: step;
}

.guide-body ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1em;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--small);
  font-weight: 600;
}

.guide-body ul.points > li {
  position: relative;
  padding-left: 22px;
}

.guide-body ul.points > li + li {
  margin-top: 10px;
}

.guide-body ul.points > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  background: var(--accent);
}

.guide-body figure img {
  width: 100%;
}

.guide-body figure img[width="440"],
.guide-body figure img[width="552"] {
  width: auto;
  max-width: 100%;
}

.guide-body figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: var(--small);
}

.guide-body a {
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
}

.guide-body a:hover {
  color: var(--accent);
}

.guide-body code,
.guide-body pre {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
}

.guide-body code {
  padding: 0.1em 0.35em;
  background: var(--surface);
  overflow-wrap: anywhere;
}

.guide-body pre {
  overflow-x: auto;
  padding: 18px 20px;
  background: var(--surface);
  line-height: 1.6;
}

.guide-body pre code {
  padding: 0;
  background: none;
}

.keys {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--body);
}

.keys th,
.keys td {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid rgba(237, 243, 238, 0.14);
  text-align: left;
  vertical-align: top;
}

.keys th {
  color: var(--muted);
  font-size: var(--small);
  font-weight: 500;
}

.keys td:first-child {
  width: 34%;
  white-space: nowrap;
  font-weight: 560;
}

.guide-next {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  margin-top: clamp(96px, 14vh, 160px);
  padding: clamp(64px, 10vh, 112px) var(--frame);
  background: var(--accent);
  color: var(--accent-ink);
}

.guide-next h2 {
  grid-column: 1 / span 7;
  font-size: var(--head);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.guide-next p {
  grid-column: 1 / span 6;
  margin-top: 18px;
}

.guide-next .button {
  grid-column: 9 / -1;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: end;
  background: var(--accent-ink);
  color: var(--accent);
}

/* ---------- 404 ---------- */

.lost {
  display: grid;
  align-content: center;
  min-height: 80svh;
  padding: 80px var(--frame);
}

.lost h1 {
  font-size: var(--display);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.lost p {
  margin-top: 24px;
  max-width: 40ch;
  font-size: var(--lead);
}

.lost .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin-top: 36px;
}

/* ---------- Chinese, Japanese and Korean ----------
   Latin display tracking cramps CJK glyphs, and they need more leading. */

html:lang(zh) body {
  line-height: 1.7;
}

:is(.hero-title, .guide-hero h1, .lost h1, .compare-copy h2, .how-step h3, .tile-head h2, .faq-title, .ticket-main h2, .closing-copy h2, .guide-row > h2, .guide-next h2, .band-line span):lang(zh) {
  letter-spacing: -0.01em;
}

:is(.hero-title, .guide-hero h1, .lost h1):lang(zh) {
  line-height: 1.1;
}

.guide-body:lang(zh) {
  font-size: clamp(17px, 1rem + 0.35vw, 21px);
}

.how-step h3:lang(zh) {
  max-width: 9em;
}

.band-line span:lang(zh) {
  line-height: 1.08;
}

.language-list span:is(:lang(zh), :lang(ja), :lang(ko)) {
  letter-spacing: 0;
}

/* ---------- entrances ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s var(--ease-out), transform 0.9s var(--ease-out);
    transition-delay: calc(var(--i, 0) * 80ms);
  }

  .js .is-in[data-rise],
  .js .is-in [data-rise] {
    opacity: 1;
    transform: none;
  }

  .js [data-load] {
    animation: rise-in 0.75s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 90ms + 60ms);
  }

  .js .stage[data-load] {
    animation-duration: 0.9s;
  }

  @keyframes rise-in {
    from {
      opacity: 0;
      transform: translateY(22px);
    }
  }

  .js :is(.mark, .mark-stack) .mark-block {
    transform: scaleY(0.18);
    transition: transform 1.1s var(--ease-expo);
  }

  .js :is(.mark, .mark-stack).is-in .mark-block {
    transform: none;
  }

  .js :is(.mark, .mark-stack) .mark-block:nth-child(2) { transition-delay: 60ms; }
  .js :is(.mark, .mark-stack) .mark-block:nth-child(3) { transition-delay: 120ms; }
  .js :is(.mark, .mark-stack) .mark-block:nth-child(4) { transition-delay: 180ms; }
  .js :is(.mark, .mark-stack) .mark-block:nth-child(5) { transition-delay: 240ms; }
  .js :is(.mark, .mark-stack) .mark-block:nth-child(6) { transition-delay: 300ms; }
  .js :is(.mark, .mark-stack) .mark-block:nth-child(7) { transition-delay: 360ms; }
  .js :is(.mark, .mark-stack) .mark-block:nth-child(8) { transition-delay: 420ms; }

}

/* ---------- tablet ---------- */

@media (max-width: 1023px) {
  .hero-title {
    grid-column: 1 / -1;
  }

  .hero-copy {
    grid-column: 1 / span 9;
  }

  .stage {
    grid-column: 1 / -1;
    margin-left: calc(-1 * var(--frame));
    padding-left: var(--frame);
  }

  .compare-copy {
    max-width: 62%;
  }

  .compare {
    min-height: 0;
    height: max(560px, 62svh);
  }

  [data-ui].segmented {
    left: 28%;
  }

  .how {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .how-picture {
    order: -1;
    min-height: 0;
    padding: 48px var(--margin) 24px;
  }

  .how-control {
    position: static;
    order: 0;
    padding: 8px var(--frame) 32px;
    background: var(--surface);
  }

  .how-copy {
    order: 1;
    padding: 56px var(--frame) 72px;
  }

  .tile-6x4 { grid-column: span 12; }
  .tile-6x2,
  .tile-head { grid-column: span 12; }
  .tile-3x4,
  .tile-3x2 { grid-column: span 6; }

  .ticket {
    width: 100%;
  }

  .activate-note {
    width: 100%;
  }

  .faq-title {
    grid-column: 1 / -1;
    position: static;
    margin-bottom: 32px;
  }

  .faq-list {
    grid-column: 1 / -1;
  }

  .closing {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .closing-copy {
    grid-column: 1;
    grid-row: 1;
    padding: 72px 0 40px;
    max-width: 44ch;
  }

  .closing-object {
    grid-column: 1;
    min-height: 0;
    height: 55svh;
    margin-inline: calc(-1 * var(--frame));
  }

  .closing-object img {
    left: var(--frame);
    right: auto;
    top: 0;
    bottom: auto;
    width: max(130%, 720px);
  }

  .footer-grid nav {
    grid-column: span 6;
  }

  .footer-contact {
    grid-column: 1 / -1;
  }

  .guide-row > h2,
  .guide-body {
    grid-column: 1 / -1;
    position: static;
  }

  .guide-body {
    margin-top: 28px;
  }

  .guide-hero figure,
  .guide-hero .hero-lead,
  .guide-hero .button,
  .guide-toc,
  .guide-hero h1 {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .guide-next h2,
  .guide-next p,
  .guide-next .button {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-self: start;
  }

  .guide-next .button {
    margin-top: 28px;
  }
}

/* ---------- phone ---------- */

@media (max-width: 599px) {
  .nav {
    padding-top: 20px;
  }

  .nav-links {
    gap: 14px;
  }

  .nav-links .nav-optional {
    display: none;
  }

  .hero {
    padding-top: 56px;
  }

  .hero-copy {
    grid-column: 1 / -1;
    padding-top: 24px;
  }

  .hero-copy .button {
    width: 100%;
    margin-top: 28px;
  }

  .stage {
    --tab: 48px;
    margin-top: 40px;
    margin-right: calc(-1 * var(--frame));
    padding: calc(var(--tab) + 16px) 0 40px 16px;
    clip-path: polygon(0 0, 200px 0, 200px var(--tab), 100% var(--tab), 100% 100%, 0 100%);
  }

  [data-ui].demo {
    margin-left: -190px;
  }

  .compare {
    height: max(520px, 78svh);
    padding-top: 56px;
  }

  .compare-copy {
    max-width: none;
  }

  [data-ui].segmented {
    --u: 12px;
    left: var(--frame);
    bottom: 40px;
  }

  .how-picture {
    padding: 32px var(--margin) 20px;
  }

  .how-shot img {
    width: 100%;
  }

  .how-names {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 4px;
    font-size: var(--small);
  }

  .how-names li:nth-child(n) {
    text-align: left;
    translate: none;
  }

  .board {
    grid-auto-rows: 28vw;
    gap: 6px;
  }

  .tile-head {
    grid-column: span 12;
    grid-row: span 2;
    padding: 20px;
  }

  .tile-6x4,
  .tile-6x2 {
    grid-column: span 12;
    grid-row: span 3;
  }

  .tile-3x4,
  .tile-3x2 {
    grid-column: span 6;
    grid-row: span 2;
  }

  .tile figcaption {
    left: 14px;
    right: 14px;
    bottom: 12px;
  }

  .tile img {
    top: 14px;
    bottom: auto;
    left: 14px;
    right: auto;
    width: calc(var(--w) * 0.6);
  }

  .language-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 22px;
    font-size: clamp(36px, 12vw, 56px);
  }

  .ticket {
    grid-template-columns: 1fr;
    aspect-ratio: auto;
  }

  .ticket-stub::before,
  .ticket-stub::after {
    top: calc(var(--notch) / -2);
    bottom: auto;
  }

  .ticket-stub::after {
    left: auto;
    right: calc(var(--notch) / -2);
  }

  .ticket-main {
    padding: 28px 22px;
  }

  .ticket-terms {
    grid-template-columns: 1fr;
  }

  .ticket-stub {
    padding: 32px 22px;
  }

  .perforation {
    display: none;
  }

  .closing-copy .button,
  .guide-next .button {
    width: 100%;
  }

  .footer-end {
    flex-direction: column;
    align-items: flex-start;
  }

  .mark {
    display: none;
  }

  .mark-stack {
    display: block;
  }

  .keys td:first-child {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
