:root {
  --bg: #081c20;
  --panel: #0e262b;
  --panel-2: #12313a;
  --white: #f4f4ef;
  --muted: #a4b5b7;
  --line: rgba(177, 204, 205, .19);
  --accent: #f28a54;
  --accent-ink: #1a0d06;
  --glow: rgba(242, 138, 84, .55);
  --radius-lg: 28px;
  --radius-md: 14px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -10%, #0f3138 0%, transparent 60%),
    var(--bg);
  color: var(--white);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Language ---------- */
.topbar { position: absolute; top: 16px; right: 16px; z-index: 30; }
.lang {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 80%, transparent);
}
.lang button {
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .02em;
  min-width: 44px; min-height: 32px; padding: 0 12px;
  border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.lang button:hover { color: var(--white); }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---------- Hero ---------- */
.hero {
  width: min(1280px, 100% - 32px);
  margin: 0 auto;
  padding: clamp(72px, 12vh, 120px) 0 clamp(36px, 6vh, 56px);
  text-align: center;
}
.wordmark {
  margin: 0; font-weight: 600;
  font-size: clamp(52px, 11vw, 112px);
  line-height: .9; letter-spacing: -.06em;
}
.dot { color: var(--accent); }
.lede {
  margin: 22px auto 0; max-width: 22ch;
  font-size: clamp(22px, 3.6vw, 34px);
  font-weight: 600; line-height: 1.22; letter-spacing: -.025em;
}
.lede mark {
  background: var(--accent); color: var(--accent-ink);
  padding: .02em .32em .08em; border-radius: .45em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.hero-demos {
  display: grid;
  grid-template-columns: 240px minmax(0, 400px) 240px;
  gap: 0 12px;
  justify-content: center;
  align-items: center;
  margin-top: clamp(20px, 4vh, 36px);
}
.hero-demos > * { display: grid; place-items: center; min-height: 136px; }
.hero-beadbar { padding: 0 8px; }
.hero-beadbar > .yl-bn { width: 100%; }
/* stacked hero (tablet / phone): equal gaps between the three demos */
@media (max-width: 900px) {
  .hero-demos { grid-template-columns: minmax(0, 420px); row-gap: 28px; margin-top: 28px; }
  .hero-demos > * { min-height: 0; }
  .hero-demos .yl-tilt-zone, .hero-demos .yl-magnet-zone { padding: 0 40px; }
  .hero-beadbar > .yl-bn { margin-top: 22px; } /* = half the bead, so the bead's top lines up */
  .hero .hint { margin-top: 34px; }
}
.hint { margin: 4px 0 0; color: var(--muted); font-size: 15px; }

/* ---------- Strip (content comes from the "marquee" snippet) ---------- */
.strip { position: relative; }

/* ---------- Sections nav ---------- */
.sections-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 14px 16px;
  background: linear-gradient(var(--bg) 60%, transparent);
}
.sections-pill {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 85%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.sections-pill a {
  display: grid;
  place-items: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: background .3s, color .3s;
}
.sections-pill a:hover { color: var(--white); }
.sections-pill a.is-active { background: var(--accent); color: var(--accent-ink); }
.sections-pill::-webkit-scrollbar { display: none; }
@media (max-width: 480px) { .sections-pill a { padding: 0 12px; font-size: 14px; } }

/* ---------- Page & sections ---------- */
.page {
  width: min(1280px, 100% - 32px);
  margin: 0 auto;
  padding: 8px 0 40px;
  display: flex; flex-direction: column;
  gap: clamp(48px, 8vh, 80px);
}
.section[hidden] { display: none; }
.section { min-height: 70vh; animation: page-in .35s ease; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .section { animation: none; } }
.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 18px;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1;
}
.count { color: var(--accent); font-size: .45em; letter-spacing: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  align-items: start;
}
.card {
  position: relative;
  min-width: 0;
  padding: 18px 20px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel) 0%, color-mix(in srgb, var(--panel) 60%, var(--bg)) 100%);
}
.num { position: absolute; top: 16px; left: 20px; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
.demo {
  min-height: 170px;
  display: grid; place-items: center;
  margin-bottom: 12px;
}
.screen {
  width: 100%;
  height: 270px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  border-radius: 30px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.035) 0 28%, transparent 28%) ,
    var(--bg);
  overflow: hidden;
}
.screen.top { justify-content: flex-start; padding-top: 22px; }
.screen-lines { display: grid; gap: 8px; margin: auto 6px 16px; }
.screen.top .screen-lines { margin: 20px 6px auto; }
.screen-lines i { display: block; height: 10px; border-radius: 6px; background: rgba(177, 204, 205, .1); }
.screen-lines i:nth-child(2) { width: 70%; }
.screen-lines i:nth-child(3) { width: 85%; }

.demo-wide { display: block; place-items: normal; margin-inline: -20px; overflow: hidden; }
.demo-wide > * { margin-top: 56px; }

.card h3 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.card p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }

/* ---------- Code panel ---------- */
.code { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.code summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: border-color .2s, color .2s;
}
.code summary::-webkit-details-marker { display: none; }
.code summary:hover { border-color: var(--accent); color: var(--accent); }
.code summary .chev { transition: transform .25s; }
.code[open] summary .chev { transform: rotate(180deg); }
.code-body { margin-top: 12px; }
.code-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.code-tab {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 13px/1 var(--font);
  cursor: pointer;
}
.code-tab:hover { color: var(--white); }
.code-tab[aria-selected="true"] { background: var(--panel-2); color: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
.copy {
  margin-left: auto;
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 13px/1 var(--font);
  cursor: pointer;
  transition: background .2s;
}
.copy.is-done { background: #8fd6a6; }
.code pre {
  margin: 0;
  max-height: 340px;
  overflow: auto;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #051417;
  border: 1px solid var(--line);
  font: 12.5px/1.6 var(--mono);
  color: #d6e2e3;
  tab-size: 2;
}
.code pre code { white-space: pre; }

.foot { text-align: center; color: var(--muted); font-size: 14px; }
.foot a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.foot a:hover { color: var(--white); border-color: var(--accent); }

