@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --hero-progress: 0;
  --bg-top: #cfe7ff;
  --bg-mid: #eef7ff;
  --bg-bottom: #f7fbff;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --panel-soft: rgba(243, 248, 255, 0.82);
  --panel-border: rgba(109, 144, 190, 0.22);
  --panel-border-strong: rgba(90, 126, 176, 0.28);
  --surface-deep: #102341;
  --surface-deep-soft: rgba(18, 37, 68, 0.84);
  --text: #102743;
  --text-strong: #07192d;
  --muted: #617896;
  --muted-strong: #455d7d;
  --accent: #2e67d7;
  --accent-strong: #173d88;
  --accent-soft: rgba(46, 103, 215, 0.1);
  --swirl: #7dbdff;
  --swirl-soft: rgba(184, 223, 255, 0.95);
  --swirl-deep: #2457b1;
  --swirl-shadow: rgba(39, 103, 196, 0.16);
  --success: #2c9b60;
  --warning: #c47a1b;
  --danger: #b94f60;
  --shadow-xl: 0 48px 132px rgba(43, 81, 130, 0.2);
  --shadow-lg: 0 32px 88px rgba(42, 73, 118, 0.18);
  --shadow-md: 0 22px 54px rgba(39, 70, 113, 0.13);
  --shadow-sm: 0 12px 28px rgba(41, 69, 113, 0.09);
  --radius-2xl: 40px;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --grid-gap: 24px;
  --transition: 220ms ease;
  --font-ui: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  --font-display: "EB Garamond", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  position: relative;
  overflow-x: hidden;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(circle at 16% 10%, rgba(164, 214, 255, 0.72), transparent 22%),
    radial-gradient(circle at 84% 14%, rgba(255, 242, 188, 0.86), transparent 13%),
    radial-gradient(circle at 52% -8%, rgba(255, 255, 255, 0.82), transparent 30%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 28%, #f6fbff 72%, var(--bg-bottom) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 20%),
    radial-gradient(circle at bottom center, rgba(255, 255, 255, 0.6), transparent 40%);
  opacity: 0.85;
}

body::after {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 42%),
    linear-gradient(180deg, transparent 68%, rgba(255, 255, 255, 0.34) 100%);
  opacity: 0.6;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p,
ol {
  margin: 0;
}

h1 {
  max-width: 10ch;
  color: var(--accent-strong);
  font-family: var(--font-display);
  font-size: clamp(4rem, 8vw, 7rem);
  line-height: 0.84;
  letter-spacing: -0.065em;
  font-weight: 500;
  text-shadow: 0 14px 42px rgba(146, 187, 235, 0.28);
}

h2 {
  color: var(--text-strong);
  font-size: clamp(1.45rem, 2vw, 2.1rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

h2 .swirl-accent {
  margin-inline: 0.03em;
}

h3 {
  color: var(--text-strong);
  font-size: 1.08rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

a {
  color: inherit;
}

.page-glow {
  position: fixed;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.58;
  z-index: 0;
  animation: drift 18s ease-in-out infinite alternate;
}

.page-glow--left {
  top: -14rem;
  left: -14rem;
  background: rgba(157, 212, 255, 0.62);
}

.page-glow--right {
  right: -10rem;
  top: 10rem;
  background: rgba(255, 233, 170, 0.42);
  animation-delay: 2s;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1460px;
  margin: 0 auto;
  padding: 28px 26px 52px;
}

.hero-story {
  position: relative;
  min-height: 340vh;
}

.hero-story__sticky {
  position: sticky;
  top: 0;
  min-height: 100svh;
  display: flex;
  align-items: stretch;
  padding: 10px 0 0;
}

.topbar {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: calc(100svh - 28px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px;
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(255, 255, 255, 0.42);
  background:
    radial-gradient(circle at 22% 18%, rgba(168, 214, 255, 0.44), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(255, 247, 220, 0.96), transparent 12%),
    linear-gradient(180deg, rgba(248, 252, 255, 0.96) 0%, rgba(223, 238, 255, 0.95) 48%, rgba(255, 255, 255, 0.97) 100%);
  box-shadow: var(--shadow-xl);
}

.topbar::before,
.topbar::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.topbar::before {
  inset: auto -10% -20% -10%;
  height: 46%;
  background:
    radial-gradient(circle at 20% 58%, rgba(255, 255, 255, 0.86), transparent 24%),
    radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.72), transparent 22%),
    radial-gradient(circle at 78% 52%, rgba(255, 255, 255, 0.78), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(247, 250, 255, 0.9) 100%);
  clip-path: polygon(0 74%, 10% 58%, 18% 64%, 29% 40%, 39% 60%, 49% 46%, 58% 62%, 68% 50%, 78% 62%, 88% 54%, 100% 70%, 100% 100%, 0 100%);
  filter: blur(18px);
  opacity: 0.78;
}

.topbar::after {
  top: -16%;
  right: -10%;
  width: 48%;
  height: 120%;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  transform: rotate(12deg);
  opacity: 0.5;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.hero-story [data-hero-step] {
  --reveal: 0;
  --reveal-base: 0.08;
  opacity: calc(var(--reveal-base) + var(--reveal) * (1 - var(--reveal-base)));
  filter: blur(calc((1 - var(--reveal)) * 4px));
  transform: translate3d(0, calc((1 - var(--reveal)) * 30px), 0)
    scale(calc(0.965 + var(--reveal) * 0.035));
  transform-origin: center center;
  will-change: transform, opacity, filter;
}

.hero-story .hero-reveal--hidden-initial {
  --reveal-base: 0;
}

.hero-story .hero-reveal--headline-shell {
  transform: none;
  filter: none;
}

.hero-story .hero-reveal--left {
  transform: translate3d(calc((1 - var(--reveal)) * -56px), calc((1 - var(--reveal)) * 18px), 0)
    scale(calc(0.96 + var(--reveal) * 0.04));
}

.hero-story .hero-reveal--right {
  transform: translate3d(calc((1 - var(--reveal)) * 56px), calc((1 - var(--reveal)) * 14px), 0)
    scale(calc(0.96 + var(--reveal) * 0.04));
}

.hero-story .hero-reveal--soft {
  transform: translate3d(0, calc((1 - var(--reveal)) * 20px), 0)
    scale(calc(0.975 + var(--reveal) * 0.025));
}

.hero-story .hero-reveal--rise {
  transform: translate3d(0, calc((1 - var(--reveal)) * 36px), 0)
    scale(calc(0.95 + var(--reveal) * 0.05));
}

.hero-story[data-hero-static="true"] {
  min-height: auto;
}

.hero-story[data-hero-static="true"] .hero-story__sticky {
  position: relative;
  min-height: auto;
  padding-top: 0;
}

.hero-story[data-hero-static="true"] .topbar {
  min-height: 0;
}

.hero-story[data-hero-static="true"] [data-hero-step] {
  opacity: 1;
  filter: none;
  transform: none;
}

.hero-nav,
.status-cluster,
.board-meta,
.mode-toggle,
.preview-actions,
.inline-field,
.chip-row,
.intent-popup__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-nav {
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 36px;
}

.hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--accent-strong);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero-brand__mark {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(23, 61, 136, 0.86);
  box-shadow: inset 0 0 0 4px rgba(157, 212, 255, 0.8);
}

.hero-nav__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.hero-chip,
.eyebrow,
.panel-kicker,
.guide-tag,
.hero-phrase-card__eyebrow {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.68);
  color: var(--accent-strong);
  backdrop-filter: blur(10px);
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.08fr) minmax(0, 0.92fr);
  gap: 28px;
  align-items: center;
  min-height: clamp(620px, 72svh, 800px);
}

.eyebrow,
.panel-kicker,
.guide-tag {
  margin-bottom: 10px;
  color: var(--accent-strong);
}

.hero-copy {
  padding: 8px 4px 12px;
}

.hero-headline {
  display: inline-block;
  min-height: 0.95em;
  will-change: transform, opacity, filter;
}

.hero-lead {
  max-width: 58ch;
  margin-top: 18px;
  color: var(--muted-strong);
  font-size: 1.04rem;
  line-height: 1.65;
}

.swirl-accent {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  flex-wrap: nowrap;
  padding: 0;
  perspective: 800px;
}

.swirl-accent__text {
  position: relative;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: baseline;
  will-change: transform, opacity, filter;
}

.swirl-accent__letter,
.swirl-accent__space {
  display: inline-block;
}

.swirl-accent__letter {
  position: relative;
  display: inline-grid;
  place-items: center;
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  will-change: transform;
}

.swirl-accent__face {
  grid-area: 1 / 1;
  display: block;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: color, text-shadow;
}

.swirl-accent__face--front {
  color: var(--text-strong);
}

.swirl-accent__face--back {
  color: var(--swirl);
  transform: rotateX(180deg);
}

.swirl-accent__space {
  width: 0.26em;
}

.swirl-accent__mark {
  display: none;
}

.hero-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.hero-feature {
  min-height: 138px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 14px 28px rgba(49, 88, 140, 0.08);
  backdrop-filter: blur(14px);
}

.hero-feature__value {
  display: block;
  margin-bottom: 10px;
  color: var(--accent-strong);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-feature p {
  color: rgba(16, 39, 67, 0.78);
  line-height: 1.58;
}

.hero-preview {
  display: flex;
  justify-content: flex-start;
}

.hero-preview__window {
  width: min(100%, 660px);
  padding: 14px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(18px);
  box-shadow: 0 34px 92px rgba(35, 67, 112, 0.14);
  transform: perspective(1600px)
    rotateY(calc(12deg - var(--hero-progress) * 10deg))
    rotateX(calc(4deg - var(--hero-progress) * 3deg))
    translateY(calc((1 - var(--hero-progress)) * 20px));
  transform-origin: center right;
  animation: floatPreview 14s ease-in-out infinite;
}

.hero-preview__toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 6px 8px 12px;
}

.window-dots {
  display: inline-flex;
  gap: 7px;
}

.window-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(14, 26, 47, 0.22);
}

.window-dots span:first-child {
  background: rgba(244, 134, 103, 0.72);
}

.window-dots span:nth-child(2) {
  background: rgba(244, 204, 88, 0.82);
}

.window-dots span:last-child {
  background: rgba(74, 191, 120, 0.78);
}

.hero-preview__toolbar-label {
  color: var(--muted-strong);
  font-size: 0.86rem;
  font-weight: 700;
}

.hero-preview__canvas {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 0%, rgba(171, 206, 255, 0.42), transparent 26%),
    radial-gradient(circle at 88% 18%, rgba(255, 243, 206, 0.36), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(233, 243, 255, 0.96));
  color: var(--text-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.hero-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hero-mini-card,
.hero-board__tile {
  padding: 14px;
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.96);
  border: 1px solid rgba(127, 159, 200, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.hero-mini-card__label {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-mini-card strong {
  display: block;
  margin-top: 10px;
  color: var(--text-strong);
  font-size: 1.03rem;
  letter-spacing: -0.03em;
}

.hero-phrase-card {
  padding: 22px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(255, 248, 221, 0.7), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(226, 238, 255, 0.98));
  border: 1px solid rgba(127, 159, 200, 0.2);
}

.hero-phrase-card__eyebrow {
  color: var(--accent-strong);
}

.hero-phrase-card h2 {
  margin-top: 6px;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 4vw, 3.5rem);
  line-height: 0.92;
  letter-spacing: -0.055em;
  font-weight: 500;
}

.hero-phrase-card span {
  display: block;
  margin-top: 12px;
  color: var(--muted-strong);
  line-height: 1.5;
}

.hero-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hero-board__tile {
  min-height: 92px;
}

.hero-board__tile strong {
  display: block;
  color: var(--text-strong);
  font-size: 1rem;
  letter-spacing: -0.03em;
}

.hero-board__tile span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.hero-board__tile--active {
  background:
    radial-gradient(circle at top left, rgba(168, 206, 255, 0.42), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(221, 235, 255, 0.96));
  border-color: rgba(113, 147, 194, 0.28);
}

.hero-scroll-dock {
  display: inline-flex;
  align-items: center;
  gap: 0;
  width: fit-content;
  margin-top: 28px;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 14px 32px rgba(56, 93, 145, 0.1);
  backdrop-filter: blur(16px);
}

.hero-scroll-dock__rail {
  display: inline-flex;
  gap: 8px;
}

.hero-scroll-dock__dot {
  --dot-fill: 0;
  position: relative;
  width: 32px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(131, 159, 199, 0.22);
}

.hero-scroll-dock__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(46, 103, 215, 0.95), rgba(128, 193, 255, 0.85));
  transform: scaleX(var(--dot-fill));
  transform-origin: left center;
}

.status-cluster {
  margin-top: 14px;
}

.pill,
.mini-pill,
.live-indicator,
.frame-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(127, 159, 200, 0.18);
  color: var(--text-strong);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
}

.mini-pill {
  padding: 9px 13px;
  font-size: 0.82rem;
}

.pill.is-on,
.mini-pill.is-on,
.live-indicator.is-on {
  background: linear-gradient(180deg, rgba(51, 110, 226, 0.86), rgba(25, 72, 169, 0.92));
  border-color: rgba(155, 191, 255, 0.32);
  color: #ffffff;
}

.pill.is-warn,
.mini-pill.is-warn {
  background: rgba(135, 92, 23, 0.88);
  border-color: rgba(255, 218, 143, 0.22);
  color: #fff7e7;
}

.pill.is-danger,
.mini-pill.is-danger {
  background: rgba(133, 45, 61, 0.9);
  border-color: rgba(255, 186, 198, 0.18);
  color: #fff0f2;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.main-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--grid-gap);
  margin-top: 24px;
}

.panel {
  position: relative;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(247, 250, 255, 0.92));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(24px);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 22%);
  pointer-events: none;
}

.panel > * {
  position: relative;
  z-index: 1;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-kicker,
.guide-tag {
  color: var(--accent-strong);
}

.panel--setup {
  grid-column: span 6;
}

.panel--guide {
  grid-column: span 6;
}

.panel--categories {
  grid-column: span 3;
}

.panel--camera {
  grid-column: span 4;
}

.panel--phrases {
  grid-column: span 5;
}

.panel--library {
  grid-column: span 7;
}

.panel--settings {
  grid-column: span 5;
}

.setup-steps,
.signal-grid,
.settings-grid {
  display: grid;
  gap: 14px;
}

.step-card,
.signal-card,
.setting-card,
.guide-card,
.preview-card,
.calibration-card,
.phrase-item,
.library-browser,
.pattern-card {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(244, 248, 255, 0.94));
  border: 1px solid rgba(123, 153, 194, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.step-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  transition:
    transform var(--transition),
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition);
}

.step-card.is-active {
  transform: translateY(-1px);
  background:
    radial-gradient(circle at top left, rgba(169, 207, 255, 0.3), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(232, 241, 255, 0.96));
  border-color: rgba(86, 130, 197, 0.28);
  box-shadow: 0 14px 30px rgba(67, 109, 164, 0.12);
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(46, 103, 215, 0.12);
  color: var(--accent-strong);
  font-weight: 800;
}

.step-card p,
.signal-label,
.fine-print,
.guide-copy p,
.lane-copy,
.field span,
.phrase-subtle,
.board-footer p,
.preview-card p,
.calibration-card p,
.pattern-card p,
.setting-card label,
.hero-mini-card__label {
  color: var(--muted);
  line-height: 1.55;
}

.setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}

.button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  transition:
    transform var(--transition),
    opacity var(--transition),
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button--primary {
  color: #ffffff;
  background: linear-gradient(180deg, #183765 0%, #0b1f42 100%);
  box-shadow: 0 16px 34px rgba(20, 41, 84, 0.18);
}

.button--secondary {
  color: var(--text-strong);
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(118, 150, 191, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.button--ghost {
  color: var(--accent-strong);
  background: rgba(230, 240, 255, 0.72);
  border-color: rgba(138, 170, 215, 0.14);
}

.calibration-card,
.preview-card,
.guide-card {
  padding: 16px;
}

.calibration-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.progress-track {
  width: 100%;
  height: 10px;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(201, 216, 236, 0.66);
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #94beff 0%, #2f67d8 100%);
  transition: width 150ms linear;
}

.signal-grid {
  margin-top: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.signal-card {
  padding: 16px;
}

.signal-card strong {
  display: block;
  margin-top: 6px;
  color: var(--text-strong);
  font-size: 1.14rem;
  letter-spacing: -0.03em;
}

.camera-frame {
  position: relative;
  min-height: 368px;
  border-radius: calc(var(--radius-xl) - 6px);
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(128, 163, 255, 0.24), transparent 30%),
    linear-gradient(180deg, rgba(7, 17, 34, 0.18), rgba(8, 17, 33, 0.58)),
    linear-gradient(180deg, #0b1730 0%, #13294b 100%);
  border: 1px solid rgba(101, 136, 188, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#video,
#overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

#video {
  opacity: 0;
  transition: opacity 280ms ease;
}

#video.is-live {
  opacity: 1;
}

.frame-badge {
  position: absolute;
  max-width: min(82%, 34rem);
}

.frame-badge--top {
  top: 18px;
  left: 18px;
}

.frame-badge--bottom {
  left: 18px;
  bottom: 18px;
}

.fine-print {
  margin-top: 16px;
  font-size: 0.92rem;
}

.mode-button {
  border: 1px solid rgba(125, 156, 196, 0.16);
  border-radius: 999px;
  background: rgba(238, 244, 255, 0.78);
  color: var(--muted-strong);
  padding: 10px 15px;
  font-weight: 800;
  transition:
    background var(--transition),
    color var(--transition),
    transform var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

.mode-button.is-active {
  background: linear-gradient(180deg, rgba(245, 249, 255, 0.98), rgba(218, 232, 255, 0.94));
  color: var(--accent-strong);
  border-color: rgba(86, 130, 197, 0.26);
  box-shadow: 0 10px 22px rgba(72, 115, 171, 0.1);
}

.guide-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}

.guide-copy h3 {
  font-size: 1.32rem;
  margin-bottom: 8px;
}

.instruction-list {
  padding-left: 20px;
  color: var(--text);
  line-height: 1.55;
}

.instruction-list li + li {
  margin-top: 9px;
}

.pattern-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.pattern-card {
  padding: 14px;
}

.pattern-card h4 {
  margin-bottom: 6px;
  color: var(--text-strong);
  font-size: 1rem;
}

.preview-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  border-color: rgba(96, 131, 186, 0.22);
  background:
    radial-gradient(circle at top right, rgba(177, 210, 255, 0.42), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(239, 246, 255, 0.96));
}

.preview-card h3 {
  color: var(--text-strong);
  font-size: clamp(1.34rem, 2.5vw, 2rem);
  letter-spacing: -0.05em;
}

.lane-helper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(244, 248, 255, 0.92);
  border: 1px solid rgba(122, 152, 193, 0.14);
}

.lane-helper__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(46, 103, 215, 0.1);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.lane-helper p {
  color: var(--muted);
  line-height: 1.5;
}

.category-rail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.board-category-chip {
  display: grid;
  gap: 0;
  padding: 14px 16px;
  text-align: left;
  border: 1px solid rgba(113, 146, 193, 0.18);
  border-radius: 20px;
  background: rgba(246, 250, 255, 0.86);
  color: var(--text-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.board-category-chip small {
  display: none;
}

.board-category-chip.is-active {
  background:
    radial-gradient(circle at top left, rgba(169, 206, 255, 0.38), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(224, 236, 255, 0.98));
  border-color: rgba(86, 130, 197, 0.28);
}

.board-category-chip.is-highlighted {
  border-color: rgba(61, 112, 193, 0.34);
  box-shadow: 0 16px 30px rgba(70, 108, 158, 0.12);
}

.board-category-chip.is-hovered {
  border-color: rgba(86, 130, 197, 0.34);
  box-shadow: 0 18px 34px rgba(70, 108, 158, 0.14);
}

.board-stage {
  position: relative;
}

.board-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.board-tile {
  position: relative;
  min-height: 88px;
  padding: 16px 18px;
  border: 1px solid rgba(113, 146, 193, 0.2);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top left, rgba(179, 211, 255, 0.24), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(242, 247, 255, 0.94));
  text-align: left;
  transition:
    transform var(--transition),
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition);
}

.board-tile:hover {
  transform: translateY(-2px);
}

.board-tile.is-highlighted,
.board-tile.is-hovered {
  border-color: rgba(86, 130, 197, 0.34);
  box-shadow: 0 18px 34px rgba(70, 108, 158, 0.14);
  background:
    radial-gradient(circle at top left, rgba(165, 201, 255, 0.34), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(231, 241, 255, 0.98));
}

.board-tile.is-selected {
  border-color: rgba(68, 151, 104, 0.34);
  background:
    radial-gradient(circle at top left, rgba(182, 238, 205, 0.36), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 252, 245, 0.98));
}

.board-tile.is-danger {
  border-color: rgba(185, 79, 96, 0.28);
}

.board-tile__label {
  display: block;
  color: var(--text-strong);
  font-size: clamp(1.02rem, 1.6vw, 1.28rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

body.large-text .board-tile__label {
  font-size: clamp(1.18rem, 2vw, 1.52rem);
}

body.large-text .preview-card h3 {
  font-size: clamp(1.55rem, 3vw, 2.25rem);
}

.board-tile__meta {
  display: none;
}

.board-tile__tag {
  display: none;
}

.board-footer {
  margin-top: 14px;
}

.board-empty-state {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(246, 250, 255, 0.86);
  border: 1px dashed rgba(113, 146, 193, 0.26);
  color: var(--muted);
  line-height: 1.55;
}

.panel--categories,
.panel--camera,
.panel--phrases {
  align-self: start;
}

.panel.is-focused-lane {
  border-color: rgba(86, 130, 197, 0.32);
  box-shadow: 0 20px 42px rgba(67, 109, 164, 0.16);
}

.panel--categories .panel-head,
.panel--phrases .panel-head {
  margin-bottom: 14px;
}

.panel--categories .board-category-chip,
.panel--phrases .board-tile {
  width: 100%;
}

.panel--phrases .preview-card {
  margin-top: 14px;
}

.dwell-cursor {
  position: fixed;
  top: 24px;
  left: 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  pointer-events: none;
  border: 3px solid rgba(46, 103, 215, 0.76);
  box-shadow: 0 0 0 8px rgba(46, 103, 215, 0.14);
  background: rgba(255, 255, 255, 0.92);
  opacity: 0;
  z-index: 50;
  transform: translate(-50%, -50%);
  transition: opacity var(--transition), left 80ms linear, top 80ms linear;
}

.dwell-cursor.is-visible {
  opacity: 1;
}

.library-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 20px;
}

.library-column {
  display: grid;
  gap: 14px;
  align-content: start;
}

.field,
.stack-field {
  display: grid;
  gap: 10px;
}

.field span {
  font-weight: 800;
  color: var(--text-strong);
}

input,
select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(121, 151, 191, 0.22);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

input:focus,
select:focus {
  outline: 2px solid rgba(46, 103, 215, 0.14);
  border-color: rgba(46, 103, 215, 0.28);
}

.library-browser {
  min-height: 100%;
  padding: 18px;
}

.chip {
  border: 1px solid rgba(119, 149, 188, 0.16);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(237, 244, 255, 0.88);
  color: var(--muted-strong);
  font-weight: 800;
}

.chip.is-active {
  background: rgba(218, 232, 255, 0.98);
  color: var(--accent-strong);
  border-color: rgba(86, 130, 197, 0.24);
}

.phrase-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.phrase-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
}

.phrase-item strong {
  display: block;
  color: var(--text-strong);
  line-height: 1.35;
}

.phrase-remove {
  border: 1px solid rgba(185, 79, 96, 0.14);
  border-radius: 999px;
  padding: 10px 12px;
  background: rgba(255, 239, 242, 0.95);
  color: #9d3244;
  font-weight: 800;
}

.settings-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.setting-card {
  padding: 18px;
}

.setting-card h3 {
  margin-bottom: 14px;
}

.setting-card label {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.95rem;
}

.setting-card output {
  color: var(--text-strong);
  font-weight: 800;
}

.setting-card input[type="range"] {
  padding: 0;
  background: transparent;
  accent-color: var(--accent);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.toggle-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.hidden {
  display: none !important;
}

.intent-popup {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
  z-index: 20;
}

.intent-popup.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.intent-popup__backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(66, 121, 198, 0.2), rgba(15, 31, 62, 0.22)),
    rgba(247, 250, 255, 0.44);
  backdrop-filter: blur(16px);
}

.intent-popup__card {
  position: relative;
  width: min(92vw, 720px);
  padding: 28px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  background:
    radial-gradient(circle at top right, rgba(255, 244, 211, 0.72), transparent 24%),
    radial-gradient(circle at top left, rgba(186, 219, 255, 0.7), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(243, 248, 255, 0.96));
  box-shadow: 0 36px 110px rgba(42, 73, 118, 0.24);
  backdrop-filter: blur(24px);
}

.intent-popup__eyebrow {
  margin-bottom: 12px;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 800;
}

.intent-popup__phrase {
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
  font-weight: 500;
}

.intent-popup__meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.intent-popup__timer {
  width: 100%;
  height: 10px;
  margin-top: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(197, 214, 238, 0.66);
}

.intent-popup__bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #99c0ff 0%, #2f67d8 100%);
}

.intent-popup__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.intent-popup__countdown {
  color: var(--text-strong);
  font-weight: 800;
  letter-spacing: -0.03em;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(18px, 18px, 0) scale(1.08);
  }
}

@keyframes floatPreview {
  0%,
  100% {
    transform: perspective(1600px) rotateY(8deg) rotateX(3deg) translateY(0);
  }

  50% {
    transform: perspective(1600px) rotateY(8deg) rotateX(3deg) translateY(-8px);
  }
}

@media (max-width: 1240px) {
  .hero-story {
    min-height: 300vh;
  }

  .hero-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    order: 1;
  }

  .hero-preview {
    order: 2;
    justify-content: flex-start;
  }

  .hero-preview__window {
    max-width: 760px;
    transform: none;
    animation: none;
  }

  .panel--setup,
  .panel--categories,
  .panel--camera,
  .panel--guide,
  .panel--phrases,
  .panel--library,
  .panel--settings {
    grid-column: span 12;
  }

  .guide-card,
  .library-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .hero-story {
    min-height: auto;
  }

  .hero-story__sticky {
    position: relative;
    min-height: auto;
    padding-top: 0;
  }

  .app-shell {
    padding: 18px 14px 34px;
  }

  .topbar {
    min-height: 0;
    padding: 20px;
  }

  .hero-nav,
  .panel-head,
  .preview-card,
  .intent-popup__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-feature-grid,
  .hero-mini-grid,
  .hero-board,
  .signal-grid,
  .board-grid,
  .pattern-grid {
    grid-template-columns: 1fr;
  }

  .lane-helper {
    flex-direction: column;
    align-items: flex-start;
  }

  h1 {
    max-width: none;
    font-size: clamp(3.4rem, 16vw, 5.2rem);
  }

  .camera-frame {
    min-height: 340px;
  }

  .board-tile {
    min-height: 132px;
  }

  .preview-actions,
  .intent-popup__buttons {
    width: 100%;
  }

  .preview-actions .button,
  .intent-popup__buttons .button {
    flex: 1;
  }

  .status-cluster {
    justify-content: flex-start;
  }

  .hero-scroll-dock {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .hero-nav__chips {
    justify-content: flex-start;
  }

  .hero-feature,
  .hero-mini-card,
  .hero-board__tile {
    min-height: 0;
  }

  .inline-field {
    flex-direction: column;
  }

  .hero-preview__canvas,
  .intent-popup__card,
  .panel {
    padding: 18px;
  }

  .hero-scroll-dock {
    justify-content: flex-start;
  }

  .button {
    width: 100%;
  }

  .setup-actions .button,
  .preview-actions .button,
  .intent-popup__buttons .button {
    width: auto;
  }
}
