:root {
  --bg: #0a0e14;
  --bg-2: #121820;
  --text: #eef1f4;
  --muted: #9aa6b4;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #e2b857;
  --accent-2: #f6e3a8;
  --card: rgba(16, 22, 30, 0.9);
  --glow: rgba(120, 165, 205, 0.26);
  --red: #c0313b;
  --blue: #5aa9ff;
}
:root[data-theme="light"] {
  --bg: #eceeef;
  --bg-2: #ffffff;
  --text: #14171c;
  --muted: #586271;
  --line: rgba(0, 0, 0, 0.1);
  --accent: #a67c12;
  --accent-2: #7a5a0a;
  --card: rgba(255, 255, 255, 0.9);
  --glow: rgba(255, 255, 255, 0.9);
  --red: #a8232d;
  --blue: #2f7fd6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}
a { color: inherit; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.accent {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#bg {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.glow {
  position: fixed; left: 50%; bottom: -40vh; width: 120vw; height: 80vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--glow), transparent 65%);
  z-index: 0; pointer-events: none;
}
main, footer, .nav { position: relative; z-index: 1; }

.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
}
.logo { font: 700 1.25rem "JetBrains Mono", monospace; text-decoration: none; }
.logo span { color: var(--accent); }
.nav nav { display: flex; align-items: center; gap: 1.5rem; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; transition: color 0.2s; }
.nav nav a:hover { color: var(--text); }
.icon-btn {
  background: none; border: 1px solid var(--line); color: var(--muted);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; transition: color 0.2s, border-color 0.2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

section { max-width: min(1500px, 92vw); margin: 0 auto; padding: 5rem clamp(1rem, 4vw, 2rem); }

.hero { min-height: 88vh; display: flex; flex-direction: column; justify-content: center; }
.kicker { color: var(--accent); margin-bottom: 1rem; font-size: 0.95rem; }
.kicker::after { content: "_"; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
h1 { font-size: clamp(2.8rem, 9vw, 6rem); line-height: 1.05; letter-spacing: -0.03em; font-weight: 700; }
.lead { color: var(--muted); font-size: clamp(1.05rem, 2.2vw, 1.35rem); max-width: 34rem; margin-top: 1.25rem; }
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.btn {
  padding: 0.7rem 1.3rem; border-radius: 999px; text-decoration: none; font-weight: 500;
  border: 1px solid var(--line); background: var(--card);
  transition: transform 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.btn.primary { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #14110a; border: 0; font-weight: 600; }

h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 2rem; letter-spacing: -0.02em; }
h2 .mono { color: var(--accent); font-size: 0.9rem; margin-right: 0.6rem; vertical-align: middle; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 2rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.media {
  aspect-ratio: 16 / 9; background: var(--bg-2); position: relative;
  display: grid; place-items: center; color: var(--muted); font: 0.8rem "JetBrains Mono", monospace;
}
.media:empty::before { content: "demo coming soon"; }
.media iframe, .media video, .media img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.media .play {
  position: absolute; inset: 0; width: 100%; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, 0.35); display: grid; place-items: center;
}
.media .play::after {
  content: ""; width: 0; height: 0; border-left: 22px solid #fff;
  border-top: 14px solid transparent; border-bottom: 14px solid transparent; margin-left: 6px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}
.body { padding: 1.8rem 2rem 2rem; }
.body h3 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.body p { color: var(--muted); font-size: 1.02rem; max-width: 46ch; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0; }
.tags li {
  font: 0.75rem "JetBrains Mono", monospace; padding: 0.2rem 0.6rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.more { color: var(--accent); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.more:hover { text-decoration: underline; }

.about { color: var(--muted); max-width: 40rem; font-size: 1.05rem; }
.about a { color: var(--accent); }

footer { text-align: center; padding: 3rem 1rem; color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--line); }

.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s, transform 0.7s; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 560px) {
  .nav nav { gap: 1rem; }
  .nav nav a { font-size: 0.85rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .kicker::after { animation: none; }
}

/* Riftborn accents: crimson ribbon line, blue core glow */
.nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--red) 20%, var(--accent) 60%, transparent);
  opacity: 0.8;
}
.kicker { color: var(--red); }
.tags li:first-child { border-color: color-mix(in srgb, var(--red) 55%, transparent); }
.card:hover { border-color: color-mix(in srgb, var(--red) 60%, transparent); }
::selection { background: var(--red); color: #fff; }

@media (max-width: 700px), (prefers-reduced-motion: reduce) { #bg { display: none; } }

/* Click shockwave ring */
.shock {
  position: fixed; z-index: 0; pointer-events: none; border-radius: 50%; transform: translate(-50%, -50%);
  border: 1.5px solid var(--accent); width: 0; height: 0; opacity: 0.8;
  animation: shock 0.9s ease-out forwards;
}
@keyframes shock { to { width: 1600px; height: 1600px; opacity: 0; } }

.shock { border-width: 1px; opacity: 0.4; }

/* About + Contact */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.prose p { color: var(--muted); font-size: 1.05rem; max-width: 52ch; margin-bottom: 1.1rem; }
.prose p.big, .big { color: var(--text); font-size: clamp(1.25rem, 2.4vw, 1.75rem); line-height: 1.4; letter-spacing: -0.01em; max-width: 34ch; margin-bottom: 1.4rem; }
.wide-text { max-width: 40ch; }
blockquote { border-left: 2px solid var(--red); padding-left: 1rem; margin-top: 1.6rem; color: var(--accent); font: 500 1.05rem/1.5 "JetBrains Mono", monospace; max-width: 38ch; }
.focus { list-style: none; display: grid; gap: 0.9rem; }
.focus li { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.3rem; }
.focus strong { display: block; font-size: 1.02rem; }
.focus span { color: var(--muted); font-size: 0.92rem; }
#contact .about { margin-bottom: 1.6rem; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* Legibility over drifting shards (plain text only; gradient text must not get a shadow) */
.prose p, .big, .about, .lead, blockquote, .focus span { text-shadow: 0 0 10px var(--bg), 0 0 3px var(--bg); }
