:root {
  --bg: #0b0b0b;
  --grid: rgba(255, 255, 255, .05);
  --mono: rgba(255, 255, 255, .52);
  --corner: #1c1c1c;
  --corner-ink: #e9e9e9;
  --orange: #ff6a1a;
  --accent-ink: #ff6a1a; /* orange used for text; deeper in light mode */
  --ink: #121212;
  --fg: #f1f1ef;
  --fg2: rgba(241, 241, 239, .62);
  --line: rgba(255, 255, 255, .1);
  --panel: #141414;
  --muted: #7d7d7d;
  --card: #fff;
  --s: 1;
}
[data-theme="light"] {
  --bg: #edece8;
  --grid: rgba(0, 0, 0, .06);
  --mono: rgba(0, 0, 0, .58);
  --corner: #fff;
  --corner-ink: #151515;
  --fg: #121212;
  --fg2: rgba(18, 18, 18, .62);
  --line: rgba(0, 0, 0, .1);
  --panel: #fff;
  --accent-ink: #a13c06;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-padding-top: 20px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  overflow-x: clip;
  transition: background .6s, color .6s;
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* ---------- background ---------- */
.bg { position: fixed; inset: 0; pointer-events: none; }
.grid {
  position: absolute; inset: -80px;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 80px 80px;
  animation: drift 30s linear infinite;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, #000 40%, transparent 100%);
  opacity: 0;
  transition: opacity 1.4s;
}
body.ready .grid { opacity: 1; }
@keyframes drift { to { transform: translate(80px, 80px); } }
.spot {
  position: absolute; inset: 0;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 106, 26, .07), transparent 60%);
}
.scan {
  position: absolute; left: 0; right: 0; height: 160px; top: -160px;
  background: linear-gradient(transparent, rgba(255, 106, 26, .035), transparent);
  animation: scan 9s linear infinite 2s;
}
@keyframes scan { to { top: 110%; } }

/* ---------- corners ---------- */
.corner {
  position: relative; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--corner); color: var(--corner-ink);
  display: grid; place-items: center;
  transition: transform .5s cubic-bezier(.3, 1.6, .5, 1), background .6s;
  opacity: 0; animation: fadeIn .6s .2s forwards;
}
.corner:hover { transform: scale(1.1); }
.corner svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.corner .moon { fill: none; }
.corner .sun { display: none; }
[data-theme="light"] .corner .moon { display: none; }
[data-theme="light"] .corner .sun { display: block; }
#theme.flip svg { animation: spinIn .6s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes spinIn { from { transform: rotate(-120deg) scale(.4); opacity: 0; } }
body.focus #focus { transform: rotate(135deg); }
@keyframes fadeIn { to { opacity: 1; } }

/* ---------- stage ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; }
.stage {
  position: absolute; left: 50%; top: 50%;
  width: 1280px; height: 800px;
  transform: translate(-50%, -50%) scale(var(--s));
}
.w { position: absolute; will-change: transform; }

.pop { opacity: 0; }
body.ready .pop { animation: pop .9s cubic-bezier(.2, 1.35, .4, 1) var(--d, 0s) both; }
@keyframes pop {
  from { opacity: 0; transform: translateY(26px) scale(.7) rotate(-4deg); filter: blur(6px); }
  60% { filter: blur(0); }
  to { opacity: 1; transform: none; filter: none; }
}
.fl { animation: float var(--fd, 6s) ease-in-out var(--fdl, 0s) infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-9px) rotate(.4deg); }
}

/* ---------- cards ---------- */
.card {
  display: block;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, .38), 0 2px 6px rgba(0, 0, 0, .18);
  transition: transform .45s cubic-bezier(.3, 1.5, .5, 1), box-shadow .45s;
}
.card:hover { transform: translateY(-5px) scale(1.025); box-shadow: 0 34px 60px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .18); }
[data-theme="light"] .card { box-shadow: 0 22px 44px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .08); }
.round { border-radius: 50%; display: grid; place-items: center; }
.ttl { font-size: 13px; font-weight: 500; letter-spacing: -.1px; display: flex; align-items: center; gap: 6px; }
.ttl.row { justify-content: space-between; }
.arw { display: inline-block; transition: transform .35s; }
.card:hover .arw { transform: translateX(5px); }
.who { display: flex; align-items: center; gap: 10px; }
.who small { display: block; font-size: 10.5px; color: var(--muted); }
.who b { display: block; font-size: 10.5px; font-weight: 500; }
.ava {
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex: none;
  background: radial-gradient(circle at 40% 30%, #e9e9e9, #9a9a9a);
}
.ava svg { width: 100%; height: 100%; fill: #161616; display: block; }
.ava.dark { background: radial-gradient(circle at 40% 30%, #ffb07e, #e2560e); }

/* labels */
.lbl { font-size: 8.5px; letter-spacing: .6px; color: var(--mono); white-space: pre; }
.l1 { left: 794px; top: 160px; }
.l2 { left: 299px; top: 495px; }
.l3 { left: 944px; top: 624px; }

/* stack */
.stack-w { left: 418px; top: 186px; width: 430px; height: 430px; perspective: 1200px; }
.stack { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .3s ease-out; }
.sheet {
  position: absolute; border-radius: 24px;
  width: 390px; height: 395px; left: 27px; top: 19px;
  background: linear-gradient(160deg, #dcdee1, #b5b8bd 75%, #a9acb1);
  box-shadow: 0 40px 80px rgba(0, 0, 0, .5);
  transition: transform .8s cubic-bezier(.3, 1.3, .4, 1);
}
.s2 { background: #9da0a5; transform: translate(-11px, -9px) rotate(-1.2deg); box-shadow: none; }
.s3 { background: #7d8085; transform: translate(-20px, -16px) rotate(-2.2deg); box-shadow: none; }
.s1 { overflow: hidden; }
.sheen {
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: sheen 7s ease-in-out 2.4s infinite;
}
@keyframes sheen { 0% { transform: translateX(-120%); } 30%, 100% { transform: translateX(120%); } }
.stack.shuffle .s1 { animation: shuffle .9s cubic-bezier(.5, 0, .3, 1); }
.stack.shuffle .s2 { animation: lift2 .9s cubic-bezier(.5, 0, .3, 1); }
@keyframes shuffle {
  0% { transform: none; }
  40% { transform: translate(-150px, 30px) rotate(-12deg); }
  41% { z-index: -1; }
  100% { transform: none; }
}
@keyframes lift2 { 50% { transform: translate(0, 0) rotate(0); } }

#device { left: 360px; top: 140px; width: 560px; height: 500px; cursor: default; }
#device.hover { cursor: pointer; }

/* ring loader */
.ring-w { left: 352px; top: 232px; }
.ring { width: 48px; height: 48px; }
.ring svg { width: 30px; height: 30px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.6; }
.ring .trk { stroke: #e6e6e6; }
.ring .arc { stroke: var(--orange); stroke-linecap: round; stroke-dasharray: 8 100; transition: stroke-dasharray .12s; }

/* studio quality */
.quality-w { left: 299px; top: 320px; }
.quality { width: 181px; height: 150px; padding: 18px 18px 16px; display: flex; flex-direction: column; justify-content: space-between; }
.big { font-size: 46px; font-weight: 700; letter-spacing: -2px; line-height: 1; height: 1em; }
.odo { display: flex; overflow: hidden; }
.dg { display: block; height: 1em; overflow: hidden; }
.col { display: flex; flex-direction: column; transition: transform 1.3s cubic-bezier(.2, 1.2, .3, 1); }
.col i { font-style: normal; height: 1em; line-height: 1; }

/* NEW */
.new-w { left: 616px; top: 199px; z-index: 3; }
.newpill {
  position: relative; overflow: hidden;
  background: var(--orange); color: #fff; font-weight: 700; font-size: 10px; letter-spacing: .4px;
  padding: 8px 14px; border-radius: 999px;
  box-shadow: 0 8px 22px rgba(255, 106, 26, .45);
}
.newpill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .7) 50%, transparent 70%);
  transform: translateX(-120%); animation: sheen 3.2s ease-in-out infinite 1.8s;
}
.newpill.bump { animation: bump .6s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bump { 30% { transform: scale(1.3) rotate(-6deg); } }

/* channels */
.channels-w { left: 700px; top: 190px; z-index: 2; }
.channels { width: 151px; height: 166px; padding: 14px 15px; }
.channels .ttl { font-size: 10.5px; }
.dots { font-size: 9px; letter-spacing: 1px; padding: 2px 0 2px 6px; transition: transform .3s; }
.dots:hover { transform: rotate(90deg); }
.gauge { width: 112px; display: block; margin: 16px auto 0; overflow: visible; }
.gauge path { fill: none; stroke-width: 16; stroke-linecap: round; }
.g-bg { stroke: #e2e2e2; }
.g-val { stroke: #2e2e2e; stroke-dasharray: 0 100; transition: stroke-dasharray 1s cubic-bezier(.3, 1.3, .5, 1); }
.needle { transform-origin: 60px 60px; transform: rotate(-90deg); transition: transform 1.1s cubic-bezier(.3, 1.6, .4, 1); }
.needle line { stroke: #111; stroke-width: 2.6; stroke-linecap: round; }
.needle circle { fill: #111; }
.scale { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 2px 0; font-size: 9px; }
.scale b { font-size: 17px; font-weight: 700; }

/* live dot */
.live-w { left: 846px; top: 384px; z-index: 4; }
.live { width: 36px; height: 36px; position: relative; }
.live i { width: 18px; height: 18px; border-radius: 50%; background: #17c25b; display: block; box-shadow: 0 0 0 0 rgba(23, 194, 91, .6); }
.live.beat i { animation: beat .5s ease-out; }
@keyframes beat { from { box-shadow: 0 0 0 0 rgba(23, 194, 91, .7); transform: scale(1.25); } to { box-shadow: 0 0 0 14px rgba(23, 194, 91, 0); transform: scale(1); } }

/* ai performance */
.ai-w { left: 792px; top: 408px; z-index: 1; }
.ai { width: 196px; height: 190px; padding: 18px 18px 16px; background: var(--orange); color: #1a1a1a; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 24px 60px rgba(255, 106, 26, .28), 0 2px 6px rgba(0, 0, 0, .2); }
.ai .who small { color: #3a1a08; }
.bars { height: 72px; display: flex; align-items: flex-end; justify-content: flex-end; gap: 5px; padding-right: 2px; }
.bars i { width: 7px; height: 20%; background: #141414; border-radius: 4px; display: block; }

/* cpu */
.cpu-w { left: 716px; top: 461px; z-index: 3; }
.glass {
  background: rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, .7);
}
.cpu { width: 150px; height: 69px; border-radius: 10px; padding: 11px 12px; font-size: 10.5px; }
.cpu .row { display: flex; justify-content: space-between; }
.pct { color: var(--orange); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.track { height: 5px; border-radius: 9px; background: rgba(0, 0, 0, .1); margin: 8px 0 7px; overflow: hidden; }
.track i { display: block; height: 100%; width: 0; background: var(--orange); border-radius: 9px; transition: width .7s cubic-bezier(.3, 1.3, .5, 1); }
.ok { display: flex; align-items: center; gap: 5px; font-size: 9.5px; }
.ok i { width: 5px; height: 5px; border-radius: 50%; background: #17c25b; animation: blink 1.6s infinite; }
.ok.hot i { background: var(--orange); }
@keyframes blink { 50% { opacity: .3; } }

/* ready */
.ready-w { left: 412px; top: 522px; z-index: 3; }
.ready { display: flex; align-items: center; gap: 8px; padding: 9px 11px 9px 10px; border-radius: 11px; text-align: left; }
.chk { width: 23px; height: 23px; border-radius: 50%; background: var(--orange); display: grid; place-items: center; transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.chk svg { width: 15px; height: 15px; }
.tick { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .5s .2s; }
body.ready .tick { stroke-dashoffset: 0; transition-delay: 1.6s; }
.pause { fill: #fff; opacity: 0; transform-origin: 12px 12px; transform: scale(.3); transition: .35s; }
.ready.on .tick { opacity: 0; }
.ready.on .pause { opacity: 1; transform: none; }
.ready.on .chk { animation: throb calc(60s / var(--bpm, 112)) ease-in-out infinite; }
@keyframes throb { 0% { transform: scale(1.18); box-shadow: 0 0 0 0 rgba(255, 106, 26, .5); } 100% { transform: scale(1); box-shadow: 0 0 0 10px rgba(255, 106, 26, 0); } }
.rt b { display: block; font-size: 10.5px; font-weight: 600; }
.rt small { display: block; font-size: 10px; color: #2a2a2a; }

/* target */
.target-w { left: 643px; top: 556px; z-index: 3; }
.target { width: 56px; height: 56px; border-radius: 50%; border: 2.5px solid var(--orange); position: relative; display: grid; place-items: center; transition: transform .3s cubic-bezier(.3, 1.8, .5, 1); }
.target:hover { transform: scale(1.12); }
.target:active { transform: scale(.9); }
.target > i { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); display: block; }
.rip { position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--orange); animation: rip .9s ease-out forwards; pointer-events: none; }
@keyframes rip { to { transform: scale(2.1); opacity: 0; } }

/* pages */
.pages-w { left: 357px; top: 592px; z-index: 2; }
.pages { display: flex; align-items: center; gap: 7px; padding: 11px 12px; border-radius: 14px; }
.nums { position: relative; display: flex; gap: 7px; }
.pg { width: 36px; height: 36px; border-radius: 9px; font-size: 13px; font-weight: 500; color: #555; position: relative; z-index: 1; transition: color .35s, background .3s; }
.pg.n { background: #e4e4e4; }
.pg.n.on { color: #fff; background: transparent; }
.pg.arrow { background: #f1f1f1; width: 30px; }
.pg.arrow:hover { background: #e2e2e2; }
.pg.n:hover:not(.on) { background: #d6d6d6; }
.pg svg { width: 14px; height: 14px; fill: none; stroke: #444; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; margin: auto; }
.ind { position: absolute; top: 0; left: 0; width: 36px; height: 36px; border-radius: 9px; background: #0d0d0d; z-index: 0; transition: transform .55s cubic-bezier(.3, 1.4, .4, 1); }

.hint {
  position: absolute; bottom: 14px; left: 0; right: 0; text-align: center;
  font-size: 9px; letter-spacing: 1.5px; color: var(--mono);
  opacity: 0; transition: opacity 1s 2.4s;
}
body.ready .hint { opacity: 1; }

/* ---------- phone: portrait stage ---------- */
@media (max-width: 720px) {
  .stage { width: 430px; height: 900px; }
  .l1 { left: 22px; top: 92px; }
  .l2 { left: 22px; top: 700px; }
  .l3 { left: 318px; top: 846px; }
  .stack-w { left: 0; top: 230px; transform-origin: 0 0; }
  .stack { --ss: .86; transform-origin: 215px 0; }
  #device { left: -40px; top: 196px; width: 510px; height: 440px; }
  .ring-w { left: 196px; top: 104px; }
  .quality-w { left: 14px; top: 110px; }
  .new-w { left: 196px; top: 222px; }
  .channels-w { left: 265px; top: 70px; }
  .live-w { left: 378px; top: 586px; }
  .ai-w { left: 220px; top: 610px; }
  .cpu-w { left: 120px; top: 666px; }
  .ready-w { left: 18px; top: 612px; }
  .target-w { left: 46px; top: 732px; }
  .pages-w { left: 85px; top: 818px; }
  .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fl, .scan, .grid, .sheen, .newpill::after { animation: none !important; }
}
