/* ---------- Fonts ---------- */

@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/instrument-serif-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  --bg: #FAF9F7;
  --ink: #16181C;
  --muted: #5A5E66;
  --line: rgba(22, 24, 28, 0.08);
  --line-strong: rgba(22, 24, 28, 0.14);
  --blue: #3378F5;
  --blue-deep: #2563D4;
  --amber: #FF9E0D;
  --card: #FFFFFF;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
}

/* ---------- Base ---------- */

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2.9rem, 6.4vw, 4.8rem); }
h2 { font-size: clamp(2.1rem, 4vw, 3.1rem); }

h1 em, h2 em {
  font-style: italic;
  color: var(--blue-deep);
}

.muted { color: var(--muted); }

section { padding: 72px 0; }

kbd {
  font-family: var(--mono);
  font-size: 0.82em;
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--card);
}

/* ---------- Reveal system ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.reveal[data-delay="1"] { transition-delay: 0.12s; }
.reveal[data-delay="2"] { transition-delay: 0.24s; }
.reveal[data-delay="3"] { transition-delay: 0.36s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  /* solid near-opaque instead of backdrop blur: the embedded verification
     browser mis-composites backdrop-filter; visually equivalent on light bg */
  background: rgba(250, 249, 247, 0.94);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.brand img { border-radius: 6px; }
.brand span { white-space: nowrap; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 14px;
  font-weight: 500;
}
.nav-links a { color: var(--muted); transition: color 0.25s var(--ease); }
.nav-links a:hover { color: var(--ink); }

.nav-cta {
  color: #fff !important;
  background: var(--blue);
  padding: 8px 16px;
  border-radius: 999px;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.nav-cta:hover { background: var(--blue-deep); transform: translateY(-1px); }

/* ---------- Hero ---------- */

#hero { padding: 84px 0 40px; }

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 16px;
  background: var(--card);
  margin-bottom: 28px;
}

#hero h1 { max-width: 24ch; }

.hero-sub {
  max-width: 52ch;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  margin-top: 22px;
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 34px;
}

.btn-primary {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  padding: 14px 28px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(51, 120, 245, 0.28);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn-primary:hover {
  background: var(--blue-deep);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(51, 120, 245, 0.32);
}

.brew-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  border-radius: 999px;
  padding: 10px 10px 10px 18px;
  color: var(--muted);
}
.brew-row code {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--ink);
}
.install-note code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.brew-soon {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--amber);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 1px 8px;
  opacity: 0.85;
}
.copy-btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.copy-btn:hover { background: var(--ink); color: #fff; }
.copy-btn.copied { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- Demo panel ---------- */

.demo-wrap {
  width: min(900px, 100%);
  margin-top: 60px;
}

.demo-stage {
  position: relative;
  aspect-ratio: 900 / 560;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(51, 120, 245, 0.05), transparent 60%),
    linear-gradient(180deg, #FFFFFF 0%, #F4F2EE 100%);
  box-shadow: 0 24px 60px -30px rgba(22, 24, 28, 0.25);
  overflow: hidden;
}

.demo-stage svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.demo-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px 8px 16px;
  box-shadow: 0 4px 14px rgba(22, 24, 28, 0.08);
}

.switch {
  position: relative;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: rgba(22, 24, 28, 0.18);
  transition: background 0.3s var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s var(--ease);
}
.demo-stage.on .switch { background: var(--blue); }
.demo-stage.on .switch::after { transform: translateX(16px); }

.demo-state {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  width: 24px;
  transition: color 0.3s var(--ease);
}
.demo-stage.on .demo-state { color: var(--blue-deep); }

.dead-seg {
  stroke: var(--amber);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 12 9;
  opacity: 0.45;
  transition: opacity 0.5s var(--ease);
}
.demo-stage.on .dead-seg { opacity: 0.12; }

#demo-cursor-path.bump { animation: bump 0.3s var(--ease); }
@keyframes bump {
  30% { transform: translateY(3px); }
  65% { transform: translateY(-1px); }
}

#demo-friction { opacity: 0; }
#demo-friction.rub { animation: friction 1.15s var(--ease); }
@keyframes friction {
  0%, 100% { opacity: 0; }
  18% { opacity: 0.9; }
  45% { opacity: 0.35; }
  68% { opacity: 0.85; }
}

.demo-hud {
  opacity: 0;
  transition: opacity 0.55s var(--ease);
  pointer-events: none;
}
.demo-hud-text {
  font-family: var(--sans);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  fill: #FFFFFF;
}

.dead-seg.pulse { animation: seg-pulse 0.55s var(--ease); }
@keyframes seg-pulse {
  0% { opacity: 0.45; }
  30% { opacity: 1; stroke-width: 6; }
  100% { opacity: 0.45; }
}

#seam-bridge {
  stroke: var(--blue);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.demo-stage.on #seam-bridge { opacity: 0.3; }

.demo-caption {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-top: 18px;
}

/* ---------- Problem section ---------- */

#problem { padding: 110px 0 90px; }

.problem-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.section-sub {
  max-width: 56ch;
  color: var(--muted);
  margin-top: 18px;
}

.problem-diagram {
  width: min(760px, 100%);
  margin-top: 52px;
}

.diag-label {
  font-family: var(--sans);
  font-size: 19px;
  font-weight: 600;
  fill: var(--ink);
}
.diag-sublabel {
  font-family: var(--sans);
  font-size: 14px;
  fill: var(--muted);
}

.diag-tag text {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.diag-tag-blue text { fill: var(--blue-deep); }
.diag-tag-amber text { fill: #B26A00; }

/* Bands wipe in when the diagram reveals */
.wipe { clip-path: inset(0 100% 0 0); transition: clip-path 0.7s var(--ease); }
.wipe-amber-l { transition-delay: 0.25s; }
.wipe-blue { transition-delay: 0.45s; }
.wipe-amber-r { transition-delay: 0.65s; }
.in .wipe { clip-path: inset(0 0 0 0); }
.diag-tag { opacity: 0; transition: opacity 0.5s var(--ease) 0.9s; }
.in .diag-tag { opacity: 1; }

/* ---------- Marquees ---------- */

.marquee { padding: 90px 0; }

.marquee-inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 72px;
  align-items: center;
}

.marquee.flip .marquee-copy { order: 2; }
.marquee.flip .marquee-art { order: 1; }

.kicker {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-deep);
  margin-bottom: 14px;
}

.marquee-copy h2 { max-width: 16ch; }

.marquee-copy p:not(.kicker) {
  color: var(--muted);
  margin-top: 18px;
  max-width: 46ch;
}

.marquee-art svg {
  width: 100%;
  height: auto;
}

.art-label {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  fill: var(--ink);
}

/* Arranger: tile drags up beside the external and snaps flush */
.arr-ghost { opacity: 0; }
.play .arr-tile { animation: arr-tile 8s infinite; }
.play .arr-ghost { animation: arr-ghost 8s infinite; }

@keyframes arr-tile {
  0%, 10% { transform: translate(0px, 0px); animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1); }
  38% { transform: translate(262px, -132px); animation-timing-function: cubic-bezier(0.2, 0.9, 0.25, 1); }
  46%, 84% { transform: translate(280px, -140px); }
  84% { opacity: 1; }
  92%, 97% { transform: translate(280px, -140px); opacity: 0; }
  98%, 100% { transform: translate(0px, 0px); opacity: 0; }
}
@keyframes arr-ghost {
  0%, 22% { opacity: 0; }
  30%, 42% { opacity: 0.9; }
  50%, 100% { opacity: 0; }
}
/* Hot corners: cursor sweeps into the corner, it blooms, the action fires */
.corner-bloom { opacity: 0; transform-box: fill-box; transform-origin: center; }
.corner-chip { opacity: 0; }
.corner-cursor { transform: translate(240px, 200px); }
.play .corner-cursor { animation: corner-cursor 7s infinite; }
.play .corner-bloom { animation: corner-bloom 7s infinite; }
.play .corner-chip { animation: corner-chip 7s infinite; }

@keyframes corner-cursor {
  0%, 8% { transform: translate(240px, 200px); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  32%, 78% { transform: translate(452px, 40px); }
  95%, 100% { transform: translate(240px, 200px); }
}
@keyframes corner-bloom {
  0%, 30% { opacity: 0; transform: scale(0.2); }
  38% { opacity: 0.85; transform: scale(0.75); }
  46%, 70% { opacity: 0.35; transform: scale(1); }
  80%, 100% { opacity: 0; transform: scale(1); }
}
@keyframes corner-chip {
  0%, 36% { opacity: 0; transform: translateY(8px); }
  44%, 78% { opacity: 1; transform: translateY(0); }
  86%, 100% { opacity: 0; }
}
.corner-badge {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  fill: var(--ink);
}
.corner-chip-text {
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 600;
  fill: var(--ink);
}

/* Dimmer: the idle display eases dark, wakes instantly on cursor return */
.dim-overlay { opacity: 0; }
.dim-cursor { transform: translate(120px, 150px); }
.play .dim-overlay { animation: dim-overlay 8s infinite; }
.play .dim-cursor { animation: dim-cursor 8s infinite; }

@keyframes dim-overlay {
  0%, 12% { opacity: 0; }
  30%, 62% { opacity: 0.85; }         /* slow cosine-feel fade down */
  66%, 100% { opacity: 0; }           /* near-instant wake */
}
@keyframes dim-cursor {
  0%, 55% { transform: translate(120px, 150px); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  64%, 86% { transform: translate(375px, 150px); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  96%, 100% { transform: translate(120px, 150px); }
}

/* ---------- Feature grid ---------- */

#more { padding: 90px 0 110px; }

.more-heading {
  text-align: center;
  margin-bottom: 56px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 24px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px -18px rgba(22, 24, 28, 0.22);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(51, 120, 245, 0.09);
  color: var(--blue-deep);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}
.card-icon svg { width: 21px; height: 21px; }

.card h3 {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 6px;
}

/* ---------- Download ---------- */

#download { padding: 40px 0 90px; }

.download-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 30px 70px -40px rgba(22, 24, 28, 0.28);
  padding: 72px 48px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.download-sub {
  color: var(--muted);
  margin-top: 14px;
}

.download-card .cta-row { margin-top: 30px; }

.install-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 52px;
  padding-top: 44px;
  border-top: 1px solid var(--line);
  text-align: left;
  width: 100%;
}

.install-note {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.note-num {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(51, 120, 245, 0.1);
  color: var(--blue-deep);
  font-size: 14px;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-top: 2px;
}

.install-note h3 {
  font-size: 15.5px;
  font-weight: 600;
}

.install-note p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 6px;
}
.install-note strong { color: var(--ink); font-weight: 600; }

/* ---------- FAQ ---------- */

#faq { padding: 60px 0 110px; }

.faq-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.faq-list {
  width: min(720px, 100%);
  margin-top: 44px;
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}
.faq-list details:first-child { border-top: 1px solid var(--line); }

.faq-list summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 4px;
  font-size: 16.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.25s var(--ease);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary:hover { color: var(--blue-deep); }

.chev {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-right: 1.8px solid var(--muted);
  border-bottom: 1.8px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.3s var(--ease);
  margin-right: 6px;
}
details[open] .chev { transform: rotate(225deg); }

.faq-list details p {
  padding: 0 4px 22px;
  color: var(--muted);
  font-size: 15px;
  max-width: 62ch;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 44px 0 60px;
  margin-top: 48px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--muted);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ink);
}
.footer-brand img { border-radius: 5px; }

.footer-tag {
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}

.footer-meta { display: flex; align-items: center; gap: 10px; }
.footer-meta a { color: var(--muted); border-bottom: 1px solid var(--line-strong); transition: color 0.25s var(--ease); }
.footer-meta a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .marquee { padding: 64px 0; }
  .marquee-inner { grid-template-columns: 1fr; gap: 36px; }
  .marquee.flip .marquee-copy { order: 1; }
  .marquee.flip .marquee-art { order: 2; }
  .marquee-art { max-width: 480px; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .install-notes { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 620px) {
  #hero { padding: 56px 0 24px; }
  .nav-links { gap: 14px; }
  #problem { padding: 72px 0 56px; }
  .cta-row { flex-direction: column; width: 100%; }
  .btn-primary { text-align: center; }
  .brew-row { justify-content: center; padding-left: 12px; }
  .brew-row code { font-size: 12px; }
  .brew-soon { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .download-card { padding: 48px 22px 40px; border-radius: 22px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .demo-wrap { margin-top: 40px; }
}
