/* Clickpad site. Mobile first, no web fonts: SF on Apple devices, system UI elsewhere. */

@property --glow {
  syntax: "<color>";
  inherits: true;
  initial-value: #4a75ff;
}

:root {
  --bg: #07080b;
  --night-bg: #0b0806;
  --ink: rgba(255, 255, 255, 0.94);
  --dim: rgba(255, 255, 255, 0.62);
  --faint: rgba(255, 255, 255, 0.38);
  --line: rgba(255, 255, 255, 0.1);
  --glow: #4a75ff;
  --amber: #ffb061;
  --amber-ink: #ffd4a3;
  --key-ink: var(--ink);
  --radius: 22px;
  --pad: clamp(20px, 5vw, 32px);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 60% at 50% -8%, color-mix(in srgb, var(--glow) 36%, transparent), transparent 62%),
    radial-gradient(90% 50% at 50% 108%, rgba(140, 90, 255, 0.14), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: --glow 1.2s ease, background-color 1.5s ease;
}

body.night {
  --key-ink: var(--amber-ink);
  background:
    radial-gradient(120% 60% at 50% -8%, color-mix(in srgb, var(--glow) 22%, transparent), transparent 62%),
    radial-gradient(90% 50% at 50% 108%, rgba(255, 176, 97, 0.08), transparent 70%),
    var(--night-bg);
  background-attachment: fixed;
}

a { color: inherit; }
img { display: block; }
button { font: inherit; color: inherit; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  padding: 10px 14px; border-radius: 12px; background: #fff; color: #000; text-decoration: none;
}
.skip:focus { top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* ---------- Header ---------- */

.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 12px) var(--pad) 12px;
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  background: rgba(7, 8, 11, 0.42);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; letter-spacing: -0.01em; }
.brand img { border-radius: 8px; }
.bar nav { display: flex; gap: 18px; font-size: 15px; }
.bar nav a { text-decoration: none; color: var(--dim); }
.bar nav a:hover, .bar nav a[aria-current] { color: var(--ink); }

/* ---------- Hero ---------- */

main { overflow-x: clip; }

.hero { padding: 44px var(--pad) 8px; text-align: center; max-width: 720px; margin: 0 auto; }
.eyebrow { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
h1 {
  margin: 0;
  font-size: clamp(40px, 11vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 750;
  background: linear-gradient(180deg, #fff 30%, color-mix(in srgb, var(--glow) 40%, #fff));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { margin: 18px auto 0; max-width: 34em; color: var(--dim); font-size: clamp(17px, 4.4vw, 20px); }

.get { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.store {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 8px 20px 8px 16px; border-radius: 16px;
  text-decoration: none; text-align: left; line-height: 1.15; font-weight: 650; font-size: 18px;
  background: rgba(255, 255, 255, 0.92); color: #000;
}
.store small { display: block; font-size: 11px; font-weight: 500; opacity: 0.7; }
.store svg { width: 26px; height: 26px; fill: currentColor; flex: none; }
.store.soon { cursor: default; }
.store.android {
  background: rgba(255, 255, 255, 0.06); color: var(--ink);
  border: 1px solid var(--line);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}

/* ---------- Glass ---------- */

.glass {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04) 45%, rgba(255, 255, 255, 0.07));
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* ---------- Demo ---------- */

.demo { display: flex; flex-direction: column; align-items: center; padding: 34px var(--pad) 10px; gap: 30px; }

.tv {
  width: min(100%, 560px);
  padding: 7px;
  border-radius: 18px;
  background: linear-gradient(#1a1c22, #0d0e12);
  box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--glow) 70%, transparent), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: box-shadow 1.2s ease;
}
.screen {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  background: radial-gradient(120% 90% at 20% 0%, color-mix(in srgb, var(--glow) 28%, #0a0b10), #07080c 70%);
  transition: --glow 1.2s ease;
}
.rows { position: absolute; inset: 9% 5% auto; display: grid; gap: 8%; }
.row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3.2%; }
.row-label { grid-column: 1 / -1; font-size: clamp(8px, 2.2vw, 12px); font-weight: 600; color: rgba(255, 255, 255, 0.55); margin-bottom: -2%; }
.tile {
  aspect-ratio: 16 / 10; border-radius: 7px;
  background: linear-gradient(145deg, var(--c), color-mix(in srgb, var(--c) 35%, #000));
  opacity: 0.55; transform: scale(0.94);
  transition: transform 0.22s cubic-bezier(.3, 1.4, .5, 1), opacity 0.22s ease, box-shadow 0.22s ease;
}
.tile.on {
  opacity: 1; transform: scale(1.04);
  box-shadow: 0 0 0 2px #fff, 0 8px 24px -6px var(--c);
}
.playing {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 6%;
  background: radial-gradient(140% 100% at 30% 20%, var(--glow), color-mix(in srgb, var(--glow) 20%, #000) 75%);
  opacity: 0; pointer-events: none; transition: opacity 0.45s ease;
}
.screen.is-playing .playing { opacity: 1; }
.playing-title { font-weight: 700; font-size: clamp(14px, 4.4vw, 24px); letter-spacing: -0.02em; }
.progress { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.25); margin-top: 3%; overflow: hidden; }
.progress span { display: block; height: 100%; width: 8%; background: #fff; border-radius: 2px; }
.screen.is-playing .progress span { animation: watch 30s linear forwards; }
.screen.paused .progress span { animation-play-state: paused; }
@keyframes watch { to { width: 100%; } }

.pad { display: flex; flex-direction: column; align-items: center; gap: 22px; }

.ring {
  --size: min(78vw, 290px);
  position: relative; width: var(--size); height: var(--size); border-radius: 50%;
  touch-action: none; user-select: none; -webkit-user-select: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.03) 45%, rgba(255, 255, 255, 0.07));
  backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 -10px 50px -10px color-mix(in srgb, var(--glow) 45%, transparent),
    0 30px 60px -20px rgba(0, 0, 0, 0.8);
  transition: box-shadow 1.2s ease;
}
.thumb {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), color-mix(in srgb, var(--glow) 40%, transparent), transparent 42%);
  transition: opacity 0.2s ease;
}
.ring.touching .thumb { opacity: 1; }

.arrow, .ok, .key {
  border: 0; background: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
  display: grid; place-items: center; color: var(--key-ink);
  transition: transform 0.18s cubic-bezier(.3, 1.6, .5, 1), color 1.5s ease;
}
.arrow { position: absolute; width: 27%; height: 27%; border-radius: 50%; }
.arrow svg, .key svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.key svg .fill { fill: currentColor; stroke: none; }
.arrow.up { top: 4%; left: 36.5%; }
.arrow.down { bottom: 4%; left: 36.5%; }
.arrow.left { left: 4%; top: 36.5%; }
.arrow.right { right: 4%; top: 36.5%; }
.arrow.up.hit { transform: translateY(-4px); }
.arrow.down.hit { transform: translateY(4px); }
.arrow.left.hit { transform: translateX(-4px); }
.arrow.right.hit { transform: translateX(4px); }

.ok, .key {
  border-radius: 50%;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0.09));
  backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 10px 24px -10px rgba(0, 0, 0, 0.7);
}
.ok {
  position: absolute; left: 50%; top: 50%; width: 41%; height: 41%;
  translate: -50% -50%; font-weight: 650; font-size: 17px; letter-spacing: 0.04em;
}
.ok.hit, .key.hit { transform: scale(0.92); }

.keys { display: flex; gap: 16px; }
.key { width: 58px; height: 58px; }

body.night .ok, body.night .key, body.night .ring {
  box-shadow:
    inset 0 1px 0 rgba(255, 176, 97, 0.55),
    inset 0 0 0 1px rgba(255, 176, 97, 0.28),
    0 0 18px -2px rgba(255, 176, 97, 0.35);
}
body.night #night { color: var(--amber); }

.hint { margin: 0; color: var(--faint); font-size: 14px; text-align: center; }

/* ---------- Features ---------- */

section h2 {
  margin: 0 0 22px; font-size: clamp(28px, 7.5vw, 44px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 720;
}
section h2 span { color: var(--faint); }

.features { padding: 80px var(--pad) 20px; max-width: 1120px; margin: 0 auto; }
.grid { display: grid; gap: 12px; }
.card {
  padding: 22px; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.card h3 { margin: 14px 0 6px; font-size: 19px; letter-spacing: -0.015em; }
.card p { margin: 0; color: var(--dim); font-size: 16px; }
.glyph {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--glow) 22%, rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: background 1.2s ease;
}
.glyph svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card.tint { background: linear-gradient(160deg, color-mix(in srgb, var(--glow) 26%, transparent), rgba(255, 255, 255, 0.025) 70%); transition: background 1.2s ease; }
.card.amber .glyph { background: rgba(255, 176, 97, 0.2); }
.card.amber .glyph svg { stroke: var(--amber); }

.brands { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.brands li {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--dim);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* ---------- CTA + footer ---------- */

.cta { text-align: center; padding: 90px var(--pad) 60px; display: flex; flex-direction: column; align-items: center; }
.cta img { border-radius: 22px; margin-bottom: 22px; box-shadow: 0 20px 60px -15px color-mix(in srgb, var(--glow) 80%, transparent); transition: box-shadow 1.2s ease; }
.cta p { margin: 0; color: var(--dim); }

.foot {
  padding: 30px var(--pad) calc(env(safe-area-inset-bottom) + 36px);
  border-top: 1px solid rgba(255, 255, 255, 0.06); text-align: center; color: var(--faint); font-size: 14px;
}
.foot nav { display: flex; justify-content: center; gap: 22px; margin-bottom: 14px; }
.foot nav a { color: var(--dim); text-decoration: none; }
.foot p { margin: 6px 0; }
.foot .fine { max-width: 40em; margin: 10px auto 0; font-size: 12px; }

/* ---------- Document pages ---------- */

.doc { max-width: 720px; margin: 0 auto; padding: 40px var(--pad) 70px; }
.doc .eyebrow { text-align: left; }
.doc h1 { font-size: clamp(36px, 9vw, 54px); }
.doc .updated { color: var(--faint); font-size: 14px; margin: 14px 0 26px; }
.doc .summary {
  padding: 18px 20px; border-radius: 18px; margin: 0 0 30px; color: var(--ink);
  background: linear-gradient(160deg, color-mix(in srgb, var(--glow) 18%, transparent), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.doc h2 { font-size: 22px; letter-spacing: -0.015em; margin: 34px 0 10px; }
.doc p, .doc li { color: var(--dim); }
.doc p strong, .doc li strong { color: var(--ink); }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc a { color: color-mix(in srgb, var(--glow) 60%, #fff); }

details.q {
  border-radius: 16px; margin: 10px 0; padding: 0 18px;
  background: rgba(255, 255, 255, 0.045); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
details.q summary {
  cursor: pointer; list-style: none; padding: 16px 28px 16px 0; font-weight: 600; position: relative;
}
details.q summary::-webkit-details-marker { display: none; }
details.q summary::after {
  content: "+"; position: absolute; right: 0; top: 13px; font-size: 22px; font-weight: 400; color: var(--faint);
  transition: transform 0.25s ease;
}
details.q[open] summary::after { transform: rotate(45deg); }
details.q > div { padding: 0 0 16px; }
details.q > div p:first-child { margin-top: 0; }

.contact {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 6px;
  padding: 14px 20px; border-radius: 14px; font-weight: 650; text-decoration: none;
  background: rgba(255, 255, 255, 0.92); color: #000 !important;
}

/* ---------- Larger screens ---------- */

@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding-top: 70px; }
}
@media (min-width: 1040px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .demo { flex-direction: row; justify-content: center; align-items: center; gap: 60px; flex-wrap: wrap; }
  .demo .hint { flex-basis: 100%; }
}

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