:root {
  --bg: #0c0907;
  --orange: #fcb057;
  --ember: #d9591f;
  --text: #f6ede3;
  --muted: #a89b8d;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-line: rgba(255, 255, 255, 0.12);
  --head: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

/* ---------- Background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; will-change: transform; filter: blur(60px); }
.b1 {
  width: 52vmax; height: 52vmax; left: -14vmax; top: -18vmax; opacity: .5;
  background: radial-gradient(circle, var(--orange) 0%, rgba(252, 176, 87, 0) 66%);
}
.b2 {
  width: 46vmax; height: 46vmax; right: -16vmax; bottom: -20vmax; opacity: .42;
  background: radial-gradient(circle, var(--ember) 0%, rgba(217, 89, 31, 0) 66%);
}
.b3 { /* follows the cursor */
  width: 30vmax; height: 30vmax; left: 0; top: 0; opacity: .24;
  background: radial-gradient(circle, #ffd7a1 0%, rgba(255, 215, 161, 0) 64%);
}

/* ---------- Glass ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 24px 60px -24px rgba(0, 0, 0, .7);
}

/* ---------- Navbar ---------- */
.nav-wrap {
  position: fixed; top: 16px; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: center; padding: 0 16px;
}
.nav {
  width: min(1080px, 100%);
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 8px 8px 16px; border-radius: 18px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--head); font-weight: 800; font-size: 1.2rem;
  letter-spacing: -.01em; text-decoration: none;
}
.brand img { width: 28px; height: 28px; border-radius: 7px; object-fit: contain; }
.nav-links { display: flex; gap: 4px; }
.nav-link {
  padding: 9px 16px; border-radius: 12px;
  color: var(--muted); font-weight: 600; font-size: .92rem; text-decoration: none;
  transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.nav-link.active { color: var(--orange); background: rgba(252, 176, 87, .13); }

/* ---------- Stage ---------- */
.stage {
  min-height: 100svh;
  width: min(1080px, 100%); margin: 0 auto;
  padding: 110px 24px 56px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: center; gap: clamp(24px, 5vw, 72px);
}

/* ---------- 3D logo ---------- */
.logo-col { display: flex; justify-content: center; }
.scene {
  position: relative; width: clamp(220px, 34vw, 420px); aspect-ratio: 1;
  perspective: 1200px;
}
.glow {
  position: absolute; inset: 8%; border-radius: 50%;
  background: radial-gradient(circle, rgba(252, 176, 87, .5), rgba(252, 176, 87, 0) 70%);
  filter: blur(40px);
}
.float, .tilt, .sway { position: absolute; inset: 0; transform-style: preserve-3d; }
.float { animation: float 6s ease-in-out infinite; }
.tilt { will-change: transform; }
.sway { animation: sway 7s ease-in-out infinite; }
.layer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; backface-visibility: visible; user-select: none; -webkit-user-drag: none;
}
.layer.depth { filter: brightness(.32) sepia(1) saturate(3.2) hue-rotate(-8deg); }
.layer.front { filter: drop-shadow(0 18px 36px rgba(252, 176, 87, .28)); }

@keyframes sway {
  0%, 100% { transform: rotateY(-28deg) rotateX(7deg) rotateZ(-2deg); }
  50%      { transform: rotateY(28deg)  rotateX(-4deg) rotateZ(2deg); }
}
@keyframes float {
  0%, 100% { transform: translateY(-6px); }
  50%      { transform: translateY(8px); }
}

/* ---------- Content ---------- */
.view[hidden] { display: none; }
.view.enter { animation: enter .55s cubic-bezier(.2, .7, .2, 1); }
@keyframes enter {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: none; }
}

.title {
  font-family: var(--head); font-weight: 800;
  font-size: clamp(3.2rem, 8.5vw, 6.2rem);
  line-height: .95; letter-spacing: -.035em;
  background: linear-gradient(180deg, #ffffff 10%, #ffdcae 62%, var(--orange) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  padding-bottom: .08em;
}
.subtitle {
  margin-top: 18px; max-width: 26ch;
  color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.45; font-weight: 600;
}
.actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 26px; border-radius: 14px;
  font: 700 .98rem var(--body); text-decoration: none; color: var(--text);
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn.glass:hover { background: rgba(255, 255, 255, .1); }
.btn.primary {
  color: #2a1608;
  background: linear-gradient(180deg, #ffc983, var(--orange));
  box-shadow: 0 10px 30px -8px rgba(252, 176, 87, .6), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn.primary:hover { box-shadow: 0 14px 38px -8px rgba(252, 176, 87, .8), inset 0 1px 0 rgba(255, 255, 255, .5); }

/* ---------- Code card ---------- */
.code { margin-top: 28px; max-width: 640px; border-radius: 18px; overflow: hidden; }
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 8px 8px 18px;
  border-bottom: 1px solid var(--glass-line);
  color: var(--muted); font: 500 .8rem var(--mono);
}
.copy {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 10px; cursor: pointer;
  color: var(--text); background: rgba(255, 255, 255, .07);
  border: 1px solid var(--glass-line); font: 700 .82rem var(--body);
  transition: background .2s, color .2s, border-color .2s;
}
.copy:hover { background: rgba(255, 255, 255, .13); }
.copy.done { color: #1d1206; background: var(--orange); border-color: var(--orange); }
.code pre {
  padding: 20px 20px 22px; overflow-x: auto;
  font: 500 .92rem/1.6 var(--mono); white-space: pre;
}
.fn { color: #fcb057; }
.gl { color: #ff8f6b; }
.m  { color: #8fd6cb; }
.s  { color: #b9dc92; }
.p  { color: #9d9184; }

/* ---------- Protected script landing page ---------- */
.lead {
  margin-top: 20px; max-width: 34ch;
  color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.5; font-weight: 600;
}
.warn {
  margin-top: 14px;
  font-family: var(--head); font-weight: 800; letter-spacing: -.01em;
  font-size: clamp(1.3rem, 2.8vw, 1.8rem);
  color: var(--orange);
  text-shadow: 0 0 28px rgba(252, 176, 87, .35);
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .stage { grid-template-columns: 1fr; text-align: center; padding-top: 100px; gap: 12px; }
  .scene { width: clamp(200px, 56vw, 300px); }
  .subtitle { margin-inline: auto; }
  .actions { justify-content: center; }
  .code { text-align: left; margin-inline: auto; }
  .nav-link { padding: 8px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .sway, .float { animation: none; }
  .sway { transform: rotateY(-18deg) rotateX(4deg); }
  .view.enter { animation: none; }
}
