:root {
  --white: #ffffff;
  --soft: #f5f5f7;
  --ink: #1d1d1f;
  --secondary: #6e6e73;
  --line: #d2d2d7;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --dark: #000000;
  --dark-tile: #161617;
  --dark-line: #2c2c2e;
  --inverse: #f5f5f7;
  --inverse-secondary: #a1a1a6;
  --spring: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-l: 28px;
  --radius-m: 18px;
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font: 17px/1.47 var(--text);
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.6);
  outline-offset: 3px;
  border-radius: 8px;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
.container.narrow { max-width: 760px; }
section { padding: 110px 0; }
section.soft { background: var(--soft); }
section.dark { background: var(--dark); color: var(--inverse); }

h1, h2, h3 { margin: 0; letter-spacing: -0.03em; }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); line-height: 1.07; font-weight: 700; margin-bottom: 48px; }
h3 { font-size: 1.3rem; line-height: 1.25; font-weight: 650; letter-spacing: -0.02em; }

/* Keycaps */
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.5em;
  height: 1.32em;
  padding: 0 0.3em;
  margin: 0 0.05em;
  font: 600 0.8em/1 var(--text);
  letter-spacing: 0;
  color: var(--ink);
  background: linear-gradient(#fff, #f4f4f6);
  border: 1px solid var(--line);
  border-bottom-width: 0.13em;
  border-radius: 0.26em;
  vertical-align: 0.08em;
  transition: transform 0.18s var(--spring), border-bottom-width 0.18s var(--spring), box-shadow 0.18s;
}
kbd.wide { padding: 0 0.6em; }
kbd.small { font-size: 12px; height: 20px; min-width: 22px; border-bottom-width: 2px; border-radius: 5px; }
kbd.pressed { transform: translateY(0.08em); border-bottom-width: 0.04em; box-shadow: inset 0 1px 2px rgba(0,0,0,0.08); }
.dark kbd { color: var(--inverse); background: linear-gradient(#2c2c2e, #1f1f21); border-color: #3a3a3c; }

code { font: 0.88em var(--mono); background: rgba(0,0,0,0.05); border-radius: 6px; padding: 0.1em 0.35em; letter-spacing: 0; }

.button, .waitlist button {
  display: inline-block;
  padding: 12px 22px;
  font: 600 17px var(--text);
  letter-spacing: -0.01em;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 980px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s var(--spring);
}
.button:hover, .waitlist button:hover { background: var(--accent-hover); text-decoration: none; transform: scale(1.02); }
.button:active { transform: scale(0.98); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.top-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1080px; height: 52px; margin: 0 auto; padding: 0 22px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 650; font-size: 18px; }
.brand:hover { text-decoration: none; }
.top nav { display: flex; align-items: center; gap: 26px; font-size: 14px; }
.top nav a { color: var(--ink); opacity: 0.8; }
.top nav a:hover { opacity: 1; text-decoration: none; }
.top nav .nav-cta { color: #fff; background: var(--accent); opacity: 1; padding: 5px 13px; border-radius: 980px; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 64px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 96px 22px 120px;
}
h1 { font-size: clamp(2.8rem, 5.6vw, 4.6rem); line-height: 1.04; font-weight: 750; letter-spacing: -0.045em; margin-bottom: 26px; }
h1 .line { white-space: nowrap; }
h1 kbd { font-size: 0.5em; vertical-align: 0.22em; }
.lede { font-size: 1.32rem; line-height: 1.4; color: var(--secondary); max-width: 30rem; margin: 0 0 34px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.cta-note { color: var(--secondary); font-size: 15px; }

.hero-stage { margin: 0; position: relative; }
.hero-stage::before {
  content: "";
  position: absolute; inset: -12% -10% -8%;
  background: radial-gradient(closest-side, rgba(0, 113, 227, 0.16), transparent 70%),
              radial-gradient(closest-side at 70% 80%, rgba(255, 159, 10, 0.12), transparent 70%);
  filter: blur(30px);
  z-index: -1;
  animation: drift 12s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate(4%, -3%) scale(1.06); } }

.panel {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}
.search { display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 18px; border-bottom: 1px solid rgba(0, 0, 0, 0.07); position: relative; }
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--secondary); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; font: 20px var(--text); letter-spacing: -0.02em; color: var(--ink); background: transparent; border: 0; outline: none; }
.search input::placeholder { color: #a1a1a6; }
.panel.autoplay .search input { caret-color: transparent; }
.caret { display: none; width: 2px; height: 22px; background: var(--accent); animation: blink 1s steps(1) infinite; }
.panel.autoplay .search .caret { display: block; position: absolute; left: var(--caret-x, 50px); }
@keyframes blink { 50% { opacity: 0; } }

#results { list-style: none; margin: 0; padding: 6px; height: 292px; overflow: hidden; }
#results .section { padding: 10px 10px 4px; font-size: 12px; font-weight: 600; color: var(--secondary); letter-spacing: 0; }
#results li.item {
  display: flex; align-items: center; gap: 12px;
  height: 42px; padding: 0 10px;
  border-radius: 10px; font-size: 15px; cursor: pointer;
  animation: row-in 0.35s var(--spring) backwards;
  animation-delay: calc(var(--i) * 35ms);
  transition: background 0.15s;
}
@keyframes row-in { from { opacity: 0; transform: translateY(6px); } }
#results li.item[aria-selected="true"] { background: rgba(0, 0, 0, 0.065); }
#results li.item.fired { animation: fire 0.45s var(--spring); }
@keyframes fire { 40% { background: rgba(0, 113, 227, 0.2); transform: scale(0.985); } }
#results .glyph { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 7px; font-size: 13px; color: #fff; background: var(--c, #8e8e93); }
#results .kind { margin-left: auto; color: var(--secondary); font-size: 13px; }
#results .empty { padding: 110px 0; text-align: center; color: var(--secondary); font-size: 14px; }
.panel-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; height: 36px; padding: 0 14px; font-size: 13px; font-weight: 600; border-top: 1px solid rgba(0, 0, 0, 0.07); background: rgba(255, 255, 255, 0.6); }
.hero-stage figcaption { margin-top: 16px; font-size: 14px; color: var(--secondary); text-align: center; min-height: 1.4em; transition: opacity 0.3s; }

/* Tour */
.tabs {
  display: flex; gap: 6px; padding: 5px; margin: 0 0 40px;
  background: rgba(0,0,0,0.05); border-radius: 980px;
  width: max-content; max-width: 100%;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; scroll-snap-align: center; }
.tabs button {
  position: relative; overflow: hidden;
  padding: 9px 18px; border: 0; border-radius: 980px;
  font: 600 15px var(--text); letter-spacing: -0.01em; color: var(--secondary);
  background: transparent; cursor: pointer; white-space: nowrap;
  transition: color 0.2s, background 0.3s var(--spring);
}
.tabs button[aria-selected="true"] { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.tabs button i { position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.tabs button[aria-selected="true"] i { animation: progress var(--step-ms, 5000ms) linear forwards; }
.tour.paused .tabs button i { animation: none; transform: scaleX(0); }
@keyframes progress { to { transform: scaleX(1); } }

.scenes { position: relative; min-height: 420px; }
.scene {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 56px; align-items: center;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 0.5s var(--spring), transform 0.6s var(--spring), visibility 0s 0.5s;
}
.scene.active { opacity: 1; visibility: visible; transform: translateY(0); transition-delay: 0s; position: relative; }
.scene-copy h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.12; letter-spacing: -0.035em; margin-bottom: 16px; }
.scene-copy p { color: var(--secondary); font-size: 1.1rem; max-width: 26rem; margin: 0 0 18px; }
.scene-copy .keys { font-size: 1.5rem; margin-top: 26px; }
.drag { color: var(--accent); font-size: 2rem; }

.mini {
  background: #fff; border-radius: var(--radius-m);
  box-shadow: 0 30px 70px -35px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,0,0,0.06);
  padding: 8px; min-height: 260px; position: relative; overflow: hidden;
}
.mini-search { display: flex; align-items: center; height: 50px; padding: 0 14px; font-size: 18px; color: #a1a1a6; border-bottom: 1px solid rgba(0,0,0,0.06); margin-bottom: 6px; }
.scene[data-scene="0"] .mini-search { color: var(--ink); }
.mini-search .caret { display: inline-block; height: 20px; margin-left: 2px; }
.mini-search.mono { font: 13px var(--mono); color: var(--secondary); letter-spacing: 0; white-space: nowrap; overflow: hidden; }
.mini-row { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 10px; font-size: 15px; }
.mini-row.sel { background: rgba(0,0,0,0.065); }
.mini-row em { margin-left: auto; font-style: normal; font-size: 13px; color: var(--secondary); }
.mini .ic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: #fff; font-size: 13px; font-weight: 400; background: var(--c); flex: none; }

/* Scene animations play each time a scene becomes active */
.scene.active .mini-row.in { animation: slide-in 0.6s var(--spring) backwards; animation-delay: calc(0.15s + var(--d) * 0.12s); }
@keyframes slide-in { from { opacity: 0; transform: translateY(-14px); } }
.scene.active[data-scene="0"] .mini-row.sel { animation: select 2.4s var(--spring) 0.6s both; }
@keyframes select { 0% { background: transparent; } 30%, 100% { background: rgba(0,0,0,0.065); } }

.code pre { margin: 6px 0 0; padding: 14px 18px; font: 15px/1.6 var(--mono); letter-spacing: 0; color: var(--ink); }
.code pre span { display: block; }
.scene.active .code pre span { animation: unfold 0.5s var(--spring) backwards; }
.scene.active .code pre span:nth-child(1) { animation-delay: 0.5s; }
.scene.active .code pre span:nth-child(2) { animation-delay: 0.62s; }
.scene.active .code pre span:nth-child(3) { animation-delay: 0.74s; }
.scene.active .code pre span:nth-child(4) { animation-delay: 0.86s; }
.scene.active .code pre span:nth-child(5) { animation-delay: 0.98s; }
@keyframes unfold {
  from { opacity: 0; transform: translateX(-10px); filter: blur(4px); }
  to { opacity: 1; transform: translateX(0); filter: blur(0); }
}
.code s { text-decoration: none; color: #c41a16; }
.code u { text-decoration: none; color: #0b4fbf; }

.convert .drop { display: grid; place-items: center; height: 92px; margin: 4px 4px 10px; border: 1.5px dashed var(--line); border-radius: 14px; }
.convert .file { padding: 8px 14px; font-size: 14px; font-weight: 600; background: var(--soft); border-radius: 10px; box-shadow: 0 6px 18px -8px rgba(0,0,0,0.3); }
.scene.active .convert .file { animation: drop-in 0.9s var(--spring) 0.2s backwards; }
@keyframes drop-in { from { opacity: 0; transform: translate(60px, -70px) rotate(8deg); } }
.scene.active .convert .drop { animation: drop-glow 0.9s ease 0.6s; }
@keyframes drop-glow { 50% { border-color: var(--accent); background: rgba(0,113,227,0.05); } }
.convert .done { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 7px 14px; font-size: 13px; font-weight: 600; color: #fff; background: #34c759; border-radius: 980px; opacity: 0; }
.scene.active .convert .done { animation: toast 3s var(--spring) 1.6s forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 10px); } 15%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

.tray { display: flex; justify-content: flex-end; background: linear-gradient(135deg, #e9edf5, #f7f7f9); }
.shelf { width: 230px; margin: 10px; padding: 10px; background: rgba(255,255,255,0.9); border-radius: 16px; box-shadow: 0 20px 50px -20px rgba(0,0,0,0.35); }
.scene.active .shelf { animation: shelf-in 0.8s var(--spring) 0.2s backwards; }
@keyframes shelf-in { from { transform: translateX(120%); } }
.shelf-head { font-size: 13px; font-weight: 650; padding: 4px 6px 10px; }
.shelf-head em { font-style: normal; color: var(--secondary); margin-left: 4px; }
.shelf-item { font-size: 13px; padding: 8px; border-radius: 8px; }
.scene.active .shelf-item { animation: slide-in 0.5s var(--spring) backwards; animation-delay: calc(0.7s + var(--d) * 0.15s); }
.shelf-all { margin-top: 8px; padding: 8px; text-align: center; font-size: 12px; font-weight: 600; color: var(--accent); background: rgba(0,113,227,0.1); border-radius: 8px; }

/* Developer (dark) */
.developer h2 { margin-bottom: 18px; }
.developer .intro { color: var(--inverse-secondary); font-size: 1.3rem; max-width: 36rem; margin: 0 0 56px; }
.dev-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.tile { padding: 34px; background: var(--dark-tile); border-radius: var(--radius-l); border: 1px solid var(--dark-line); }
.tile h3 { margin-bottom: 10px; }
.tile p { margin: 0; color: var(--inverse-secondary); }

/* Toolbox: one collapsible section per category, one tile per tool */
.tool-group { border-top: 1px solid var(--line); }
.tool-group:last-of-type { border-bottom: 1px solid var(--line); }
.tool-group summary {
  display: flex; align-items: baseline; gap: 16px;
  padding: 26px 4px; cursor: pointer; list-style: none;
}
.tool-group summary::-webkit-details-marker { display: none; }
.tool-group h3 { display: flex; align-items: baseline; gap: 10px; font-size: 1.5rem; flex: none; }
.tool-group h3 span { font-size: 15px; font-weight: 500; color: var(--secondary); letter-spacing: 0; }
.tool-group .peek {
  flex: 1; min-width: 0; font-style: normal; font-size: 15px; color: var(--secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity 0.25s;
}
.tool-group[open] .peek { opacity: 0; }
.tool-group .chev {
  flex: none; width: 10px; height: 10px; margin-right: 6px; align-self: center;
  border-right: 2px solid var(--secondary); border-bottom: 2px solid var(--secondary);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.35s var(--spring);
}
.tool-group[open] .chev { transform: rotate(-135deg) translateY(-3px); }
.tool-group summary:hover h3 { color: var(--accent); }
.tool-group .tool-grid { padding-bottom: 30px; }
.tool-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tool {
  display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 2px;
  padding: 18px; background: var(--soft); border-radius: var(--radius-m);
  transition: transform 0.35s var(--spring), background 0.25s;
}
.tool:hover { transform: translateY(-3px); background: #ececf0; }
.tool .ic {
  grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  font: 600 14px/1 var(--text); letter-spacing: 0; color: #fff; background: var(--c);
}
.tool strong { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.tool span { font-size: 14px; line-height: 1.35; color: var(--secondary); }

.privacy p, .faq p { color: var(--secondary); font-size: 1.15rem; }

/* Lifetime */
.price-tile { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; padding: 40px; border-radius: var(--radius-l); background: var(--soft); }
.price-tile h3 { margin-bottom: 8px; }
.price-tile p { color: var(--secondary); margin: 0 0 22px; }
.waitlist { display: flex; flex-direction: column; gap: 10px; }
.waitlist input { padding: 12px 16px; font: 17px var(--text); color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.status { min-height: 1.4em; font-size: 15px; margin: 10px 0 0 !important; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 20px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.1rem; list-style: none; display: flex; justify-content: space-between; gap: 20px; }
.faq summary::after { content: "+"; font-weight: 400; color: var(--secondary); transition: transform 0.3s var(--spring); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 12px 0 0; font-size: 1.02rem; }
.faq details[open] p { animation: unfold 0.4s var(--spring); }

/* Closing */
.closing { text-align: center; padding: 140px 0; }
.closing-keys { font-size: 3rem; margin: 0 0 18px; }
.closing h2 { margin-bottom: 30px; }

.foot { border-top: 1px solid var(--line); background: var(--soft); }
.foot-inner { display: flex; align-items: center; gap: 24px; max-width: 1080px; margin: 0 auto; padding: 22px; font-size: 13px; color: var(--secondary); }
.foot-inner span { display: flex; align-items: center; gap: 6px; margin-right: auto; color: var(--ink); font-weight: 600; }
.foot-inner a { color: var(--secondary); }

.privacy-policy { padding: 72px 22px 96px; }
.privacy-policy h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); margin-bottom: 8px; }
.privacy-policy h2 { font-size: 1.4rem; margin: 40px 0 10px; }
.privacy-policy p { color: var(--secondary); margin: 0; }

/* Scroll reveal (set up by app.js only when motion is allowed) */
/* Entrances are played from app.js with the Web Animations API, so content is visible if they never run. */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 48px; padding: 56px 22px 80px; }
  .scene { grid-template-columns: 1fr; gap: 28px; }
  .scenes { min-height: 640px; }
  .dev-grid, .price-tile { grid-template-columns: 1fr; }
  .top nav a:not(.nav-cta) { display: none; }
  section { padding: 80px 0; }
}
@media (max-width: 560px) {
  .tool-group .peek { display: none; }
  #results { height: 250px; }
  .price-tile { padding: 26px; }
}
