:root {
  /* console */
  --bg: var(--tq-console);
  --surface: var(--tq-console-surface);
  --card: var(--tq-console-card);
  --line: var(--tq-console-line);
  --line-mid: var(--tq-console-line-mid);
  --line-strong: var(--tq-console-line-strong);
  --fg: var(--tq-console-text);
  --fg-strong: var(--tq-white);
  --fg-dim: var(--tq-console-text-dim);
  --fg-mute: var(--tq-console-text-mute);
  --mono: var(--tq-font-mono);
  --ui: var(--tq-font-ui);
  /* one frame for the header, the stage and the footer, capped so a wide
     screen gets margins rather than a sprawl */
  --g: clamp(20px, 4.4vw, 72px);
  --edge: max(var(--g), (100vw - 1560px) / 2);
  --gap: clamp(48px, 5.5vw, 112px);
  --top: 72px;
}

* { box-sizing: border-box; }
html, body { background: var(--bg); }
body {
  margin: 0; color: var(--fg);
  font: 16px/1.6 var(--ui); -webkit-font-smoothing: antialiased;
}
/* the whole page is console, so its focus ring is the console's */
:root { --tq-focus: var(--tq-signal-deep); }
a { text-decoration: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* ---------- the header, the hero, the footer ---------- */

/* one button on console: primary, outline and ghost, compact or .lg; the
   primary carries the arrow and is never a signal colour (feature 038) */
.btn, .cols a {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 36px; padding: 0 14px;
  font: 500 14px/1 var(--ui); color: var(--fg); white-space: nowrap;
  background: transparent; border: 1px solid var(--line-mid); border-radius: 6px;
  transition: background .12s, border-color .12s, color .12s, scale .12s;
}
.btn:active, .cols a:active { scale: .97; }
.btn:hover, .cols a:hover { background: var(--tq-console-hover); border-color: var(--line-strong); }
.btn.lg { min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn.primary { color: var(--bg); background: var(--fg); border-color: var(--fg); }
.btn.primary:hover { background: var(--fg-strong); border-color: var(--fg-strong); }
.btn.ghost, .cols a { gap: 8px; padding-inline: 10px; color: var(--fg-dim); border-color: transparent; }
.btn.ghost:hover, .cols a:hover { color: var(--fg-strong); border-color: transparent; }
.btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s cubic-bezier(.16, 1, .3, 1); }
.btn.ghost svg { width: 14px; height: 14px; }
.btn.primary:hover svg { transform: translateX(3px); }

/* Docs beside the mark, the account doors on the right */
.top { min-height: var(--top); display: flex; align-items: center; gap: 14px; padding: 14px var(--edge); }
.top .tq-mark { font-size: 20px; }
.nav { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nav::before { content: ""; width: 1px; height: 20px; margin-right: 8px; background: var(--line); }
.nav .push { margin-left: auto; }

/* the hero: the pitch centred, the app's windows fanned beneath it */
.hero { display: grid; justify-items: center; text-align: center; padding: clamp(36px, 6vw, 84px) var(--edge) 0; }
h1 {
  margin: 0; max-width: 15em; font-size: clamp(40px, 5.4vw, 76px); font-weight: 600; line-height: 1.03;
  letter-spacing: -0.035em; text-wrap: balance; color: var(--fg-strong);
}
h1 .dim { color: var(--fg-mute); }
.lede { margin: clamp(20px, 2vw, 28px) 0 0; max-width: 40em; font-size: clamp(17px, 1.3vw, 20px); line-height: 1.5; color: var(--fg-dim); text-wrap: balance; }

.cta { margin-top: clamp(28px, 2.6vw, 40px); display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.reassurance { margin: 14px 0 0; color: var(--fg-dim); font-size: 14px; text-wrap: balance; }

/* the free hour over the headline, in the cockpit's own clock */
.offer {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 clamp(20px, 2vw, 28px); padding: 6px 14px 6px 6px;
  font: 500 14px/1 var(--ui); color: var(--fg-dim); white-space: nowrap;
  border: 1px solid var(--line-mid); border-radius: 999px; background: var(--surface);
}
.clock { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; background: var(--card); font: 500 13px/1 var(--mono); color: var(--fg); font-variant-numeric: tabular-nums; }
.clock svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- the tour: a row per feature, the real app held at an angle beside its copy ---------- */

.tour { padding: clamp(64px, 8vw, 120px) var(--edge) 0; display: grid; gap: clamp(72px, 9vw, 140px); }
.tour-head { display: grid; gap: 14px; justify-items: center; text-align: center; }
.tour-head h2, .close h2 { margin: 0; font-size: clamp(32px, 3.6vw, 50px); font-weight: 600; line-height: 1.08; letter-spacing: -0.03em; color: var(--fg-strong); text-wrap: balance; max-width: 18em; }
.tour-head p, .close p { margin: 0; font-size: clamp(17px, 1.3vw, 19px); color: var(--fg-dim); text-wrap: balance; }

.row { display: grid; gap: 32px; align-items: center; }
.copy { display: grid; gap: 14px; align-content: start; max-width: 30rem; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0; font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-mute); }
.eyebrow svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.copy h3 { margin: 0; font-size: clamp(26px, 2.4vw, 36px); font-weight: 600; line-height: 1.12; letter-spacing: -0.025em; color: var(--fg-strong); text-wrap: balance; }
.copy > p:not(.eyebrow) { margin: 0; font-size: 17px; line-height: 1.55; color: var(--fg-dim); text-wrap: pretty; }
.copy ul { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
/* Lucide's check, as a mask so it takes the text's own colour */
.copy li { position: relative; padding-left: 28px; font-size: 15px; line-height: 1.5; color: var(--fg-dim); text-wrap: pretty; }
.copy li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px; background: var(--fg-mute);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* the pictures: a front page and, for most rows, a second one set behind it;
   each is a button that opens it in the viewer */
.shots { position: relative; min-width: 0; }
.shot {
  display: block; width: 100%; padding: 0; border: 0; border-radius: 10px; background: none; cursor: zoom-in;
  transition: translate .2s cubic-bezier(.16, 1, .3, 1), scale .12s;
}
.shot:active { scale: .98; }
@media (hover: hover) {
  .shot:hover { translate: 0 -4px; }
  .shot:hover img { border-color: var(--line-strong); }
}
.shots img {
  display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line-mid); background: var(--surface);
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .65), 0 0 0 1px rgba(0, 0, 0, .3); transition: border-color .12s;
}
.shots .back { display: none; }

@media (min-width: 900px) {
  .row { grid-template-columns: minmax(0, 40fr) minmax(0, 60fr); gap: var(--gap); }
  .row:nth-of-type(even) { grid-template-columns: minmax(0, 60fr) minmax(0, 40fr); }
  .row:nth-of-type(even) .copy { order: 2; }
  .shots { perspective: 1600px; padding-block: 4% 10%; }
  .shot { --tilt: rotateY(-14deg) rotateX(6deg); --z: translateZ(0); transform: var(--tilt) var(--z); transition: transform .6s cubic-bezier(.16, 1, .3, 1), translate .2s cubic-bezier(.16, 1, .3, 1), scale .12s; }
  .row:nth-of-type(even) .shot { --tilt: rotateY(14deg) rotateX(6deg); }
  .shots .front, .shots .solo { position: relative; z-index: 1; }
  .shots .front { width: 88%; }
  .shots .back { --z: translateZ(-90px); display: block; position: absolute; right: -2%; top: 18%; width: 78%; opacity: .9; }
  .row:nth-of-type(even) .shots .front { margin-left: auto; }
  .row:nth-of-type(even) .shots .back { right: auto; left: 2%; }
  /* the pages turn to face the reader as they scroll in; without scroll timelines, when pointed at */
  .row:hover .shot { transform: var(--z); }
  @media (prefers-reduced-motion: no-preference) {
    @supports ((animation-timeline: view()) and (animation-range: entry)) {
      .shot { animation: face auto linear both; animation-timeline: view(); animation-range: entry 0% cover 50%; }
    }
  }
}
@keyframes face { from { transform: var(--tilt) var(--z); } to { transform: var(--z); } }

/* the viewer: one picture at the size the screen allows */
.viewer:modal {
  width: fit-content; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); padding: 4px;
  border: 0; background: transparent; overscroll-behavior: contain;
}
.viewer[open] { display: grid; gap: 12px; justify-items: end; }
.viewer::backdrop { background: color-mix(in srgb, var(--bg) 92%, transparent); overflow: hidden; overscroll-behavior: contain; }
/* sized before it loads: the captures are 16:10, their height from the width and height attributes */
.viewer img {
  display: block; width: min(100vw - 40px, (100dvh - 96px) * 16 / 10, 1440px); height: auto;
  border-radius: 10px; border: 1px solid var(--line-mid); background: var(--surface);
}
/* a phone gets the capture at full size to pan around, Close held in the corner */
@media (max-width: 899px) {
  .viewer:modal { width: 100vw; height: 100dvh; max-width: none; max-height: none; padding: 0; }
  .viewer[open] { display: block; justify-items: start; }
  .viewer img { width: 1440px; border: 0; border-radius: 0; }
  .viewer .btn {
    position: fixed; z-index: 1; background: var(--bg);
    top: max(12px, env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  }
}

.close { display: grid; gap: 16px; justify-items: center; text-align: center; margin: clamp(80px, 9vw, 140px) var(--edge) clamp(56px, 6vw, 96px); padding: clamp(40px, 5vw, 72px) 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.close .btn { margin-top: 8px; }

/* the footer: the mark and its line, then the links by what they are */
.foot {
  position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px 64px;
  padding: 36px var(--edge) 40px; border-top: 1px solid var(--line); background: var(--bg);
}
.foot-who { display: grid; gap: 8px; align-content: start; justify-items: start; }
.foot .tq-mark { font-size: 15px; }
.foot-who p { margin: 0; font-size: 14px; color: var(--fg-mute); }
.cols { display: flex; flex-wrap: wrap; gap: 24px 56px; }
.col { display: grid; gap: 2px; align-content: start; justify-items: start; }
.col-h { margin: 0 0 4px; padding-left: 10px; font-size: 13px; color: var(--fg-mute); }
.cols a { min-height: 32px; }

/* ---------- the fan: three real windows of the app, tipped back in depth ---------- */

.fan {
  width: 100%; margin-top: clamp(40px, 5vw, 64px); padding-bottom: 24px; overflow: hidden;
  perspective: 1700px; perspective-origin: 50% 0;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 72%, transparent); mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 72%, transparent);
}
.rig {
  position: relative; width: min(1120px, 100%); margin: 0 auto; transform-style: preserve-3d;
  transform: rotateX(calc(14deg + var(--ry, 0deg))) rotateY(var(--rx, 0deg));
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.rig img {
  display: block; height: auto; border-radius: 12px; border: 1px solid var(--line-mid); background: var(--surface);
  box-shadow: 0 50px 100px -20px rgba(0, 0, 0, .65), 0 0 0 1px rgba(0, 0, 0, .3);
}
.rig .centre { position: relative; z-index: 2; width: 68%; margin: 0 auto; transform: translateZ(40px); }
.rig .side { position: absolute; top: 7%; width: 52%; opacity: .95; }
.rig .left { left: -4%; transform: translateZ(-160px) rotateY(20deg); }
.rig .right { right: -4%; transform: translateZ(-160px) rotateY(-20deg); }

/* ---------- small screens: the lesson alone, flat ---------- */

@media (max-width: 899px) {
  .rig { transform: none; }
  .rig .side { display: none; }
  .rig .centre { width: 100%; transform: none; }
}
@media (max-width: 420px) {
  .top .tq-mark { font-size: 18px; }
  .cta .btn, .close .btn { width: 100%; }
}

/* touch: every target 44px tall, whatever the width */
@media (pointer: coarse) {
  .btn, .cols a, .top .tq-mark, .foot .tq-mark { min-height: 44px; }
}
/* narrow: the header's primary left to the hero below it */
@media (max-width: 600px) {
  .nav .primary { display: none; }
  .cols { margin-left: -10px; }
}

@media (prefers-reduced-motion: reduce) {
  .rig, .shot, .shots img, .btn, .btn svg, .cols a { transition: none; }
}
