/* =========================================================================
   Claude Usage Trend Tracker — landing page
   Aesthetic: instrument-panel precision. Space Grotesk display + Inter body
   + JetBrains Mono for readouts. Indigo primary with amber (warning) and
   jade (on-pace) as functional signal colors, over a deep ink surface.
   Fully themed (dark default, light variant, persisted toggle).
   ========================================================================= */

:root {
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  --accent: #6C6FF2;       /* indigo — primary */
  --accent-2: #8B8EFF;     /* indigo highlight */
  --warn: #F2A93C;         /* amber — threshold/pace warning */
  --good: #35C29A;         /* jade — on pace */
  --radius: 16px;
  --radius-lg: 26px;
  --maxw: 1180px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

:root, [data-theme="dark"] {
  --bg: #0A0B10;
  --bg-2: #12131C;
  --surface: rgba(255,255,255,.045);
  --surface-2: rgba(255,255,255,.075);
  --border: rgba(255,255,255,.09);
  --border-strong: rgba(255,255,255,.16);
  --text: #F2F1F7;
  --text-dim: #A7A5B7;
  --text-faint: #6B6980;
  --shadow: 0 40px 90px -30px rgba(0,0,0,.8);
  --glow-a: rgba(108,111,242,.32);
  --glow-b: rgba(53,194,154,.14);
  --glow-c: rgba(242,169,60,.12);
  --nav-bg: rgba(10,11,16,.68);
  --track: rgba(255,255,255,.08);
  --grain-opacity: .04;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #F5F5F8;
  --bg-2: #FFFFFF;
  --surface: rgba(20,18,40,.035);
  --surface-2: rgba(20,18,40,.055);
  --border: rgba(20,18,40,.10);
  --border-strong: rgba(20,18,40,.18);
  --text: #17161F;
  --text-dim: #57546B;
  --text-faint: #8B889C;
  --shadow: 0 40px 80px -32px rgba(30,20,60,.24);
  --glow-a: rgba(108,111,242,.22);
  --glow-b: rgba(53,194,154,.14);
  --glow-c: rgba(242,169,60,.16);
  --nav-bg: rgba(245,245,248,.72);
  --track: rgba(20,18,40,.08);
  --grain-opacity: .025;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background .5s var(--ease), color .5s var(--ease);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

/* ---------- Atmosphere ---------- */
.atmosphere { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.glow { position: absolute; border-radius: 50%; filter: blur(95px); opacity: .9; transition: background .5s var(--ease); }
.glow--a { width: 62vw; height: 62vw; top: -24vw; right: -14vw; background: radial-gradient(circle, var(--glow-a), transparent 65%); }
.glow--b { width: 50vw; height: 50vw; bottom: -20vw; left: -14vw; background: radial-gradient(circle, var(--glow-b), transparent 65%); }
.glow--c { width: 40vw; height: 40vw; top: 46%; left: 32%; background: radial-gradient(circle, var(--glow-c), transparent 60%); }
.grain {
  position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: var(--grain-opacity); mix-blend-mode: overlay;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--font-body); font-weight: 600; font-size: .98rem;
  padding: .82em 1.4em; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease);
}
.btn--primary {
  color: #0c0c14;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 12px 34px -10px rgba(108,111,242,.55), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -10px rgba(108,111,242,.65), inset 0 1px 0 rgba(255,255,255,.45); }
.btn--ghost { color: var(--text); background: var(--surface); border-color: var(--border-strong); backdrop-filter: blur(8px); }
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent-2); }
.btn--sm { padding: .6em 1.1em; font-size: .88rem; }
.btn[aria-disabled="true"] { opacity: .55; cursor: default; pointer-events: none; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.5rem;
  max-width: var(--maxw); margin: .8rem auto 0; width: calc(100% - 4vw);
  padding: .85rem 1.4rem;
  background: var(--nav-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 10px 40px -24px rgba(0,0,0,.5);
  transition: background .5s var(--ease), border-color .5s var(--ease);
}
.nav__brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; }
.nav__icon { border-radius: 9px; box-shadow: 0 4px 12px -4px rgba(0,0,0,.4); }
.nav__name { font-family: var(--font-display); font-size: 1.14rem; letter-spacing: -.01em; }
.nav__links { display: flex; gap: 1.6rem; margin-left: auto; font-size: .93rem; color: var(--text-dim); font-weight: 500; }
.nav__links a { position: relative; transition: color .2s; }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: -5px; height: 2px; width: 0; background: var(--accent); transition: width .25s var(--ease); }
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }
.nav__right { display: flex; align-items: center; gap: .9rem; }

/* Theme toggle */
.theme-toggle { background: none; border: none; cursor: pointer; padding: 0; }
.theme-toggle__track { display: block; width: 52px; height: 28px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); position: relative; transition: background .3s; }
.theme-toggle__thumb {
  position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  display: grid; place-items: center; color: #0c0c14;
  transition: transform .35s var(--ease); box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
[data-theme="dark"] .theme-toggle__thumb { transform: translateX(24px); }
.icon-sun, .icon-moon { position: absolute; transition: opacity .25s, transform .25s; }
[data-theme="dark"] .icon-sun { opacity: 0; transform: scale(.4); }
[data-theme="dark"] .icon-moon { opacity: 1; }
[data-theme="light"] .icon-moon { opacity: 0; transform: scale(.4); }
[data-theme="light"] .icon-sun { opacity: 1; }

/* ---------- Layout helpers ---------- */
section { position: relative; }
.kicker { display: inline-block; font-family: var(--font-mono); font-size: .78rem; letter-spacing: .04em; color: var(--accent-2); margin-bottom: 1rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem; font-size: .85rem; font-weight: 500; color: var(--text-dim);
  padding: .45rem .9rem; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); margin-bottom: 1.6rem;
}
.eyebrow__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgba(53,194,154,.18); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw); margin: 0 auto; width: calc(100% - 4vw);
  padding: clamp(3.5rem, 8vw, 7rem) 0 4rem;
  display: grid; grid-template-columns: 1.08fr 1fr; gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.hero__title {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(2.5rem, 5.6vw, 4.5rem);
  line-height: 1.04; letter-spacing: -.02em; margin-bottom: 1.5rem;
}
.hero__lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--text-dim); max-width: 40ch; margin-bottom: 2.2rem; }
.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero__note { display: flex; align-items: center; gap: .5rem; margin-top: 1.6rem; color: var(--text-faint); font-size: .9rem; }

/* ---------- Gauge cluster (hero visual) ---------- */
.gauges { position: relative; display: grid; place-items: center; }
.gauge-panel {
  position: relative; width: 100%; max-width: 420px;
  background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 1.8rem 1.6rem 1.6rem;
  transition: transform .5s var(--ease);
}
.gauge-panel:hover { transform: translateY(-4px); }
.gauge-panel__head { display: flex; align-items: center; gap: .5rem; padding-bottom: 1.1rem; margin-bottom: 1.3rem; border-bottom: 1px solid var(--border); color: var(--text-faint); font-size: .8rem; font-family: var(--font-mono); }
.gauge-panel__head .dot { width: 9px; height: 9px; border-radius: 50%; }
.dot--r { background: #FF5F57; } .dot--y { background: #FEBC2E; } .dot--g { background: #28C840; }
.gauge-panel__head span:last-child { margin-left: auto; }
.gauge-row { display: flex; align-items: center; gap: 1.1rem; padding: .85rem 0; }
.gauge-row + .gauge-row { border-top: 1px solid var(--border); }
.ring { position: relative; width: 56px; height: 56px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring__track { stroke: var(--track); }
.ring__val { stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--ease); }
.ring__num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-mono); font-size: .78rem; font-weight: 600; }
.gauge-row__label { font-weight: 600; font-size: .95rem; }
.gauge-row__meta { font-size: .82rem; color: var(--text-faint); font-family: var(--font-mono); }
.gauge-row__body { flex: 1; }

/* ---------- Window chrome (for screenshots) ---------- */
.window { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border-strong); background: var(--bg-2); box-shadow: var(--shadow); transition: transform .5s var(--ease); }
.window:hover { transform: translateY(-4px); }
.window__bar { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.window__title { margin-left: .6rem; font-size: .82rem; color: var(--text-faint); font-weight: 500; }
.window img { width: 100%; }
.shot-placeholder {
  aspect-ratio: 3 / 2; display: grid; place-items: center; gap: .5rem;
  color: var(--text-faint); font-size: .82rem; font-family: var(--font-mono);
  background:
    repeating-linear-gradient(135deg, var(--surface) 0 10px, transparent 10px 20px);
}
.shot-placeholder svg { opacity: .5; }

/* ---------- Strip ---------- */
.strip { max-width: var(--maxw); margin: 1rem auto 0; width: calc(100% - 4vw); padding: 2.4rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: center; }
.strip__lead { font-family: var(--font-display); font-size: 1.25rem; color: var(--text-dim); margin-bottom: 1.8rem; }
.strip__items { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(1.5rem, 5vw, 4rem); }
.strip__items li { display: flex; flex-direction: column; gap: .2rem; }
.strip__items strong { font-family: var(--font-display); font-size: 1.6rem; color: var(--accent-2); font-weight: 700; }
.strip__items span { font-size: .9rem; color: var(--text-faint); }

/* ---------- Feature sections ---------- */
.feature { max-width: var(--maxw); margin: 0 auto; width: calc(100% - 4vw); padding: clamp(4rem, 9vw, 7rem) 0; }
.feature__grid--split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 6vw, 5.5rem); align-items: center; }
.feature__grid--reverse .feature__text { order: 2; }
.feature__text h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.85rem, 3.4vw, 2.7rem); line-height: 1.1; letter-spacing: -.02em; margin-bottom: 1.2rem; }
.feature__text p { color: var(--text-dim); margin-bottom: 1.6rem; max-width: 48ch; }
.ticks { list-style: none; display: flex; flex-direction: column; gap: .85rem; }
.ticks li { position: relative; padding-left: 2rem; color: var(--text); font-size: .98rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .1em; width: 20px; height: 20px; border-radius: 50%; background: var(--good);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6 9 17l-5-5' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6 9 17l-5-5' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat;
}

/* ---------- Section head ---------- */
.section-head { text-align: center; max-width: 640px; margin: 0 auto clamp(2.5rem,5vw,3.5rem); }
.section-head h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem,4vw,2.9rem); line-height: 1.08; letter-spacing: -.02em; margin-bottom: 1rem; }
.section-head p { color: var(--text-dim); }

/* ---------- Platform / download cards ---------- */
.platforms { max-width: var(--maxw); margin: 0 auto; width: calc(100% - 4vw); padding: clamp(3rem,7vw,6rem) 0; }
.platform-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.4rem; }
.pcard {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .35s var(--ease), border-color .35s var(--ease), background .35s var(--ease);
}
.pcard:hover { transform: translateY(-6px); border-color: var(--border-strong); background: var(--surface-2); }
.pcard__shot { border-bottom: 1px solid var(--border); }
.pcard__shot img { width: 100%; display: block; }
.pcard__body { padding: 1.6rem 1.6rem 1.8rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.pcard__head { display: flex; align-items: center; gap: .6rem; }
.pcard__head h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.pcard__status { margin-left: auto; font-size: .74rem; font-family: var(--font-mono); padding: .28rem .6rem; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-faint); }
.pcard__status--live { color: var(--good); border-color: rgba(53,194,154,.4); background: rgba(53,194,154,.1); }
.pcard__body p { color: var(--text-dim); font-size: .95rem; flex: 1; }
.pcard__body .btn { align-self: flex-start; margin-top: .3rem; }

/* ---------- Bento ---------- */
.bento { max-width: var(--maxw); margin: 0 auto; width: calc(100% - 4vw); padding: clamp(2rem,5vw,3rem) 0 clamp(4rem,8vw,6rem); display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.bento__cell { padding: 1.7rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: transform .35s var(--ease), background .35s; }
.bento__cell:hover { transform: translateY(-4px); background: var(--surface-2); }
.bento__cell--wide { grid-column: span 2; }
.bento__cell--accent { background: linear-gradient(140deg, rgba(108,111,242,.14), rgba(53,194,154,.08)); border-color: var(--border-strong); }
.bento__cell h3 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; margin-bottom: .6rem; }
.bento__cell p { color: var(--text-dim); font-size: .92rem; }
.bento__stat { display: block; font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; color: var(--accent-2); margin-bottom: .35rem; }

/* ---------- CTA ---------- */
.cta { max-width: var(--maxw); margin: 0 auto clamp(4rem,8vw,7rem); width: calc(100% - 4vw); }
.cta__inner {
  text-align: center; padding: clamp(3rem,7vw,5.5rem) clamp(1.5rem,5vw,4rem); border-radius: var(--radius-lg);
  background: radial-gradient(ellipse at 50% -10%, rgba(108,111,242,.22), transparent 60%), var(--surface);
  border: 1px solid var(--border-strong); position: relative; overflow: hidden;
}
.cta__icon { margin: 0 auto 1.4rem; border-radius: 22px; box-shadow: 0 20px 50px -16px rgba(108,111,242,.5); }
.cta__inner h2 { font-family: var(--font-display); font-size: clamp(2rem,4.5vw,3rem); font-weight: 600; letter-spacing: -.02em; margin-bottom: 1rem; }
.cta__inner > p { color: var(--text-dim); max-width: 48ch; margin: 0 auto 2rem; }
.cta__actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.cta__fine { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: 1.4rem; color: var(--text-faint); font-size: .85rem; }

/* ---------- Footer / more apps ---------- */
.more-apps { max-width: var(--maxw); margin: 0 auto; width: calc(100% - 4vw); padding: clamp(2.5rem,5vw,4rem) 0; border-top: 1px solid var(--border); }
.more-apps__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.more-apps__head h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; }
.more-apps__head a { color: var(--accent-2); font-size: .92rem; font-weight: 600; }
.more-apps__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.app-card { display: block; padding: 1.2rem 1.3rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: transform .3s var(--ease), background .3s, border-color .3s; }
.app-card:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--surface-2); }
.app-card h4 { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; margin-bottom: .35rem; }
.app-card p { color: var(--text-faint); font-size: .84rem; }

.footer {
  max-width: var(--maxw); margin: 0 auto; width: calc(100% - 4vw); padding: 3rem 0 4rem; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center;
}
.footer__brand { display: flex; align-items: center; gap: .55rem; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.footer__brand img { border-radius: 8px; }
.footer__tag { color: var(--accent-2); font-family: var(--font-mono); font-size: .88rem; }
.footer__meta { color: var(--text-faint); font-size: .85rem; }
.footer__meta a { color: var(--text-dim); border-bottom: 1px solid var(--border-strong); }
.footer__meta a:hover { color: var(--accent-2); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; padding-top: 3rem; }
  .hero__lede { max-width: none; }
  .feature__grid--split { grid-template-columns: 1fr; }
  .feature__grid--reverse .feature__text { order: 0; }
  .platform-cards { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr 1fr; }
  .bento__cell--wide { grid-column: span 2; }
  .more-apps__grid { grid-template-columns: repeat(2, 1fr); }
  .nav__links { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .bento { grid-template-columns: 1fr; }
  .bento__cell--wide, .bento__cell--accent { grid-column: span 1; }
  .more-apps__grid { grid-template-columns: 1fr; }
  .nav__cta { display: none; }
  .nav { gap: .8rem; }
  .strip__items { gap: 1.4rem 2rem; }
}
