:root {
  --bg: #060606;
  --bg2: #0c0c0c;
  --ink: #f2f0ea;
  --muted: #8a877f;
  --dim: #4a4843;
  --line: #1e1c1a;
  --accent: #ff5c1a;
  --accent2: #3b6cff;
  --card: #101010;
  --pill: #f2f0ea;
  --display: 'Anton', Impact, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, sans-serif;
}

[data-theme="light"] {
  --bg: #f2f0ea;
  --bg2: #e9e6de;
  --ink: #111110;
  --muted: #6e6b66;
  --dim: #b9b5ac;
  --line: #d8d4ca;
  --card: #ffffff;
  --pill: #111110;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  cursor: none;
  -webkit-font-smoothing: antialiased;
}
a, button { cursor: none; font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* backdrop layers */
#dust { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .8; }
.glow { position: fixed; z-index: 0; pointer-events: none; filter: blur(90px); opacity: .7; }
.glow-a { width: 52vw; height: 52vw; right: -12vw; top: -14vw; background: radial-gradient(circle, rgba(255,92,26,.45), transparent 65%); }
.glow-b { width: 44vw; height: 44vw; right: -6vw; bottom: -16vw; background: radial-gradient(circle, rgba(59,108,255,.4), transparent 65%); }
[data-theme="light"] .glow { opacity: .25; }
.grain {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: .13;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* cursor */
#cursor-dot, #cursor-ring { position: fixed; top: 0; left: 0; z-index: 50; pointer-events: none; border-radius: 50%; will-change: transform; }
#cursor-dot { width: 6px; height: 6px; background: var(--ink); transform: translate(-50%, -50%); }
#cursor-ring {
  width: 34px; height: 34px; border: 1px solid var(--muted);
  transform: translate(-50%, -50%);
  transition: width .18s, height .18s, border-color .18s, background .18s;
}
#cursor-ring.is-hover { width: 56px; height: 56px; border-color: var(--ink); background: rgba(255,255,255,.06); }
@media (hover: none) {
  body, a, button { cursor: auto; }
  #cursor-dot, #cursor-ring { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-inner { animation: none; }
  .card { transition: none; }
  #dust { display: none; }
}

/* ticker */
.ticker { position: fixed; top: 0; left: 0; right: 0; z-index: 5; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); overflow: hidden; }
.ticker-inner { display: flex; width: max-content; animation: tick 30s linear infinite; padding: 6px 0; font-family: var(--mono); font-size: 10px; letter-spacing: .18em; color: var(--muted); }
@keyframes tick { to { transform: translateX(-50%); } }

/* top bar */
.top {
  position: fixed; top: 25px; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
}
.wordmark { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .22em; }
.wordmark img { width: 26px; height: 26px; border-radius: 6px; object-fit: contain; display: block; }
[data-theme="light"] .wordmark img { filter: invert(1); }
[data-theme="light"] img.invert-in-light { filter: invert(1); }
.top-mid { font-size: 10px; letter-spacing: .18em; color: var(--muted); }
.top-mid .dim { color: var(--dim); }
.topnav { display: flex; gap: 26px; }
.topnav a { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; color: var(--muted); }
.topnav a:hover, .topnav a.active { color: var(--ink); }

/* pills */
.pill {
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  border-radius: 999px; padding: 10px 20px; border: 1px solid var(--dim);
  background: transparent; color: var(--ink); white-space: nowrap;
}
.pill-solid { background: var(--pill); color: var(--bg); border-color: var(--pill); }
.pill-ghost:hover { border-color: var(--ink); }

/* stage */
.stage {
  position: relative; z-index: 2; height: 100svh;
  display: grid; grid-template-columns: 240px 1fr 260px;
  align-items: center; gap: 24px; padding: 90px 40px 90px;
}
.ghost {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -52%);
  font-family: var(--display); font-size: clamp(120px, 22vw, 340px); line-height: .85;
  text-align: center; color: color-mix(in srgb, var(--ink) 7%, transparent); -webkit-text-stroke: 1px var(--dim);
  opacity: .9; user-select: none; pointer-events: none; z-index: 0;
}

.meta { font-family: var(--mono); z-index: 2; }
.meta-left .meta-index { font-size: 12px; letter-spacing: .14em; }
.meta-left .meta-index .dim { color: var(--dim); }
.meta-name { font-size: 22px; letter-spacing: .06em; margin-top: 12px; color: var(--ink); }
.meta-type { font-size: 10px; letter-spacing: .18em; color: var(--muted); margin-top: 8px; }
.meta-status { display: flex; align-items: center; gap: 8px; font-size: 10px; letter-spacing: .18em; color: var(--accent); margin-top: 14px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }

.mono { font-family: var(--mono); }
.meta-right .meta-label { font-size: 10px; letter-spacing: .2em; color: var(--dim); margin-bottom: 12px; }
.meta-desc { font-family: var(--sans); font-size: 14px; line-height: 1.7; color: var(--muted); max-width: 26ch; margin-bottom: 6px; }
.meta-sub { font-size: 10px; letter-spacing: .16em; color: var(--muted); margin-top: 10px; }
.meta-sub.dim, .meta-sub .dim { color: var(--dim); }
.meta-rows { margin: 14px 0 18px; border-top: 1px solid var(--line); }
.meta-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 10px; letter-spacing: .14em; color: var(--muted); }
.meta-row span:last-child { color: var(--ink); }

/* card stack */
.stack-wrap { position: relative; z-index: 2; display: flex; justify-content: center; perspective: 1400px; }
.stack { position: relative; width: min(420px, 60vw); height: min(520px, 62svh); transform-style: preserve-3d; }
.card {
  position: absolute; inset: 0; border-radius: 14px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: transform .55s cubic-bezier(.2,.8,.2,1), opacity .55s, filter .55s;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.card-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--muted); border-bottom: 1px solid var(--line); }
.card-tag { color: var(--accent); }
.card-visual { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px; overflow: hidden; background: var(--bg2); }
.card-visual img.logo { max-width: 100%; max-height: 100%; object-fit: contain; display: block; position: relative; z-index: 1; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.card-visual img[data-logo="filey"] { width: 56%; }
.card-visual img[data-logo="associated"] { width: 48%; }
.card-visual img[data-logo="aci"] { width: 82%; }
.card-visual img[data-logo="emperfict"] { width: 72%; }
.card.is-front .card-visual img.logo { transform: translateY(-4px) scale(1.03); }
.card.is-front:hover .card-visual img.logo { transform: translateY(-8px) scale(1.07); }
.leaf-badge { position: absolute; right: 14px; bottom: 14px; width: 46px; height: 46px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; z-index: 2; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.leaf-badge img { width: 30px; height: 30px; object-fit: contain; }
.card-visual img + .card-mark { display: none; }
.card-visual::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 20%, rgba(255,92,26,.14), transparent 55%); pointer-events: none; }
.card-mark { position: absolute; font-family: var(--display); font-size: clamp(64px, 8vw, 110px); line-height: .9; text-align: center; color: var(--ink); text-shadow: 0 4px 30px rgba(0,0,0,.6); }
.card-bottom { padding: 18px; border-top: 1px solid var(--line); }
.card-bottom h2 { font-size: 20px; letter-spacing: -.01em; margin-bottom: 6px; }
.card-bottom p { font-size: 13px; line-height: 1.6; color: var(--muted); }
.card-stat { margin-top: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--dim); }
.stack-shadow {
  position: absolute; bottom: -34px; left: 50%; transform: translateX(-50%);
  width: 60%; height: 30px; background: radial-gradient(ellipse, rgba(0,0,0,.6), transparent 70%);
  filter: blur(10px);
}

/* bottom */
.bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}
.controls { display: flex; gap: 10px; }
.hint { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--dim); }

@media (max-width: 900px) {
  .top-mid { display: none; }
  .stage { grid-template-columns: 1fr; padding: 110px 20px 110px; gap: 12px; }
  .meta-right { display: none; }
  .meta-left { text-align: center; }
  .meta-left .meta-status { justify-content: center; }
  .topnav { display: none; }
  .ghost { font-size: 30vw; }
}
