:root {
  --bg: #07090d;
  --fg: #e8edf5;
  --muted: #8b95a7;
  --line: rgba(255, 255, 255, 0.09);
  --card: rgba(13, 17, 23, 0.72);
  --accent: #5eead4;
  --accent-2: #818cf8;
  --warn: #fbbf24;
  --glow: rgba(94, 234, 212, 0.14);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5f7fb;
  --fg: #0c1220;
  --muted: #566074;
  --line: rgba(12, 18, 32, 0.12);
  --card: rgba(255, 255, 255, 0.78);
  --accent: #0d9488;
  --accent-2: #4f46e5;
  --warn: #b45309;
  --glow: rgba(13, 148, 136, 0.14);
  --shadow: 0 24px 60px rgba(12, 18, 32, 0.14);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f7fb;
    --fg: #0c1220;
    --muted: #566074;
    --line: rgba(12, 18, 32, 0.12);
    --card: rgba(255, 255, 255, 0.78);
    --accent: #0d9488;
    --accent-2: #4f46e5;
    --warn: #b45309;
    --glow: rgba(13, 148, 136, 0.14);
    --shadow: 0 24px 60px rgba(12, 18, 32, 0.14);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

#net { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  opacity: 0.55;
}
.spot {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 30%), var(--glow), transparent 65%);
}

.shell {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  max-width: 1240px; margin: 0 auto;
}

.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; font-size: 17px; }
.brand img { border-radius: 9px; }
.bar-right { display: flex; align-items: center; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 0 var(--warn); animation: ping 2.2s ease-out infinite; }
.theme {
  width: 38px; height: 38px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--card);
  color: var(--fg); cursor: pointer; transition: transform 0.25s var(--ease), border-color 0.2s ease;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.theme:hover { transform: scale(1.07); border-color: var(--muted); }
.theme:active { transform: scale(0.94); }
.theme svg { width: 18px; height: 18px; }
#theme:hover { transform: rotate(18deg) scale(1.06); }
#motion .i-play { display: none; }
.paused #motion .i-pause { display: none; }
.paused #motion .i-play { display: block; }

.stage {
  flex: 1; display: grid; align-items: center; gap: clamp(28px, 5vw, 64px);
  grid-template-columns: 1fr; padding: clamp(18px, 4vh, 40px) 0;
}
.hero { position: relative; isolation: isolate; container-type: inline-size; }
.hero::before {
  content: ""; position: absolute; inset: -48px -12px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, var(--bg) 35%, transparent 100%);
  opacity: 0.82;
}
.kicker { margin: 0 0 14px; font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.word {
  margin: 0 0 14px;
  font-size: clamp(30px, 8.6vw, 92px);
  font-size: clamp(28px, 13.6cqw, 112px);
  white-space: nowrap;
  line-height: 1; letter-spacing: -0.045em; font-weight: 800;
  background: linear-gradient(100deg, var(--fg) 8%, var(--accent) 52%, var(--accent-2) 92%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: sheen 9s ease-in-out infinite alternate;
  font-variant-numeric: tabular-nums;
  min-height: 1em;
  padding-bottom: 0.14em;
  margin-bottom: 4px;
}
.lead { margin: 0 0 26px; max-width: 34em; color: var(--muted); font-size: clamp(16px, 2.1vw, 19px); }

.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 15px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s ease, background 0.2s ease, border-color 0.2s ease;
  will-change: transform;
}
.btn svg { width: 18px; height: 18px; transition: transform 0.3s var(--ease); }
.btn.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); box-shadow: 0 8px 24px var(--glow); }
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px var(--glow); }
.btn.primary:hover svg { transform: translateX(4px); }
.btn.ghost { background: var(--card); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.btn.ghost:hover { transform: translateY(-2px); border-color: var(--muted); }
.btn.icon { width: 48px; padding: 0; background: var(--card); }
.btn.icon svg { width: 20px; height: 20px; }
.btn.icon:hover { transform: translateY(-2px) rotate(-6deg); border-color: var(--muted); }
.btn:active { transform: scale(0.97); }

  position: relative; width: 100%; max-width: 520px; justify-self: center;
  border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  background: var(--card); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  -webkit-user-select: none; user-select: none;
}








.foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding-top: 14px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px;
}
.clock { font-family: var(--mono); font-variant-numeric: tabular-nums; margin-left: auto; }

.rise { animation: rise 0.9s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 110ms + 80ms); }
[data-i="0"] { --i: 0; } [data-i="1"] { --i: 1; } [data-i="2"] { --i: 2; }
[data-i="3"] { --i: 3; } [data-i="4"] { --i: 4; } [data-i="5"] { --i: 5; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warn) 55%, transparent); } 80%, 100% { box-shadow: 0 0 0 10px transparent; } }
@keyframes sheen { to { background-position: 100% 0; } }

.stage3d {
  position: relative; width: 100%; max-width: 520px; justify-self: center;
  -webkit-user-select: none; user-select: none;
}
.stage3d:focus-visible { outline-offset: 6px; border-radius: 22px; }
.stage-art { position: relative; width: 100%; aspect-ratio: 1; line-height: 0; }
#pet-canvas, .stage-poster { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#pet-canvas { opacity: 0; transition: opacity 0.5s ease; touch-action: pan-y; cursor: grab; }
#pet-canvas:active { cursor: grabbing; }
.stage-poster { object-fit: contain; pointer-events: none; transition: opacity 0.5s ease; }
.stage-art.ready #pet-canvas { opacity: 1; }
.stage-art.ready .stage-poster { opacity: 0; }
.stage3d.static .stage-poster { opacity: 1; }
.stage-meta { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.stage-meta strong { color: var(--fg); font-weight: 700; }
.stage-meta span::before { content: "\00b7"; margin-right: 8px; }
.stage-hint { font-size: 12px; }

@media (min-width: 940px) {
  .stage { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
  .hero::before { inset: -48px -64px; }
}
@media (max-width: 560px) {
  .shell { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .pill { padding: 6px 11px; font-size: 12px; }
  .brand span { font-size: 16px; }
  .btn { flex: 1 1 auto; }
  .btn.primary { flex: 1 1 100%; }
  .btn.icon { flex: 0 0 48px; }
  .clock { margin-left: 0; width: 100%; }
}
@media (max-width: 400px) {
  .brand span { display: none; }
}
@media (max-width: 340px) {
  .pill { display: none; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .stage { padding: 8px 0; }
  .word { font-size: min(13.6cqw, 22vh); }
}

.paused *, .paused *::before, .paused *::after { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
