/* ControlPad — controlpad.tech. One stylesheet for every page: no framework, no web fonts
   (the system font is San Francisco on Apple devices), no images for decoration. Dark, like
   the app's default appearance. */

/* ─── TOKENS ─── */

:root {
  color-scheme: dark;

  /* Surfaces: a deep navy-to-black page, with slightly lifted cards. */
  --bg: #05070c;
  --bg-navy: #0a1226;
  --surface: #0e121b;
  --surface-raised: #151a25;
  --hairline: rgba(255, 255, 255, 0.09);

  /* Text. Each passes WCAG AA on --bg and --surface. */
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #8e8e93;

  /* Brand blue: a lighter tint for text on dark, the deeper one for filled controls. */
  --accent: #6ea6ff;
  --accent-fill: #0a5fd8;
  --accent-fill-hover: #1a6ce6;
  --accent-soft: rgba(92, 155, 255, 0.14);
  --glow: rgba(60, 130, 255, 0.16);

  /* Hardware, as the App Store screenshots draw it: black glass with a lit metal edge. */
  --glass: #0c0c0e;
  --metal-edge: #6a6a72;
  --metal-dark: #2a2a2f;

  /* Type and rhythm. Fluid, so nothing needs per-breakpoint overrides. */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --content-max: 1200px;
  --section-gap: clamp(64px, 8vw, 112px);
  --title-gap: clamp(28px, 4vw, 48px);
  --radius-card: 24px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ─── BASE ─── */

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

html {
  font-family: var(--font);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Clear the sticky header when jumping to a section. */
  scroll-padding-top: 72px;
}

body {
  background: var(--bg);
  /* `clip`, not `hidden`: it stops sideways scroll without making body a scroll container,
     which would break the sticky header. */
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

p {
  text-wrap: pretty;
}

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

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  padding: 8px 12px;
  background: var(--text);
  color: var(--bg);
  z-index: 100;
}

.skip-link:focus {
  left: 16px;
}

/* ─── TOP NAV ───
   Sticky, on a near-opaque bar rather than a backdrop blur: blur repaints on every scroll
   frame, which is the expensive thing on mid-range phones. */

.top-nav-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 7, 12, 0.92);
  border-bottom: 1px solid var(--hairline);
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  max-width: var(--content-max);
  min-height: 56px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.top-nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-nav-logo {
  width: 28px;
  height: 28px;
}

.top-nav-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.top-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  color: var(--text-secondary);
}

.top-nav-links a {
  padding: 6px 0;
  transition: color 0.15s;
}

.top-nav-links a:hover {
  color: var(--text);
}

.top-nav-links .top-nav-cta {
  color: #fff;
  background: var(--accent-fill);
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
}

.top-nav-links .top-nav-cta:hover {
  color: #fff;
  background: var(--accent-fill-hover);
}

.top-nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: var(--surface-raised);
  cursor: pointer;
}

/* Two-line menu glyph drawn in CSS, so there's no icon to load. */
.top-nav-toggle span,
.top-nav-toggle span::after {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s ease;
}

.top-nav-toggle span {
  position: relative;
  transform: translateY(-3px);
}

.top-nav-toggle span::after {
  content: "";
  position: absolute;
  top: 6px;
}

.top-nav-toggle[aria-expanded="true"] span {
  transform: translateY(0) rotate(45deg);
}

.top-nav-toggle[aria-expanded="true"] span::after {
  transform: translateY(-6px) rotate(-90deg);
}

/* ─── BUTTONS ─── */

.download-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
  min-height: 58px;
  padding: 8px 22px 8px 18px;
  border-radius: 16px;
  line-height: 1.15;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

/* The App Store: the primary action, as bright as anything on the page. */
.button--primary {
  color: #05070c;
  background: #f5f5f7;
  box-shadow: 0 10px 30px rgba(60, 130, 255, 0.18);
}

.button--primary:hover {
  background: #fff;
}

/* The Mac companion: present, but second. */
.button--secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.button--secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.button-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.button-icon {
  width: 28px;
  height: 28px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.button-small {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.8;
}

.button-large {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.requirements {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--text-tertiary);
}

/* ─── HERO ───
   All CSS: the light is gradients, so the headline paints with the first byte of styles. */

.hero {
  position: relative;
  isolation: isolate;
  padding: clamp(36px, 5vw, 64px) var(--gutter) 0;
  text-align: center;
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(40, 96, 200, 0.32), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 78%, var(--glow), transparent 70%),
    linear-gradient(180deg, #0b1630 0%, var(--bg-navy) 34%, var(--bg) 100%);
}

.hero-text {
  max-width: 860px;
  margin: 0 auto clamp(28px, 4vw, 48px);
}

/* The news, above the headline: a link to the iPhone Duo section. */
.announce {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 36px;
  margin-bottom: 22px;
  padding: 6px 16px 6px 8px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(110, 166, 255, 0.28);
  transition: background-color 0.15s ease;
}

.announce:hover {
  background: rgba(255, 255, 255, 0.1);
}

.announce::after {
  content: "›";
  margin-left: 8px;
  font-size: 17px;
  line-height: 1;
  color: var(--accent);
}

.announce-dot {
  margin: 0 7px;
  color: var(--text-tertiary);
}

.announce-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent-fill);
  border-radius: 999px;
  padding: 3px 9px;
}

.hero h1 {
  font-size: clamp(42px, 5.6vw + 0.5rem, 84px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.02;
  margin-bottom: 22px;
}

.hero-subtitle {
  font-size: clamp(17px, 0.9vw + 14px, 22px);
  line-height: 1.45;
  color: var(--text-secondary);
  max-width: 660px;
  margin: 0 auto 30px;
}

.hero-devices {
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-tertiary);
}

/* The product scene. The <img>'s width and height attributes (and each <source>'s) reserve
   its box before it loads, so nothing below moves. */
.hero-visual {
  width: min(100%, 1160px);
  margin: 0 auto;
}

.hero-visual img {
  width: 100%;
}

/* ─── SECTIONS ───
   One template: a centred header (eyebrow, title, lead) above the content. Sections span
   the page so a background can, and hold their content to the column. */

.section {
  padding: var(--section-gap) max(var(--gutter), (100% - var(--content-max)) / 2);
}

/* A soft blue light from above, for rhythm between sections: a gradient, not an image. */
.section--glow {
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(40, 96, 200, 0.14), transparent 70%);
}

.section-header {
  max-width: 780px;
  margin: 0 auto var(--title-gap);
  text-align: center;
}

.section-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--accent);
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(32px, 3.4vw + 0.75rem, 58px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.06;
}

.section-lead {
  max-width: 660px;
  margin: 18px auto 0;
  font-size: clamp(17px, 0.5vw + 15px, 21px);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
}

/* ─── CARDS ─── */

.card-grid,
.feature-list,
.duo-grid {
  list-style: none;
}

.card-grid {
  display: grid;
  /* Three across, or (below 660px) one: never a lone orphan on a second row. */
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
}

.card {
  padding: 28px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.card h3,
.feature-item h3,
.duo-card h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 6px;
}

.card p,
.feature-item p,
.duo-card p {
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.icon-tile,
.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(92, 155, 255, 0.22);
}

.icon-tile svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.step-number {
  font-size: 20px;
  font-weight: 700;
}

/* ─── DEVICES ───
   Drawn in CSS, as the App Store screenshots draw them, so there are no frame images to
   download and they stay crisp at any size. Each device is a size container: the bezel and
   corners are fractions of its own width (cqw), so it scales as one piece. Corner radii come
   from the simulators' device profiles (iPhone 17 Pro Max: 62 pt on a 440 pt-wide screen;
   iPad Pro: 30 pt on a 1210 pt-wide landscape screen). */

.device {
  container-type: inline-size;
  width: 100%;
  display: flow-root;
}

.device > .screen {
  --screen-w: calc(100cqw - 2 * var(--bezel));
  position: relative;
  overflow: hidden;
  margin: var(--bezel);
  border-radius: calc(var(--screen-w) * var(--screen-r));
  background: #000;
  aspect-ratio: var(--screen-aspect);
}

/* A descendant queries the device's width. The device itself would query its
   ancestor (or viewport), giving the hardware a different radius from the screen. */
.device {
  position: relative;
  isolation: isolate;
}

.device::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: calc((100cqw - 2 * var(--bezel)) * var(--screen-r) + var(--bezel));
  background: var(--glass);
  box-shadow:
    0 0 0 1px var(--metal-edge),
    0 0 0 2px var(--metal-dark),
    0 24px 48px rgba(0, 0, 0, 0.5),
    0 0 80px var(--glow);
}

.device--iphone {
  --bezel: 2.2cqw;
  --screen-r: 0.1409;
  --screen-aspect: 1320 / 2868;
}

.device--ipad {
  --bezel: 2.4cqw;
  --screen-r: 0.0248;
  --screen-aspect: 1600 / 1103;
}

.screen picture,
.screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.screen img {
  object-fit: cover;
}

/* Composed art (marketing-captures/site-art): transparent, with its own shadows. */
.art img {
  width: 100%;
}

/* ─── TRACKPAD, KEYBOARD AND MAC KEYS ─── */

.feature-split {
  display: grid;
  grid-template-columns: auto minmax(0, 520px);
  justify-content: center;
  align-items: center;
  gap: clamp(40px, 7vw, 104px);
}

.feature-device {
  width: 280px;
}

.feature-list {
  display: grid;
  gap: 12px;
}

.feature-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 20px;
  padding: 22px 24px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.feature-item .icon-tile {
  grid-row: span 2;
  margin-bottom: 0;
}

/* The card(s) for the step playing. */
.feature-item.is-current {
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 1px rgba(110, 166, 255, 0.4);
}

/* Input demo (scripts.js), in step with the cards beside it: gestures on the full trackpad,
   a tap on the keyboard button (the keyboard shot wipes up from the bottom, the way the iOS
   keyboard slides in), then a tap on Command (the modifier keys fade in). Frames are hidden
   only once the script arms the demo, so without it the last shows. Everything animated is
   clip-path, opacity or transform: no layout, nothing for the main thread. */
.input-demo.is-armed .input-demo-keyboard {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.5s var(--ease-out);
}

.input-demo.is-armed.is-keyboard .input-demo-keyboard {
  clip-path: inset(0);
}

.input-demo.is-armed .input-demo-modifiers {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.input-demo.is-armed.is-modifiers .input-demo-modifiers {
  opacity: 1;
}

/* Touch indicators. Each is a layer the size of the screen, moved with translate() in
   percentages of itself — i.e. of the screen — carrying one circle (its child span) whose
   height comes from padding (a percentage of the same width), so it is square by
   construction and never stretches. Size never animates: a touch brightens the circle. */
.input-demo {
  --touch: rgba(92, 155, 255, 0.4);
  --touch-pressed: rgba(150, 192, 255, 0.75);
}

.input-demo-finger,
.input-demo-tap {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
}

.input-demo-finger > span,
.input-demo-tap > span {
  position: absolute;
  left: 0;
  top: 0;
  width: 13%;
  height: 0;
  padding-bottom: 13%;
  border-radius: 50%;
  background: var(--touch);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
  transform: translate(-50%, -50%);
}

.input-demo-tap--keyboard { transform: translate(57.9%, 91.2%); }
.input-demo-tap--command { transform: translate(42%, 61.4%); }

.input-demo.is-tapping-keyboard .input-demo-tap--keyboard,
.input-demo.is-tapping-command .input-demo-tap--command {
  animation: input-demo-tap-show 0.6s ease-out;
}

.input-demo.is-tapping-keyboard .input-demo-tap--keyboard > span,
.input-demo.is-tapping-command .input-demo-tap--command > span {
  animation: input-demo-tap-press 0.6s ease-out;
}

@keyframes input-demo-tap-show {
  0% { opacity: 0; }
  20%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes input-demo-tap-press {
  0%, 25% { background: var(--touch); }
  40% { background: var(--touch-pressed); }
  60%, 100% { background: var(--touch); }
}

/* On the trackpad (24–86% down), one 5 s timeline, shaped for a thumb: a right thumb pivots
   near the bottom-right corner, so the pointer sweeps along an arc about that point, drawn
   in around the middle of the trackpad, then clicks; then two fingers scroll up (the
   everyday gesture for reading down a page), side by side on the same samples so they stay
   level. Paths are sampled from smooth curves with eased speed, so the animations
   themselves run linearly. */
.input-demo.is-gesturing .input-demo-finger--one {
  animation: input-demo-finger-one 5s linear;
}

.input-demo.is-gesturing .input-demo-finger--one > span {
  animation: input-demo-finger-one-press 5s linear;
}

.input-demo.is-gesturing .input-demo-finger--two {
  animation: input-demo-finger-two 5s linear;
}

@keyframes input-demo-finger-one {
  /* Generated (see the comment above): a thumb sweeping the pointer around, a click,
     then the left finger of the scroll. */
  0.00% { opacity: 0; transform: translate(31.9%, 60.1%); }
  5.00% { opacity: 1; transform: translate(31.9%, 60.1%); }
  6.77% { opacity: 1; transform: translate(32.1%, 60.0%); }
  8.55% { opacity: 1; transform: translate(32.6%, 59.8%); }
  10.32% { opacity: 1; transform: translate(33.5%, 59.4%); }
  12.09% { opacity: 1; transform: translate(34.8%, 58.8%); }
  13.86% { opacity: 1; transform: translate(36.3%, 58.1%); }
  15.64% { opacity: 1; transform: translate(38.1%, 57.4%); }
  17.41% { opacity: 1; transform: translate(40.3%, 56.5%); }
  19.18% { opacity: 1; transform: translate(42.8%, 55.6%); }
  20.95% { opacity: 1; transform: translate(45.6%, 54.8%); }
  22.73% { opacity: 1; transform: translate(48.7%, 54.1%); }
  24.50% { opacity: 1; transform: translate(52.0%, 53.4%); }
  26.27% { opacity: 1; transform: translate(55.3%, 52.9%); }
  28.05% { opacity: 1; transform: translate(58.6%, 52.4%); }
  29.82% { opacity: 1; transform: translate(61.8%, 52.0%); }
  31.59% { opacity: 1; transform: translate(64.3%, 52.4%); }
  33.36% { opacity: 1; transform: translate(63.4%, 53.6%); }
  35.14% { opacity: 1; transform: translate(62.2%, 54.7%); }
  36.91% { opacity: 1; transform: translate(61.1%, 55.5%); }
  38.68% { opacity: 1; transform: translate(60.2%, 56.2%); }
  40.45% { opacity: 1; transform: translate(59.5%, 56.7%); }
  42.23% { opacity: 1; transform: translate(59.1%, 57.0%); }
  44.00% { opacity: 1; transform: translate(59.0%, 57.1%); }
  58.00% { opacity: 1; transform: translate(59.0%, 57.1%); }
  62.00% { opacity: 0; transform: translate(59.0%, 57.1%); }
  64.00% { opacity: 0; transform: translate(43.0%, 67.0%); }
  68.00% { opacity: 1; transform: translate(43.0%, 67.0%); }
  69.38% { opacity: 1; transform: translate(43.0%, 66.8%); }
  70.75% { opacity: 1; transform: translate(43.0%, 66.2%); }
  72.12% { opacity: 1; transform: translate(43.0%, 65.1%); }
  73.50% { opacity: 1; transform: translate(43.0%, 63.8%); }
  74.88% { opacity: 1; transform: translate(43.0%, 62.1%); }
  76.25% { opacity: 1; transform: translate(43.0%, 60.2%); }
  77.62% { opacity: 1; transform: translate(43.0%, 58.1%); }
  79.00% { opacity: 1; transform: translate(43.0%, 56.0%); }
  80.38% { opacity: 1; transform: translate(43.0%, 53.9%); }
  81.75% { opacity: 1; transform: translate(43.0%, 51.8%); }
  83.12% { opacity: 1; transform: translate(43.0%, 49.9%); }
  84.50% { opacity: 1; transform: translate(43.0%, 48.2%); }
  85.88% { opacity: 1; transform: translate(43.0%, 46.9%); }
  87.25% { opacity: 1; transform: translate(43.0%, 45.8%); }
  88.62% { opacity: 1; transform: translate(43.0%, 45.2%); }
  90.00% { opacity: 1; transform: translate(43.0%, 45.0%); }
  95.00% { opacity: 0; transform: translate(43.0%, 45.0%); }
  100.00% { opacity: 0; transform: translate(43.0%, 45.0%); }
}

@keyframes input-demo-finger-one-press {
  0%, 48% { background: var(--touch); }
  50.5% { background: var(--touch-pressed); }
  54%, 100% { background: var(--touch); }
}

@keyframes input-demo-finger-two {
  /* Generated: the right finger of the scroll, on the same samples as the left. */
  0.00% { opacity: 0; transform: translate(57.0%, 67.0%); }
  64.00% { opacity: 0; transform: translate(57.0%, 67.0%); }
  68.00% { opacity: 1; transform: translate(57.0%, 67.0%); }
  69.38% { opacity: 1; transform: translate(57.0%, 66.8%); }
  70.75% { opacity: 1; transform: translate(57.0%, 66.2%); }
  72.12% { opacity: 1; transform: translate(57.0%, 65.1%); }
  73.50% { opacity: 1; transform: translate(57.0%, 63.8%); }
  74.88% { opacity: 1; transform: translate(57.0%, 62.1%); }
  76.25% { opacity: 1; transform: translate(57.0%, 60.2%); }
  77.62% { opacity: 1; transform: translate(57.0%, 58.1%); }
  79.00% { opacity: 1; transform: translate(57.0%, 56.0%); }
  80.38% { opacity: 1; transform: translate(57.0%, 53.9%); }
  81.75% { opacity: 1; transform: translate(57.0%, 51.8%); }
  83.12% { opacity: 1; transform: translate(57.0%, 49.9%); }
  84.50% { opacity: 1; transform: translate(57.0%, 48.2%); }
  85.88% { opacity: 1; transform: translate(57.0%, 46.9%); }
  87.25% { opacity: 1; transform: translate(57.0%, 45.8%); }
  88.62% { opacity: 1; transform: translate(57.0%, 45.2%); }
  90.00% { opacity: 1; transform: translate(57.0%, 45.0%); }
  95.00% { opacity: 0; transform: translate(57.0%, 45.0%); }
  100.00% { opacity: 0; transform: translate(57.0%, 45.0%); }
}

/* ─── SHOWCASE (app picker, layouts) ───
   One screenshot at a time. The rest are [hidden] and lazy, so they never download until
   chosen; the device's screen keeps a fixed aspect ratio, so switching never shifts layout. */

.showcase {
  max-width: 880px;
  margin: 0 auto;
}

.segmented {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 32px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.segment {
  min-height: 40px;
  padding: 8px 20px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.segment:hover {
  color: var(--text);
}

.segment[aria-pressed="true"] {
  color: var(--text);
  background: var(--surface-raised);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.slide:not([hidden]) {
  animation: fade-in 0.35s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
}

.showcase-caption {
  max-width: 600px;
  min-height: 3em;
  margin: 28px auto 0;
  text-align: center;
  font-size: 17px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.showcase-caption strong {
  color: var(--text);
  font-weight: 600;
}

/* ─── 50+ APPS ─── */

.apps-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
  align-items: center;
  gap: clamp(40px, 6vw, 88px);
}

.apps-text .section-eyebrow {
  justify-content: flex-start;
}

.apps-text .section-lead {
  margin-left: 0;
}

.app-groups {
  display: grid;
  gap: 14px;
  margin-top: 32px;
}

.app-groups > div {
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}

.app-groups dt {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.app-groups dd {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ─── IPHONE DUO ───
   A deeper navy band, with the six App Store artworks in a static grid: the three poses,
   then open flat, typing and shortcuts. */

.section--duo {
  background:
    radial-gradient(ellipse 80% 45% at 50% 0%, #142a52 0%, transparent 70%),
    linear-gradient(180deg, var(--bg-navy) 0%, var(--bg) 100%);
}

.duo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.duo-card {
  display: flex;
  flex-direction: column;
  padding: 24px 22px 28px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px var(--hairline);
  text-align: center;
}

/* Every artwork sits on the same baseline in the same height, whatever its shape. */
.duo-art {
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(300px, 26vw, 380px);
  margin-bottom: 22px;
}

.duo-art picture {
  height: 100%;
}

.duo-art img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

/* ─── PRIVACY ─── */

.privacy-art {
  width: min(100%, 680px);
  margin: 0 auto clamp(32px, 5vw, 56px);
}

/* ─── FAQ ─── */

.faq {
  display: grid;
  gap: 10px;
  max-width: 780px;
  margin: 0 auto;
}

.faq details {
  padding: 0 24px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.faq summary {
  position: relative;
  padding: 20px 36px 20px 0;
  list-style: none;
  cursor: pointer;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

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

.faq summary::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-tertiary);
  border-bottom: 2px solid var(--text-tertiary);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

.faq details p {
  padding: 0 0 22px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* ─── DOWNLOAD ─── */

.final-cta {
  max-width: var(--content-max);
  margin: 0 auto clamp(48px, 6vw, 80px);
  margin-inline: max(var(--gutter), (100% - var(--content-max)) / 2);
  padding: clamp(56px, 8vw, 96px) var(--gutter);
  border-radius: 32px;
  text-align: center;
  background:
    radial-gradient(ellipse 70% 80% at 50% 0%, rgba(40, 96, 200, 0.35), transparent 70%),
    var(--bg-navy);
  box-shadow: inset 0 0 0 1px rgba(110, 166, 255, 0.18);
}

.final-cta-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
}

.final-cta h2 {
  font-size: clamp(32px, 3.4vw + 0.75rem, 58px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin-bottom: 12px;
}

.final-cta > p:not(.requirements) {
  max-width: 560px;
  margin: 0 auto 30px;
  font-size: clamp(17px, 0.5vw + 15px, 21px);
  color: var(--text-secondary);
}

/* ─── FOOTER ─── */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 22px var(--gutter) 40px;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  color: var(--text-tertiary);
}

.site-footer nav {
  display: flex;
  gap: 20px;
}

.site-footer a {
  padding: 4px 0;
}

.site-footer a:hover {
  color: var(--text);
}

/* ─── LEGAL PAGES ─── */

.legal {
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) var(--gutter) var(--section-gap);
  box-sizing: content-box;
}

.legal h1 {
  font-size: clamp(30px, 3vw + 1rem, 44px);
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-bottom: 8px;
}

.legal .updated {
  margin-bottom: 32px;
  font-size: 14px;
  color: var(--text-tertiary);
}

.legal h2 {
  margin: 32px 0 8px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.legal p,
.legal li {
  font-size: 16px;
  line-height: 1.65;
  color: #c7c7cc;
}

.legal p + p,
.legal ul + p {
  margin-top: 12px;
}

.legal ul {
  margin-top: 8px;
  padding-left: 20px;
}

.legal a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ─── SCROLL REVEALS ───
   A short fade and rise as content enters the viewport, driven by the scroll position on the
   compositor (scroll-driven animations): no script, no scroll listeners. Where that isn't
   supported, or with Reduce Motion, content is simply there. Content is never held back:
   it is fully shown by the time it's a fifth of the way into view. */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 20%;
    }
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

/* ─── RESPONSIVE ───
   Content-driven transitions rather than a device ladder:
     900px — the nav's link row no longer fits: it becomes a menu; two-column layouts stack.
     700px — the hero swaps to its phone composition (in the HTML, via <picture>).
     660px — three-column card grids become one column.
     640px — the iPhone Duo grid becomes a swipeable row.
   Type and spacing are fluid (clamp()). */

@media (max-width: 900px) {
  .top-nav-toggle {
    display: flex;
  }

  .top-nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 0 16px;
  }

  .top-nav-links.is-open {
    display: flex;
  }

  .top-nav-links a {
    padding: 13px 4px;
    font-size: 17px;
    color: var(--text);
    border-bottom: 1px solid var(--hairline);
  }

  .top-nav-links .top-nav-cta {
    margin-top: 14px;
    text-align: center;
    border-bottom: none;
  }

  /* Legal pages: a single Download button that never collapses into a menu. */
  .top-nav-links.top-nav-links--simple {
    display: flex;
    width: auto;
    padding: 0;
  }

  .top-nav-links--simple .top-nav-cta {
    margin-top: 0;
    padding: 7px 16px;
    font-size: 14px;
  }

  .feature-split {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .feature-device {
    width: 240px;
  }

  .feature-list {
    max-width: 560px;
  }

  .apps-split {
    grid-template-columns: 1fr;
  }

  .apps-text {
    text-align: center;
  }

  .apps-text .section-eyebrow {
    justify-content: center;
  }

  .apps-text .section-lead {
    margin-left: auto;
  }

  .app-groups {
    text-align: left;
  }

  .apps-art {
    max-width: 560px;
    margin: 0 auto;
  }

  .duo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 660px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  /* Phones: the six Duo cards become one swipeable row (native scroll snapping, no script),
     with the next card peeking in, rather than six screens of scrolling. */
  .duo-grid {
    display: flex;
    gap: 12px;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 var(--gutter);
    scrollbar-width: none;
  }

  .duo-grid::-webkit-scrollbar {
    display: none;
  }

  .duo-card {
    flex: 0 0 84%;
    scroll-snap-align: start;
  }

  .card,
  .duo-card {
    padding: 24px;
  }

  .duo-art {
    height: min(380px, 100vw);
  }

  .button {
    width: min(100%, 300px);
  }

  .segment {
    padding: 8px 13px;
    font-size: 14px;
  }

  /* Product imagery reads as artwork: let the showcase use the whole width. */
  .showcase-device {
    width: calc(100% + 2 * var(--gutter) - 16px);
    margin-left: calc(8px - var(--gutter));
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
