/* =========================================================
   Knowra — web landing
   Tokens follow knowra_frontend/DesignSystem.swift
   Theme: html[data-theme="light" | "dark"] (set before paint in <head>)
   ========================================================= */

@font-face { font-family: "Source Serif Pro"; src: url("assets/fonts/SourceSerifPro-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Serif Pro"; src: url("assets/fonts/SourceSerifPro-Semibold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root {
  --accent: #0088ff;
  --accent-soft: rgba(0, 136, 255, 0.08);
  --accent-line: rgba(0, 136, 255, 0.3);
  --on-accent: #fff;
  --negative: #ff8f8f;

  --bg: #ffffff;
  --bg-1: #f2f2f7;
  --bg-2: #e8e8e8;
  --bg-3: #f8f8f8;
  --card: #ffffff;
  --abstract: #f8f8f8;
  --cat: #f2f2f7;
  --cat-text: rgba(60, 60, 67, 0.6);
  --divider: #e5e5e5;

  --text: #000000;
  --text-alt: #3c3c42;
  --text-2: rgba(60, 60, 67, 0.6);
  --text-3: rgba(60, 60, 67, 0.3);
  --text-4: rgba(60, 60, 67, 0.18);

  --ink: #1a2140;
  --ink-2: #6f7c99;
  --spark-grey: #b7b2bd;

  --spectrum: linear-gradient(100deg, #2fb6ee 0%, #9db0e8 32%, #d9aed6 58%, #f4c3c2 80%, #f2b074 100%);

  --shadow-card: 0 1px 2px rgba(20, 24, 40, 0.04), 0 12px 40px -12px rgba(20, 24, 40, 0.18);
  --shadow-float: 0 30px 80px -30px rgba(20, 30, 70, 0.35);

  --r-m: 12px;
  --r-l: 16px;
  --r-xl: 24px;

  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  --font-serif: "Source Serif Pro", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --accent: #0091ff;
  --accent-soft: rgba(0, 145, 255, 0.13);
  --accent-line: rgba(0, 145, 255, 0.38);

  --bg: #010101;
  --bg-1: #1c1c1e;
  --bg-2: #2c2c2e;
  --bg-3: #3a3a3c;
  --card: #1c1c1e;
  --abstract: #2c2c2e;
  --cat: #2c2c2e;
  --cat-text: rgba(255, 255, 255, 0.3);
  --divider: #2c2c2e;

  --text: #ffffff;
  --text-alt: #ebebf5;
  --text-2: rgba(235, 235, 245, 0.6);
  --text-3: rgba(235, 235, 245, 0.3);
  --text-4: rgba(235, 235, 245, 0.16);

  --ink: #ffffff;
  --ink-2: #8e9ab3;
  --spark-grey: #8a8a90;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -20px rgba(0, 0, 0, 0.9);
  --shadow-float: 0 40px 90px -30px rgba(0, 0, 0, 0.9);

  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.53;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
img, svg { display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(0, 136, 255, 0.18); }

.container { width: min(1180px, 100% - 48px); margin-inline: auto; }

.logo-dark { display: none !important; }
[data-theme="dark"] .logo-light { display: none !important; }
[data-theme="dark"] .logo-dark { display: block !important; }

.spectrum-text {
  font-style: italic;
  background: var(--spectrum);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.08em;
}

/* ---------- buttons ---------- */
.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 20px;
  border-radius: 999px;
  font-size: 16px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap;
  transition: transform 0.25s var(--ease), background-color 0.2s, box-shadow 0.25s var(--ease), opacity 0.2s, color 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn--sm { --h: 36px; padding: 0 16px; font-size: 15px; }
.btn--lg { --h: 52px; padding: 0 26px; font-size: 17px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 20px -8px var(--accent); }
.btn--primary:hover { box-shadow: 0 10px 28px -8px var(--accent); transform: translateY(-1px); }
.btn--primary:active { transform: translateY(0) scale(0.97); }
.btn--ghost { border: 1px solid color-mix(in srgb, var(--text-alt) 25%, transparent); color: var(--text-alt); }
.btn--ghost:hover { background: var(--bg-1); }
.btn--text { color: var(--text-alt); padding: 0 12px; }
.btn--text:hover { color: var(--accent); }

/* ---------- nav ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; transition: background-color 0.3s, box-shadow 0.3s; }
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 var(--divider);
}
.nav__inner { height: 64px; display: flex; align-items: center; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand__word { font-size: 14px; font-weight: 600; letter-spacing: 0.115em; color: var(--text); }
.nav__links { display: flex; gap: 28px; margin-left: auto; font-size: 15px; color: var(--text-2); }
.nav__links a { transition: color 0.2s; }
.nav__links a:hover { color: var(--text); }
.nav__auth { display: flex; align-items: center; gap: 6px; }

.theme-btn {
  position: relative;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-2);
  border: 1px solid var(--divider);
  margin-right: 4px;
  transition: color 0.2s, background 0.2s, transform 0.4s var(--spring);
}
.theme-btn:hover { color: var(--text); background: var(--bg-1); }
.theme-btn:active { transform: rotate(-30deg) scale(0.92); }
.theme-btn svg { position: absolute; transition: opacity 0.3s, transform 0.5s var(--spring); }
.theme-btn .ic-sun { opacity: 0; transform: rotate(-90deg) scale(0.6); }
[data-theme="dark"] .theme-btn .ic-sun { opacity: 1; transform: none; }
[data-theme="dark"] .theme-btn .ic-moon { opacity: 0; transform: rotate(90deg) scale(0.6); }

/* ---------- hero ---------- */
.hero { position: relative; padding: 108px 0 0; overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 24px; min-height: calc(100svh - 230px); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 8px 6px 12px; border-radius: 999px;
  background: var(--bg-1); color: var(--text-2);
  font-size: 13px; font-weight: 500;
}
.eyebrow__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--spectrum); box-shadow: 0 0 0 3px var(--accent-soft); }
.beta { font-size: 10px; font-weight: 600; color: #f08a24; background: rgba(255, 149, 0, 0.12); padding: 2px 7px; border-radius: 999px; letter-spacing: 0.02em; }

.hero__title {
  margin-top: 22px;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(44px, 6vw, 82px); line-height: 1.02; letter-spacing: -0.025em;
}
.hero__lede { margin-top: 24px; max-width: 30em; font-size: clamp(17px, 1.4vw, 19px); line-height: 1.6; color: var(--text-2); }
.hero__lede strong { color: var(--text-alt); font-weight: 600; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 28px; font-size: 14px; color: var(--text-2); }
.hero__meta li { display: inline-flex; align-items: center; gap: 7px; }

/* visual */
.hero__visual { position: relative; height: 730px; }
.prism { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.prism__shape { fill: none; stroke: var(--ink); stroke-width: 4.5; }
[data-theme="dark"] .prism__shape { stroke-width: 3.5; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.3)); }

.incoming line { stroke: var(--text-3); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 6 10; animation: flow 1.6s linear infinite; }
.incoming line:nth-child(2) { animation-duration: 1.9s; }
.incoming line:nth-child(3) { animation-duration: 1.4s; }
.incoming line:nth-child(4) { animation-duration: 2.1s; }
.incoming line:nth-child(5) { animation-duration: 1.7s; }
@keyframes flow { to { stroke-dashoffset: -32; } }
.in-stop { stop-color: var(--ink); }

.beam { transform-origin: 130px 380px; animation: beam 9s ease-in-out infinite; }
@keyframes beam { 0%, 100% { opacity: 0.88; transform: rotate(0deg) scale(1); } 50% { opacity: 1; transform: rotate(-1.5deg) scale(1.03); } }
[data-theme="dark"] .beam { mix-blend-mode: screen; }

.spk { color: var(--ink); transform-box: fill-box; transform-origin: center; animation: twinkle 4s ease-in-out infinite; }
.spk--b { animation-delay: -1.2s; }
.spk--c { color: var(--ink-2); animation-delay: -2.1s; }
.spk--d { color: var(--spark-grey); animation-delay: -3s; }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; } 50% { transform: scale(0.82) rotate(12deg); opacity: 0.75; } }
.diamond { fill: var(--ink); }
.dot { animation: drift 7s ease-in-out infinite; transform-box: fill-box; }
.dot:nth-of-type(2n) { animation-delay: -2s; animation-duration: 9s; }
.dot:nth-of-type(3n) { animation-delay: -4s; }
.dot--blue { fill: #7ec3e0; }
.dot--slate { fill: var(--ink-2); }
.dot--orange { fill: #f0a955; }
.dot--peach { fill: #f2b896; }
[data-theme="dark"] .dot--blue { fill: #5ab4f0; filter: drop-shadow(0 0 6px #5ab4f0); }
[data-theme="dark"] .dot--orange { fill: #f6b46a; filter: drop-shadow(0 0 6px #f6b46a); }
@keyframes drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(6px, -10px); } }

/* phone */
.phone-wrap { position: absolute; top: 28px; right: 7%; width: 300px; animation: rise 1.2s var(--ease) both 0.15s; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
.phone {
  position: relative;
  width: 300px; height: 620px;
  padding: 10px;
  border-radius: 52px;
  background: linear-gradient(145deg, #2b2b30, #121215 40%, #1d1d21);
  box-shadow:
    inset 0 0 0 1.5px #45454c,
    inset 0 0 0 4px #0b0b0d,
    0 0 0 1px rgba(0, 0, 0, 0.25),
    0 50px 90px -40px rgba(20, 30, 70, 0.55),
    0 24px 50px -30px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .phone { box-shadow: inset 0 0 0 1.5px #55555c, inset 0 0 0 4px #0b0b0d, 0 0 0 1px rgba(255,255,255,.06), 0 50px 110px -40px rgba(0, 0, 0, 1), 0 0 80px -20px rgba(120, 140, 255, 0.25); }
.phone__btn { position: absolute; width: 3px; border-radius: 2px; background: #2a2a2f; }
.phone__btn--a { left: -3px; top: 120px; height: 28px; }
.phone__btn--b { left: -3px; top: 164px; height: 50px; }
.phone__btn--c { right: -3px; top: 150px; height: 74px; }
.phone__screen {
  position: relative; height: 100%;
  border-radius: 42px; overflow: hidden;
  background: var(--bg);
  isolation: isolate;
}
.phone__island { position: absolute; top: 11px; left: 50%; width: 84px; height: 25px; margin-left: -42px; border-radius: 20px; background: #000; z-index: 5; }
.statusbar {
  position: absolute; inset: 0 0 auto 0; height: 50px; z-index: 4;
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 22px 0 30px;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.statusbar__icons { display: flex; align-items: center; gap: 4px; }
.statusbar__icons svg:last-child { width: 22px; }
.statusbar__icons svg { fill: currentColor; }

.deck { position: absolute; top: 54px; left: 12px; right: 12px; bottom: 92px; touch-action: none; }

.fcard {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 14px 12px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.1);
  border: 1px solid color-mix(in srgb, var(--text) 5%, transparent);
  transition: transform 0.55s var(--ease), opacity 0.45s var(--ease);
  will-change: transform;
  user-select: none; -webkit-user-select: none;
  overflow: hidden;
  cursor: grab;
}
.fcard.is-dragging { transition: none; cursor: grabbing; }
.fcard[data-pos="0"] { z-index: 3; }
.fcard[data-pos="1"] { z-index: 2; transform: translateY(9px) scale(0.955); }
.fcard[data-pos="2"] { z-index: 1; transform: translateY(18px) scale(0.91); opacity: 0.55; }
.fcard[data-pos="hidden"] { z-index: 0; transform: translateY(18px) scale(0.91); opacity: 0; }
.fcard:not([data-pos="0"]) { pointer-events: none; }
.fcard:not([data-pos="0"]) > * { opacity: 0.5; }

.fcard__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fcard .cat { font-size: 11px; color: var(--cat-text); background: var(--cat); padding: 3px 9px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard__date { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); white-space: nowrap; }
.fcard__date svg { color: var(--accent); }
.fcard__title {
  font-family: var(--font-display); font-weight: 700; font-size: 16.5px; line-height: 1.28; color: var(--text-alt);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.fcard__authors { font-family: var(--font-display); font-size: 12px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fcard__id { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); }
.fcard__abstract {
  flex: 1; min-height: 0;
  font-family: var(--font-serif); font-size: 11.5px; line-height: 1.62; color: var(--text-alt);
  background: var(--abstract); padding: 11px 12px; border-radius: 12px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 70%, transparent);
  mask-image: linear-gradient(#000 70%, transparent);
}
.fcard__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.fcard__tags span { font-size: 10.5px; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: 999px; }

.stamp {
  position: absolute; top: 46px; z-index: 6;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  opacity: 0; pointer-events: none;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.3);
}
.stamp--save { left: 12px; background: var(--accent); color: #fff; transform: rotate(-8deg); }
.stamp--skip { right: 12px; background: var(--negative); color: #fff; transform: rotate(8deg); }

.tabbar {
  position: absolute; left: 50%; bottom: 22px; z-index: 6;
  transform: translateX(-50%);
  display: flex; gap: 2px; padding: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 72%, transparent);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.3);
}
.tab {
  position: relative;
  display: grid; justify-items: center; gap: 1px;
  width: 74px; padding: 6px 0 5px; border-radius: 999px;
  font-size: 10px; font-weight: 500; color: var(--text-alt);
}
.tab.is-active { color: var(--accent); background: color-mix(in srgb, var(--text) 7%, transparent); }
.tab__badge {
  position: absolute; top: 2px; right: 16px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: #ff3b30; color: #fff; font-size: 10px; font-weight: 600; line-height: 16px; text-align: center;
}
.tab.is-bump svg { animation: bump 0.5s var(--spring); }
@keyframes bump { 40% { transform: scale(1.35) rotate(-10deg); color: #ffb800; } }

/* ---------- ticker (indexed arXiv categories) ---------- */
.ticker {
  position: relative;
  margin-top: 84px; padding: 15px 0;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker__track { display: flex; gap: 44px; width: max-content; animation: ticker 36s linear infinite; }
.ticker__track span { display: flex; align-items: center; gap: 44px; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.06em; color: var(--text-3); }
.ticker__track span::after { content: "·"; color: var(--accent); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { padding: clamp(88px, 12vw, 140px) 0; position: relative; }
.section--tint { background: var(--bg-1); }
[data-theme="dark"] .section--tint { background: #0b0b0c; }
.section__head { max-width: 820px; margin-bottom: 64px; }
.section__head .section__lede { max-width: 640px; }
.section__head--center { margin-inline: auto; text-align: center; }
.section__head--center .section__lede { margin-inline: auto; }
.kicker { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
.section__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(32px, 4vw, 52px); line-height: 1.1; letter-spacing: -0.02em; color: var(--text); }
.section__lede { margin-top: 20px; font-size: 18px; line-height: 1.65; color: var(--text-2); }

/* flow */
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.flow__item {
  position: relative; padding: 32px 28px 34px; border-radius: var(--r-xl);
  background: var(--bg-3); border: 1px solid color-mix(in srgb, var(--text) 5%, transparent);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
[data-theme="dark"] .flow__item { background: var(--bg-1); }
.flow__item:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.flow__num { position: absolute; top: 28px; right: 28px; font-family: var(--font-display); font-size: 15px; color: var(--text-3); }
.flow__item h3 { margin-top: 26px; font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.flow__item p { margin-top: 10px; color: var(--text-2); font-size: 16px; line-height: 1.6; }
.flow__icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow-card); position: relative; overflow: hidden; }
.flow__icon::after { content: ""; position: absolute; inset: auto -30% -60% -30%; height: 80%; background: var(--spectrum); filter: blur(14px); opacity: 0.35; }
.flow__icon svg { width: 40px; height: 40px; position: relative; z-index: 1; }
.ic-back { fill: none; stroke: var(--text-3); stroke-width: 2; }
.ic-front { fill: var(--card); stroke: var(--ink); stroke-width: 2.5; }
.ic-ring { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.ic-line { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.ic-spark { color: var(--accent); }
.ic-bookmark { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }

/* split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 100px); align-items: center; }
.split .section__title { font-size: clamp(30px, 3.4vw, 46px); }

.checks { display: grid; gap: 14px; margin-top: 32px; }
.checks li { display: flex; gap: 14px; align-items: flex-start; color: var(--text-2); font-size: 16px; line-height: 1.55; }
.checks strong { color: var(--text-alt); font-weight: 600; }
.check { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; background: var(--accent-soft); position: relative; }
.check::after { content: ""; position: absolute; left: 7px; top: 5px; width: 6px; height: 10px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.fine { margin-top: 28px; font-size: 14px; color: var(--text-3); }

/* scout sheet */
.sheet {
  position: relative; background: var(--card); border-radius: 28px;
  padding: 10px 26px 20px; box-shadow: var(--shadow-float);
  border: 1px solid color-mix(in srgb, var(--text) 6%, transparent); overflow: hidden;
}
.sheet::before { content: ""; position: absolute; top: -120px; right: -120px; width: 300px; height: 300px; background: var(--spectrum); filter: blur(60px); opacity: 0.22; border-radius: 50%; pointer-events: none; }
.sheet__grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--text-4); margin: 0 auto 18px; }
.sheet__head { display: flex; align-items: center; gap: 12px; position: relative; }
.sheet__badge { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); background: var(--accent-soft); font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; }
.sheet__badge svg { color: currentColor; }
.sheet__status { margin-left: auto; font-size: 12px; color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; }
.sheet__status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.sheet__status.is-done::before { background: #34c759; animation: none; }
.sheet__replay { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); background: var(--bg-1); transition: transform 0.4s var(--spring); }
.sheet__replay:hover { transform: rotate(-60deg); color: var(--accent); }
@keyframes pulse { 50% { opacity: 0.3; } }
.sheet__title { margin-top: 16px; font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.3; color: var(--text-alt); position: relative; }
.sheet__body { margin-top: 18px; display: grid; gap: 16px; align-content: start; min-height: 340px; position: relative; }
.sheet__body section { opacity: 0; transform: translateY(6px); transition: opacity 0.4s, transform 0.5s var(--ease); }
.sheet__body section.is-live { opacity: 1; transform: none; }
.sheet__body h4 { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; display: flex; align-items: center; gap: 8px; }
.sheet__body h4::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--spectrum); }
.sheet__body p { margin-top: 6px; font-family: var(--font-serif); font-size: 15px; line-height: 1.65; color: var(--text-alt); }
.caret::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--accent); animation: pulse 0.9s steps(2) infinite; }
.sheet__foot { display: flex; gap: 10px; align-items: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--divider); }
.sheet__note { margin-right: auto; font-size: 12px; color: var(--text-3); }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 500; background: var(--bg-1); color: var(--text-alt); }
.chip-btn--accent { background: var(--accent); color: #fff; }

/* bento */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tile {
  position: relative;
  padding: 30px 28px 32px;
  border-radius: var(--r-xl);
  background: var(--bg-3);
  border: 1px solid color-mix(in srgb, var(--text) 5%, transparent);
  overflow: hidden;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s;
}
[data-theme="dark"] .tile { background: var(--bg-1); }
.tile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(157, 176, 232, 0.16), transparent 45%);
  opacity: 0; transition: opacity 0.3s;
}
.tile:hover::after { opacity: 1; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.tile:not(.tile--wide) { display: flex; flex-direction: column; justify-content: center; }
.tile__idx { position: absolute; top: 26px; right: 28px; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.tile h3 { font-family: var(--font-display); font-weight: 700; font-size: 21px; line-height: 1.25; margin-top: 22px; }
.tile p { margin-top: 10px; font-size: 15.5px; line-height: 1.6; color: var(--text-2); }
.tile__icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.tile__icon--swipe { position: relative; }
.tile__icon--swipe span { position: absolute; width: 16px; height: 21px; border-radius: 4px; border: 2px solid var(--accent); background: var(--card); }
.tile__icon--swipe span:first-child { transform: translateX(-4px) rotate(-10deg); opacity: 0.5; }
.tile__icon--swipe span:last-child { transform: translateX(4px) rotate(10deg); animation: swipeHint 2.6s var(--ease) infinite; }
@keyframes swipeHint { 0%, 30% { transform: translateX(4px) rotate(10deg); } 55% { transform: translateX(13px) rotate(22deg); opacity: 0; } 56% { transform: translateX(4px) rotate(10deg); opacity: 0; } 80%, 100% { opacity: 1; } }

.tile--wide { grid-column: span 3; display: grid; grid-template-columns: minmax(260px, 0.8fr) 1.6fr; gap: 32px; align-items: center; padding: 36px 36px 36px 36px; }
.tile--wide h3 { margin-top: 14px; font-size: clamp(24px, 2.4vw, 32px); }
.tile--wide .tile__idx { position: static; }

/* five paths */
.disperse { display: grid; grid-template-columns: 56px minmax(80px, 1fr) minmax(250px, 1.2fr); align-items: stretch; min-height: 300px; }
.disperse__rays { grid-column: 1 / 3; grid-row: 1; width: 100%; height: 100%; overflow: visible; }
.disperse__prism { grid-column: 1; grid-row: 1; align-self: center; justify-self: end; width: 40px; height: 54px; margin-right: -12px; position: relative; z-index: 1; }
.disperse__prism polygon { fill: var(--bg-3); stroke: var(--ink); stroke-width: 3; }
[data-theme="dark"] .disperse__prism polygon { fill: var(--bg-1); }
.ray { fill: none; stroke: var(--c); stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 600; stroke-dashoffset: 600; filter: drop-shadow(0 0 6px var(--c)); transition: stroke-dashoffset 1.6s var(--ease); }
.disperse.is-visible .ray { stroke-dashoffset: 0; }
.disperse.is-visible .ray:nth-of-type(2) { transition-delay: 0.08s; }
.disperse.is-visible .ray:nth-of-type(3) { transition-delay: 0.16s; }
.disperse.is-visible .ray:nth-of-type(4) { transition-delay: 0.24s; }
.disperse.is-visible .ray:nth-of-type(5) { transition-delay: 0.32s; }
.paths { grid-column: 3; grid-row: 1; display: grid; grid-template-rows: repeat(5, 1fr); }
.paths li { display: flex; align-items: center; gap: 14px; padding: 4px 0; opacity: 0; transform: translateX(12px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.disperse.is-visible .paths li { opacity: 1; transform: none; }
.disperse.is-visible .paths li:nth-child(1) { transition-delay: 0.7s; }
.disperse.is-visible .paths li:nth-child(2) { transition-delay: 0.8s; }
.disperse.is-visible .paths li:nth-child(3) { transition-delay: 0.9s; }
.disperse.is-visible .paths li:nth-child(4) { transition-delay: 1s; }
.disperse.is-visible .paths li:nth-child(5) { transition-delay: 1.1s; }
.paths__dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent), 0 0 16px var(--c); }
.paths h4 { font-family: var(--font-display); font-size: 17px; font-weight: 700; line-height: 1.2; }
.paths p { margin: 0; font-size: 14px; color: var(--text-2); line-height: 1.4; }

/* ---------- agents (tinted panel in light; deep dark in dark theme) ---------- */
.agents {
  /* code / terminal surface palette — light */
  --t-bg: #ffffff;
  --t-bg-2: #f5f5f7;
  --t-border: #e3e3e8;
  --t-line: #ededf1;
  --t-control: #d2d2da;
  --t-hover: #f0f0f4;
  --t-text: #3c3c42;
  --t-strong: #111114;
  --t-dim: #9a9aa4;
  --t-meta: #86868f;
  --t-ok: #1f9d55;
  --t-str: #b35a12;
  --t-key: #0a6bff;
  --t-accent: #0088ff;
  --t-tool: #7c4dff;

  position: relative; overflow: hidden;
  padding: clamp(96px, 12vw, 150px) 0;
  background: var(--bg-1); color: var(--text);
}
[data-theme="dark"] .agents {
  --t-bg: #0c0c0f;
  --t-bg-2: #101014;
  --t-border: #24242b;
  --t-line: #1d1d22;
  --t-control: #2a2a31;
  --t-hover: #1b1b21;
  --t-text: #d6d6dc;
  --t-strong: #f2f2f5;
  --t-dim: #6e6e78;
  --t-meta: #7c7c86;
  --t-ok: #5ad17a;
  --t-str: #f2b074;
  --t-key: #8fc8ff;
  --t-accent: #4fb3ff;
  --t-tool: #c3a6ff;

  background: #050507; color: #fff;
}
.agents__glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(40% 50% at 85% 20%, rgba(47, 182, 238, 0.16), transparent 70%),
    radial-gradient(35% 45% at 95% 80%, rgba(217, 174, 214, 0.16), transparent 70%),
    radial-gradient(30% 40% at 0% 100%, rgba(242, 176, 116, 0.12), transparent 70%);
}
[data-theme="dark"] .agents__glow {
  background:
    radial-gradient(40% 50% at 85% 20%, rgba(47, 182, 238, 0.16), transparent 70%),
    radial-gradient(35% 45% at 95% 80%, rgba(217, 174, 214, 0.12), transparent 70%),
    radial-gradient(30% 40% at 0% 100%, rgba(242, 176, 116, 0.08), transparent 70%);
}
.agents__grid { position: relative; display: grid; grid-template-columns: 0.95fr 1.05fr; gap: clamp(40px, 6vw, 80px); align-items: stretch; }
.agents__copy { display: flex; flex-direction: column; }
.agents .section__title { color: var(--text); font-size: clamp(30px, 3.4vw, 46px); }
.agents .section__lede { color: var(--text-2); margin-bottom: 34px; }
.kicker--light { color: var(--accent); }
[data-theme="dark"] .kicker--light { color: #4fb3ff; }

.code { margin-top: auto; border-radius: 14px; background: var(--t-bg); border: 1px solid var(--t-border); box-shadow: 0 16px 40px -28px rgba(20, 30, 70, 0.35); overflow: hidden; }
[data-theme="dark"] .code { box-shadow: none; }
.code__bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--t-line); }
.code__file { font-family: var(--font-mono); font-size: 12px; color: var(--t-dim); }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 8px; font-size: 12px; color: var(--t-meta); border: 1px solid var(--t-control); transition: background 0.2s, color 0.2s; }
.copy-btn:hover { background: var(--t-hover); color: var(--t-strong); }
.copy-btn.is-done { color: var(--t-ok); border-color: color-mix(in srgb, var(--t-ok) 45%, transparent); }
.code pre { margin: 0; padding: 16px 18px 18px; font-family: var(--font-mono); font-size: 13px; line-height: 1.7; color: var(--t-text); overflow-x: auto; }
.code i, .term i { font-style: normal; }
.k { color: var(--t-key); }
.s { color: var(--t-str); }

/* terminal */
.term {
  display: flex; flex-direction: column;
  border-radius: 18px;
  background: var(--t-bg);
  border: 1px solid var(--t-border);
  box-shadow: 0 24px 60px -30px rgba(20, 30, 70, 0.3), 0 0 80px -50px rgba(47, 182, 238, 0.4);
  overflow: hidden;
}
[data-theme="dark"] .term {
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, 1), 0 0 0 1px rgba(255, 255, 255, 0.02), 0 0 120px -40px rgba(47, 182, 238, 0.35);
}
.term__bar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--t-line); background: var(--t-bg-2); }
.term__dots { display: flex; gap: 7px; }
.term__dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term__dots i:nth-child(2) { background: #febc2e; }
.term__dots i:nth-child(3) { background: #28c840; }
.term__title { flex: 1; text-align: center; font-family: var(--font-mono); font-size: 12px; color: var(--t-dim); }
.term__replay { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--t-meta); border: 1px solid var(--t-control); transition: color 0.2s, transform 0.4s var(--spring); }
.term__replay:hover { color: var(--t-strong); transform: rotate(-60deg); }
.term__body {
  flex: 1 0 auto; height: 520px; overflow: hidden;
  padding: 18px 20px;
  font-family: var(--font-mono); font-size: 12.8px; line-height: 1.7; color: var(--t-text);
  display: flex; flex-direction: column; justify-content: flex-start;
}
.term__body > div { animation: lineIn 0.35s var(--ease) both; white-space: pre-wrap; word-break: break-word; }
@keyframes lineIn { from { opacity: 0; transform: translateY(4px); } }
.term__foot { margin-top: auto; display: flex; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--t-line); font-family: var(--font-mono); font-size: 11px; color: var(--t-dim); }
.term__cursor-note { color: color-mix(in srgb, var(--t-accent) 72%, transparent); }

.t-dim { color: var(--t-dim); }
.t-prompt { color: var(--t-accent); }
.t-user { color: var(--t-strong); }
.t-tool { color: var(--t-tool); }
.t-ok { color: var(--t-ok); }
.t-str { color: var(--t-str); }
.t-title { color: var(--t-strong); }
.t-meta { color: var(--t-meta); }
.t-num { color: var(--t-dim); display: inline-block; width: 2.2ch; }
.t-ai { color: var(--t-text); font-family: var(--font-ui); font-size: 14px; line-height: 1.6; padding: 10px 0 2px; }
.t-ai b { color: var(--t-strong); font-weight: 600; }
.t-ai .t-mark { color: var(--t-accent); font-family: var(--font-mono); margin-right: 8px; }
.t-soon { color: var(--t-dim); }
.t-soon b { font-weight: 500; color: var(--t-meta); border: 1px solid var(--t-control); padding: 0 6px; border-radius: 5px; font-size: 11px; }
.t-gap { height: 10px; }
.t-cursor::after { content: ""; display: inline-block; width: 7px; height: 15px; margin-left: 2px; vertical-align: -3px; background: var(--t-accent); animation: pulse 0.9s steps(2) infinite; }
.t-result { padding-left: 2ch; }
.t-result .t-title { transition: color 0.3s; }
.t-result.is-hl .t-title { color: var(--t-strong); background: linear-gradient(90deg, color-mix(in srgb, var(--t-accent) 18%, transparent), color-mix(in srgb, #d9aed6 12%, transparent)); border-radius: 4px; }

/* final CTA */
.cta { position: relative; overflow: hidden; padding: clamp(110px, 14vw, 180px) 0; text-align: center; }
.cta__glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(40% 55% at 30% 58%, rgba(47, 182, 238, 0.22), transparent 70%),
    radial-gradient(35% 50% at 50% 45%, rgba(183, 156, 230, 0.22), transparent 70%),
    radial-gradient(40% 55% at 72% 40%, rgba(244, 195, 194, 0.28), transparent 70%),
    radial-gradient(30% 40% at 82% 62%, rgba(242, 176, 116, 0.18), transparent 70%);
}
[data-theme="dark"] .cta__glow { filter: saturate(1.3) brightness(1.2); }
.cta__inner { position: relative; display: grid; justify-items: center; }
.cta__spark { width: 44px; height: 44px; color: var(--ink); margin-bottom: 28px; animation: twinkle 4s ease-in-out infinite; }
.cta h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 6vw, 76px); line-height: 1.06; letter-spacing: -0.025em; }
.cta p { margin-top: 20px; font-size: 18px; color: var(--text-2); }
.cta__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 38px; }

/* footer */
.footer { border-top: 1px solid var(--divider); padding: 36px 0 44px; font-size: 14px; color: var(--text-2); }
.footer__inner { display: grid; grid-template-columns: 1fr auto; gap: 16px 32px; align-items: center; }
.footer__brand { display: flex; align-items: baseline; gap: 14px; }
.footer__links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer__links a:hover { color: var(--accent); }
.footer__copy { grid-column: 1 / -1; color: var(--text-3); font-size: 12.5px; }

/* ---------- auth dialog ---------- */
.auth {
  width: min(420px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 28px;
  background: var(--card); color: var(--text);
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.45); overflow: hidden;
}
.auth[open] { animation: pop 0.45s var(--spring); }
.auth::backdrop { background: rgba(10, 12, 24, 0.38); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade 0.3s; }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes fade { from { opacity: 0; } }
.auth::before { content: ""; position: absolute; top: -140px; left: 50%; width: 360px; height: 260px; transform: translateX(-50%); background: var(--spectrum); filter: blur(70px); opacity: 0.28; border-radius: 50%; pointer-events: none; }
.auth__close-form { position: absolute; top: 14px; right: 14px; z-index: 2; }
.auth__close { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); background: var(--bg-1); transition: background 0.2s; }
.auth__close:hover { background: var(--bg-2); }
.auth__inner, .auth__success { position: relative; padding: 36px 32px 28px; display: grid; }
.auth__logo { justify-self: center; }
.auth__logo img { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 8px 24px -8px rgba(0, 136, 255, 0.4); }
.segment { position: relative; display: grid; grid-template-columns: 1fr 1fr; margin: 22px auto 0; width: 220px; padding: 3px; border-radius: 999px; background: var(--bg-1); }
.segment__btn { position: relative; z-index: 1; height: 32px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--text-2); transition: color 0.25s; }
.segment__btn[aria-selected="true"] { color: var(--text); }
.segment__thumb { position: absolute; top: 3px; left: 3px; bottom: 3px; width: calc(50% - 3px); border-radius: 999px; background: var(--card); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); transition: transform 0.4s var(--spring); }
[data-theme="dark"] .segment__thumb { background: var(--bg-3); }
.segment[data-mode="signup"] .segment__thumb { transform: translateX(100%); }
.auth__title { margin-top: 22px; text-align: center; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: var(--accent); }
.auth__sub { margin-top: 8px; text-align: center; font-size: 14px; color: var(--text-2); }
.auth__form { display: grid; gap: 14px; margin-top: 26px; }
.field {
  width: 100%; height: 52px; padding: 0 20px; border: 1px solid transparent; border-radius: 999px;
  background: color-mix(in srgb, var(--bg-2) 50%, transparent); color: var(--text-alt);
  font: inherit; font-size: 16px; outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.field::placeholder { color: var(--text-3); }
.field:focus { border-color: var(--accent-line); background: var(--card); box-shadow: 0 0 0 4px var(--accent-soft); }
.field:disabled { opacity: 0.7; }
.field--code { letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; animation: pop 0.4s var(--spring); }
.field--code::placeholder { letter-spacing: normal; }
.field.is-invalid { border-color: #ff6b6b; box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.12); animation: shake 0.4s; }
@keyframes shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.auth__error { font-size: 13px; color: #e5484d; text-align: center; margin-top: -4px; }
#authPrimary { --h: 52px; position: relative; }
#authPrimary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; animation: spin 0.7s linear infinite; }
.is-loading .btn__label { display: none; }
.is-loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn--resend { --h: 32px; font-size: 13px; color: var(--text-2); }
.or { display: flex; align-items: center; gap: 12px; margin: 22px 0 18px; font-size: 13px; color: color-mix(in srgb, var(--text-alt) 40%, transparent); }
.or span { flex: 1; height: 1px; background: color-mix(in srgb, var(--text-alt) 20%, transparent); }
.oauth { display: grid; gap: 12px; }
.oauth__btn { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 20px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--text-alt) 40%, transparent); color: var(--text-alt); font-size: 16px; transition: background 0.2s, transform 0.2s var(--ease); }
.oauth__btn:hover { background: var(--bg-1); }
.oauth__btn:active { transform: scale(0.98); }
.oauth__btn span { flex: 1; text-align: center; margin-right: 32px; }
.oauth__btn img { width: 20px; height: 20px; }
.auth__legal { margin-top: 22px; text-align: center; font-size: 12px; color: var(--text-3); }
.auth__legal a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.auth__success { text-align: center; justify-items: center; padding-top: 56px; padding-bottom: 32px; }
.auth__success-spark { width: 56px; height: 56px; color: var(--accent); animation: twinkle 3s ease-in-out infinite; }
.auth__success h2 { margin-top: 22px; font-family: var(--font-display); font-size: 32px; }
.auth__success p { margin: 8px 0 28px; color: var(--text-2); }
.auth__success form { width: 100%; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 100; transform: translate(-50%, 20px);
  padding: 12px 20px; border-radius: 999px;
  background: color-mix(in srgb, var(--text) 88%, transparent); color: var(--bg);
  font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.4s var(--spring); backdrop-filter: blur(10px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.hero .reveal:nth-child(2) { transition-delay: 0.08s; }
.hero .reveal:nth-child(3) { transition-delay: 0.16s; }
.hero .reveal:nth-child(4) { transition-delay: 0.24s; }
.hero .reveal:nth-child(5) { transition-delay: 0.32s; }
.flow .reveal:nth-child(2), .bento .reveal:nth-child(3) { transition-delay: 0.1s; }
.flow .reveal:nth-child(3) { transition-delay: 0.2s; }
.bento .reveal:nth-child(4) { transition-delay: 0.2s; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .nav__links { display: none; }
  .nav__auth { margin-left: auto; }
  .hero__grid { grid-template-columns: 1fr; gap: 40px; min-height: 0; }
  .hero__copy { text-align: center; display: grid; justify-items: center; }
  .hero__lede { margin-inline: auto; }
  .hero__cta, .hero__meta { justify-content: center; }
  .hero__visual { width: min(640px, 100%); margin-inline: auto; }
  .phone-wrap { right: auto; left: 50%; margin-left: -150px; }
  .prism { left: -18%; width: 100%; }
  .split, .agents__grid { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
  .section__head { margin-inline: auto; text-align: center; }
  .section__head .section__lede { margin-inline: auto; }
  .bento { grid-template-columns: 1fr 1fr; }
  .tile--wide { grid-column: span 2; grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .container { width: calc(100% - 36px); }
  .theme-btn { display: none; }
  .hero { padding-top: 96px; }
  .hero__title { font-size: clamp(40px, 11vw, 56px); }
  .hero__visual { height: 620px; }
  .phone-wrap { transform: scale(0.88); transform-origin: top center; }
  .prism { left: -40%; width: 120%; opacity: 0.8; }
  .bento { grid-template-columns: 1fr; }
  .tile--wide { grid-column: auto; padding: 28px 24px; }
  .disperse { grid-template-columns: 1fr; min-height: 0; }
  .disperse__rays, .disperse__prism { display: none; }
  .paths { grid-column: 1; grid-template-rows: none; gap: 8px; }
  .paths li { padding: 12px 14px; background: var(--card); border-radius: var(--r-l); }
  .sheet { padding: 10px 18px 18px; }
  .term__body { height: 560px; font-size: 11.5px; padding: 14px; }
  .footer__inner { grid-template-columns: 1fr; }
  .auth__inner { padding: 32px 22px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
  html { scroll-behavior: auto; }
}


/* ---------- account page ---------- */
.account {
  /* code surface palette (mirrors .agents) */
  --t-bg: #ffffff;
  --t-bg-2: #f5f5f7;
  --t-border: #e3e3e8;
  --t-line: #ededf1;
  --t-control: #d2d2da;
  --t-hover: #f0f0f4;
  --t-text: #3c3c42;
  --t-strong: #111114;
  --t-dim: #9a9aa4;
  --t-meta: #86868f;
  --t-ok: #1f9d55;
  --t-str: #b35a12;
  --t-key: #0a6bff;
  --t-accent: #0088ff;
  --t-tool: #7c4dff;

  max-width: 940px;
  min-height: 100vh;
  padding-top: 118px;
  padding-bottom: 96px;
}
[data-theme="dark"] .account {
  --t-bg: #0c0c0f;
  --t-bg-2: #101014;
  --t-border: #24242b;
  --t-line: #1d1d22;
  --t-control: #2a2a31;
  --t-hover: #1b1b21;
  --t-text: #d6d6dc;
  --t-strong: #f2f2f5;
  --t-dim: #6e6e78;
  --t-meta: #7c7c86;
  --t-ok: #5ad17a;
  --t-str: #f2b074;
  --t-key: #8fc8ff;
  --t-accent: #4fb3ff;
  --t-tool: #c3a6ff;
}

.muted { color: var(--text-2); }
.small { font-size: 13px; }
.mono { font-family: var(--font-mono); font-size: 12.5px; word-break: break-all; }
.nav__user { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--text-2); }
.nav--account .nav__auth { margin-left: auto; }
.nav-back { height: 34px; padding: 0 14px; border-radius: 999px; background: var(--bg-1); font-size: 14px; color: var(--text-alt); }
.nav-back:hover { background: var(--bg-2); color: var(--text); }

.acct-state { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 72px 0; color: var(--text-2); }
.acct-state--card { max-width: 540px; margin: 32px auto 0; padding: 48px 34px; background: var(--card); border: 1px solid var(--divider); border-radius: var(--r-xl); box-shadow: var(--shadow-card); }
.acct-state h1 { font-family: var(--font-display); font-size: clamp(26px, 4vw, 34px); letter-spacing: -0.02em; color: var(--text); }
.acct-state p { max-width: 420px; }
.acct-state code { font-family: var(--font-mono); font-size: 13px; background: var(--bg-1); padding: 2px 6px; border-radius: 6px; }
.acct-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--divider); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }

/* head + profile */
.account__head { margin-bottom: 24px; }
.account__head .kicker { color: var(--accent); font-weight: 600; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.account__title { margin-top: 8px; font-family: var(--font-display); font-size: clamp(30px, 4vw, 40px); letter-spacing: -0.02em; }

.profile { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding: 18px 22px; background: var(--card); border: 1px solid var(--divider); border-radius: 20px; box-shadow: var(--shadow-card); }
.profile__avatar { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%; color: #fff; font-size: 18px; font-weight: 700; background: var(--accent); box-shadow: 0 6px 18px -8px var(--accent); }
.profile__meta { flex: 1; min-width: 0; }
.profile__email { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile__sub { margin-top: 2px; font-size: 13px; color: var(--text-2); }

/* cards */
.acards { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; margin-bottom: 18px; }
.acard { padding: 22px; background: var(--card); border: 1px solid var(--divider); border-radius: 20px; box-shadow: var(--shadow-card); }
.acard__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.acard__head h2 { font-size: 12px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-2); }
.acard__value { font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.acard__unit { font-size: 16px; font-weight: 500; color: var(--text-2); }
.acard__note { margin-top: 8px; font-size: 14px; color: var(--text-alt); }
.acard__fine { margin-top: 12px; font-size: 12.5px; color: var(--text-3); }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }
.badge--on { background: var(--accent-soft); color: var(--accent); }
.badge--off { background: var(--bg-1); color: var(--text-2); }

.usage__bar { height: 8px; margin: 14px 0 10px; border-radius: 999px; background: var(--bg-1); overflow: hidden; }
.usage__bar > span { display: block; width: 0; height: 100%; border-radius: 999px; background: var(--spectrum); transition: width 0.5s var(--ease); }
.usage__bar > span.is-over { background: var(--negative); }

/* keys */
.keys { display: grid; gap: 16px; }
.keys__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.keys__head h2 { margin-bottom: 6px; font-family: var(--font-display); font-size: 26px; letter-spacing: -0.01em; }
.keys__head p { max-width: 440px; font-size: 14px; }
.keys__empty { display: grid; gap: 6px; justify-items: center; padding: 36px 20px; text-align: center; border: 1px dashed var(--divider); border-radius: 18px; color: var(--text-2); }
.keys__empty svg { color: var(--text-3); }

.keys__list { display: grid; gap: 10px; }
.krow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; padding: 14px 18px; background: var(--card); border: 1px solid var(--divider); border-radius: 14px; transition: border-color 0.2s, box-shadow 0.2s; }
.krow:hover { border-color: var(--accent-line); box-shadow: var(--shadow-card); }
.krow__main { display: grid; gap: 3px; flex: 1 1 240px; min-width: 0; }
.krow__name { font-size: 15px; font-weight: 600; }
.krow__key { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2); }
.krow__mask { margin-left: 2px; letter-spacing: 0.08em; color: var(--text-3); }
.krow__meta { display: flex; flex-wrap: wrap; gap: 4px 18px; flex: 1 1 240px; font-size: 12px; color: var(--text-3); }
.krow__meta b { font-weight: 600; color: var(--text-2); }
.krow__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.krow__actions [data-revoke] { color: var(--negative); }
.krow__actions [data-revoke]:hover { opacity: 0.75; }

/* create-key modal */
.modal { width: min(440px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 22px; background: var(--card); color: var(--text); box-shadow: 0 40px 120px -24px rgba(0, 0, 0, 0.5); }
.modal.is-reveal { width: min(880px, calc(100% - 28px)); }
.modal[open] { animation: pop 0.4s var(--spring); }
.modal::backdrop { background: rgba(10, 12, 24, 0.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade 0.25s; }
.modal__close-form { position: absolute; top: 12px; right: 12px; z-index: 2; }
.modal__close { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--text-2); background: var(--bg-1); transition: background 0.2s; }
.modal__close:hover { background: var(--bg-2); }
.modal__step { display: grid; gap: 10px; padding: 26px 24px 22px; }
.modal__title { font-family: var(--font-display); font-size: 24px; letter-spacing: -0.01em; }
.modal__sub { font-size: 14px; color: var(--text-2); }
.modal__warn { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 159, 10, 0.13); color: #b45309; font-size: 13px; }
[data-theme="dark"] .modal__warn { color: #f4b06a; }
.modal__warn svg { flex: 0 0 auto; }
.modal__form { display: grid; gap: 12px; margin-top: 4px; }
.modal__form .field { height: 48px; }
.modal__row { display: flex; align-items: center; gap: 10px; }
.modal__row .field { flex: 0 0 auto; width: auto; }
.modal__row .btn--ghost { margin-left: auto; }
.modal__error { font-size: 13px; color: #e5484d; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.modal__actions .btn--block { flex: 1; }

.key-box { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border: 1px solid var(--divider); border-radius: 14px; background: var(--bg-1); }
.key-box code { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 13px; color: var(--text); word-break: break-all; }
.key-box__mcp summary { padding: 2px 0; cursor: pointer; font-size: 13px; color: var(--text-2); }
.key-box__mcp .code { margin-top: 10px; }
.btn.is-done { background: #1f9d55; color: #fff; box-shadow: 0 6px 20px -8px #1f9d55; }
.copy-btn.is-done span { color: inherit; }

@media (max-width: 900px) {
  .acards { grid-template-columns: 1fr; }
  .keys__head { align-items: stretch; }
  .keys__head .btn { align-self: flex-start; }
}

@media (max-width: 680px) {
  .nav__user { display: none; }
  .account { padding-top: 96px; }
  .profile { flex-wrap: wrap; }
  .profile .btn { width: 100%; }
  .krow__meta { flex-basis: 100%; }
  .krow__actions { margin-left: 0; }
}

/* ---------- redeem a promotion code ---------- */
.redeem { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 24px; margin-bottom: 44px; padding: 20px 22px; background: var(--card); border: 1px solid var(--divider); border-radius: 20px; box-shadow: var(--shadow-card); }
.redeem__copy h2 { margin-bottom: 4px; font-size: 17px; font-weight: 600; }
.redeem__copy p { font-size: 14px; }
.redeem__form { display: flex; align-items: center; gap: 10px; }
.redeem__form .field { width: 240px; height: 46px; }
.redeem__msg { grid-column: 1 / -1; font-size: 13px; }
.redeem__msg.is-ok { color: #1f9d55; }
.redeem__msg.is-error { color: #e5484d; }
.redeem__msg.is-warning { color: var(--text-2); }
.redeem__refresh { grid-column: 1 / -1; justify-self: start; }

@media (max-width: 680px) {
  .redeem { grid-template-columns: 1fr; }
  .redeem__form .field { flex: 1; width: auto; }
}
