/* Polypulser website. Colors, spacing, radii and type follow the Polypulser design system
   (extracted from the iOS app). Values are copied here so the site stays static and self-contained. */

:root {
  color-scheme: light dark;

  /* Color — design system tokens */
  --accent: #f26b1d;
  --beat-accent: #e8471c;
  --beat-secondary-accent: #ea9910;
  --beat-normal: #3f7de8;
  --beat-silent: #8e8e93;
  --background: #ffffff;
  --grouped-background: #f2f2f7;
  --grouped-row: #ffffff;
  --label: #000000;
  --label-tertiary: rgba(60, 60, 67, 0.3);
  --fill-tertiary: rgba(118, 118, 128, 0.12);
  --fill-quaternary: rgba(116, 116, 128, 0.08);
  --fill-quinary: rgba(116, 116, 128, 0.05);
  --icon-ground-top: #211e4c;
  --icon-ground-bottom: #0d0d1f;
  /* Web-only: iOS secondaryLabel is 3.4:1 on white, too low for paragraphs. This gray is 5.07:1 on
     `background` and 4.54:1 on `grouped-background`. */
  --text-muted: #6e6e73;

  /* Opacity */
  --beat-fill-rest: 0.28;
  --beat-fill-active: 1;
  --silent-fill-rest: 0.06;
  --selection-tint: 0.18;

  /* Spacing */
  --space-2: 2px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --module-spacing: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;

  /* Radius */
  --module-corner: 18px;
  --pattern-tile-corner: 14px;
  --radius-full: 9999px;

  /* Shadow */
  --play-shadow: 0 3px 16px rgba(242, 107, 29, 0.3);

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;
  --font-serif: ui-serif, "New York", Georgia, serif;

  /* Web layout */
  --page-width: 1040px;
  --prose-width: 42rem;
  --gutter: var(--space-16);
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #ff8a3d;
    --beat-accent: #ff5f33;
    --beat-secondary-accent: #ffc247;
    --beat-normal: #5c95ff;
    --beat-silent: #636366;
    --background: #000000;
    --grouped-background: #000000;
    --grouped-row: #1c1c1e;
    --label: #ffffff;
    --label-tertiary: rgba(235, 235, 245, 0.3);
    --fill-tertiary: rgba(118, 118, 128, 0.24);
    --fill-quaternary: rgba(118, 118, 128, 0.18);
    --fill-quinary: rgba(118, 118, 128, 0.12);
    --text-muted: #a1a1a6;
    --play-shadow: 0 3px 16px rgba(255, 138, 61, 0.3);
  }
}

@media (min-width: 720px) {
  :root { --gutter: var(--space-24); }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; } /* clears the sticky header */
body {
  margin: 0;
  background: var(--background);
  color: var(--label);
  font: 17px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
p, li { margin: var(--space-8) 0; }
.muted { color: var(--text-muted); }

/* Links: text stays `label` (accent is only 3.05:1 on white); the underline carries the tint. */
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--beat-normal); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: var(--gutter); top: -100px;
  padding: var(--space-8) var(--space-16); border-radius: var(--radius-full);
  background: var(--label); color: var(--background); text-decoration: none; z-index: 10;
}
.skip:focus { top: var(--space-8); }

.wrap { width: 100%; max-width: var(--page-width); margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  border-bottom: 1px solid var(--fill-tertiary);
  background: color-mix(in srgb, var(--background) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-16); min-height: 64px; }
.brand { display: flex; align-items: center; gap: var(--space-10); font-weight: 600; font-size: 17px; text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 7px; }
.site-nav { display: flex; gap: var(--space-4); }
.site-nav a {
  text-decoration: none; font-size: 15px; font-weight: 500;
  padding: var(--space-6) var(--module-spacing); border-radius: var(--radius-full);
}
.site-nav a:hover { background: var(--fill-tertiary); }
.site-nav a[aria-current="page"] { background: var(--fill-tertiary); font-weight: 600; }
.site-header .site-nav { margin-left: auto; }

/* Language menu: the current language as a small pill; the list opens below it. */
.lang-menu { position: relative; flex: none; }
/* Plain inline layout: older Safari cannot make <summary> a flex container. */
.lang-menu summary {
  display: block; list-style: none; cursor: pointer; white-space: nowrap;
  padding: var(--space-4) var(--space-10); border-radius: var(--radius-full);
  background: var(--fill-tertiary); font-size: 13px; font-weight: 600; line-height: 20px;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::marker { content: ""; }
.lang-menu summary::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-left: var(--space-6); vertical-align: 2px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
}
.lang-menu[open] summary::after { transform: rotate(-135deg); vertical-align: -1px; }
.lang-menu ul {
  position: absolute; right: 0; top: calc(100% + var(--space-6)); z-index: 6;
  min-width: 160px; margin: 0; padding: var(--space-4); list-style: none;
  background: var(--grouped-row); border: 1px solid var(--fill-tertiary); border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.lang-menu li { margin: 0; }
.lang-menu a { display: flex; justify-content: space-between; gap: var(--space-16); padding: var(--space-8) var(--module-spacing); border-radius: 10px; text-decoration: none; font-size: 15px; }
.lang-menu a:hover { background: var(--fill-tertiary); }
.lang-menu a[aria-current] { font-weight: 600; }
.lang-menu a[aria-current]::after { content: "✓"; color: var(--accent); }

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

/* Small phones: the icon stands for the name, so navigation and language menu fit on one line. */
@media (max-width: 479px) {
  .site-header .wrap { gap: var(--space-8); }
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .site-nav { gap: 0; }
  .site-nav a { padding: var(--space-6) var(--space-10); }
  .lang-menu summary { padding: var(--space-4) var(--space-8); }
}

/* Footer */
.site-footer { border-top: 1px solid var(--fill-tertiary); margin-top: 72px; padding: var(--space-24) 0 40px; font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: var(--space-8) var(--space-24); justify-content: space-between; }
.site-footer nav { display: flex; gap: var(--space-16); }

/* Buttons */
.store {
  display: inline-flex; align-items: center; gap: var(--space-10);
  padding: var(--module-spacing) var(--space-20); border-radius: var(--radius-full);
  background: var(--label); color: var(--background);
  font-weight: 600; font-size: 17px; text-decoration: none;
}
.store .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }

/* ---------- Home ---------- */
.hero { padding: 56px 0 32px; }
.hero .wrap { display: grid; gap: 48px; align-items: center; }
@media (min-width: 880px) {
  .hero { padding: 88px 0 56px; }
  .hero .wrap { grid-template-columns: 1fr 380px; gap: 64px; }
}
.hero h1 { font-size: clamp(44px, 9vw, 76px); line-height: 0.98; letter-spacing: -0.03em; margin: 0; font-weight: 700; }
.hero .tagline { font-size: clamp(20px, 3vw, 24px); line-height: 1.35; margin: var(--space-16) 0 0; font-weight: 500; }
.hero .lede { font-size: 17px; max-width: 34rem; margin: var(--space-10) 0 var(--space-24); }
.hero .made-by {
  display: flex; align-items: center; gap: var(--space-10);
  font-size: 19px; line-height: 1.35; font-weight: 600; margin: var(--space-20) 0 0;
}
.hero .made-by svg { flex: none; color: var(--accent); }
.hero .requirements { font-size: 15px; margin: var(--module-spacing) 0 0; }

/* A drawn rendition of the Basic screen */
.device {
  width: 100%; max-width: 380px; margin: 0 auto;
  background: var(--background);
  border: 1px solid var(--fill-tertiary);
  border-radius: 40px; padding: var(--space-16);
  display: flex; flex-direction: column; gap: var(--module-spacing);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
}
@media (prefers-color-scheme: dark) { .device { box-shadow: none; } }
.card { background: var(--fill-quinary); border-radius: var(--module-corner); }

.tempo { padding: var(--space-10) var(--space-8); text-align: center; }
.tempo .controls { display: flex; align-items: center; justify-content: center; gap: var(--space-16); }
.tempo .value { min-width: 112px; }
.tempo .n { display: block; font: 700 54px/64px var(--font-rounded); font-variant-numeric: tabular-nums; }
.tempo .u { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text-muted); }
.circle-btn {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  background: var(--fill-tertiary); color: var(--accent);
  display: grid; place-items: center;
}
.circle-btn svg { width: 40%; height: 40%; fill: currentColor; }

.beats { padding: var(--space-16) var(--space-10) var(--space-10); display: flex; flex-direction: column; gap: var(--space-16); }
.beat-line { display: flex; justify-content: center; gap: var(--space-8); }
.beat-cell { width: 70px; display: flex; flex-direction: column; align-items: center; gap: var(--space-6); }
.beat-cell .notes { height: 26px; color: var(--label); }

.transport { display: flex; justify-content: center; align-items: center; gap: var(--space-24); padding: var(--space-4) 0 var(--space-8); }
.play {
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--accent); color: #ffffff; box-shadow: var(--play-shadow);
  display: grid; place-items: center;
}
.play svg { width: 38%; height: 38%; fill: currentColor; }
.tap { width: 68px; height: 68px; border-radius: 50%; background: var(--fill-tertiary); color: var(--accent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tap svg { width: 30%; height: 30%; fill: currentColor; }
.tap span { font: 700 10px/12px var(--font-rounded); letter-spacing: 0.5px; }

/* AccentCircle */
.beat {
  --d: 52px; --c: var(--beat-normal);
  position: relative; width: var(--d); height: var(--d); flex: none;
  border-radius: 50%; border: max(calc(var(--d) * 0.05), 1.5px) solid var(--c);
  color: var(--c); display: grid; place-items: center;
}
.beat::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--c); opacity: var(--beat-fill-rest); }
.beat.accent { --c: var(--beat-accent); }
.beat.secondary { --c: var(--beat-secondary-accent); }
.beat.silent { --c: var(--beat-silent); border-style: dashed; }
.beat.silent::before { opacity: var(--silent-fill-rest); }
.beat.is-active { color: #ffffff; transform: scale(1.08); box-shadow: 0 0 calc(var(--d) * 0.36) var(--c); }
.beat.is-active::before { opacity: var(--beat-fill-active); }
.beat .mark { position: relative; }
.beat.accent .mark { width: 36%; height: 24%; }
.beat.secondary .mark { width: 26%; height: 36%; }

/* The hero bar plays at 120 BPM: seven beats, 0.5 s each. */
.beat.play-anim { animation: beat-lit 3.5s linear infinite; animation-delay: calc(var(--i) * 0.5s); }
.beat.play-anim::before { animation: beat-fill 3.5s linear infinite; animation-delay: calc(var(--i) * 0.5s); }
@keyframes beat-lit {
  0% { transform: scale(1.1); box-shadow: 0 0 calc(var(--d) * 0.36) var(--c); color: #ffffff; }
  10% { transform: scale(1); box-shadow: 0 0 calc(var(--d) * 0.36) var(--c); color: #ffffff; }
  14.2857% { box-shadow: 0 0 0 transparent; color: var(--c); }
  100% { box-shadow: 0 0 0 transparent; color: var(--c); }
}
@keyframes beat-fill {
  0%, 14% { opacity: 1; }
  14.2857%, 100% { opacity: var(--beat-fill-rest); }
}
@media (prefers-reduced-motion: reduce) {
  .beat.play-anim, .beat.play-anim::before { animation: none; }
}

/* Notation */
.notes { overflow: visible; }

/* Privacy strip */
.promise { padding: 8px 0 24px; }
.promise ul {
  list-style: none; margin: 0; padding: var(--space-20) var(--space-24);
  display: flex; flex-wrap: wrap; gap: var(--space-8) var(--space-24); justify-content: center;
  background: var(--fill-quinary); border-radius: var(--module-corner);
  font-weight: 600; font-size: 15px;
}
.promise li { margin: 0; display: flex; align-items: center; gap: var(--space-8); }
.promise li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--beat-normal); }

/* Showcase: arranging beats in lines (a drawn, looping rendition of the app's drag and drop) */
.showcase { padding: 64px 0 16px; }
.showcase .wrap { display: grid; gap: 40px; align-items: center; }
@media (min-width: 880px) { .showcase .wrap { grid-template-columns: 1fr 360px; gap: 64px; } }
.showcase-copy .section-lede { margin-bottom: var(--space-20); }
.showcase-steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 var(--space-16); display: grid; gap: var(--space-10); }
.showcase-steps li { counter-increment: step; display: flex; gap: var(--module-spacing); align-items: baseline; margin: 0; }
.showcase-steps li::before {
  content: counter(step); flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; transform: translateY(6px);
  background: var(--fill-tertiary); font: 700 14px/1 var(--font-rounded);
}

.line-demo { container-type: inline-size; padding: var(--space-16) var(--space-8); width: 100%; max-width: 360px; margin: 0 auto; }
/* All drawing units scale with the card: 1 unit = 1px at the full 320px stage. */
.ld-stage { --u: calc(min(100cqw, 320px) / 320); position: relative; width: calc(320 * var(--u)); height: calc(334 * var(--u)); margin: 0 auto; }
.ld-layer { position: absolute; inset: 0; }
.ld-stage .beat { --d: calc(var(--dn, 52) * var(--u)); }
.ld-beat, .ld-note { position: absolute; left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u)); transform: translate(-50%, -50%); }
.ld-note { width: calc(40 * var(--u)); height: calc(22 * var(--u)); color: var(--label); overflow: visible; }
.ld-after .beat { --dn: 56; }

.ld-line, .ld-zone { position: absolute; left: calc(var(--x0, 12) * var(--u)); top: calc(var(--y0) * var(--u)); width: calc(var(--w, 296) * var(--u)); height: calc(var(--h, 38) * var(--u)); border-radius: calc(12 * var(--u)); }
.ld-line { border: 1px solid var(--accent); opacity: 0; }
.ld-line::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--accent); opacity: 0.05; }
.ld-zone { border: 1.5px dashed var(--accent); display: grid; place-items: center; opacity: 0; }
.ld-zone::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--accent); opacity: 0.1; }
.ld-zone span { position: relative; color: var(--accent); font-weight: 600; font-size: calc(15 * var(--u)); }

.ld-drag { position: absolute; left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u)); width: 0; height: 0; z-index: 2; }
.ld-drag > .beat { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); }
.ld-drag-note { position: absolute; left: 0; top: calc(48 * var(--u)); width: calc(40 * var(--u)); height: calc(22 * var(--u)); transform: translate(-50%, -50%); color: var(--label); overflow: visible; }
.ld-finger { position: absolute; left: calc(6 * var(--u)); top: calc(10 * var(--u)); width: calc(34 * var(--u)); height: calc(34 * var(--u)); border-radius: 50%; background: var(--label); opacity: 0; transform: translate(-50%, -50%); }

.ld-reset { position: absolute; right: 0; top: 0; width: calc(30 * var(--u)); height: calc(30 * var(--u)); border-radius: 50%; background: var(--fill-tertiary); color: var(--accent); display: grid; place-items: center; opacity: 0; }
.ld-reset svg { width: 50%; height: 50%; fill: currentColor; }

/* 8 s loop: rest · lift · drag onto New Line · drop into 1 + 3 + 3 · hold · back */
.ld-before { animation: ld-before 8s ease-in-out infinite; }
.ld-after { animation: ld-after 8s ease-in-out infinite; }
.ld-line, .ld-zone { animation: ld-guides 8s ease-in-out infinite; }
.ld-zone:not(.ld-zone-bottom)::before { animation: ld-target 8s ease-in-out infinite; }
.ld-drag { animation: ld-drag 8s ease-in-out infinite; }
.ld-drag > .beat, .ld-drag-note { animation: ld-lift 8s ease-in-out infinite; }
.ld-finger { animation: ld-finger 8s ease-in-out infinite; }
.ld-reset { animation: ld-reset 8s ease-in-out infinite; }
@keyframes ld-before { 0%, 46% { opacity: 1; } 51%, 90% { opacity: 0; } 96%, 100% { opacity: 1; } }
@keyframes ld-after { 0%, 47% { opacity: 0; } 53%, 90% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes ld-guides { 0%, 10% { opacity: 0; } 16%, 46% { opacity: 1; } 51%, 100% { opacity: 0; } }
@keyframes ld-target { 0%, 34% { opacity: 0.1; } 40%, 46% { opacity: 0.28; } 51%, 100% { opacity: 0.1; } }
@keyframes ld-drag {
  0%, 16% { transform: translate(0, 0); opacity: 1; }
  40%, 46% { transform: translate(calc(109.5 * var(--u)), calc(-63 * var(--u))); opacity: 1; }
  50% { transform: translate(calc(109.5 * var(--u)), calc(-63 * var(--u))); opacity: 0; }
  51%, 92% { transform: translate(0, 0); opacity: 0; }
  96%, 100% { transform: translate(0, 0); opacity: 1; }
}
@keyframes ld-lift {
  0%, 9% { scale: 1; filter: none; }
  15%, 46% { scale: 1.12; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.22)); }
  50%, 100% { scale: 1; filter: none; }
}
@keyframes ld-finger { 0%, 6% { opacity: 0; } 10%, 44% { opacity: 0.18; } 48%, 100% { opacity: 0; } }
@keyframes ld-reset { 0%, 55% { opacity: 0; } 60%, 90% { opacity: 1; } 95%, 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  /* Show the moment of the drag, still. */
  .ld-before, .ld-after, .ld-line, .ld-zone, .ld-zone::before, .ld-drag, .ld-drag > .beat, .ld-drag-note, .ld-finger, .ld-reset { animation: none; }
  .ld-line, .ld-zone { opacity: 1; }
  .ld-zone:not(.ld-zone-bottom)::before { opacity: 0.28; }
  .ld-drag { transform: translate(calc(109.5 * var(--u)), calc(-63 * var(--u))); }
  .ld-drag > .beat, .ld-drag-note { scale: 1.12; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.22)); }
}

/* Polyrhythms: the two play modes, drawn like the Poly screen (one bar = 2 s at 120 BPM) */
.poly { padding: 88px 0 16px; }
.poly-intro .section-lede { max-width: 40rem; }
.poly-modes { display: grid; gap: var(--module-spacing); }
@media (min-width: 720px) { .poly-modes { grid-template-columns: 1fr 1fr; } }
.mode { padding: var(--space-20); display: flex; flex-direction: column; gap: var(--space-16); }
@media (min-width: 720px) { .mode { padding: var(--space-24); } }
.mode h3 { font-size: 20px; margin: var(--space-4) 0 0; }
.mode p { margin: 0; font-size: 16px; }
/* The panel is a small Poly screen, so it takes the app's background. */
.pl-panel { padding: var(--space-16) var(--module-spacing) var(--space-10); background: var(--background); border: 1px solid var(--fill-tertiary); border-radius: var(--pattern-tile-corner); }
.pl-panel .seg { max-width: 260px; margin: 0 auto var(--module-spacing); }

/* Full-screen grid lines: a drawn rendition of the Poly full screen, framed like the hero device */
.poly-grid { margin-top: 64px; display: grid; gap: 40px; align-items: center; }
@media (min-width: 880px) {
  .poly-grid { grid-template-columns: 300px 1fr; gap: 72px; }
  .poly-grid .phone { order: -1; }
}
.phone {
  margin: 0 auto; width: 100%; max-width: 280px; padding: var(--space-8);
  background: var(--background); border: 1px solid var(--fill-tertiary); border-radius: 40px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
}
@media (prefers-color-scheme: dark) { .phone { box-shadow: none; } }
.pg { width: 100%; height: auto; }
.pg text { font-family: var(--font-sans); }
.pg-fill { fill: var(--fill-tertiary); }
.pg-thumb { fill: var(--background); filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.15)); }
@media (prefers-color-scheme: dark) { .pg-thumb { fill: #636366; filter: none; } }
.pg-seg { fill: var(--label); font-size: 21px; }
.pg-seg-on { font-weight: 600; }
.pg-x { stroke: var(--label); stroke-width: 4; stroke-linecap: round; }
.pg-grid line { stroke: var(--text-muted); stroke-width: 2; opacity: 0.7; }
.pg-grid .pg-dash { stroke-dasharray: 8 6; }
.pg-grid .pg-dot { stroke-dasharray: 2 5; stroke-linecap: round; }
.pg-label { fill: var(--text-muted); font-size: 26px; font-weight: 600; }
.pg-track { stroke: var(--fill-tertiary); stroke-width: 6; }
.pg-tick { fill: var(--accent); }
.pg-check { fill: none; stroke: #ffffff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
/* Notes: the one nearest φ plays (Normal), the rest are Silent. */
.pg-note { fill: var(--background); stroke: var(--beat-silent); stroke-width: 2; stroke-dasharray: 4 4; }
.pg-note.on { fill: color-mix(in srgb, var(--beat-normal) 28%, var(--background)); stroke: var(--beat-normal); stroke-width: 3; stroke-dasharray: none; }
.pg-play { fill: var(--accent); filter: drop-shadow(0 3px 10px rgba(242, 107, 29, 0.35)); }
.pg-play-icon { fill: #ffffff; stroke: #ffffff; stroke-width: 4; stroke-linejoin: round; }
.poly-grid-copy { max-width: 32rem; }
.poly-grid-copy h3 { font-size: clamp(22px, 3vw, 28px); margin: 0 0 var(--space-8); letter-spacing: -0.015em; }
.poly-grid-copy p { margin: 0 0 var(--space-20); }
.poly-grid-copy p:last-child { margin: 0; font-size: 15px; }
.grid-legend { list-style: none; margin: 0 0 var(--space-20); padding: var(--space-4) var(--space-20); background: var(--fill-quinary); border-radius: var(--module-corner); }
.grid-legend li { display: flex; align-items: center; gap: var(--module-spacing); margin: 0; padding: var(--module-spacing) 0; }
.grid-legend li + li { border-top: 1px solid var(--fill-tertiary); }
.grid-legend b { width: 20px; text-align: center; font: 600 17px/1 var(--font-serif); }
/* Line samples in the styles the app draws: ½ solid, φ dashed, ⅔ dotted. */
.gl { flex: none; width: 0; height: 28px; border-left: 2px solid var(--text-muted); }
.gl-dashed { border-left-style: dashed; }
.gl-dotted { border-left-style: dotted; }

.seg { display: flex; gap: var(--space-2); padding: 3px; border-radius: var(--radius-full); background: var(--fill-tertiary); }
.seg span { flex: 1; text-align: center; padding: 5px 0; border-radius: var(--radius-full); font-size: 14px; line-height: 20px; }
.seg .on { background: var(--background); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }
@media (prefers-color-scheme: dark) { .seg .on { background: #636366; } /* iOS dark segmented thumb */ }

.pl-lines { display: grid; gap: var(--space-6); }
.pl-row { position: relative; display: flex; align-items: center; gap: var(--space-8); height: 36px; padding: 0 var(--space-10); }
.pl-row::before { content: ""; position: absolute; inset: 0; border-radius: 16px; background: var(--accent); opacity: 0; }
.pl-track { position: relative; flex: 1; height: 100%; }
.pl-track::before { content: ""; position: absolute; left: 10px; right: 10px; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: var(--fill-tertiary); }
/* Bar end, like the closing grid line on the Poly screen */
.pl-track::after { content: ""; position: absolute; right: 9px; top: 50%; width: 2px; height: 22px; margin-top: -11px; border-radius: 1px; background: var(--fill-tertiary); }
.pl-track .beat { --d: 20px; position: absolute; top: 50%; margin-top: -10px; left: calc(var(--x) * (100% - 20px)); }
.pl-count { position: relative; width: 14px; text-align: right; font: 700 13px/1 var(--font-rounded); color: var(--text-muted); }
.pl-head { position: absolute; top: 50%; width: 3px; height: 28px; margin: -14px 0 0 -1.5px; border-radius: 2px; background: var(--accent); left: 10px; opacity: 0; }
.pl-tick { position: relative; flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--text-muted); }
.pl-tick.on { background: var(--accent); border-color: var(--accent); }
.pl-tick.on::after { content: ""; position: absolute; left: 6px; top: 2.5px; width: 4px; height: 8px; border: solid #ffffff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
/* The unticked circle stays at full strength, like in Sequential: it is the control that turns the line back on. */
.pl-off .pl-track, .pl-off .pl-count { opacity: 0.35; }
.pl-mute .pl-count { opacity: 0.5; }
/* A muted line keeps its bar (band and playhead still pass), but its notes look as off as in Parallel. */
.pl-mute .pl-track::before, .pl-mute .pl-track::after, .pl-mute .beat { opacity: 0.35; }

/* Sequential: 6 s — each line gets one 2 s bar, marked by the app's light accent band. */
.pl-lines.seq .pl-row::before { animation: pl-seq-band 6s linear infinite; animation-delay: var(--delay); }
.pl-lines.seq .pl-head { animation: pl-seq-head 6s linear infinite; animation-delay: var(--delay); }
.pl-lines.seq .beat { animation: pl-hit-seq 6s linear infinite; animation-delay: var(--delay); }
.pl-lines.seq .beat::before { animation: pl-fill-seq 6s linear infinite; animation-delay: var(--delay); }
.pl-lines.seq .pl-mute .beat, .pl-lines.seq .pl-mute .beat::before { animation: none; }
/* Parallel: 2 s — every ticked line plays the same bar. */
.pl-lines.par .pl-row:not(.pl-off) .pl-head { opacity: 1; animation: pl-par-head 2s linear infinite; }
.pl-lines.par .pl-row:not(.pl-off) .beat { animation: pl-hit-par 2s linear infinite; animation-delay: var(--delay); }
.pl-lines.par .pl-row:not(.pl-off) .beat::before { animation: pl-fill-par 2s linear infinite; animation-delay: var(--delay); }

@keyframes pl-seq-band { 0%, 33.3% { opacity: 0.1; } 33.4%, 100% { opacity: 0; } }
@keyframes pl-seq-head { 0% { left: 10px; opacity: 1; } 33.3% { left: calc(100% - 10px); opacity: 1; } 33.4%, 100% { left: 10px; opacity: 0; } }
@keyframes pl-par-head { 0% { left: 10px; } 100% { left: calc(100% - 10px); } }
@keyframes pl-hit-seq { 0% { transform: scale(1.1); box-shadow: 0 0 8px var(--c); } 5%, 100% { transform: scale(1); box-shadow: 0 0 0 transparent; } }
@keyframes pl-fill-seq { 0%, 4% { opacity: 1; } 5%, 100% { opacity: var(--beat-fill-rest); } }
@keyframes pl-hit-par { 0% { transform: scale(1.1); box-shadow: 0 0 8px var(--c); } 15%, 100% { transform: scale(1); box-shadow: 0 0 0 transparent; } }
@keyframes pl-fill-par { 0%, 12% { opacity: 1; } 15%, 100% { opacity: var(--beat-fill-rest); } }

@media (prefers-reduced-motion: reduce) {
  .pl-lines .pl-row::before, .pl-lines .pl-head, .pl-lines .beat, .pl-lines .beat::before { animation: none !important; }
  /* Still frame: the first line playing in Sequential; both ticked lines at the downbeat in Parallel. */
  .pl-lines.seq .pl-row:first-child::before { opacity: 0.1; }
  .pl-lines.seq .pl-row:first-child .pl-head { opacity: 1; }
}

/* Features */
.features { padding: 48px 0 0; }
.section-title { font-size: clamp(28px, 4.5vw, 40px); margin: 0 0 var(--space-8); font-weight: 700; letter-spacing: -0.02em; }
.section-lede { margin: 0 0 32px; font-size: 19px; max-width: 36rem; }
.feature-grid { display: grid; gap: var(--module-spacing); grid-template-columns: 1fr; }
@media (min-width: 680px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .feature-grid { grid-template-columns: 1fr 1fr 1fr; } }
.feature { padding: var(--space-24); display: flex; flex-direction: column; gap: var(--space-16); }
.feature h3 { font-size: 20px; margin: 0; }
.feature p { margin: 0; font-size: 16px; }
.art { min-height: 132px; display: flex; align-items: center; justify-content: center; }

.art-beats { display: flex; gap: var(--module-spacing); flex-wrap: wrap; justify-content: center; }
.art-beats figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--space-6); }
.art-beats figcaption { font-size: 11px; line-height: 13px; font-weight: 600; color: var(--text-muted); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); width: 100%; max-width: 280px; }
.tile {
  position: relative; height: 56px; border-radius: var(--pattern-tile-corner);
  background: var(--fill-quaternary); display: grid; place-items: center; color: var(--label);
}
.tile.on { box-shadow: inset 0 0 0 2px var(--accent); }
.tile.on::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--accent); opacity: var(--selection-tint); }
.tile svg { position: relative; height: 26px; }

.art-many { display: grid; grid-template-columns: repeat(6, 28px); gap: var(--space-8); }
.art-many .beat { --d: 28px; }

.art-setlist { width: 100%; max-width: 300px; background: var(--grouped-row); border-radius: 12px; overflow: hidden; border: 1px solid var(--fill-tertiary); }
.song { display: flex; align-items: center; gap: var(--module-spacing); padding: var(--space-8) var(--module-spacing); font-size: 15px; line-height: 20px; }
.song + .song { border-top: 1px solid var(--fill-tertiary); }
.song b { font-weight: 400; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song small { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.art-sound { width: 100%; display: flex; flex-wrap: wrap; gap: var(--space-6); justify-content: center; max-width: 300px; }
.chip { font-size: 13px; font-weight: 600; padding: var(--space-4) var(--space-10); border-radius: var(--radius-full); background: var(--fill-tertiary); }

/* Watches: Apple Watch (rounded rectangle) and Wear OS (round), drawn like their remote screens */
.art-watches { display: flex; align-items: center; justify-content: center; gap: var(--space-16); }
.watch { height: auto; overflow: visible; }
.watch-apple { width: 110px; max-width: 42%; }
.watch-wear { width: 132px; max-width: 50%; }
.watch text { font-family: var(--font-sans); }
.w-case { fill: #d1d1d6; }
.w-face { fill: var(--grouped-row); }
.w-txt { fill: var(--label); }
.w-strong { font-weight: 600; }
.w-muted { fill: var(--text-muted); }
.w-tint { fill: var(--accent); }
.w-btn2 { fill: var(--fill-tertiary); }
.w-ico { color: var(--accent); }
.w-ico-label { color: var(--label); }
.w-play { fill: var(--accent); }
.w-play-icon { fill: #ffffff; stroke: #ffffff; stroke-width: 6; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) {
  .w-case { fill: #3a3a3c; }
  .w-face { fill: #000000; }
  .w-btn2 { fill: #2c2c2e; }
}

.facts { margin-top: 56px; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--module-spacing); }
@media (min-width: 720px) { .facts { grid-template-columns: repeat(4, 1fr); } }
.fact { padding: var(--space-20); text-align: center; }
.fact .n { display: block; font: 700 32px/1.1 var(--font-rounded); font-variant-numeric: tabular-nums; }
.fact .l { font-size: 13px; font-weight: 600; color: var(--text-muted); }

.cta { margin-top: 72px; text-align: center; }
.cta h2 { font-size: clamp(28px, 4.5vw, 40px); margin: 0 0 var(--space-8); letter-spacing: -0.02em; }
.cta p { margin: 0 0 var(--space-24); }
.cta img { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto var(--space-20); }

/* ---------- Text pages (Support, Privacy) ---------- */
.doc { max-width: var(--prose-width); margin: 0 auto; padding: 48px var(--gutter) 0; }
.doc h1 { font-size: clamp(34px, 6vw, 44px); margin: 0 0 var(--space-6); font-weight: 700; letter-spacing: -0.02em; }
.doc .intro { margin: 0 0 var(--space-8); }
.doc h2 { font-size: 24px; margin: 48px 0 var(--module-spacing); }
.doc h3 { font-size: 17px; margin: 0 0 var(--space-4); }
.doc ul, .doc ol { padding-left: 1.3em; }

.summary { margin-top: var(--space-24); padding: var(--space-20) var(--space-24); background: var(--fill-quinary); border-radius: var(--module-corner); }
.summary .summary-label { font-size: 15px; margin: 0 0 var(--space-6); }
.summary p { margin: 0; font-size: 19px; line-height: 1.45; font-weight: 500; }

.contact-card { margin-top: var(--space-24); padding: var(--space-20) var(--space-24); background: var(--fill-quinary); border-radius: var(--module-corner); }
.contact-card h2 { margin: 0 0 var(--space-4); font-size: 20px; }
.contact-card p { margin: 0; }
.contact-card .email { display: inline-block; margin-top: var(--space-8); font-weight: 600; word-break: break-all; }

.qa { background: var(--grouped-background); border-radius: var(--module-corner); padding: var(--space-4); }
@media (prefers-color-scheme: dark) { .qa { background: var(--fill-quinary); } }
.qa details { background: var(--grouped-row); border-radius: 14px; }
.qa details + details { margin-top: var(--space-4); }
.qa summary {
  cursor: pointer; list-style: none; padding: var(--space-16) var(--space-20);
  font-weight: 600; display: flex; gap: var(--module-spacing); align-items: flex-start; justify-content: space-between;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-top: 7px;
  border-right: 2.5px solid var(--text-muted); border-bottom: 2.5px solid var(--text-muted);
  transform: rotate(45deg); transition: transform 0.15s ease-out;
}
.qa details[open] summary::after { transform: rotate(-135deg); margin-top: 11px; }
.qa .answer { padding: 0 var(--space-20) var(--space-16); }
.qa .answer p:first-child { margin-top: 0; }

.steps { counter-reset: step; list-style: none; padding: 0 !important; display: grid; gap: var(--space-8); }
.steps li { counter-increment: step; display: flex; gap: var(--module-spacing); align-items: baseline; margin: 0; }
.steps li::before {
  content: counter(step); flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; transform: translateY(6px);
  background: var(--fill-tertiary); font: 700 14px/1 var(--font-rounded);
}

.limits { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.limits th, .limits td { text-align: left; padding: var(--space-10) 0; border-bottom: 1px solid var(--fill-tertiary); }
.limits th { font-weight: 400; }
.limits td { text-align: right; font-weight: 600; }

.checklist { list-style: none; padding: 0 !important; }
.checklist li { display: flex; gap: var(--module-spacing); align-items: baseline; }
.checklist li::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; border: 2px dashed var(--beat-silent); transform: translateY(1px); }

.updated { font-size: 15px; }
