/* Clearly's own look: Catppuccin Mocha (dark, the default) and Latte (light),
   translucent glass cards over a soft ground. No third-party fonts or requests. */

:root {
  --base: #1e1e2e;
  --crust: #11111b;
  --text: #cdd6f4;
  --sub: #a6adc8;
  --accent: #b4befe;
  --accent-2: #89b4fa;
  --mint: #94e2d5;
  --on-accent: #11111b;
  --logo-c: #d3defe;
  --logo-m: #94e2d5;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.1);
  --shadow: rgba(0, 0, 0, 0.55);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--base);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; height: auto; display: block; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--glass-strong); padding: 0.1em 0.4em; border-radius: 6px; }

.wrap { width: min(1160px, 100% - 48px); margin-inline: auto; }
.narrow { width: min(820px, 100% - 48px); }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }

.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background: var(--base);
}
.sprite { position: absolute; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; transition: background 0.25s, border-color 0.25s; border-bottom: 1px solid transparent; }
.nav.scrolled { background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.logo { width: 24px; height: 26px; display: inline-block; }
.mk-c { fill: var(--logo-c); }
.mk-m { fill: var(--logo-m); }
.nav nav { display: flex; align-items: center; gap: 26px; }
.nav nav a:not(.btn) { color: var(--sub); text-decoration: none; font-size: 16px; }
.nav nav a:not(.btn):hover { color: var(--text); }
@media (max-width: 720px) { .nav nav a:not(.btn) { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 14px 24px; border-radius: 16px; font-weight: 600; font-size: 17px; text-decoration: none; border: 1px solid transparent; transition: transform 0.15s, background 0.2s; }
.btn-small { padding: 9px 16px; font-size: 15px; border-radius: 13px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--mint); color: var(--on-accent); transform: translateY(-2px); }
.btn-ghost { background: var(--glass); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--glass-strong); color: var(--text); transform: translateY(-1px); }

/* Hero */
.hero { padding: 56px 0 120px; }
.hero-mark { display: block; width: 74px; height: 81px; margin: 26px auto 4px; animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero-mark .mk-m { transform-box: fill-box; transform-origin: center; animation: nudge 5s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(10px); } }
.hero-copy { text-align: center; max-width: 860px; }
.eyebrow { display: inline-block; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; color: var(--mint); border: 1px solid var(--line); background: var(--glass); padding: 7px 14px 7px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 9px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 var(--mint); animation: ping 2.4s ease-out infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
h1 { font-size: clamp(64px, 11vw, 132px); line-height: 0.98; letter-spacing: -0.05em; font-weight: 800; margin: 6px 0 22px; }
.claim { font-size: clamp(22px, 3vw, 34px); line-height: 1.25; letter-spacing: -0.02em; font-weight: 600; max-width: 820px; margin: 0 auto 18px; }
.price { position: relative; white-space: nowrap; color: var(--sub); }
.price::after { content: ""; position: absolute; left: -3px; right: -3px; top: 54%; height: 4px; border-radius: 3px; background: var(--mint); transform: scaleX(0); transform-origin: left; animation: strike 0.7s 1.1s cubic-bezier(0.7, 0, 0.2, 1) forwards; }
.free { display: inline-block; margin-left: 12px; padding: 0 14px 2px; border-radius: 14px; background: var(--mint); color: var(--on-accent); font-weight: 800; animation: pop 0.55s 1.75s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes strike { to { transform: scaleX(1); } }
@keyframes pop { from { opacity: 0; transform: scale(0.6) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero-copy > * { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero-copy > :nth-child(1) { animation-delay: 0s; }
.hero-copy > :nth-child(3) { animation-delay: 0.1s; }
.hero-copy > :nth-child(4) { animation-delay: 0.2s; }
.hero-copy > :nth-child(5) { animation-delay: 0.3s; }
.hero-copy > :nth-child(6) { animation-delay: 0.4s; }
.hero-copy > :nth-child(7) { animation-delay: 0.5s; }
.grad { background: linear-gradient(100deg, var(--accent) 5%, var(--mint) 70%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(18px, 2vw, 22px); color: var(--sub); max-width: 640px; margin-inline: auto; line-height: 1.45; }
.actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.note { margin-top: 18px; font-size: 15px; color: var(--sub); }

.stage { position: relative; margin-top: 64px; perspective: 2200px; }
.window {
  --rx: 5deg; --ry: -12deg;
  position: relative; max-width: 1040px; margin-inline: auto;
  transform: rotateY(var(--ry)) rotateX(var(--rx));
  transition: transform 0.35s ease-out;
  border-radius: 26px; padding: 12px;
  background: linear-gradient(135deg, var(--glass-strong), var(--glass));
  border: 1px solid var(--line);
  box-shadow: 0 50px 120px var(--shadow);
}
.window img { border-radius: 16px; }
@media (max-width: 800px) { .window { transform: none; } }
.chip { position: absolute; overflow: hidden; border-radius: 20px; padding: 0; border: 1px solid var(--line); box-shadow: 0 30px 70px var(--shadow); background: var(--base); }
.chip img { display: block; max-width: none; width: 1800px; height: auto; }
.chip-a { overflow: visible; width: 360px; left: -2%; bottom: -34px; border: 0; border-radius: 0; background: none; box-shadow: none; animation: float 7s ease-in-out infinite; }
.chip-a img { width: 100%; margin: 0; filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.5)); }
.chip-b { overflow: visible; width: 392px; right: 1%; top: -26px; border: 0; border-radius: 0; background: none; box-shadow: none; animation: float 8s 1s ease-in-out infinite reverse; }
.chip-b img { width: 100%; margin: 0; filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.5)); }
@keyframes float { 50% { transform: translateY(-12px); } }
@media (max-width: 1100px) { .chip { display: none; } }

/* Sections */
.section { padding: 84px 0; }
h2 { font-size: clamp(36px, 5vw, 56px); line-height: 1.05; letter-spacing: -0.04em; font-weight: 800; margin-bottom: 18px; }
h3 { font-size: 26px; letter-spacing: -0.025em; line-height: 1.15; font-weight: 700; margin-bottom: 10px; }
.section-lead { color: var(--sub); font-size: 21px; margin-bottom: 36px; }
.kicker { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--mint); margin-bottom: 12px; }

.card { background: var(--glass); border: 1px solid var(--line); border-radius: 24px; padding: 30px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.card p { color: var(--sub); }
.card-tint { background: linear-gradient(135deg, rgba(180, 190, 254, 0.14), var(--glass)); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.quad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1000px) { .quad { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .quad { grid-template-columns: 1fr; } }
.pop { position: relative; overflow: hidden; transition: transform 0.25s, border-color 0.25s; }
.pop:hover { transform: translateY(-4px); border-color: var(--accent); }
.pop h3 { color: var(--accent); }
.pop p { position: relative; }
.duo { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.more { margin-top: 36px; }
@media (max-width: 860px) { .trio, .duo { grid-template-columns: 1fr; } }

/* Feature rows */
.feature { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 56px; align-items: center; margin-top: 88px; }
.feature.flip { grid-template-columns: 1.2fr 0.8fr; }
.feature.flip .feature-copy { order: 2; }
.feature-copy p:not(.kicker) { color: var(--sub); font-size: 19px; }
.shot { border-radius: 24px; padding: 11px; background: linear-gradient(135deg, var(--glass-strong), var(--glass)); border: 1px solid var(--line); box-shadow: 0 40px 100px var(--shadow); }
.shot img { border-radius: 15px; }
@media (max-width: 900px) {
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 28px; margin-top: 64px; }
  .feature.flip .feature-copy { order: 0; }
}

/* Download */
.cta { text-align: center; padding: 52px 30px; background: linear-gradient(135deg, rgba(180, 190, 254, 0.14), var(--glass)); }
.cta .section-lead { margin-bottom: 26px; }
.code { text-align: left; max-width: 520px; margin: 0 auto; background: var(--crust); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; font-family: var(--mono); font-size: 16px; color: var(--text); overflow-x: auto; }
.code code { background: none; padding: 0; font-size: inherit; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 38px 0 40px; margin-top: 40px; color: var(--sub); font-size: 15px; }
.footer-grid { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a, .footer-base a { color: var(--sub); text-decoration: none; }
.footer-links a:hover, .footer-base a:hover { color: var(--mint); }
.social { display: flex; gap: 10px; }
.social a { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; border: 1px solid var(--line); background: var(--glass); color: var(--sub); transition: transform 0.2s, color 0.2s, border-color 0.2s; }
.social a:hover { color: var(--mint); border-color: var(--mint); transform: translateY(-3px) rotate(-4deg); }
.footer-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 14px; }

/* Docs (privacy, terms) */
.doc { padding: 56px 0 40px; }
.doc-title { font-size: clamp(40px, 6vw, 64px); margin: 0 0 8px; }
.doc .meta { color: var(--sub); margin-bottom: 20px; }
.doc h2 { font-size: 24px; letter-spacing: -0.02em; margin: 34px 0 8px; }
.doc p { color: var(--sub); margin-bottom: 12px; }

/* Download extras */
.terminal { margin: 26px auto 0; max-width: 520px; text-align: left; }
.terminal summary { cursor: pointer; color: var(--sub); text-align: center; font-size: 15px; list-style: none; }
.terminal summary:hover { color: var(--mint); }
.terminal .code { margin-top: 14px; }
.cta .note { margin-top: 20px; }

/* Reveal on scroll (only when JS is on) */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .window { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bg::before, .bg::after, .chip, .dot, .hero-mark .mk-m { animation: none; }
  .hero-copy > *, .hero-mark, .free { animation: none; }
  .price::after { animation: none; transform: scaleX(1); }
}

/* More motion */
.progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 80; background: linear-gradient(90deg, var(--accent), var(--mint)); transform: scaleX(0); transform-origin: left; }
.grad { background-size: 220% 100%; animation: shimmer 6s ease-in-out infinite alternate; }
@keyframes shimmer { to { background-position: 100% 0; } }
.js .reveal.from-side { transform: translateX(-34px); }
.js .flip .reveal.from-side { transform: translateX(34px); }
.js .reveal.from-zoom { transform: translateY(40px) scale(0.94); }
.js .reveal.in.from-side, .js .reveal.in.from-zoom { transform: none; }
.js .quad .reveal:nth-child(2) { transition-delay: 0.08s; }
.js .quad .reveal:nth-child(3) { transition-delay: 0.16s; }
.js .quad .reveal:nth-child(4) { transition-delay: 0.24s; }
.shot { transition: transform 0.35s ease-out, box-shadow 0.35s; }
.shot:hover { box-shadow: 0 50px 120px var(--shadow); }
.window, .chip { will-change: transform; }
.nav nav a.on { color: var(--mint) !important; }
@media (prefers-reduced-motion: reduce) {
  .grad,   .progress { display: none; }
}

/* Pinned feature story: each feature fills the screen, the text drops to the
   bottom and the screenshot pulls to the centre, then the next one takes over.
   Only active when JavaScript sets .pinned; otherwise the features just stack. */
.story.pinned { margin-top: 56px; }
.story.pinned .story-pin { position: sticky; top: 0; height: 100vh; width: 100vw; margin-left: calc(50% - 50vw); overflow: hidden; }
.story.pinned .feature { position: absolute; inset: 0; display: block; margin: 0; opacity: var(--o, 0); visibility: hidden; }
.js .story.pinned .feature .feature-copy {
  --w: calc(420px + (min(760px, 80vw) - 420px) * var(--f, 0));
  position: absolute; width: var(--w); opacity: 1; transition: none;
  left: calc(7vw + (50vw - var(--w) / 2 - 7vw) * var(--f, 0));
  top: calc(48vh + (88vh - 48vh) * var(--f, 0));
  transform: translateY(calc(-50% + var(--ty, 0px)));
}
.story.pinned .feature-copy h3 { font-size: calc(32px - 10px * var(--f, 0)); }
.story.pinned .feature-copy p:not(.kicker) { font-size: calc(19px - 3px * var(--f, 0)); }
.js .story.pinned .feature .shot {
  position: absolute; margin: 0; opacity: 1; transition: none;
  left: calc(68vw + (50vw - 68vw) * var(--f, 0));
  top: calc(50vh + (44vh - 50vh) * var(--f, 0));
  width: calc(54vw + (min(90vw, (100vh - 290px) * 1.674) - 54vw) * var(--f, 0));
  transform: translate(-50%, -50%) translateY(var(--ty, 0px));
}
