@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-var.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #08090c;
  --panel: rgba(15, 18, 24, 0.82);
  --line: rgba(255, 255, 255, 0.09);
  --text: #eceef2;
  --muted: #a3abb9;
  --accent: #7ce4c4;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --wrap: 72rem;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 0.6em; font-weight: 650; }
p { margin: 0 0 1em; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--accent); color: #04110d; padding: 0.5rem 0.9rem; border-radius: 6px; font-weight: 600;
}
.skip:focus { top: 1rem; }

/* Background: a CSS poster that is always there; the WebGL canvas fades in over it. */
.backdrop {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 78% 28%, rgba(124, 228, 196, 0.10), transparent 60%),
    radial-gradient(40rem 32rem at 12% 85%, rgba(122, 168, 255, 0.10), transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.07) 1px, transparent 1.5px) 0 0 / 22px 22px,
    var(--bg);
}
#field {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1;
  display: block; opacity: 0; transition: opacity 1.2s ease;
}
#field.on { opacity: 1; }

/* Header */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  background: linear-gradient(var(--bg), rgba(8, 9, 12, 0));
}
.brand { white-space: nowrap; font: 400 1rem var(--mono); color: var(--text); text-decoration: none; }
.brand b { color: var(--accent); font-weight: 400; }
.top nav { display: flex; gap: clamp(0.8rem, 2.5vw, 1.6rem); font-size: 0.95rem; }
.top nav a { color: var(--muted); text-decoration: none; padding: 0.35rem 0; }
.top nav a:hover { color: var(--text); }

main { position: relative; }
section[id], [id="home-assistant"] { scroll-margin-top: 4.5rem; }
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

/* Hero */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: grid; align-content: center; padding: 6rem 0 4rem;
}
.hero h1 { font-size: clamp(3rem, 11vw, 7.5rem); font-weight: 700; letter-spacing: -0.045em; margin-bottom: 0.15em; }
.role { font: 400 clamp(0.95rem, 2.6vw, 1.15rem) var(--mono); color: var(--accent); margin-bottom: 1.4rem; }
.lede { font-size: clamp(1.25rem, 3.4vw, 1.75rem); line-height: 1.35; max-width: 30ch; color: var(--text); }
.cue {
  margin-top: 3rem; display: inline-flex; align-items: center; gap: 0.6rem;
  font: 400 0.85rem var(--mono); color: var(--muted); text-decoration: none;
}
.cue span { display: inline-block; animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }

/* Sections */
section.chapter { padding: 18vh 0 22vh; }
.kicker { font: 400 0.85rem var(--mono); color: var(--accent); letter-spacing: 0.04em; margin-bottom: 0.9rem; }
.chapter h2 { font-size: clamp(2.1rem, 6vw, 3.6rem); }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: clamp(1.2rem, 3vw, 1.8rem);
}
.ds { max-width: 36rem; display: grid; gap: 1rem; }
.ds h3 { font-size: 1.2rem; margin-bottom: 0.4em; }
.ds p { color: var(--muted); margin: 0; }
.chips, .tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chips li, .tags li {
  font: 400 0.8rem/1 var(--mono); color: var(--text);
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04);
  padding: 0.5rem 0.65rem; border-radius: 999px;
}
.tags li { font-size: 0.74rem; padding: 0.38rem 0.55rem; color: var(--muted); }

/* Projects */
.build-head { max-width: 36rem; }
.build-head p:not(.kicker) { color: var(--muted); }
.cards {
  list-style: none; padding: 0; margin: 2rem 0 0;
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
}
.card { display: flex; flex-direction: column; gap: 0.8rem; }
.card h3 { font-size: 1.15rem; margin: 0; }
.card p { color: var(--muted); margin: 0; flex: 1; }
.card.ha { grid-column: 1 / -1; border-color: rgba(124, 228, 196, 0.35); }
.card.ha p { color: var(--text); max-width: 60ch; }
.links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin: 0; }
.links a { font-weight: 500; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; background: rgba(8, 9, 12, 0.88); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; color: var(--muted); font-size: 0.95rem; }
.foot p { margin: 0; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }

/* Plain document pages (privacy, assistant, 404) */
.doc { width: min(100% - 2.5rem, 42rem); margin: 0 auto; padding: 7rem 0 4rem; }
.doc h1 { font-size: clamp(2.2rem, 7vw, 3.2rem); }
.doc h2 { font-size: 1.2rem; margin-top: 2.2rem; }
.doc p { color: #d3d7de; }

@media (min-width: 60rem) {
  /* Leave the right side to the particle field on wide screens. */
  .ds, .build-head { margin-right: auto; }
  .cards { max-width: 44rem; grid-template-columns: 1fr 1fr; }
  .hero .wrap > * { max-width: 46rem; }
}
@media (max-width: 40rem) {
  .top nav a.opt { display: none; }
  .top nav { gap: 0.85rem; font-size: 0.9rem; }
  section.chapter { padding: 12vh 0 16vh; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cue span { animation: none; }
  #field { transition: none; }
}

/* Home Assistant: its own section after the projects (Google reviews this as the app's homepage). */
.assistant { padding: 0 0 6rem; }
.assistant h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin: 0 0 1rem; }

/* Videos */
section.watch { padding-top: 0; }
.reels video {
  display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain;
  border-radius: 10px; background: #000;
}
.credit { margin-top: 1.5rem; max-width: 44rem; font-size: 0.85rem; color: var(--muted); }
