/* ═══════════════════════════════════════════════════════════════
   V2 PREMIUM LAYER — dark mode, gestures, motion, micro-interactions
   ═══════════════════════════════════════════════════════════════ */

/* ─── Dark theme tokens ─── */
[data-theme="dark"] {
  --color-bg:               #0B0E14;
  --color-surface:          #11151D;
  --color-surface-2:        #1A1F2A;
  --color-border:           #262D3B;
  --color-border-light:     #1E2430;
  --color-text-primary:     #E8ECF3;
  --color-text-secondary:   #9BA6B8;
  --color-text-muted:       #5F6B7E;
  --color-accent:           #818CF8;
  --color-accent-hover:     #A5B4FC;
  --color-accent-subtle:    #1B1E3A;
  --color-accent-border:    #34386B;
  --color-positive:         #4ADE80;
  --color-negative:         #F87171;
  --color-diff-output:      #2A2118;
  --color-diff-output-bd:   #4A3A22;
  --color-diff-assumption:  #12251A;
  --color-diff-assumption-bd: #1F4230;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.4);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.6), 0 4px 12px rgba(0,0,0,0.4);
  --shadow-xl:  0 24px 64px rgba(0,0,0,0.7);
}
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body { transition: background-color 0.35s ease, color 0.35s ease; }

[data-theme="dark"] .nav { background: rgba(11,14,20,0.8); }
[data-theme="dark"] .btn-primary { color: #0B0E14; box-shadow: 0 1px 3px rgba(129,140,248,0.4); }
[data-theme="dark"] .btn-primary:hover { box-shadow: 0 4px 16px rgba(129,140,248,0.45); }
[data-theme="dark"] .check-icon { color: #0B0E14; }
[data-theme="dark"] .step-num::before { color: #0B0E14; }
[data-theme="dark"] .solution-card { background: linear-gradient(135deg, var(--color-accent-subtle), var(--color-surface)); }
[data-theme="dark"] .problem-icon { background: #2A1517; }
[data-theme="dark"] .footer { background: #05070B; }
[data-theme="dark"] .grid-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
[data-theme="dark"] .grid-table td { border-bottom-color: rgba(38,45,59,0.5); border-right-color: rgba(38,45,59,0.3); }
[data-theme="dark"] .diff-row { border-bottom-color: rgba(38,45,59,0.4); }
[data-theme="dark"] .cell-output { color: #FBBF24 !important; }
[data-theme="dark"] .announce-banner { background: #1B1E3A; color: #C7D2FE; }
[data-theme="dark"] .hero-screenshot,
[data-theme="dark"] .screenshot-preview img,
[data-theme="dark"] .usecase-visual img { filter: brightness(0.96); }

/* ─── Theme toggle ─── */
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), border-color 0.2s, color 0.2s;
}
.theme-toggle:hover { border-color: var(--color-accent); color: var(--color-accent); transform: rotate(40deg); }
.theme-toggle:active { transform: rotate(140deg) scale(0.9); }

/* ─── Scroll progress bar ─── */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2.5px; width: 100%;
  z-index: 200; pointer-events: none;
  background: linear-gradient(90deg, #4F46E5, #7C3AED, #C084FC);
  transform-origin: 0 50%; transform: scaleX(0);
}

/* ─── Nav polish ─── */
.nav { transition: box-shadow 0.25s, background 0.35s, transform 0.35s ease; }
.nav.nav-hidden { transform: translateY(-100%); }
.nav-links a { position: relative; }
.nav-links a::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 3px;
  height: 2px; border-radius: 2px; background: var(--color-accent);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.25s ease;
}
.nav-links a.active { color: var(--color-text-primary); }
.nav-links a.active::after, .nav-links a:hover::after { transform: scaleX(1); }

/* ─── Aurora hero ─── */
.hero { isolation: isolate; }
.hero-aurora {
  position: absolute; inset: -20% -10%; z-index: -1;
  pointer-events: none; overflow: hidden; filter: blur(70px);
  opacity: 0.55;
}
[data-theme="dark"] .hero-aurora { opacity: 0.4; }
.hero-aurora span { position: absolute; border-radius: 50%; will-change: transform; }
.hero-aurora span:nth-child(1) {
  width: 560px; height: 560px; left: -6%; top: 4%;
  background: radial-gradient(circle, rgba(79,70,229,0.45), transparent 65%);
  animation: aurora-a 16s ease-in-out infinite alternate;
}
.hero-aurora span:nth-child(2) {
  width: 480px; height: 480px; right: 2%; top: -8%;
  background: radial-gradient(circle, rgba(124,58,237,0.38), transparent 65%);
  animation: aurora-b 20s ease-in-out infinite alternate;
}
.hero-aurora span:nth-child(3) {
  width: 420px; height: 420px; left: 38%; bottom: -18%;
  background: radial-gradient(circle, rgba(16,185,129,0.28), transparent 65%);
  animation: aurora-c 24s ease-in-out infinite alternate;
}
@keyframes aurora-a { from { transform: translate(0,0) scale(1); }   to { transform: translate(90px,60px) scale(1.15); } }
@keyframes aurora-b { from { transform: translate(0,0) scale(1.1); } to { transform: translate(-70px,50px) scale(0.95); } }
@keyframes aurora-c { from { transform: translate(0,0); }            to { transform: translate(60px,-50px) scale(1.2); } }

/* ─── Hero 3D tilt ─── */
.tilt-wrap { perspective: 1200px; }
.tilt {
  transform: rotateY(calc(var(--ry, -4) * 1deg)) rotateX(calc(var(--rx, 2) * 1deg));
  transition: transform 0.18s ease-out, box-shadow 0.3s ease;
  will-change: transform;
}
.tilt-wrap:hover .tilt { box-shadow: 0 32px 90px rgba(0,0,0,0.22), 0 8px 28px rgba(79,70,229,0.18); }
.hero-screenshot { cursor: zoom-in; }

/* hero staggered entrance */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(26px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}
.hero-left > * { animation: rise-in 0.7s cubic-bezier(0.22,1,0.36,1) both; }
.hero-left > *:nth-child(1) { animation-delay: 0.05s; }
.hero-left > *:nth-child(2) { animation-delay: 0.14s; }
.hero-left > *:nth-child(3) { animation-delay: 0.24s; }
.hero-left > *:nth-child(4) { animation-delay: 0.34s; }
.hero-left > *:nth-child(5) { animation-delay: 0.42s; }
.hero-left > *:nth-child(6) { animation-delay: 0.5s; }
.hero-right { animation: rise-in 0.9s cubic-bezier(0.22,1,0.36,1) 0.3s both; }

/* ─── Reveal upgrade (blur + rise, staggered children) ─── */
.fade-up { transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1), transform 0.7s cubic-bezier(0.22,1,0.36,1), filter 0.7s ease; filter: blur(3px); }
.fade-up.visible { filter: blur(0); }
[data-stagger] > * {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.22,1,0.36,1), transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
[data-stagger].visible > * { opacity: 1; transform: translateY(0); }
[data-stagger].visible > *:nth-child(1)  { transition-delay: 0.00s; }
[data-stagger].visible > *:nth-child(2)  { transition-delay: 0.06s; }
[data-stagger].visible > *:nth-child(3)  { transition-delay: 0.12s; }
[data-stagger].visible > *:nth-child(4)  { transition-delay: 0.18s; }
[data-stagger].visible > *:nth-child(5)  { transition-delay: 0.24s; }
[data-stagger].visible > *:nth-child(6)  { transition-delay: 0.30s; }
[data-stagger].visible > *:nth-child(7)  { transition-delay: 0.36s; }
[data-stagger].visible > *:nth-child(8)  { transition-delay: 0.42s; }
[data-stagger].visible > *:nth-child(9)  { transition-delay: 0.48s; }
[data-stagger].visible > *:nth-child(10) { transition-delay: 0.54s; }
[data-stagger].visible > *:nth-child(11) { transition-delay: 0.60s; }
[data-stagger].visible > *:nth-child(12) { transition-delay: 0.66s; }

/* ─── Cursor-glow cards ─── */
.glow-card { position: relative; overflow: hidden; }
.glow-card::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), rgba(99,102,241,0.13), transparent 65%);
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.glow-card:hover::before { opacity: 1; }
.glow-card > * { position: relative; z-index: 1; }
[data-theme="dark"] .glow-card::before {
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), rgba(129,140,248,0.15), transparent 65%);
}
.feature-card:hover { background: var(--color-surface); }
.feature-card { transition: background 0.15s, transform 0.25s ease; }

/* ─── Magnetic buttons ─── */
.btn-magnetic { transition: transform 0.18s cubic-bezier(0.22,1,0.36,1), background 0.15s, border-color 0.15s, box-shadow 0.15s; will-change: transform; }

/* ─── Logo bar marquee ─── */
.logo-marquee { overflow: hidden; position: relative; }
.logo-marquee::before, .logo-marquee::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 90px; z-index: 2; pointer-events: none;
}
.logo-marquee::before { left: 0; background: linear-gradient(90deg, var(--color-bg), transparent); }
.logo-marquee::after  { right: 0; background: linear-gradient(-90deg, var(--color-bg), transparent); }
.logo-marquee-track {
  display: flex; align-items: center;
  width: max-content;
  animation: marquee 26s linear infinite;
}
.logo-marquee:hover .logo-marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.logo-marquee .logo-item {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  color: var(--color-text-muted); letter-spacing: 0.04em;
  opacity: 0.65; white-space: nowrap; padding-right: 56px;
}

/* ─── What's new section ─── */
.wn-badge-row { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.wn-chip {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--color-text-secondary); background: var(--color-surface);
  border: 1px solid var(--color-border); padding: 5px 12px; border-radius: 20px;
}
.wn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 52px; }
.wn-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s, border-color 0.3s;
}
.wn-card:hover { transform: translateY(-6px); border-color: var(--color-accent-border); box-shadow: var(--shadow-lg); }
.wn-card-img { position: relative; overflow: hidden; aspect-ratio: 16/10; background: var(--color-bg); }
.wn-card-img img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; cursor: zoom-in; transition: transform 0.5s cubic-bezier(0.22,1,0.36,1); }
.wn-card:hover .wn-card-img img { transform: scale(1.04); }
.wn-card-body { padding: 20px 22px 22px; }
.wn-card-tag {
  display: inline-block; font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-accent); background: var(--color-accent-subtle);
  border: 1px solid var(--color-accent-border);
  padding: 3px 8px; border-radius: 4px; margin-bottom: 12px;
}
.wn-card h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 8px; }
.wn-card p { font-size: 13.5px; color: var(--color-text-secondary); line-height: 1.6; }

/* ─── Screenshots carousel v2 ─── */
.screenshots-track { cursor: grab; scroll-snap-type: x proximity; user-select: none; }
.screenshots-track.dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.screenshots-track.dragging .screenshot-card { pointer-events: none; }
.screenshot-card { width: 560px; }
.screenshot-preview { height: 320px; }
.screenshot-preview img { transition: transform 0.5s cubic-bezier(0.22,1,0.36,1); }
.screenshot-card:hover .screenshot-preview img { transform: scale(1.03); }
.ss-dots { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 20px; }
.ss-dot {
  width: 7px; height: 7px; border-radius: 10px; border: none; padding: 0;
  background: var(--color-border); cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22,1,0.36,1);
}
.ss-dot.active { width: 22px; background: var(--color-accent); }
.screenshots-hint {
  text-align: center; font-size: 12px; color: var(--color-text-muted);
  margin-top: 10px; font-family: var(--font-mono);
}

/* ─── Lightbox v2 (gallery + zoom + swipe) ─── */
.lb-backdrop { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
#lightbox { flex-direction: column; }
#lightbox.lb-open { animation: lb-fade 0.25s ease; }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
.lb-img { transition: transform 0.3s cubic-bezier(0.22,1,0.36,1); cursor: zoom-in; touch-action: none; }
.lb-img.zoomed { cursor: grab; }
.lb-caption {
  position: relative; margin-top: 14px; color: rgba(255,255,255,0.75);
  font-size: 13px; text-align: center; max-width: 80vw; z-index: 1;
}
.lb-counter {
  position: absolute; top: 24px; left: 28px;
  font-family: var(--font-mono); font-size: 12px; color: rgba(255,255,255,0.6);
  z-index: 1;
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18);
  color: #fff; font-size: 18px; cursor: pointer; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.15s;
}
.lb-nav:hover { background: rgba(255,255,255,0.18); }
.lb-prev { left: 22px; }
.lb-next { right: 22px; }
.lb-prev:hover { transform: translateY(-50%) translateX(-2px); }
.lb-next:hover { transform: translateY(-50%) translateX(2px); }

/* ─── Command palette ─── */
#cmdk { display: none; position: fixed; inset: 0; z-index: 10000; }
#cmdk.ck-open { display: block; animation: lb-fade 0.15s ease; }
.ck-backdrop { position: absolute; inset: 0; background: rgba(13,17,23,0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ck-panel {
  position: relative; max-width: 560px; margin: 12vh auto 0; width: calc(100% - 32px);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 14px; box-shadow: var(--shadow-xl); overflow: hidden;
  animation: ck-pop 0.18s cubic-bezier(0.22,1,0.36,1);
}
@keyframes ck-pop { from { opacity: 0; transform: translateY(-10px) scale(0.98); } to { opacity: 1; transform: none; } }
.ck-input {
  width: 100%; box-sizing: border-box; padding: 16px 18px;
  font-family: var(--font-sans); font-size: 15px;
  background: transparent; color: var(--color-text-primary);
  border: none; border-bottom: 1px solid var(--color-border-light); outline: none;
}
.ck-input::placeholder { color: var(--color-text-muted); }
.ck-list { max-height: min(46vh, 380px); overflow-y: auto; padding: 6px; }
.ck-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-sans); font-size: 14px; color: var(--color-text-primary);
}
.ck-item.sel { background: var(--color-accent-subtle); }
.ck-item-hint {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--color-text-muted); flex-shrink: 0;
}
.ck-item.sel .ck-item-hint { color: var(--color-accent); }
.ck-empty { padding: 22px 16px; font-size: 13.5px; color: var(--color-text-muted); text-align: center; }
.ck-foot {
  display: flex; gap: 16px; justify-content: flex-end;
  padding: 8px 14px; border-top: 1px solid var(--color-border-light);
  font-size: 11px; color: var(--color-text-muted);
}
.ck-foot kbd {
  font-family: var(--font-mono); font-size: 10px;
  background: var(--color-surface-2); border: 1px solid var(--color-border);
  border-radius: 4px; padding: 1px 5px; margin-right: 3px;
}
.cmdk-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text-muted); cursor: pointer;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
}
.cmdk-trigger:hover { border-color: var(--color-accent); color: var(--color-accent); }
.cmdk-trigger .ck-slash { font-size: 13px; }

/* ─── Interactive playground ─── */
#playground { background: var(--color-surface); }
.pg-wrap {
  display: grid; grid-template-columns: 3fr 2fr; gap: 22px;
  margin-top: 52px; align-items: stretch;
}
.pg-panel {
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow-md);
}
#playground-widget { display: grid; grid-template-columns: 170px 1fr; gap: 22px; }
.pg-tree { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.pg-tree-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-text-muted); margin-bottom: 4px;
}
.pg-tree-children {
  margin-left: 14px; padding-left: 10px;
  border-left: 2px solid var(--color-border);
  display: flex; flex-direction: column; gap: 6px;
}
.pg-chip {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 8px; padding: 8px 12px; cursor: pointer;
  transition: all 0.15s; text-align: left;
}
.pg-chip:hover { border-color: var(--color-accent-border); color: var(--color-text-primary); }
.pg-chip.active {
  background: var(--color-accent-subtle); border-color: var(--color-accent-border);
  color: var(--color-accent);
}
.pg-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pg-dot-base { background: var(--color-text-muted); }
.pg-dot-bull { background: #059669; }
.pg-dot-bear { background: #D97706; }
.pg-reset {
  margin-top: auto; align-self: flex-start;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--color-text-muted); background: none; border: none;
  cursor: pointer; padding: 6px 2px;
}
.pg-reset:hover { color: var(--color-accent); }

.pg-grid { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pg-cell {
  display: flex; align-items: center; gap: 10px;
  background: var(--color-surface); border: 1px solid var(--color-border-light);
  border-radius: 8px; padding: 9px 14px;
  transition: background 0.25s, border-color 0.25s;
}
.pg-label { flex: 1; font-size: 13px; font-weight: 500; color: var(--color-text-secondary); }
.pg-val {
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
  color: var(--color-text-primary); min-width: 64px; text-align: right;
}
.pg-cell-irr .pg-val { color: var(--color-accent); font-size: 16px; }
.pg-tag {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  padding: 2px 7px; border-radius: 4px; white-space: nowrap;
}
.pg-tag-trunk { color: var(--color-text-muted); background: var(--color-surface-2); border: 1px solid var(--color-border-light); }
.pg-tag-inh { color: var(--color-text-muted); background: transparent; border: 1px dashed var(--color-border); }
.pg-tag-over { color: var(--color-positive); background: var(--color-diff-assumption); border: 1px solid var(--color-diff-assumption-bd); }
.pg-cell-over { background: var(--color-diff-assumption); border-color: var(--color-diff-assumption-bd); }
.pg-cell-cause { outline: 2px solid var(--color-positive); outline-offset: -1px; }
.pg-steps { display: flex; gap: 4px; }
.pg-step {
  width: 24px; height: 24px; border-radius: 6px;
  border: 1px solid var(--color-border); background: var(--color-bg);
  color: var(--color-text-secondary); font-size: 14px; line-height: 1;
  cursor: pointer; transition: all 0.12s;
  display: inline-flex; align-items: center; justify-content: center;
}
.pg-step:hover { border-color: var(--color-accent); color: var(--color-accent); }
.pg-step:active { transform: scale(0.92); }
@keyframes pg-flash-kf {
  0% { background: var(--color-accent-subtle); }
  100% { background: var(--color-surface); }
}
.pg-flash { animation: pg-flash-kf 0.7s ease; }
.pg-actions { margin-top: 6px; }
.pg-diff-btn {
  width: 100%; padding: 10px 16px; border-radius: 8px;
  border: 1.5px solid var(--color-accent-border);
  background: var(--color-accent-subtle); color: var(--color-accent);
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all 0.15s;
}
.pg-diff-btn:not(:disabled):hover { background: var(--color-accent); color: #fff; }
[data-theme="dark"] .pg-diff-btn:not(:disabled):hover { color: #0B0E14; }
.pg-diff-btn:disabled { opacity: 0.55; cursor: default; }
.pg-diff-out { font-size: 12.5px; color: var(--color-text-secondary); line-height: 1.55; min-height: 0; }
.pg-diff-out b { color: var(--color-positive); }
.pg-hint {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--color-text-muted); line-height: 1.5;
}

/* mini Monte Carlo widget */
.pg-panel-mc { display: flex; flex-direction: column; gap: 14px; }
.mc-w-head { display: flex; flex-direction: column; gap: 2px; }
.mc-w-title { font-size: 15px; font-weight: 700; }
.mc-w-sub { font-size: 12px; color: var(--color-text-muted); }
.mc-w-sliders { display: flex; flex-direction: column; gap: 10px; }
.mc-w-sliders label {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--color-text-secondary);
}
.mc-w-sliders output { font-family: var(--font-mono); font-size: 12px; color: var(--color-accent); margin-left: auto; }
.mc-w-sliders input[type="range"] { width: 100%; accent-color: var(--color-accent); cursor: pointer; }
.mc-w-canvas { width: 100%; height: 120px; display: block; border-radius: 6px; background: var(--color-surface); border: 1px solid var(--color-border-light); }
.mc-w-stats { font-family: var(--font-mono); font-size: 12.5px; color: var(--color-text-secondary); text-align: center; }
.mc-w-stats b { color: var(--color-text-primary); }
.mc-w-meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--color-text-muted); text-align: center; }

/* ─── Cost calculator ─── */
.cc-wrap {
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
  max-width: 940px; margin: 48px auto 0;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 32px;
  box-shadow: var(--shadow-md);
}
.cc-inputs { display: flex; flex-direction: column; gap: 18px; }
.cc-field { display: flex; flex-direction: column; gap: 8px; }
.cc-field-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; font-weight: 600; color: var(--color-text-secondary);
}
.cc-field-label b { font-family: var(--font-mono); font-size: 14px; color: var(--color-accent); }
.cc-field input[type="range"] { width: 100%; accent-color: var(--color-accent); cursor: pointer; }
.cc-result { display: flex; flex-direction: column; gap: 10px; justify-content: center; text-align: center; }
.cc-big {
  font-family: var(--font-mono); font-size: 34px; font-weight: 800; letter-spacing: -0.03em;
  color: var(--color-text-primary); line-height: 1.1;
}
.cc-big-money { color: var(--color-accent); font-size: 40px; }
.cc-unit { display: block; font-family: var(--font-sans); font-size: 12px; font-weight: 500; color: var(--color-text-muted); letter-spacing: 0; }
.cc-line { font-size: 13px; color: var(--color-text-secondary); line-height: 1.6; margin: 6px 0 10px; }
.cc-note { font-size: 11.5px; font-family: var(--font-mono); color: var(--color-text-muted); }

@media (max-width: 960px) {
  .pg-wrap { grid-template-columns: 1fr; }
  #playground-widget { grid-template-columns: 1fr; }
  .pg-tree { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .pg-tree-children { border-left: none; margin-left: 0; padding-left: 0; flex-direction: row; gap: 6px; }
  .pg-reset { margin-top: 0; margin-left: auto; }
  .cc-wrap { grid-template-columns: 1fr; }
}

/* ─── Formula library ─── */
#formulas { background: var(--color-surface); }
.fx-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 14px; margin-top: 52px;
}
.fx-row {
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 18px 20px;
  transition: border-color 0.25s, transform 0.25s ease, box-shadow 0.25s;
}
.fx-row:hover { border-color: var(--color-accent-border); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.fx-name {
  display: inline-block; font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  color: var(--color-accent); background: var(--color-accent-subtle);
  border: 1px solid var(--color-accent-border);
  padding: 4px 10px; border-radius: 6px; margin-bottom: 10px;
  max-width: 100%; overflow-wrap: anywhere;
}
.fx-row p { font-size: 13.5px; color: var(--color-text-secondary); line-height: 1.6; }
.fx-row p em { font-style: normal; font-weight: 600; color: var(--color-text-primary); }
.fx-ex { font-family: var(--font-mono); font-size: 12px; color: var(--color-positive); }
.fx-note {
  text-align: center; margin-top: 28px;
  font-size: 13px; color: var(--color-text-muted);
}
@media (max-width: 800px) { .fx-grid { grid-template-columns: 1fr; } }

/* ─── Demo video ─── */
.demo-video-wrap { max-width: 980px; margin: 48px auto 0; position: relative; }
.demo-video-wrap video {
  width: 100%; display: block;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: 0 28px 80px rgba(13,17,23,0.18), 0 6px 20px rgba(79,70,229,0.10);
}
[data-theme="dark"] .demo-video-wrap video {
  box-shadow: 0 28px 80px rgba(0,0,0,0.65), 0 6px 20px rgba(129,140,248,0.12);
}
.demo-video-note {
  text-align: center; margin-top: 14px;
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--color-text-muted); letter-spacing: 0.03em;
}
.demo-subhead { text-align: center; max-width: 720px; margin: 72px auto 0; }
.demo-subhead h3 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.demo-subhead p { font-size: 15px; color: var(--color-text-secondary); line-height: 1.65; margin-top: 12px; }

/* ─── Back to top ─── */
.back-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--color-surface); border: 1px solid var(--color-border);
  color: var(--color-text-secondary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity 0.3s, transform 0.3s, border-color 0.2s, color 0.2s;
}
.back-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-top:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ─── Section shimmer divider ─── */
.shimmer-line {
  height: 1px; border: none; margin: 0;
  background: linear-gradient(90deg, transparent, var(--color-accent-border), transparent);
}

/* ─── Responsive v2 ─── */
@media (max-width: 960px) {
  .wn-grid { grid-template-columns: 1fr; }
  .screenshot-card { width: 82vw; }
  .screenshot-preview { height: 46vw; max-height: 300px; }
}
@media (max-width: 640px) {
  .lb-nav { width: 38px; height: 38px; }
  .back-top { right: 14px; bottom: 14px; }
}

/* ─── Mobile polish ─── */
@media (max-width: 960px) {
  /* show the app on mobile — stacked under the hero text (style.css hides it) */
  .hero-right { display: block; margin-top: 36px; }
  .hero-screenshot { transform: none; cursor: default; }
  .tilt-wrap { perspective: none; }
  /* aurora blur is GPU-heavy on phones */
  .hero-aurora { filter: blur(40px); opacity: 0.4; }
}
@media (max-width: 640px) {
  /* nav: the store button was pushing the hamburger off-screen */
  .nav-actions .btn-primary { display: none; }
  .nav-inner { gap: 10px; }
  .cmdk-trigger { padding: 0 10px; }

  /* announce banner: tighter */
  .announce-banner { font-size: 12px; padding: 8px 12px; }

  /* hero */
  .hero { padding-top: calc(var(--nav-height) + 40px); }
  .hero-cta .btn-xl { width: 100%; justify-content: center; }

  /* playground: touch-size the steppers and chips */
  .pg-step { width: 34px; height: 34px; font-size: 16px; }
  .pg-chip { padding: 10px 14px; }
  .pg-panel { padding: 18px; }
  .pg-val { min-width: 54px; }
  .screenshots-hint::before { content: "swipe to browse · tap to zoom"; }
  .screenshots-hint { font-size: 0; }
  .screenshots-hint::before { font-size: 12px; }

  /* carousel dots: bigger touch targets */
  .ss-dots { gap: 10px; }
  .ss-dot { width: 9px; height: 9px; }
  .ss-dot.active { width: 26px; }

  /* calculator + palette: 16px inputs so iOS doesn't auto-zoom */
  .ck-input { font-size: 16px; }
  #contact-form input, #contact-form textarea { font-size: 16px !important; }
  .cc-wrap { padding: 22px; }
  .cc-big { font-size: 28px; }
  .cc-big-money { font-size: 34px; }
  .cc-result .btn { width: 100%; justify-content: center; }

  /* demo videos edge-to-edge feel */
  .demo-video-wrap { margin-top: 32px; }
  .demo-subhead { margin-top: 52px; }

  /* palette panel closer to top on short screens */
  .ck-panel { margin-top: 7vh; }
  .ck-list { max-height: 52vh; }

  /* what's-new chips wrap tighter */
  .wn-chip { font-size: 10px; padding: 4px 9px; }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .fade-up, [data-stagger] > * { opacity: 1 !important; transform: none !important; filter: none !important; }
  .hero-left > *, .hero-right { animation: none !important; opacity: 1; }
}
