:root {
  --bg: #0b0d12;
  --ink: #eef1f8;
  --muted: #8b93a7;
  --card: rgba(18, 21, 29, 0.72);
  --line: rgba(255, 255, 255, 0.08);
  --pink: #ff9ecb;
  --blue: #93d2ff;
  --green: #8df0c0;
  --lav: #cfc3ff;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background:
    radial-gradient(900px 600px at 15% -10%, rgba(255, 158, 203, 0.10), transparent 60%),
    radial-gradient(900px 700px at 90% 10%, rgba(147, 210, 255, 0.10), transparent 60%),
    radial-gradient(800px 800px at 50% 110%, rgba(141, 240, 192, 0.07), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: none;
}

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
}

#cursor {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 60;
}

#score {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  background: var(--card);
  pointer-events: none;
  user-select: none;
}

#score .n { color: var(--ink); }

#score.pop { animation: score-pop 0.25s ease; }

@keyframes score-pop {
  0% { transform: translateX(-50%) scale(1); }
  40% { transform: translateX(-50%) scale(1.12); }
  100% { transform: translateX(-50%) scale(1); }
}

main {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vh, 6rem) 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 3.5rem);
}

/* ---------- header ---------- */

header { margin-bottom: clamp(2.5rem, 6vh, 4.5rem); }

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 1.4rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
}

.mode-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.22rem;
  background: rgba(255, 255, 255, 0.02);
  cursor: none;
}

.mode-opt {
  position: relative;
  display: inline-flex;
  cursor: none;
}

.mode-opt input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.mode-opt span {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.22rem 0.8rem;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.mode-opt:hover span { color: var(--ink); }

.mode-opt input:checked + span {
  color: var(--ink);
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  border-color: color-mix(in srgb, var(--blue) 35%, transparent);
}

.mode-opt input:focus-visible + span {
  border-color: color-mix(in srgb, var(--blue) 55%, transparent);
}

.badge .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

h1 {
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

h1 .io {
  color: var(--pink);
  font-weight: 600;
}

.tagline {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  max-width: 46ch;
  line-height: 1.6;
}

.tagline em { color: var(--ink); font-style: normal; }

/* ---------- project grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.card {
  --accent: var(--pink);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.4rem 1.3rem 1.5rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  opacity: 0;
  transform: translateY(14px);
}

.card.in {
  opacity: 1;
  transform: translateY(0);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 180px at 20% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

a.card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 12px 40px -12px color-mix(in srgb, var(--accent) 35%, transparent);
}

a.card:hover::before { opacity: 1; }

.card .icon {
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.card .icon svg { width: 24px; height: 24px; }

.card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
}

.card .kind {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  white-space: nowrap;
}

.card p {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
  flex: 1;
}

.card .go {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

a.card:hover .go { opacity: 1; transform: translateX(0); }

.card.soon {
  border-style: dashed;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  --accent: var(--lav);
  justify-content: center;
  text-align: center;
  color: var(--muted);
}

.card.soon h2 { justify-content: center; font-size: 1.05rem; }
.card.soon .icon { margin: 0 auto; animation: spin-slow 14s linear infinite; }

@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

.card .scorch {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle,
    rgba(6, 5, 4, 0.85) 0%,
    rgba(10, 8, 6, 0.5) 45%,
    rgba(10, 8, 6, 0.28) 62%,
    transparent 78%);
  animation: scorch-in 0.18s ease-out;
}

@keyframes scorch-in {
  from { transform: scale(0.3); opacity: 0; }
}

/* per-project accents */
.card.riz     { --accent: var(--blue); }
.card.site9   { --accent: var(--pink); }
.card.soon    { --accent: var(--lav); }
.card.secret  { --accent: var(--green); }

/* the secret card is not a link — its "go" line stays visible */
.card.secret .go { opacity: 1; transform: none; }

/* ---------- ticker ---------- */

.ticker {
  margin-top: clamp(2.5rem, 7vh, 5rem);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 0.65rem 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.ticker .track {
  display: flex;
  width: max-content;
  animation: scroll 32s linear infinite;
}

.ticker span {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  padding-right: 0.5rem;
}

.ticker b { font-weight: 400; color: var(--ink); }

.ticker i {
  font-style: normal;
  padding: 0 0.9rem;
  color: var(--pink);
}

@keyframes scroll {
  to { transform: translateX(-50%); }
}

footer {
  margin-top: 1.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--pink); }

/* ---------- site breaker ---------- */

body.breaker {
  overflow: hidden;
  cursor: default;
}

body.breaker .mode-pick,
body.breaker .mode-opt {
  cursor: default;
}

/* shrink text blocks to their content so bricks cover what you can see */
body.breaker h1,
body.breaker .tagline { display: inline-block; }
body.breaker footer { display: inline-flex; }

/* a broken brick: a fragment of the original element, clipped to the brick, tumbling away */
.brick-piece {
  position: fixed;
  margin: 0;
  pointer-events: none;
  z-index: 40;
  transition: none !important;
  will-change: transform;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* a glyph/icon in a saucer's tractor beam: fixed clone while the original hides in place */
.beam-piece {
  position: fixed;
  margin: 0;
  pointer-events: none;
  z-index: 40;
  will-change: left, top, transform;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .badge .dot, .card.soon .icon { animation: none; }
  .ticker .track { animation: none; }
  .card .scorch { animation: none; }
  #score.pop { animation: none; }
  .card { transition: none; opacity: 1; transform: none; }
}
