:root {
  --bg: #0b0b0c;
  --bg-2: #131315;
  --line: #26262a;
  --text: #ece9e2;
  --muted: #8a877f;
  --accent: #ff3d4d;
  --accent-ink: #0b0b0c;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

/* film grain */
.grain {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 100; opacity: .05;
  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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); }
}

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 18px var(--gutter);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo {
  font-weight: 800; font-size: 20px; letter-spacing: -.02em;
  text-decoration: none; margin-right: auto;
}
.logo .x { color: var(--accent); }
.logo .tld { color: var(--muted); font-weight: 400; }
.nav-links { display: flex; gap: 28px; font-family: var(--mono); font-size: 14px; }
.nav-links a { text-decoration: none; color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.lang {
  font-family: var(--mono); font-size: 13px;
  background: none; border: 1px solid var(--line); color: var(--muted);
  padding: 6px 10px; border-radius: 999px; cursor: pointer;
}
.lang .sep { margin: 0 4px; opacity: .5; }
.lang [data-lang].on { color: var(--accent); }
@media (max-width: 640px) { .nav-links { display: none; } }

/* HERO */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(48px, 10vh, 120px) var(--gutter) 64px;
  min-height: calc(100svh - 64px);
  display: flex; flex-direction: column; justify-content: center;
  position: relative;
}
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted); margin: 0 0 20px;
  text-transform: uppercase; letter-spacing: .12em;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent); animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  100% { box-shadow: 0 0 0 12px transparent; }
}
.wordmark {
  font-size: clamp(64px, 17vw, 240px);
  font-weight: 800; line-height: .85; letter-spacing: -.055em;
  margin: 0 0 40px;
  display: flex; flex-wrap: wrap;
}
.wordmark span { display: inline-block; animation: rise .9s cubic-bezier(.2, .8, .2, 1) both; }
.wordmark span:nth-child(2) { animation-delay: .12s; }
.wordmark span:nth-child(3) { animation-delay: .2s; }
@keyframes rise { from { transform: translateY(40%); opacity: 0; } }
.big-x {
  color: var(--accent);
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
  cursor: default;
}
.big-x:hover { transform: rotate(90deg) scale(1.05); }

.hero-grid {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(24px, 4vw, 64px);
  align-items: start;
}
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
.lede { font-size: clamp(20px, 2.2vw, 26px); line-height: 1.35; margin: 0; max-width: 32ch; }
.lede strong { color: var(--accent); font-weight: 600; }

.terminal {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-2); overflow: hidden;
  box-shadow: 0 30px 80px -40px color-mix(in srgb, var(--accent) 35%, transparent);
}
.term-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.term-bar span { margin-left: 8px; }
.term-body {
  margin: 0; padding: 16px 18px; min-height: 196px;
  font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
}
.term-body .p { color: var(--accent); }
.term-body .c { color: var(--muted); }
.term-body .cursor {
  display: inline-block; width: .6em; height: 1.1em; vertical-align: -.2em;
  background: var(--accent); animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.scroll-cue {
  position: absolute; bottom: 24px; left: var(--gutter);
  font-size: 12px; color: var(--muted); text-decoration: none;
}

/* MARQUEE */
.marquee {
  border-block: 1px solid var(--line); overflow: hidden;
  padding: 18px 0; background: var(--bg-2);
}
.marquee-track {
  display: flex; gap: 28px; width: max-content;
  font-size: clamp(16px, 2vw, 22px); text-transform: uppercase; letter-spacing: .06em;
  animation: scroll 30s linear infinite;
}
.marquee-track b { color: var(--accent); font-weight: 400; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* SECTIONS */
.section {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(72px, 12vw, 140px) var(--gutter) 0;
}
.label {
  font-size: 13px; font-weight: 400; color: var(--muted);
  text-transform: uppercase; letter-spacing: .14em;
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 40px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.label span:first-child { color: var(--accent); }

.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(32px, 6vw, 96px); }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }
.big-text {
  font-size: clamp(26px, 3.6vw, 46px); line-height: 1.15; letter-spacing: -.02em;
  margin: 0; font-weight: 600;
}
.big-text em { font-style: normal; color: var(--accent); }
.stats { margin: 0; display: grid; gap: 0; align-content: start; }
.stats div {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { margin: 0; font-size: 36px; font-weight: 800; letter-spacing: -.03em; }

/* STACK */
.stack-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
}
.card { background: var(--bg); padding: 28px 24px 32px; transition: background .25s; }
.card:hover { background: var(--bg-2); }
.card h3 {
  font-size: 12px; font-weight: 500; color: var(--muted);
  text-transform: uppercase; letter-spacing: .14em; margin: 0 0 22px;
}
.card ul { list-style: none; margin: 0; padding: 0; }
.card li { font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 1.35; }
.card-accent { background: var(--accent); color: var(--accent-ink); }
.card-accent:hover { background: color-mix(in srgb, var(--accent) 88%, white); }
.card-accent h3 { color: color-mix(in srgb, var(--accent-ink) 65%, transparent); }

/* WORK */
.work-list { list-style: none; margin: 0; padding: 0; counter-reset: w; }
.work-item { border-bottom: 1px solid var(--line); }
.work-item a, .work-item > div {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 20px; align-items: center;
  padding: 28px 0; text-decoration: none; position: relative;
}
.work-item .num { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.work-item h3 {
  margin: 0; font-size: clamp(26px, 4vw, 48px); font-weight: 800; letter-spacing: -.035em; line-height: 1;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), color .2s;
}
.work-item p { margin: 8px 0 0; color: var(--muted); font-size: 16px; max-width: 60ch; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tags span {
  font-family: var(--mono); font-size: 12px;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; color: var(--muted);
}
.work-item a:hover h3 { transform: translateX(12px); color: var(--accent); }
@media (max-width: 640px) {
  .work-item a, .work-item > div { grid-template-columns: 1fr; gap: 10px; }
  .tags { justify-content: flex-start; }
}

/* CONTACT */
.contact { padding-bottom: clamp(72px, 10vw, 120px); }
.contact-big {
  font-size: clamp(48px, 9vw, 128px); font-weight: 800; letter-spacing: -.05em; line-height: .95;
  margin: 0 0 48px;
}
.contact-links { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 18px;
  padding: 18px 26px; border-radius: 999px; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 18px;
  transition: transform .2s, box-shadow .2s;
}
.btn .mono { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; opacity: .7; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -16px var(--accent); }

/* FOOTER */
.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 24px var(--gutter); border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s, transform .8s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.btn-icon { flex: none; margin-right: -8px; }
