@property --accent  { syntax: '<color>'; inherits: true; initial-value: #7c8cff; }
@property --accent2 { syntax: '<color>'; inherits: true; initial-value: #ff6ad5; }

:root {
  --bg: #07070b;
  --fg: #ecebf5;
  --muted: #9b99b5;
  --line: rgba(236, 235, 245, .12);
  --pad: clamp(20px, 6vw, 96px);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
  transition: --accent .9s ease, --accent2 .9s ease;
}

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

body {
  color: var(--fg);
  font: 400 clamp(16px, .35vw + 14.5px, 19px)/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background:
    radial-gradient(60vmax 60vmax at 78% 45%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}
.no-webgl #stage { display: none; }

/* subtle film grain so the dark never looks flat */
.grain {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }

/* ───────── header ───────── */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: max(18px, env(safe-area-inset-top)) var(--pad) 18px;
  font-family: var(--mono); font-size: .85rem; letter-spacing: .02em;
}
.brand { font-weight: 600; font-size: 1rem; }
.toplinks { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); }
.toplinks a { color: var(--muted); transition: color .2s; }
.toplinks a:hover { color: var(--fg); }
.toplinks .hello i { display: inline-block; font-style: normal; }
.brand span { color: var(--accent); }
.hello { color: var(--muted); transition: color .2s; }
.hello i { display: inline-block; font-style: normal; transition: transform .25s; }
.hello:hover { color: var(--fg); }
.hello:hover i { transform: translateX(4px); }

/* ───────── side rail ───────── */
.rail {
  position: fixed; right: clamp(14px, 2vw, 28px); top: 50%; transform: translateY(-50%);
  z-index: 10; display: flex; flex-direction: column; gap: 4px;
}
.rail a { position: relative; display: flex; align-items: center; justify-content: flex-end; height: 22px; width: 22px; }
.rail b { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: all .3s; }
.rail a:hover b { background: var(--muted); }
.rail a.on b { background: var(--accent); box-shadow: 0 0 12px var(--accent); transform: scale(1.5); }
.rail span {
  position: absolute; right: 26px; white-space: nowrap; font: 500 .72rem/1 var(--mono);
  color: var(--fg); opacity: 0; transform: translateX(6px); transition: all .25s; pointer-events: none;
}
.rail a:hover span, .rail a:focus-visible span { opacity: 1; transform: none; }

/* ───────── panels ───────── */
main { position: relative; z-index: 2; }

.panel {
  min-height: 100svh;
  display: flex; align-items: center;
  padding: 96px var(--pad);
}
.copy { width: min(100%, 540px); }

.eyebrow, .kicker {
  font: 500 .78rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 1.4rem;
}
.eyebrow em { font-style: normal; color: var(--muted); margin: 0 .35em; }

h1, h2 { font-weight: 700; letter-spacing: -.04em; line-height: .98; text-wrap: balance; }
h1 { font-size: clamp(3rem, 8.4vw, 7rem); }
h2 { font-size: clamp(2.15rem, 4.6vw, 4rem); margin-bottom: 1.2rem; }
.grad {
  background: linear-gradient(95deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; /* a shadow would show through the transparent fill */
}
.copy p:not(.eyebrow):not(.kicker):not(.foot):not(.scroll-hint) { color: var(--muted); max-width: 46ch; text-wrap: pretty; }
.lede { margin-top: 1.6rem; font-size: 1.08em; }
a.inline { color: var(--fg); border-bottom: 1px solid var(--accent); transition: color .2s; }
a.inline:hover { color: var(--accent); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2rem; }
.chips a {
  display: inline-flex; align-items: center; gap: .55em; padding: .5em .95em;
  font: 500 .82rem/1 var(--mono); border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, .03); backdrop-filter: blur(6px);
  transition: border-color .25s, background .25s, transform .25s;
}
.chips i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--accent)); box-shadow: 0 0 10px var(--c, var(--accent)); }
.chips a:hover, .chips a:focus-visible { border-color: var(--c, var(--accent)); background: rgba(255, 255, 255, .07); transform: translateY(-2px); }

.copy p.also { margin-top: 1.4rem; font: 400 .85rem/1.4 var(--mono); color: var(--muted); }
a.more { display: inline-block; margin-top: 1.6rem; font: 500 .9rem/1.4 var(--mono); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.6rem; }
.tags li {
  font: 500 .75rem/1 var(--mono); letter-spacing: .04em; color: var(--fg);
  padding: .55em .9em; border-radius: 6px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
}

.scroll-hint {
  display: flex; align-items: center; gap: 14px; margin-top: 3rem;
  font: 400 .75rem/1.3 var(--mono); letter-spacing: .08em; color: var(--muted); text-transform: uppercase;
}
.scroll-hint span { position: relative; width: 1px; height: 38px; background: var(--line); overflow: hidden; flex: none; }
.scroll-hint span::after {
  content: ""; position: absolute; left: 0; top: -100%; width: 1px; height: 100%; background: var(--accent);
  animation: drip 2.2s cubic-bezier(.6, 0, .3, 1) infinite;
}
@keyframes drip { to { top: 100%; } }

.button {
  display: inline-flex; align-items: center; gap: .7em; margin-top: 2rem;
  padding: 1em 1.5em; border-radius: 999px; font: 600 .95rem/1 var(--mono);
  color: #07070b; background: linear-gradient(95deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 40px -10px var(--accent);
  transition: transform .25s, box-shadow .25s;
}
.button i { font-style: normal; transition: transform .25s; }
.button:hover { transform: translateY(-3px); box-shadow: 0 16px 50px -8px var(--accent); }
.button:hover i { transform: translateX(5px); }
button.button { border: 0; cursor: pointer; }

.socials { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.6rem; }
.socials a {
  display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px;
  color: var(--fg); border: 1px solid var(--line); border-radius: 50%; background: rgba(255, 255, 255, .03);
  transition: border-color .25s, background .25s, transform .25s, box-shadow .25s;
}
.socials svg { width: 20px; height: 20px; flex: none; }
.socials a.coffee { width: auto; padding: 0 1.15rem; gap: .55em; border-radius: 999px; font: 500 .8rem/1 var(--mono); letter-spacing: .01em; white-space: nowrap; }
.socials a:hover, .socials a:focus-visible {
  border-color: var(--accent); background: rgba(255, 255, 255, .07); transform: translateY(-2px);
  box-shadow: 0 8px 30px -10px var(--accent);
}

/* ───────── contact dialog ───────── */
dialog {
  margin: auto; width: min(92vw, 520px); max-height: 92svh; overflow: auto;
  padding: clamp(1.4rem, 4vw, 2.2rem); color: var(--fg);
  border: 1px solid var(--line); border-radius: 22px;
  background: color-mix(in srgb, var(--bg) 88%, #fff 4%);
  box-shadow: 0 40px 120px -20px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 0 1px rgba(255, 255, 255, .03) inset;
}
dialog[open] { animation: pop .35s cubic-bezier(.2, .8, .2, 1); }
dialog::backdrop { background: rgba(4, 4, 8, .65); backdrop-filter: blur(8px); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
body:has(dialog[open]) { overflow: hidden; }

dialog h2 { font-size: clamp(2rem, 6vw, 2.8rem); margin-bottom: .6rem; }
dialog .sub { color: var(--muted); margin-bottom: 1.4rem; font-size: .95em; }
dialog .kicker { margin-bottom: 1rem; }
dialog .x {
  position: absolute; top: 12px; right: 14px; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer;
  transition: color .2s, border-color .2s;
}
dialog .x:hover { color: var(--fg); border-color: var(--muted); }
dialog label { display: block; margin-bottom: 1rem; font: 500 .72rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
dialog input, dialog textarea {
  display: block; width: 100%; margin-top: .5rem; padding: .8em 1em;
  font: 400 1rem/1.5 var(--sans); letter-spacing: 0; text-transform: none; color: var(--fg);
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .2s, background .2s;
}
dialog textarea { resize: vertical; min-height: 7.5rem; }
dialog input:focus, dialog textarea:focus { outline: none; border-color: var(--accent); background: rgba(255, 255, 255, .07); }
dialog .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
dialog .button { margin-top: .6rem; }
dialog .button[disabled] { opacity: .6; cursor: progress; transform: none; }
.status { min-height: 1.4em; margin-top: 1rem; font: 400 .85rem/1.4 var(--mono); color: var(--muted); }
.status.err { color: #ff7a8a; }
.status.err a { text-decoration: underline; }
dialog.sent .fields { display: none; }
dialog.sent .status { margin: 3rem 0 2rem; font: 600 1.4rem/1.3 var(--sans); letter-spacing: -.02em; color: var(--fg); text-align: center; }
dialog.sent .status::before { content: "✦"; display: block; font-size: 2rem; color: var(--accent); margin-bottom: .6rem; }

.foot { margin-top: 4rem; font: 400 .75rem/1 var(--mono); color: var(--muted); letter-spacing: .04em; }

/* staggered reveal */
.js .copy > * {
  opacity: 0; transform: translateY(22px);
  transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js .panel.is-active .copy > * { opacity: 1; transform: none; }

/* ───────── small screens: shape on top, copy at the bottom ───────── */
@media (max-width: 1099px) {
  .rail { display: none; }
  .panel { align-items: flex-end; padding-top: 40svh; padding-bottom: max(7svh, 44px); }
  .panel.hero { padding-top: 34svh; }
  h1 { font-size: clamp(2.6rem, 13vw, 4.2rem); }
  .scroll-hint { display: none; }
  .copy { text-shadow: 0 2px 24px var(--bg), 0 0 6px var(--bg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .copy > *, .scroll-hint span::after, .chips a { transition: none; animation: none; }
}

.socials a.coffee span { font-size: 1.45rem; line-height: 1; transform: translateY(-1px); }
