/* Website override of the Geist face from vars.css: wait for the (preloaded)
   font instead of flashing a fallback, so the hero h1 never swaps (no FOUT).
   vars.css keeps "swap" because the app shares it. */
@font-face {
  font-family: "Geist";
  src: url("./fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}

/* ── Website theme: Daylight (mirrors the Studio's light theme) ──
   vars.css is shared with the app, so the website overrides its tokens here. */
:root {
  color-scheme: light;
  --bg:      #ffffff;
  --band:    #f7f8fa; /* subtle fill for alternating sections on white */
  --panel:   #ffffff;
  --surface: #eceef3;
  --accent:     #e0234e;
  --accent-dim: rgba(224, 35, 78, 0.25);
  --kf:         #d48a00;
  --orange:     #ef4f4f;
  --text:     #1d1f2b;
  --text-dim: #6b7085;
  --dim:      #6b7085;
  --border:       #e1e3ea;
  --border-light: #cdd0da;
  --ruler-bg:     #e9ebf0;
  --canvas-bg:    #e4e6ec;
  --shadow-lg: 0 24px 60px rgba(20, 22, 35, 0.12), 0 4px 12px rgba(20, 22, 35, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: #ffffff;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: var(--leading-normal);
}

/* ── Playful text selection: the colour depends on what you grab ──── */
::selection {
  background-color: #ffe14d; /* highlighter yellow */
  color: var(--text);
}
h1::selection,
h2::selection,
h3::selection,
h4::selection,
h1 *::selection,
h2 *::selection {
  background-color: var(--accent);
  color: #fff;
  text-shadow: 2px 2px 0 #ffb800;
}
h1 .accent::selection,
h2 .accent::selection,
.page-hero h1 .accent::selection {
  background-color: #8b5cf6;
  color: #fff;
  text-shadow: 2px 2px 0 #ff7ab6;
}
h1 .kf::selection,
h2 .kf::selection,
.hero-mind::selection {
  background-color: #06b6d4;
  color: #fff;
  text-shadow: 2px 2px 0 #ffe14d;
}
em::selection,
strong::selection {
  background-color: #ff9ecb; /* bubblegum */
  color: var(--text);
}
code::selection,
kbd::selection,
.chip-list span::selection,
.code-block *::selection {
  background-color: #10b981;
  color: #fff;
}
a::selection,
a *::selection,
button::selection {
  background-color: #06b6d4;
  color: #fff;
}
.value-big::selection {
  background-color: var(--text);
  color: #ffe14d;
}
img::selection {
  background-color: rgba(139, 92, 246, 0.25);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── NAV ─────────────────────────────────────────────── */
nav {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  padding-right: 14px;
  height: 64px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(20, 22, 35, 0.1);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: var(--font-bold);
  color: var(--accent);
  letter-spacing: -0.3px;
}

.nav-logo img {
  width: 22px;
  height: 22px;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  padding: 8px 20px;
  padding-left: 12px;
  border-radius: 999px;
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  transition: filter 0.15s;
}
.nav-cta:hover {
  filter: brightness(110%);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--text);
  transition: background 0.15s;
}
.nav-icon:hover {
  background: var(--surface);
}

/* ── HERO ────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 100px;
  position: relative;
  overflow: hidden;
}

.hero-split {
  display: flex;
  align-items: center;
  gap: 64px;
  width: 100%;
  max-width: 1080px;
  margin-bottom: 60px;
}

.hero-left {
  flex: 0 0 400px;
  height: 430px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-phone-anim {
  width: 680px;
  height: 680px;
  flex-shrink: 0;
}

.hero-right {
  flex: 1;
  text-align: left;
}

.hero-right .hero-badge {
  margin-bottom: 28px;
}

.hero-right .hero-sub {
  margin-left: 0;
  margin-right: 0;
  max-width: 480px;
}

.hero-right .hero-actions {
  justify-content: flex-start;
  margin-bottom: 0;
}

.hero-split .hero-right h1 {
  font-size: clamp(22px, calc((100vw - 512px) * 0.09), 54px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 60% 50% at 50% 0%,
      rgba(233, 69, 96, 0.12) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 40% 40% at 80% 80%,
      rgba(245, 197, 66, 0.07) 0%,
      transparent 60%
    );
  pointer-events: none;
}

/* Animated keyframe diamonds in background */
.hero-bg-diamonds {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-bg-diamonds span {
  position: absolute;
  display: block;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--kf);
  transform: rotate(45deg);
  opacity: 0;
  animation: float-diamond 8s ease-in-out infinite;
}
.hero-bg-diamonds span:nth-child(1) {
  left: 8%;
  top: 20%;
  animation-delay: 0s;
  opacity: 0.12;
}
.hero-bg-diamonds span:nth-child(2) {
  left: 18%;
  top: 65%;
  animation-delay: 1.2s;
  opacity: 0.08;
  width: 8px;
  height: 8px;
}
.hero-bg-diamonds span:nth-child(3) {
  left: 32%;
  top: 12%;
  animation-delay: 2.4s;
  opacity: 0.1;
}
.hero-bg-diamonds span:nth-child(4) {
  display: none;
}
.hero-bg-diamonds span:nth-child(5) {
  display: none;
}
.hero-bg-diamonds span:nth-child(6) {
  display: none;
}
.hero-bg-diamonds span:nth-child(7) {
  display: none;
}
.hero-bg-diamonds span:nth-child(8) {
  left: 5%;
  top: 80%;
  animation-delay: 2.8s;
  opacity: 0.08;
  width: 18px;
  height: 18px;
  border-color: var(--orange);
}

@keyframes float-diamond {
  0%,
  100% {
    transform: rotate(45deg) translateY(0);
  }
  50% {
    transform: rotate(45deg) translateY(-14px);
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(212, 138, 0, 0.08);
  border: 1px solid rgba(212, 138, 0, 0.3);
  color: var(--kf);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  margin-bottom: 28px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(42px, 7vw, 80px);
  font-weight: var(--font-extrabold);
  letter-spacing: -2px;
  line-height: 1.05;
  margin-bottom: 24px;
  position: relative;
}

.hero h1 .accent {
  color: var(--accent);
}
.hero h1 .kf {
  color: var(--kf);
}

.hero-sub {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--dim);
  max-width: 560px;
  margin: 0 auto 48px;
  line-height: var(--leading-loose);
}

.hero-sub em {
  color: var(--text);
  font-style: normal;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 72px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  padding: 14px 32px 14px 20px;
  border-radius: var(--radius-lg);
  font-size: 15px;
  font-weight: var(--font-bold);
  transition:
    filter 0.15s,
    transform 0.15s;
}
.btn-primary:hover {
  filter: brightness(110%);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 14px 32px;
  border-radius: var(--radius-lg);
  font-size: 15px;
  font-weight: var(--font-semibold);
  transition:
    border-color 0.15s,
    transform 0.15s;
}
.btn-secondary:hover {
  border-color: var(--dim);
  transform: translateY(-1px);
}

/* Fake app window preview */
.hero-preview {
  width: 100%;
  max-width: 820px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.preview-titlebar {
  background: var(--surface);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.preview-dot.red {
  background: #ff5f57;
}
.preview-dot.yellow {
  background: #febc2e;
}
.preview-dot.green {
  background: #28c840;
}

.preview-title {
  flex: 1;
  text-align: center;
  font-size: var(--text-base);
  color: var(--dim);
}

.preview-body {
  display: grid;
  grid-template-columns: 160px 1fr 140px;
  height: 220px;
}

.preview-layers {
  border-right: 1px solid var(--border);
  padding: 10px 0;
}

.preview-layer-item {
  padding: 5px 12px;
  font-size: var(--text-sm);
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 6px;
}
.preview-layer-item.sel {
  background: rgba(233, 69, 96, 0.12);
  color: var(--text);
  border-left: 2px solid var(--accent);
}

.preview-layer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dim);
  flex-shrink: 0;
}
.preview-layer-item.sel .preview-layer-dot {
  background: var(--accent);
}

.preview-canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas-bg);
  position: relative;
}

/* canvas SVG layer animations */
@keyframes orbit-cw {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@keyframes orbit-ccw {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(-360deg);
  }
}
@keyframes ring-breath {
  0%,
  100% {
    stroke-opacity: 0.22;
    stroke-width: 1;
  }
  50% {
    stroke-opacity: 0.55;
    stroke-width: 2;
  }
}
@keyframes dash-march {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: -48;
  }
}
@keyframes core-beat {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25);
  }
}
@keyframes kf-spin {
  from {
    transform: rotate(45deg);
  }
  to {
    transform: rotate(405deg);
  }
}

.can-ring-a {
  transform-origin: 50px 50px;
  animation: ring-breath 4s ease-in-out infinite;
}
.can-ring-b {
  transform-origin: 50px 50px;
  animation: ring-breath 3s ease-in-out infinite 1.5s;
}
.can-dash {
  transform-origin: 50px 50px;
  animation: dash-march 2s linear infinite;
}
.can-orbit-a {
  transform-origin: 50px 50px;
  animation: orbit-cw 4s linear infinite;
}
.can-orbit-b {
  transform-origin: 50px 50px;
  animation: orbit-ccw 7s linear infinite;
}
.can-orbit-c {
  transform-origin: 50px 50px;
  animation: orbit-cw 2.6s linear infinite;
}
.can-kf {
  transform-origin: 50px 50px;
  animation: kf-spin 10s linear infinite;
}
.can-core {
  transform-origin: 50px 50px;
  animation: core-beat 1.8s ease-in-out infinite;
}

.preview-props {
  border-left: 1px solid var(--border);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.preview-prop-label {
  font-size: var(--text-xs);
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.preview-prop-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 22px;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0 6px;
  font-size: var(--text-sm);
  color: var(--kf);
  font-family: var(--font-mono);
}
.preview-kf-dot {
  width: 8px;
  height: 8px;
  background: var(--kf);
  transform: rotate(45deg);
  margin-left: auto;
  flex-shrink: 0;
}

.preview-timeline {
  grid-column: 1/-1;
  border-top: 1px solid var(--border);
  height: 70px;
  background: var(--bg);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.preview-track {
  flex: 1;
  height: 16px;
  background: rgba(15, 20, 40, 0.04);
  border-radius: 2px;
  position: relative;
}

.preview-kf {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--kf);
  transform: rotate(45deg) translateY(-50%);
  top: 50%;
}
.preview-kf.accent {
  background: var(--accent);
}
.preview-kf.orange {
  background: var(--orange);
}

.preview-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: var(--accent);
  left: 30%;
  animation: playhead-move 3s ease-in-out infinite alternate;
}
@keyframes playhead-move {
  from {
    left: 0%;
  }
  to {
    left: 100%;
  }
}

/* ── SECTIONS SHARED ─────────────────────────────────── */
section {
  padding: 100px 24px;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
  margin-bottom: 16px;
}

.section-tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

h2 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: var(--font-extrabold);
  letter-spacing: -1px;
  line-height: var(--leading-snug);
  margin-bottom: 16px;
}

h2 .accent {
  color: var(--accent);
}
h2 .kf {
  color: var(--kf);
}

.section-intro {
  font-size: var(--text-3xl);
  color: var(--dim);
  max-width: 520px;
  line-height: var(--leading-loose);
  margin-bottom: 64px;
}

/* ── FEATURES GRID ───────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
}

.feature-card {
  background: var(--panel);
  padding: 32px;
  transition: background 0.15s;
}
.feature-card:hover {
  background: var(--surface);
}

.feature-icon {
  font-size: 28px;
  margin-bottom: 16px;
  display: block;
}

.feature-card h3 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin-bottom: 8px;
  color: var(--text);
}

.feature-card p {
  font-size: var(--text-lg);
  color: var(--dim);
  line-height: var(--leading-relaxed);
}

.feature-card p em {
  color: var(--text);
  font-style: normal;
}

/* ── KEYFRAME SECTION ────────────────────────────────── */
.kf-section {
  background: var(--panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.kf-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}


.kf-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.kf-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.kf-diamond {
  width: 14px;
  height: 14px;
  border: 2px solid var(--kf);
  transform: rotate(45deg);
  flex-shrink: 0;
  margin-top: 4px;
}
.kf-diamond.filled {
  background: var(--kf);
}
.kf-diamond.accent {
  border-color: var(--accent);
  background: var(--accent);
}
.kf-diamond.orange {
  border-color: var(--orange);
  background: var(--orange);
}

.kf-item-text h4 {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  margin-bottom: 4px;
}
.kf-item-text p {
  font-size: var(--text-lg);
  color: var(--dim);
  line-height: var(--leading-normal);
}

/* Fake timeline vis */
.timeline-vis {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.tl-track-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tl-track-label {
  font-size: var(--text-sm);
  color: var(--dim);
  width: 52px;
  flex-shrink: 0;
  text-align: right;
}
.tl-track-bar {
  flex: 1;
  height: 14px;
  background: rgba(15, 20, 40, 0.05);
  border-radius: 2px;
  position: relative;
}
.tl-kf {
  position: absolute;
  width: 8px;
  height: 8px;
  transform: rotate(45deg) translateY(-50%);
  top: 50%;
  border-radius: 1px;
}

.tl-playhead {
  position: absolute;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--accent);
  left: 38%;
}
.tl-playhead::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  width: 0;
  height: 0;
  border-left: 4.5px solid transparent;
  border-right: 4.5px solid transparent;
  border-top: 6px solid var(--accent);
}

/* ── SHORTCUTS ───────────────────────────────────────── */
.shortcuts-section {
  background: var(--bg);
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.shortcut-group {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
}

.shortcut-group h4 {
  font-size: var(--text-md);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  margin-bottom: 16px;
}

.shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-md);
}
.shortcut-row:last-child {
  border-bottom: none;
}

.shortcut-row span {
  color: var(--dim);
}

.kbd {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.kbd kbd {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px 6px;
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  color: var(--text);
}

/* ── EXPORT SECTION ──────────────────────────────────── */
.export-section {
  background: var(--panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.export-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
@media (max-width: 720px) {
  .export-layout {
    grid-template-columns: 1fr;
  }
}

.code-block {
  background: #1d1f2b;
  color: #e8e8f0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  line-height: 1.8;
  overflow: hidden;
}
.code-kw {
  color: #c792ea;
}
.code-sel {
  color: var(--accent);
}
.code-prop {
  color: #82aaff;
}
.code-val {
  color: var(--kf);
}
.code-str {
  color: #c3e88d;
}
.code-dim {
  color: var(--dim);
}

/* ── GROUP FEATURE SECTION ──────────────────────────── */
.group-feature-section {
  background: var(--panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.group-feature-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.group-preview {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.group-preview-body {
  display: grid;
  grid-template-columns: 172px 1fr;
  height: 260px;
}

.group-layer-tree {
  border-right: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.group-layer-item {
  padding: 5px 12px;
  font-size: var(--text-sm);
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 5px;
}

.group-layer-item.gsel {
  background: rgba(233, 69, 96, 0.12);
  color: var(--text);
  border-left: 2px solid var(--accent);
  padding-left: 10px;
}

.group-layer-item.gchild {
  padding-left: 26px;
}

.glayer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dim);
  flex-shrink: 0;
}

.group-layer-item.gsel .glayer-dot {
  background: var(--accent);
}

.glayer-icon {
  font-size: 8px;
  flex-shrink: 0;
  opacity: 0.6;
}

.group-canvas {
  background: var(--canvas-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

@keyframes grp-bbox-pulse {
  0%, 100% { stroke-opacity: 0.55; }
  50% { stroke-opacity: 1; }
}

@keyframes grp-glow {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

.grp-bbox { animation: grp-bbox-pulse 2.8s ease-in-out infinite; }
.grp-handle { animation: grp-bbox-pulse 2.8s ease-in-out infinite; }
.grp-circle { animation: grp-glow 2.8s ease-in-out infinite; }
.grp-rect { animation: grp-glow 2.8s ease-in-out infinite 0.5s; }
.grp-solo { animation: grp-glow 4s ease-in-out infinite 1.2s; }

/* group ↔ ungroup cycle — 8s total, ~0.15s snappy transitions */
.glayer-header {
  height: 31px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.glayer-state {
  position: absolute;
  inset: 31px 0 0 0;
  padding: 10px 0;
}

/* Layer tree: slides up on exit, comes from slightly below on enter */
@keyframes show-grouped-layer {
  0%, 44%   { opacity: 1; transform: translateY(0); }
  46%, 90%  { opacity: 0; transform: translateY(-7px); }
  92%       { opacity: 0; transform: translateY(3px); }
  94%, 100% { opacity: 1; transform: translateY(0); }
}
@keyframes show-ungrouped-layer {
  0%, 44%   { opacity: 0; transform: translateY(5px); }
  46%, 90%  { opacity: 1; transform: translateY(0); }
  92%, 100% { opacity: 0; transform: translateY(-7px); }
}

/* Canvas groups: scale pop — shrinks out, springs in with slight overshoot */
@keyframes show-grouped-canvas {
  0%, 44%   { opacity: 1; transform: scale(1); }
  45.5%     { opacity: 0; transform: scale(0.86); }
  46%, 90%  { opacity: 0; transform: scale(0.86); }
  92%       { opacity: 1; transform: scale(1.06); }
  94%, 100% { opacity: 1; transform: scale(1); }
}
@keyframes show-ungrouped-canvas {
  0%, 44%    { opacity: 0; transform: scale(0.86); }
  45.5%      { opacity: 1; transform: scale(1.06); }
  47%, 90%   { opacity: 1; transform: scale(1); }
  91.5%      { opacity: 0; transform: scale(0.86); }
  92%, 100%  { opacity: 0; transform: scale(0.86); }
}

/* Keyboard hints: appear ~1s before each transition, hold through the snap */
@keyframes show-ungroup-hint {
  0%, 28%   { opacity: 0; transform: translateX(-50%) translateY(4px); }
  32%, 44%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  47%, 100% { opacity: 0; transform: translateX(-50%) translateY(-2px); }
}
@keyframes show-group-hint {
  0%, 74%   { opacity: 0; transform: translateX(-50%) translateY(4px); }
  78%, 90%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  93%, 100% { opacity: 0; transform: translateX(-50%) translateY(-2px); }
}

.glayer-grouped   { animation: show-grouped-layer    8s linear infinite; }
.glayer-ungrouped { animation: show-ungrouped-layer  8s linear infinite; }
.gcanvas-grouped {
  transform-box: fill-box;
  transform-origin: center;
  animation: show-grouped-canvas  8s linear infinite;
}
.gcanvas-ungrouped {
  transform-box: fill-box;
  transform-origin: center;
  animation: show-ungrouped-canvas 8s linear infinite;
}

.grp-kbd-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
}
.grp-kbd-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-bottom: 2px solid #b9bdca;
  border-radius: var(--radius-lg);
  font-size: var(--text-lg);
  font-family: var(--font-sans);
  font-weight: var(--font-medium);
  color: var(--text);
  box-shadow: 0 2px 4px rgba(20, 22, 35, 0.08);
}
.grp-ungroup-hint { animation: show-ungroup-hint 8s linear infinite; }
.grp-group-hint   { animation: show-group-hint   8s linear infinite; }

/* ── CTA SECTION ─────────────────────────────────────── */
.cta-section {
  text-align: center;
  padding: 120px 24px;
}

.cta-section h2 {
  margin-bottom: 20px;
}

.cta-section p {
  color: var(--dim);
  font-size: var(--text-3xl);
  max-width: 460px;
  margin: 0 auto 48px;
}

/* ── FOOTER ──────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 40px;
  margin-bottom: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--dim);
  font-size: var(--text-md);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: var(--font-bold);
  color: var(--text);
}
.footer-logo img {
  width: 16px;
  height: 16px;
}

@media (max-width: 900px) {
  .hero-split {
    flex-direction: column;
    gap: 40px;
    margin-bottom: 40px;
  }
  .hero-left {
    flex: none;
    width: auto;
    height: auto;
    overflow: visible;
  }
  .hero-phone-anim {
    display: block;
    width: 600px;
    height: 600px;
    transform: scale(0.43);
    transform-origin: center;
    margin: -171px;
  }
  .hero-right {
    text-align: center;
  }
  .hero-right .hero-sub {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-right .hero-actions {
    justify-content: center;
  }
  .hero-actions .btn-primary {
    display: none;
  }
  .group-feature-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero-split .hero-right h1 {
    font-size: clamp(35px, 8vw, 52px);
    letter-spacing: -0.5px;
  }
}

@media (max-width: 720px) {
  nav {
    bottom: 16px;
    left: 16px;
    right: 16px;
    padding-right: 28px;
    height: 48px;
  }
  .nav-cta {
    display: none;
  }
  .kf-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .preview-body {
    grid-template-columns: 1fr;
  }
  .preview-layers,
  .preview-props {
    display: none;
  }
  .btn-primary,
  .btn-secondary {
    width: 220px;
    justify-content: center;
  }
  .group-preview-body {
    grid-template-columns: 1fr;
  }
  .group-layer-tree {
    display: none;
  }
  .hide-mobile {
    display: none;
  }
  .hero-split {
    gap: 0;
    flex-direction: column-reverse;
  }
  .hero-badge {
    display: none;
  }
  .hero-left {
    height: 224px;
  }
  body {
    background-color: #ffffff;
  }
  .page-wrap {
    background-color: var(--bg);
  }
  .hero {
    padding-top: 0;
    padding-bottom: 0;
    justify-content: flex-start;
    min-height: unset;
  }
  .hero-sub {
    margin-bottom: 0;
  }
}

/* ══════════════════════════════════════════════════════════
   v2 STRUCTURE — shared by index.html and features.html
   ══════════════════════════════════════════════════════════ */

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}
.nav-links a:not(.nav-cta):not(.nav-icon):hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
}
.nav-links a:not(.nav-cta):not(.nav-icon) {
  color: var(--dim);
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  transition: color 0.15s;
}

/* ── FEATURE HIGHLIGHTS (home) ─────────────────────────── */
.highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.highlight-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 28px;
  transition:
    border-color 0.15s,
    transform 0.15s,
    background 0.15s;
}
a.highlight-card:hover {
  border-color: var(--border-light);
  background: var(--surface);
  transform: translateY(-2px);
}

.highlight-visual {
  height: 120px;
  margin: -8px -8px 24px;
  border-radius: var(--radius-xl);
  background: var(--ruler-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.highlight-card h3 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin-bottom: 8px;
}
.highlight-card p {
  font-size: var(--text-lg);
  color: var(--dim);
  line-height: var(--leading-relaxed);
  flex: 1;
}
.highlight-card p em {
  color: var(--text);
  font-style: normal;
}
.highlight-more {
  margin-top: 20px;
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--accent);
}

.section-footer-cta {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

/* mini visuals inside highlight cards */
.mini-cube {
  width: 44px;
  height: 44px;
  position: relative;
  transform-style: preserve-3d;
  animation: mini-cube-spin 6s linear infinite;
}
.mini-cube span {
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--accent);
  background: rgba(233, 69, 96, 0.08);
}
.mini-cube span:nth-child(1) { transform: translateZ(22px); }
.mini-cube span:nth-child(2) { transform: rotateY(180deg) translateZ(22px); }
.mini-cube span:nth-child(3) { transform: rotateY(90deg) translateZ(22px); border-color: var(--kf); background: rgba(245, 197, 66, 0.08); }
.mini-cube span:nth-child(4) { transform: rotateY(-90deg) translateZ(22px); border-color: var(--kf); background: rgba(245, 197, 66, 0.08); }
.mini-cube span:nth-child(5) { transform: rotateX(90deg) translateZ(22px); border-color: var(--orange); }
.mini-cube span:nth-child(6) { transform: rotateX(-90deg) translateZ(22px); border-color: var(--orange); }
.mini-cube-stage {
  perspective: 300px;
}
@keyframes mini-cube-spin {
  from { transform: rotateX(-20deg) rotateY(0deg); }
  to { transform: rotateX(-20deg) rotateY(360deg); }
}

.draw-path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw-on 3.2s ease-in-out infinite;
}
.draw-path.d2 { animation-delay: 0.35s; }
.draw-path.d3 { animation-delay: 0.7s; }
@keyframes draw-on {
  0% { stroke-dashoffset: 1; }
  55%, 80% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -1; }
}

.mini-tl {
  width: 78%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.mini-tl .tl-track-bar {
  height: 12px;
}
.mini-tl .preview-playhead {
  top: -8px;
  bottom: -8px;
}

.mini-keys {
  display: flex;
  gap: 6px;
}
.mini-keys kbd,
.kbd-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-bottom: 2px solid #b9bdca;
  border-radius: var(--radius-lg);
  font-size: var(--text-xl);
  font-family: var(--font-sans);
  font-weight: var(--font-medium);
  color: var(--text);
  box-shadow: 0 2px 4px rgba(20, 22, 35, 0.08);
}
.mini-keys kbd:nth-child(2) {
  animation: key-press 2.4s ease-in-out infinite;
}
@keyframes key-press {
  0%, 40%, 60%, 100% { transform: translateY(0); border-bottom-width: 2px; }
  48% { transform: translateY(2px); border-bottom-width: 0; color: var(--kf); }
}

/* ── VALUE SECTION (home) ──────────────────────────────── */
.value-section {
  background: var(--panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.value-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 50% 60% at 50% 100%,
    rgba(233, 69, 96, 0.1) 0%,
    transparent 70%
  );
  pointer-events: none;
}
.value-section .container {
  position: relative;
  text-align: center;
}
.value-section .section-intro {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 56px;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 56px;
  text-align: left;
}

.value-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 28px 24px;
}
.value-card .value-big {
  display: block;
  font-size: 34px;
  font-weight: var(--font-extrabold);
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 14px;
  color: var(--kf);
}
.value-card:nth-child(2) .value-big { color: var(--accent); }
.value-card:nth-child(3) .value-big { color: var(--orange); }
.value-card:nth-child(4) .value-big { color: #7c5cf0; }
.value-card h3 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin-bottom: 6px;
}
.value-card p {
  font-size: var(--text-lg);
  color: var(--dim);
  line-height: var(--leading-relaxed);
}

/* ── FOOTER v2 ─────────────────────────────────────────── */
footer.site-footer {
  display: block;
  padding: 64px 24px 32px;
  margin-bottom: 96px;
}
.footer-top {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.footer-brand p {
  margin-top: 12px;
  max-width: 280px;
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}
.footer-cols {
  display: flex;
  gap: 64px;
}
.footer-col h4 {
  font-size: var(--text-md);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 14px;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col a {
  font-size: var(--text-lg);
  transition: color 0.15s;
}
.footer-col a:hover {
  color: var(--text);
}
.footer-bottom {
  max-width: 1080px;
  margin: 0 auto;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── FEATURES PAGE ─────────────────────────────────────── */
.page-hero {
  padding: 120px 24px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 60% 70% at 50% 0%,
    rgba(233, 69, 96, 0.12) 0%,
    transparent 70%
  );
  pointer-events: none;
}
.page-hero h1 {
  font-size: clamp(38px, 6vw, 64px);
  font-weight: var(--font-extrabold);
  letter-spacing: -1.5px;
  line-height: 1.05;
  margin-bottom: 20px;
  position: relative;
}
.page-hero h1 .accent { color: var(--accent); }
.page-hero h1 .kf { color: var(--kf); }
.page-hero .hero-sub {
  margin-bottom: 40px;
  position: relative;
}

.jump-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  position: relative;
}
.jump-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius-full);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--dim);
  transition: color 0.15s, border-color 0.15s;
}
.jump-links a:hover {
  color: var(--text);
  border-color: var(--border-light);
}
.jump-links .kf-diamond {
  width: 8px;
  height: 8px;
  margin: 0;
  border-width: 1.5px;
}

.deep-section {
  scroll-margin-top: 24px;
}
.deep-section.alt {
  background: var(--panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.deep-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}
.deep-layout.flip > :first-child {
  order: 2;
}

.media-frame {
  background: var(--ruler-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.media-frame img,
.media-frame object {
  display: block;
  width: 100%;
  height: auto;
}
.media-caption {
  font-size: var(--text-md);
  color: var(--dim);
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.media-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.spec-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 64px;
}
.spec-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px;
}
.deep-section:not(.alt) .spec-card {
  background: var(--panel);
}
.spec-card h4 {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  margin-bottom: 6px;
}
.spec-card p {
  font-size: var(--text-lg);
  color: var(--dim);
  line-height: var(--leading-relaxed);
}
.spec-card code,
.section-intro code,
.kf-item-text code {
  color: var(--kf);
  font-family: var(--font-mono);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.chip-list span {
  font-size: var(--text-md);
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

/* 3D props mock */
.props-mock {
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 16px;
  display: grid;
  grid-template-columns: auto 1fr 1fr 1fr;
  gap: 8px 10px;
  align-items: center;
}
.props-mock .preview-prop-label {
  padding-right: 6px;
}
.props-mock .preview-prop-input {
  justify-content: space-between;
}
.props-mock .axis {
  color: var(--dim);
}
.props-mock .cube-toggle {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-md);
  color: var(--text);
  padding-bottom: 6px;
}
.props-mock .cube-toggle svg {
  color: var(--accent);
}

/* draw demo */
.draw-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  min-height: 260px;
}
.draw-stage svg {
  width: 100%;
  max-width: 360px;
  height: auto;
}
.draw-track {
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.draw-track .tl-track-bar {
  position: relative;
}
.draw-track .preview-playhead {
  animation: playhead-draw 3.2s ease-in-out infinite;
}
@keyframes playhead-draw {
  0% { left: 0%; }
  55%, 80% { left: 100%; }
  100% { left: 100%; }
}
.draw-val {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--kf);
  width: 24px;
  text-align: center;
}

/* easing list */
.ease-table {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* shortcuts OS toggle */
.os-toggle {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-bottom: 32px;
}
.os-toggle button {
  font: inherit;
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--dim);
  background: none;
  border: none;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.os-toggle button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
}

.cta-section.compact {
  padding: 100px 24px;
}

@media (max-width: 900px) {
  .highlight-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .value-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .deep-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .deep-layout.flip > :first-child {
    order: 0;
  }
  .spec-row,
  .ease-table {
    grid-template-columns: 1fr 1fr;
  }
  .footer-top {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .nav-links {
    gap: 20px;
  }
  .nav-links .nav-hide-sm {
    display: none;
  }
  .highlight-grid,
  .value-grid,
  .spec-row,
  .ease-table {
    grid-template-columns: 1fr;
  }
  section {
    padding: 72px 16px;
  }
  .page-hero {
    padding: 72px 16px 48px;
  }
  .footer-cols {
    gap: 40px;
  }
  footer.site-footer {
    padding: 48px 16px 24px;
    margin-bottom: 80px;
  }
}

/* keep grid children from forcing horizontal scroll on small screens */
.deep-layout > *,
.kf-layout > *,
.group-feature-layout > *,
.export-layout > *,
.spec-row > *,
.ease-table > *,
.highlight-grid > *,
.value-grid > * {
  min-width: 0;
}
.media-frame img {
  max-width: 100%;
}
.shortcut-row {
  gap: 12px;
}
.shortcut-row .kbd {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.code-block {
  overflow-x: auto;
}
@media (max-width: 720px) {
  .props-mock {
    grid-template-columns: auto repeat(3, minmax(0, 1fr));
  }
}

/* ══════════════════════════════════════════════════════════
   HERO v3 — light, drawn lines, app front and center
   ══════════════════════════════════════════════════════════ */
@font-face {
  font-family: "Geist Mono";
  src: url("./fonts/GeistMono-Regular.woff2") format("woff2");
  font-display: swap;
}

.hero {
  display: block;
  min-height: 0;
  padding: 128px 24px 0;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  background: radial-gradient(ellipse 70% 55% at 50% 0%, #ffffff 0%, transparent 70%);
}

.hero-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.hero-lines .hl {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0.55;
  animation: hl-draw 1.8s cubic-bezier(0.33, 1, 0.68, 1) var(--d) forwards;
}
.hero-lines .hl-pulse {
  stroke-dasharray: 0.07 1.2;
  stroke-dashoffset: 0.08;
  animation: hl-pulse 3.6s cubic-bezier(0.45, 0, 0.55, 1) var(--d) infinite;
}
@keyframes hl-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes hl-pulse {
  0% { stroke-dashoffset: 0.08; }
  70%, 100% { stroke-dashoffset: -1; }
}

.hero-copy {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
}
.hero-copy::before {
  content: "";
  position: absolute;
  inset: -60px -120px -40px;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.96) 55%, rgba(255, 255, 255, 0));
  z-index: -1;
}
.hero-copy .hero-badge {
  background: #fff;
}
.hero h1 {
  font-size: clamp(40px, 6.4vw, 78px);
  letter-spacing: -0.035em;
  margin-bottom: 24px;
}
.hero-mind {
  position: relative;
  display: inline-block;
  color: var(--kf);
}
.hero-mind svg {
  position: absolute;
  left: -2%;
  bottom: -0.1em;
  width: 104%;
  height: 0.28em;
  overflow: visible;
}
.hero-mind path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: hl-draw 0.9s cubic-bezier(0.33, 1, 0.68, 1) 1.1s forwards;
}
.hero .hero-sub {
  margin: 0 auto 40px;
  max-width: 600px;
}
.hero .hero-actions {
  justify-content: center;
  margin-bottom: 0;
}

/* app window */
.hero-app-wrap {
  perspective: 2400px;
  max-width: 1200px;
  margin: 72px auto 0;
}
.hero-app {
  position: relative;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 50px 100px -20px rgba(20, 22, 35, 0.22),
    0 30px 60px -30px rgba(224, 35, 78, 0.18),
    0 0 0 6px rgba(255, 255, 255, 0.6);
  transform-origin: 50% 0;
  animation: app-rise 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}
@keyframes app-rise {
  from { opacity: 0; transform: rotateX(18deg) translateY(40px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.app-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.app-url {
  flex: 1;
  margin-right: 46px;
  text-align: center;
  font-size: var(--text-md);
  color: var(--dim);
}
.app-shot {
  position: relative;
  container-type: inline-size;
}
.app-shot img {
  display: block;
  width: 100%;
  height: auto;
}
/* positions are measured from the 2880×1800 screenshot */
.app-artboard {
  position: absolute;
  left: 26.285%;
  top: 7.056%;
  width: 41.667%;
  height: 65.11%;
  overflow: hidden;
}
.app-artboard object {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  pointer-events: none;
}
.app-time {
  position: absolute;
  left: 34.2%;
  top: 1.33%;
  width: 4.34%;
  height: 2.11%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef0f4;
  font-family: "Geist Mono", var(--font-mono);
  font-size: 0.86cqw;
  color: var(--kf);
}
.app-playhead {
  position: absolute;
  top: 72.28%;
  bottom: 0;
  left: 14.583%;
  width: max(1px, 0.07cqw);
  background: var(--accent);
}
.app-playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 0.35cqw solid transparent;
  border-right: 0.35cqw solid transparent;
  border-top: 0.55cqw solid var(--accent);
}
.app-shot.running .app-playhead {
  animation: app-playhead 4s linear infinite;
}
@keyframes app-playhead {
  from { left: 14.583%; }
  to { left: 56.25%; }
}

@media (max-width: 900px) {
  .hero .hero-actions .btn-primary {
    display: inline-flex;
  }
}
@media (max-width: 720px) {
  .hero {
    padding: 72px 16px 0;
    min-height: 0;
  }
  .hero-app-wrap {
    margin-top: 48px;
    margin-right: -40%;
  }
  .hero-app {
    border-radius: 10px;
  }
  .app-chrome {
    height: 26px;
  }
  .app-url {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-lines .hl,
  .hero-mind path {
    animation: none;
    stroke-dashoffset: 0;
  }
  .hero-lines .hl-pulse {
    display: none;
  }
  .hero-app {
    animation: none;
  }
}

/* lines canvas: fixed height so the 1440-wide viewBox isn't cropped at the edges */
.hero-lines {
  bottom: auto;
  height: 1100px;
}

/* Round caps paint a dot even on a zero-length dash, so a "1"-dash parked at
   offset 1 still shows at the path start. Use a "1 2" pattern and park the dash
   slightly past the path (offset 1.1 / -1.1) so hidden really means hidden. */
.hero-mind path,
.hero-lines .hl,
.draw-path {
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1.1;
}
.hero-lines .hl-pulse {
  stroke-dashoffset: 0.15;
}
@keyframes hl-pulse {
  0% { stroke-dashoffset: 0.15; }
  70%, 100% { stroke-dashoffset: -1.1; }
}
@keyframes draw-on {
  0% { stroke-dashoffset: 1.1; }
  55%, 80% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -1.1; }
}

/* ── Hero lines v2: fixed canvas centred on the app, running the full hero
   height and fading out before the next section ─────────────────────── */
.hero {
  padding-bottom: 160px;
}
.hero-lines-wrap {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  /* eased fade: long, soft tail instead of a hard linear ramp */
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0,
    #000 calc(100% - 640px),
    rgba(0, 0, 0, 0.82) calc(100% - 500px),
    rgba(0, 0, 0, 0.55) calc(100% - 370px),
    rgba(0, 0, 0, 0.28) calc(100% - 250px),
    rgba(0, 0, 0, 0.1) calc(100% - 140px),
    transparent calc(100% - 40px)
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0,
    #000 calc(100% - 640px),
    rgba(0, 0, 0, 0.82) calc(100% - 500px),
    rgba(0, 0, 0, 0.55) calc(100% - 370px),
    rgba(0, 0, 0, 0.28) calc(100% - 250px),
    rgba(0, 0, 0, 0.1) calc(100% - 140px),
    transparent calc(100% - 40px)
  );
}
.hero-lines-wrap .hero-lines {
  position: absolute;
  inset: auto;
  top: 0;
  left: 50%;
  width: 2400px;
  height: 1760px;
  margin-left: -1200px;
  z-index: auto;
}
@media (max-width: 720px) {
  .hero {
    padding-bottom: 96px;
  }
}

/* ── Secondary button: readable on the light background ───────────── */
.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border-light);
  font-weight: var(--font-bold);
  box-shadow:
    0 1px 2px rgba(20, 22, 35, 0.06),
    0 4px 14px rgba(20, 22, 35, 0.08);
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
.btn-secondary:hover {
  border-color: var(--text);
  transform: translateY(-1px);
  box-shadow:
    0 2px 4px rgba(20, 22, 35, 0.08),
    0 10px 24px rgba(20, 22, 35, 0.12);
}

/* ── Hero lines v3: pinned to the viewport while you scroll, faded out by
   script as the next section arrives (see the scroll handler in index.html) ── */
.hero {
  padding-bottom: 120px;
}
.hero-lines-wrap {
  position: fixed;
  inset: 0;
  -webkit-mask-image: none;
  mask-image: none;
  will-change: opacity, transform;
  transform-origin: 50% 40%;
}
.hero-lines-wrap.is-off {
  visibility: hidden;
}
.hero-lines-wrap.is-off * {
  animation-play-state: paused !important;
}
/* sections after the hero paint above the pinned lines */
.hero ~ section,
.hero ~ footer {
  position: relative;
  z-index: 1;
}

/* Tapered hero lines: each line is a filled shape (wide at the top, original
   width at the end), revealed by an animated stroke in its mask. The mask
   stroke carries the .hl draw-in animation and 0.55 opacity. */
.hero-lines mask .hl {
  stroke-linecap: round;
}

/* ── Pure white page: banded sections get a faint grey so they still read ── */
.value-section,
.deep-section.alt,
.kf-section,
.group-feature-section,
.export-section {
  background: var(--band);
}
.value-card {
  background: #fff;
}
.highlight-card,
.shortcut-group {
  box-shadow: 0 1px 2px rgba(20, 22, 35, 0.04);
}

/* ── Keyboard shortcuts: mirrors the Studio's shortcuts window (Daylight) ── */
.kbd-window {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.kbd-window-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #f6f7f9;
  border-bottom: 1px solid var(--border-light);
}
.kbd-window-header h3 {
  flex: 1;
  margin-left: 10px;
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
}
.kbd-window .os-toggle {
  position: relative;
  display: flex;
  margin: 0;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}
.os-toggle-indicator {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 1px 6px rgba(224, 35, 78, 0.4);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.kbd-window .os-toggle[data-active="pc"] .os-toggle-indicator {
  transform: translateX(100%);
}
.kbd-window .os-toggle button {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 52px;
  padding: 4px 14px;
  border-radius: var(--radius);
  font-size: var(--text-md);
  background: none;
  color: var(--dim);
}
.kbd-window .os-toggle button[aria-pressed="true"] {
  background: none;
  color: #fff;
}
.kbd-window .os-toggle button[aria-pressed="false"]:hover {
  color: var(--text);
}
.kbd-window-body {
  display: flex;
  gap: 16px;
  padding: 20px;
}
.sc-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sc-group {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.sc-group-label {
  padding: 9px 14px;
  background: #eef0f5;
  border-bottom: 1px solid var(--border-light);
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5a5f75;
}
.sc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(15, 20, 40, 0.06);
}
.sc-row:last-child {
  border-bottom: none;
}
.sc-row:hover {
  background: #fafbfc;
}
.sc-desc {
  font-size: var(--text-xl);
  color: #2f3242;
}
.sc-keys {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.sc-kbd {
  display: inline-block;
  min-width: 22px;
  padding: 2px 7px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-bottom-width: 2px;
  border-radius: var(--radius);
  font-family: "Geist Mono", var(--font-mono);
  font-size: var(--text-md);
  line-height: 1.5;
  text-align: center;
  color: var(--text);
  white-space: nowrap;
}
.sc-or {
  padding: 0 1px;
  font-size: var(--text-md);
  color: var(--dim);
}

@media (max-width: 820px) {
  .kbd-window-body {
    flex-direction: column;
    padding: 14px;
  }
  .kbd-window-header .preview-dot {
    display: none;
  }
  .kbd-window-header h3 {
    margin-left: 0;
  }
}
@media (max-width: 420px) {
  .sc-desc {
    font-size: var(--text-lg);
  }
  .sc-row {
    padding: 8px 10px;
    gap: 10px;
  }
}

/* ── Inline keycaps in body copy (same look as the shortcuts window) ── */
.ikbd {
  display: inline-block;
  min-width: 1.75em;
  padding: 0.05em 0.45em;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-bottom-width: 2px;
  border-radius: var(--radius);
  font-family: "Geist Mono", var(--font-mono);
  font-size: 0.82em;
  font-weight: 400;
  line-height: 1.45;
  text-align: center;
  color: var(--text);
  white-space: nowrap;
  vertical-align: 0.08em;
}
.ikbd-combo {
  display: inline-flex;
  gap: 3px;
  white-space: nowrap;
}

/* <code> always inherits the size of its container */
code {
  font-size: inherit;
}

/* ── Hero on phones: fit the whole line fan to the screen and show the full
   app window instead of a cropped one ─────────────────────────────── */
@media (max-width: 720px) {
  .hero-lines-wrap .hero-lines {
    transform: scale(0.42, 0.66);
    transform-origin: 50% 0;
  }
  .hero-app-wrap {
    margin-right: 0;
  }
}

/* Live SVG showcases (3D cube, drawn app icon) sit on white */
.media-frame--white {
  background: #fff;
}

/* ── Native-size 3D SVGs scaled with a transform (Safari-safe) ─────── */
.svg-fit {
  position: relative;
  overflow: hidden;
}
.svg-fit.is-scaled > object {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--native);
  height: var(--native);
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  margin: 0;
  transform-origin: 0 0;
  transform: scale(var(--s));
}
.cube-fit {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  margin: 0 auto;
}
.cube-fit > object {
  display: block;
  width: 100%;
  aspect-ratio: 1;
}

/* Hero phone: static poster until the animated SVG has loaded */
.svg-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  pointer-events: none;
  transition: opacity 0.3s, visibility 0s 0.3s;
}
.svg-fit > object {
  position: relative;
}
.svg-ready > .svg-poster {
  opacity: 0;
  visibility: hidden;
}
.app-artboard.svg-fit {
  position: absolute;
}
