/* Ripple project site. Same tokens as the dashboard: a cool, blue-tinted neutral
   palette, a teal accent, amber for motion. System fonts only, light + dark. */
:root {
  color-scheme: light dark;
  --bg: oklch(0.982 0.004 232);
  --bg-2: oklch(0.955 0.008 232);
  --fg: oklch(0.205 0.022 248);
  --muted: oklch(0.48 0.022 245);
  --card: oklch(1 0 0);
  --line: oklch(0.91 0.01 235);
  --accent: oklch(0.5 0.105 205);
  --accent-fg: oklch(0.99 0.004 220);
  --accent-soft: oklch(0.948 0.018 210);
  --motion: oklch(0.7 0.165 58);
  --motion-soft: oklch(0.96 0.04 70);
  --ok: oklch(0.58 0.14 155);
  --ring: oklch(0.6 0.1 205);
  --shadow: 0 1px 2px oklch(0.2 0.02 248 / 0.06), 0 12px 32px -12px oklch(0.2 0.03 248 / 0.18);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.165 0.013 248);
    --bg-2: oklch(0.2 0.015 248);
    --fg: oklch(0.962 0.006 232);
    --muted: oklch(0.72 0.02 238);
    --card: oklch(0.205 0.015 248);
    --line: oklch(1 0 0 / 0.1);
    --accent: oklch(0.79 0.12 198);
    --accent-fg: oklch(0.2 0.03 225);
    --accent-soft: oklch(0.27 0.03 225);
    --motion: oklch(0.8 0.15 70);
    --motion-soft: oklch(0.3 0.05 70);
    --ok: oklch(0.78 0.15 155);
    --ring: oklch(0.66 0.1 205);
    --shadow: 0 1px 2px oklch(0 0 0 / 0.4), 0 16px 40px -12px oklch(0 0 0 / 0.6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-fg); }

.wrap { width: min(72rem, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(46rem, 100% - 2.5rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--accent); color: var(--accent-fg); padding: 0.5rem 0.75rem; border-radius: 8px; z-index: 10; }
.skip:focus { left: 0.5rem; }

/* ----------------------------------------------------------- top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 0; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--fg); text-decoration: none; font-weight: 650; letter-spacing: -0.01em; }
.brand svg { width: 1.9rem; height: 1.9rem; color: var(--accent); }
.nav { display: flex; align-items: center; gap: clamp(0.75rem, 2.5vw, 1.75rem); font-size: 0.95rem; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--fg); }
.pill { font: 0.75rem/1 var(--mono); padding: 0.35rem 0.55rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); white-space: nowrap; }
@media (max-width: 40rem) { .nav .hide-sm { display: none; } }

/* ------------------------------------------------------------- hero */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(2.5rem, 6vw, 5rem); }
.hero::before {            /* concentric rings, the project's mark, blown up */
  content: ""; position: absolute; z-index: -1; right: -14rem; top: -12rem; width: 52rem; aspect-ratio: 1;
  background:
    radial-gradient(circle, var(--accent) 0 0.35rem, transparent 0.4rem),
    repeating-radial-gradient(circle, transparent 0 3.2rem, color-mix(in oklab, var(--accent) 22%, transparent) 3.2rem 3.28rem);
  mask-image: radial-gradient(circle, #000 18%, transparent 68%);
  opacity: 0.7;
}
.hero-grid { display: grid; gap: clamp(1.75rem, 4vw, 3.5rem); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 62rem) { .hero-grid { grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); } }
.eyebrow { display: inline-flex; gap: 0.6rem; align-items: center; font: 0.78rem/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin: 0 0 1.1rem; }
.eyebrow::before { content: ""; width: 1.6rem; height: 1px; background: currentColor; }
h1 { font-size: clamp(2.6rem, 6.6vw, 5.1rem); line-height: 0.98; letter-spacing: -0.045em; font-weight: 700; margin: 0 0 1.25rem; text-wrap: balance; }
h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--muted); max-width: 34rem; margin: 0 0 1.75rem; text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.85rem 1.25rem; border-radius: 12px; font-weight: 600; text-decoration: none; border: 1px solid var(--line); color: var(--fg); background: var(--card); transition: transform 0.15s, box-shadow 0.15s, background 0.15s; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
.facts { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; padding: 0; margin: 0; list-style: none; font: 0.85rem/1.4 var(--mono); color: var(--muted); }
.facts li::before { content: "·"; margin-right: 0.5rem; color: var(--accent); }

/* ----------------------------------------------------------- scope */
.scope { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 0.9rem 0.9rem 0.75rem; touch-action: pan-y; transition: border-color 0.2s, box-shadow 0.2s; }
.scope[data-state="motion"] { border-color: var(--motion); box-shadow: var(--shadow), 0 0 0 3px color-mix(in oklab, var(--motion) 25%, transparent); }
.scope-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.1rem 0.25rem 0.6rem; }
.scope-title { font: 0.75rem/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.state { display: inline-flex; align-items: center; gap: 0.5rem; font: 700 0.8rem/1 var(--mono); letter-spacing: 0.05em; padding: 0.4rem 0.65rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); transition: background 0.2s, color 0.2s; }
.state::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; }
.scope[data-state="motion"] .state { background: var(--motion-soft); color: oklch(0.45 0.12 58); }
@media (prefers-color-scheme: dark) { .scope[data-state="motion"] .state { color: var(--motion); } }
canvas#scope { width: 100%; height: clamp(11rem, 26vw, 15rem); border-radius: 12px; background: var(--bg); cursor: crosshair; }
.scope-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0.25rem 0; font-size: 0.88rem; color: var(--muted); }
.scope-foot button { white-space: nowrap; font: inherit; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 0.25rem 0; cursor: pointer; }
.scope-foot button:hover { text-decoration: underline; }

/* --------------------------------------------------------- sections */
section { padding: clamp(3rem, 7vw, 6rem) 0; }
.band { background: var(--bg-2); border-block: 1px solid var(--line); }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 700; margin: 0 0 1rem; text-wrap: balance; }
h3 { font-size: 1.2rem; letter-spacing: -0.015em; margin: 0 0 0.4rem; }
.kicker { font: 0.78rem/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin: 0 0 0.9rem; }
.sub { color: var(--muted); max-width: 38rem; margin: 0 0 2.5rem; font-size: 1.1rem; text-wrap: pretty; }

.steps { display: grid; gap: 2rem; grid-template-columns: 1fr; counter-reset: s; padding: 0; margin: 0; list-style: none; }
@media (min-width: 52rem) { .steps { grid-template-columns: repeat(3, 1fr); gap: 3rem; } }
.steps li { position: relative; padding-top: 4.2rem; counter-increment: s; }
.steps li::before { content: "0" counter(s); position: absolute; top: 0; left: 0; font: 700 3.4rem/1 var(--mono); letter-spacing: -0.06em; color: color-mix(in oklab, var(--accent) 30%, transparent); }
.steps p { margin: 0; color: var(--muted); }

.showcase { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 56rem) {
  .showcase { grid-template-columns: repeat(12, 1fr); grid-auto-flow: dense; }
  .shot-main { grid-column: 1 / span 8; grid-row: span 2; }
  .shot-phone { grid-column: 9 / span 4; grid-row: span 2; align-self: center; }
  .shot-a { grid-column: 1 / span 7; align-self: center; }
  .shot-b { grid-column: 8 / span 5; }
  .shot-b .phone { max-width: 14rem; }
}
figure { margin: 0; }
.frame { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.frame img { width: 100%; height: auto; }
.phone { border-radius: 2rem; padding: 0.45rem; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); max-width: 17rem; margin-inline: auto; }
.phone img { border-radius: 1.6rem; width: 100%; height: auto; }
figcaption { margin-top: 0.7rem; font-size: 0.9rem; color: var(--muted); }

.features { display: grid; gap: 0 3rem; grid-template-columns: 1fr; padding: 0; margin: 0; list-style: none; }
@media (min-width: 52rem) { .features { grid-template-columns: 1fr 1fr; } }
.features li { padding: 1.15rem 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 2.4rem 1fr; gap: 0.25rem 0.5rem; }
.features li::before { content: "→"; color: var(--accent); font-weight: 700; grid-row: span 2; padding-top: 0.05rem; }
.features strong { font-size: 1.05rem; letter-spacing: -0.01em; }
.features span { color: var(--muted); }

.split { display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 56rem) { .split { grid-template-columns: 1fr 1fr; } .split.flip > :first-child { order: 2; } }
.ents { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 1.25rem 0 0; list-style: none; }
.ents li { font: 0.82rem/1 var(--mono); padding: 0.5rem 0.7rem; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
code { font: 0.88em var(--mono); background: var(--bg-2); border: 1px solid var(--line); padding: 0.1em 0.4em; border-radius: 6px; }

.honest { border-left: 4px solid var(--motion); background: var(--motion-soft); border-radius: 0 16px 16px 0; padding: clamp(1.25rem, 3vw, 2rem); }
.honest h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.honest ul { margin: 1rem 0 0; padding-left: 1.2rem; }
.honest li { margin: 0.5rem 0; }

table { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
th, td { text-align: left; padding: 0.8rem 0.5rem; border-top: 1px solid var(--line); vertical-align: top; }
th { font: 0.75rem/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border-top: 0; }
td:last-child, th:last-child { text-align: right; color: var(--muted); }

details { border-top: 1px solid var(--line); padding: 1rem 0; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font: 400 1.4rem/1 var(--mono); color: var(--accent); transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 0.7rem 0 0; color: var(--muted); max-width: 42rem; }

.final { text-align: center; }
.final .cta { justify-content: center; }
.final .sub { margin-inline: auto; }

footer { padding: 2.5rem 0 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
footer a { color: var(--muted); }
footer a:hover { color: var(--fg); }

/* ---------------------------------------------------------- install */
.install-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: clamp(1.25rem, 3vw, 2rem); }
label.field { display: block; font: 0.78rem/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.5rem; }
select { width: 100%; font: inherit; padding: 0.8rem 0.9rem; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); margin-bottom: 1.25rem; }
esp-web-install-button { display: block; }
esp-web-install-button button { font: inherit; font-weight: 600; padding: 0.9rem 1.4rem; border-radius: 12px; border: 0; background: var(--accent); color: var(--accent-fg); cursor: pointer; }
esp-web-install-button [slot="unsupported"], esp-web-install-button [slot="not-allowed"] { color: var(--muted); font-size: 0.95rem; }
.note { padding: 0.9rem 1rem; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; margin-top: 1.25rem; }
.note[hidden] { display: none; }
ol.how { padding-left: 1.3rem; }
ol.how li { margin: 0.6rem 0; }
ol.how li::marker { color: var(--accent); font-weight: 700; }

/* ---------------------------------------------------------- motion */
@media (prefers-reduced-motion: no-preference) {
  .hero::before { animation: drift 18s ease-in-out infinite alternate; }
  @keyframes drift { from { transform: scale(0.96) rotate(0deg); } to { transform: scale(1.04) rotate(6deg); } }
  .rise { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 90ms); }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }

/* the installer button is a custom element: make [hidden] win over its display rule */
[hidden] { display: none !important; }
