/* ============================================================
   Nejc Končan — portfolio
   Design tokens
   ============================================================ */
:root {
  --bg: #08080c;
  --bg-2: #0d0d14;
  --ink: #ecedee;
  --ink-dim: #9b9ca6;
  --ink-faint: #55565f;
  --acc: #c8ff4f;
  --acc-ink: #0a0c02;
  --line: rgba(236, 237, 238, 0.1);
  --line-strong: rgba(236, 237, 238, 0.22);

  --font-display: "Clash Display", "Inter", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --section-gap: clamp(6rem, 14vh, 11rem);
  --radius: 20px;
}

/* ============================================================
   Reset / base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: auto; }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img, canvas { display: block; max-width: 100%; }

.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* split-text chars */
.split .ch {
  display: inline-block;
  transform: translateY(120%);
  will-change: transform;
}
.split .wd { display: inline-block; }

/* ============================================================
   Preloader
   ============================================================ */
.preloader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; align-items: flex-end;
  padding: var(--gutter);
}
.preloader__inner { width: 100%; }
.preloader__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 7vw, 5.5rem);
  letter-spacing: -0.02em;
  line-height: 1;
  overflow: hidden;
}
.preloader__row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 1.5rem;
}
.preloader__label {
  font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-dim);
}
.preloader__count {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--acc);
  font-variant-numeric: tabular-nums;
}
.preloader__bar {
  margin-top: 0.75rem;
  height: 1px; background: var(--line);
  overflow: hidden;
}
.preloader__bar span {
  display: block; height: 100%; width: 0%;
  background: var(--acc);
}

/* ============================================================
   Cursor
   ============================================================ */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor { display: block; position: fixed; inset: 0; z-index: 150; pointer-events: none; }
  .cursor__dot {
    position: absolute; top: 0; left: 0;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--acc);
    transform: translate(-50%, -50%);
  }
  .cursor__ring {
    position: absolute; top: 0; left: 0;
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid rgba(236, 237, 238, 0.35);
    transform: translate(-50%, -50%);
    display: flex; align-items: center; justify-content: center;
    transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                height 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                background-color 0.35s, border-color 0.35s;
  }
  .cursor__text {
    font-family: var(--font-mono); font-size: 0.6rem;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--acc-ink); opacity: 0;
    transition: opacity 0.25s;
  }
  .cursor--hover .cursor__ring {
    width: 64px; height: 64px;
    background: rgba(200, 255, 79, 0.12);
    border-color: rgba(200, 255, 79, 0.5);
  }
  .cursor--mail .cursor__ring {
    width: 84px; height: 84px;
    background: var(--acc); border-color: var(--acc);
  }
  .cursor--mail .cursor__text { opacity: 1; }
  .cursor--drag .cursor__ring {
    width: 76px; height: 76px;
    background: rgba(8, 8, 12, 0.45);
    border-color: rgba(236, 237, 238, 0.6);
    backdrop-filter: blur(2px);
  }
  .cursor--drag .cursor__text { opacity: 1; color: var(--ink); }
  body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; }
}

/* ============================================================
   Grain
   ============================================================ */
.grain {
  position: fixed; inset: -50%; z-index: 140; pointer-events: none;
  width: 200%; height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.045;
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -10%); }
  20% { transform: translate(-15%, 5%); }
  30% { transform: translate(7%, -25%); }
  40% { transform: translate(-5%, 25%); }
  50% { transform: translate(-15%, 10%); }
  60% { transform: translate(15%, 0%); }
  70% { transform: translate(0%, 15%); }
  80% { transform: translate(3%, 35%); }
  90% { transform: translate(-10%, 10%); }
}

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem var(--gutter);
  background: linear-gradient(to bottom, rgba(8, 8, 12, 0.88) 0%, rgba(8, 8, 12, 0.45) 60%, transparent 100%);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav--hidden { transform: translateY(-110%); }
.nav__logo {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.3rem; letter-spacing: -0.01em;
}
.nav__logo sup { color: var(--acc); font-size: 0.6em; }
.nav__links { display: flex; gap: 2.2rem; }
.nav__links a {
  font-size: 0.85rem; font-weight: 500;
  color: var(--ink-dim);
  transition: color 0.3s;
  position: relative;
}
.nav__links a:hover { color: var(--ink); }
.nav__idx {
  font-family: var(--font-mono); font-size: 0.55rem;
  color: var(--acc); margin-right: 0.4rem; vertical-align: super;
}
.nav__status {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-mono); font-size: 0.66rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 0.55rem 1rem;
  backdrop-filter: blur(8px);
  background: rgba(8, 8, 12, 0.4);
  transition: border-color 0.3s, background-color 0.3s;
}
.nav__status:hover { border-color: var(--acc); }
.nav__pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 0 0 rgba(200, 255, 79, 0.6);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(200, 255, 79, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(200, 255, 79, 0); }
  100% { box-shadow: 0 0 0 0 rgba(200, 255, 79, 0); }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 var(--gutter) clamp(3rem, 8vh, 5rem);
  overflow: hidden;
}
.hero__bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, #14141f 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 20% 80%, #0e1410 0%, transparent 55%),
    var(--bg);
}
.hero__bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero__content { position: relative; }

.hero__eyebrow {
  display: flex; align-items: center; gap: 0.6rem 1rem; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: clamp(1.2rem, 3vh, 2.4rem);
  opacity: 0;
}
.hero__eyebrow-line { width: 3rem; height: 1px; background: var(--acc); flex: none; }
.hero__at {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-left: 0.4rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  color: var(--ink);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: border-color 0.3s, color 0.3s;
}
.hero__at:hover { border-color: var(--acc); color: var(--acc); }
.hero__at strong { color: var(--acc); font-weight: 600; }
.hero__at:hover strong { color: inherit; }
.hero__at-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 0 0 rgba(200, 255, 79, 0.6);
  animation: pulse 2.2s infinite;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.4rem, 13.5vw, 12.5rem);
  line-height: 0.92;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}
.hero__line { display: block; overflow: hidden; padding-bottom: 0.05em; margin-bottom: -0.05em; }
.hero__line--outline .ch {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(236, 237, 238, 0.85);
}
.hero__dot { color: var(--ink-faint); }
.hero__dot--acc { color: var(--acc); }

.hero__foot {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 2rem;
  margin-top: clamp(2rem, 5vh, 3.5rem);
}
.hero__sub {
  max-width: 26rem;
  color: var(--ink-dim);
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  opacity: 0;
}

.hero__hint {
  position: absolute; right: var(--gutter); top: 50%;
  display: flex; flex-direction: column; align-items: center; gap: 0.8rem;
  opacity: 0;
}
.hero__hint-track {
  width: 1px; height: 56px;
  background: var(--line-strong);
  position: relative; overflow: hidden;
}
.hero__hint-track span {
  position: absolute; left: 0; top: -40%;
  width: 100%; height: 40%;
  background: var(--acc);
  animation: scrollhint 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes scrollhint {
  0% { top: -40%; } 100% { top: 110%; }
}
.hero__hint-label {
  font-family: var(--font-mono); font-size: 0.6rem;
  letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--ink-dim);
  writing-mode: vertical-rl;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 1rem 1.7rem;
  font-weight: 500; font-size: 0.9rem;
  position: relative; overflow: hidden;
  transition: color 0.4s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.4s;
  white-space: nowrap;
  flex: none;
}
.btn::before {
  content: ""; position: absolute; inset: 0;
  background: var(--acc);
  border-radius: inherit;
  transform: translateY(101%);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
}
.btn:hover::before { transform: translateY(0); }
.btn:hover { color: var(--acc-ink); border-color: var(--acc); }
.btn__label, .btn__arrow { position: relative; z-index: 1; }
.btn__arrow { transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.btn:hover .btn__arrow { transform: translateX(3px) translateY(2px); }
.btn--primary { opacity: 0; }
.btn--big {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.6rem);
  font-weight: 500;
  padding: clamp(1.2rem, 2.5vw, 1.8rem) clamp(2rem, 4vw, 3.2rem);
}

/* ============================================================
   Marquee
   ============================================================ */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.3rem 0;
  overflow: hidden;
  background: var(--bg);
}
.marquee__track {
  display: flex; width: max-content;
  will-change: transform;
}
.marquee__track span {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.1rem, 2.4vw, 1.8rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--ink-dim);
}
.marquee__track em {
  font-style: normal; color: var(--acc);
  margin: 0 1.2rem;
}

/* ============================================================
   Sections (shared)
   ============================================================ */
.section { padding: var(--section-gap) var(--gutter) 0; }
.section__head {
  display: flex; align-items: center; gap: 1.5rem;
  margin-bottom: clamp(2.5rem, 6vh, 4.5rem);
}
.section__label { color: var(--acc); flex: none; }
.section__rule { flex: 1; height: 1px; background: var(--line); transform-origin: left; }
.section__note { color: var(--ink-faint); flex: none; }

/* ============================================================
   About
   ============================================================ */
.about__statement {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.55rem, 3.6vw, 3.1rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  max-width: 62rem;
}
.about__statement .wd { opacity: 0.14; }

.about__piara {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  max-width: 44rem;
  border-left: 2px solid var(--acc);
  padding: 0.4rem 0 0.4rem 1.6rem;
}
.about__piara-label {
  display: block;
  color: var(--acc);
  margin-bottom: 0.6rem;
}
.about__piara-text {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.05rem, 1.8vw, 1.45rem);
  line-height: 1.45;
  color: var(--ink-dim);
}
.about__piara-text a {
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1px solid var(--acc);
  padding-bottom: 0.1em;
  transition: color 0.3s;
}
.about__piara-text a:hover { color: var(--acc); }

.about__grid {
  margin-top: clamp(3.5rem, 8vh, 6rem);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.about__stat {
  padding: 2rem 1.5rem 0 0;
  border-right: 1px solid var(--line);
  padding-left: 1.5rem;
}
.about__stat:first-child { padding-left: 0; }
.about__stat:last-child { border-right: none; }
.about__num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 1;
  display: block;
  color: var(--acc);
  font-variant-numeric: tabular-nums;
}
.about__cap {
  display: block; margin-top: 0.8rem;
  color: var(--ink-dim); font-size: 0.85rem;
}

/* ============================================================
   Works — sticky stack
   ============================================================ */
.works__stack { display: flex; flex-direction: column; gap: clamp(1.5rem, 4vh, 3rem); }

.card {
  position: sticky;
  top: clamp(5rem, 12vh, 8rem);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3.5vw, 3.2rem);
  min-height: clamp(24rem, 62vh, 34rem);
  overflow: hidden;
  transform-origin: center top;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.45);
}

.card__meta {
  display: flex; align-items: center; gap: 1rem;
  color: var(--ink-dim);
  margin-bottom: clamp(1.5rem, 4vh, 3rem);
}
.card__idx { color: var(--acc); }
.card__badge {
  background: var(--acc); color: var(--acc-ink);
  border-radius: 99px; padding: 0.25rem 0.7rem;
  font-weight: 500;
}
.card__year { margin-left: auto; }
.card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.card__type { color: var(--acc); margin-top: 0.9rem; }
.card__desc {
  margin-top: clamp(1rem, 2.5vh, 1.8rem);
  color: var(--ink-dim);
  max-width: 34rem;
  font-size: 0.98rem;
}
.card__tags {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: clamp(1.2rem, 3vh, 2rem);
}
.card__tags li {
  font-family: var(--font-mono); font-size: 0.68rem;
  letter-spacing: 0.05em; text-transform: uppercase;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 0.4rem 0.85rem;
  color: var(--ink-dim);
}

.card__visual {
  position: relative;
  border-radius: calc(var(--radius) - 6px);
  overflow: hidden;
  min-height: 16rem;
  background: var(--vis-bg, #11131c);
  display: flex; align-items: center; justify-content: center;
}
.card__orb {
  position: absolute;
  width: 70%; aspect-ratio: 1;
  border-radius: 50%;
  background: var(--vis-orb, radial-gradient(circle at 35% 30%, rgba(200,255,79,0.55), transparent 65%));
  filter: blur(40px);
  opacity: 0.8;
}
.card__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}
.card__mono {
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(7rem, 14vw, 13rem);
  line-height: 1;
  color: var(--vis-mono, var(--acc));
  text-shadow: 0 0 80px rgba(0, 0, 0, 0.4);
  user-select: none;
}
.card__art {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  clip-path: circle(0% at 50% 60%);
  transform: scale(1.12);
  will-change: clip-path, transform;
}
@media (hover: none) {
  .card__art { clip-path: none !important; transform: none !important; }
}

.card__chip {
  position: absolute; bottom: 1.1rem; left: 1.1rem; right: 1.1rem;
  text-align: center;
  background: rgba(8, 8, 12, 0.55);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 0.55rem 1rem;
  color: var(--ink-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* per-project hues */
.card[data-theme="lime"]   { --vis-bg: #10150a; --vis-orb: radial-gradient(circle at 35% 30%, rgba(200,255,79,0.5), transparent 65%); --vis-mono: #c8ff4f; }
.card[data-theme="red"]    { --vis-bg: #170d0d; --vis-orb: radial-gradient(circle at 65% 30%, rgba(255,94,74,0.45), transparent 65%); --vis-mono: #ff6a55; }
.card[data-theme="violet"] { --vis-bg: #120d1c; --vis-orb: radial-gradient(circle at 35% 60%, rgba(154,108,255,0.45), transparent 65%); --vis-mono: #a98bff; }
.card[data-theme="blue"]   { --vis-bg: #0a1019; --vis-orb: radial-gradient(circle at 60% 60%, rgba(86,156,255,0.45), transparent 65%); --vis-mono: #6aa6ff; }
.card[data-theme="amber"]  { --vis-bg: #16120a; --vis-orb: radial-gradient(circle at 40% 35%, rgba(255,193,77,0.42), transparent 65%); --vis-mono: #ffc14d; }

/* ============================================================
   More projects
   ============================================================ */
.more { margin-top: clamp(4rem, 10vh, 7rem); position: relative; }
.more__title { color: var(--ink-faint); margin-bottom: 1.2rem; }
.more__preview {
  position: fixed; top: 0; left: 0;
  width: 300px; aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  z-index: 90;
  opacity: 0;
  transform: scale(0.85);
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  .more__preview { display: block; }
}
.more__preview img { width: 100%; height: 100%; object-fit: cover; }
.more__list { border-top: 1px solid var(--line); }
.more__row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2.6fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.45s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s;
}
.more__row:hover { padding-left: 1.2rem; background: rgba(236, 237, 238, 0.02); }
.more__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
}
.more__row:hover .more__name { color: var(--acc); }
.more__what { color: var(--ink-dim); font-size: 0.9rem; }
.more__tech { color: var(--ink-faint); text-align: right; }

/* ============================================================
   Capabilities
   ============================================================ */
.caps__heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 4.5vw, 3.6rem);
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin-bottom: clamp(3rem, 7vh, 5rem);
  max-width: 56rem;
}
.caps__heading .wd { display: inline-block; }
.caps__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.cap {
  background: var(--bg);
  padding: clamp(1.8rem, 3.5vw, 3rem);
  position: relative;
  transition: background-color 0.4s;
}
.cap:hover { background: var(--bg-2); }
.cap__idx { color: var(--acc); display: block; margin-bottom: 2.2rem; }
.cap__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  letter-spacing: -0.01em;
}
.cap__body { color: var(--ink-dim); margin-top: 1rem; font-size: 0.94rem; max-width: 30rem; }
.cap__list { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; color: var(--ink-faint); }
.cap__list li::before { content: "— "; color: var(--acc); }

/* ============================================================
   Experience
   ============================================================ */
.xp__list { border-top: 1px solid var(--line); }
.xp__row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 2fr) minmax(0, 1.6fr);
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
}
.xp__years { color: var(--acc); }
.xp__row--current { background: linear-gradient(to right, rgba(200, 255, 79, 0.05), transparent 60%); }
.xp__badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.7rem;
  background: var(--acc);
  color: var(--acc-ink);
  border-radius: 99px;
  padding: 0.22rem 0.65rem;
  font-size: 0.58rem;
}
.xp__role {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.15rem, 2.2vw, 1.7rem);
  letter-spacing: -0.01em;
}
.xp__org { color: var(--ink-dim); font-size: 0.92rem; text-align: right; }

/* ============================================================
   Contact
   ============================================================ */
.contact {
  text-align: center;
  padding-bottom: var(--section-gap);
}
.contact__pre { color: var(--ink-dim); margin-bottom: 1.6rem; opacity: 0; }
.contact__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(4rem, 17vw, 15rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}
.contact__line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.contact__line--acc .ch { color: var(--acc); }
.contact__links {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 1rem 2.6rem;
}
.contact__links a {
  font-family: var(--font-mono); font-size: 0.78rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-dim);
  transition: color 0.3s;
}
.contact__links a:hover { color: var(--acc); }

/* ============================================================
   Project room — 3D overlay
   ============================================================ */
.room {
  position: fixed; inset: 0; z-index: 120;
  background:
    radial-gradient(ellipse 70% 60% at 70% 40%, rgba(20, 20, 32, 0.92) 0%, transparent 70%),
    rgba(5, 5, 8, 0.99);
  backdrop-filter: blur(14px);
  visibility: hidden;
  opacity: 0;
}
.room__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.room__close {
  position: absolute; top: 1.4rem; right: var(--gutter); z-index: 2;
  display: inline-flex; align-items: center; gap: 0.6rem;
  background: rgba(8, 8, 12, 0.5);
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  color: var(--ink);
  font-size: 0.95rem;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  transition: border-color 0.3s, background-color 0.3s;
}
.room__close:hover { border-color: var(--acc); }
.room__close .mono { color: var(--ink-faint); }
.room__content {
  position: absolute; z-index: 1;
  left: var(--gutter); top: 50%;
  transform: translateY(-50%);
  width: min(46%, 40rem);
  max-height: 86vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 1.4rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(236, 237, 238, 0.18) transparent;
}
.room__content::-webkit-scrollbar { width: 4px; }
.room__content::-webkit-scrollbar-track { background: transparent; }
.room__content::-webkit-scrollbar-thumb {
  background: rgba(236, 237, 238, 0.18);
  border-radius: 99px;
}
.room__meta {
  display: flex; gap: 1.5rem;
  color: var(--room-acc, var(--acc));
  margin-bottom: 1rem;
}
.room__year { color: var(--ink-faint); }
.room__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.room__vision {
  margin-top: 1.4rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 1.45;
  color: var(--ink-dim);
}
.room__label { color: var(--room-acc, var(--acc)); margin: 1.8rem 0 0.7rem; }
.room__points li {
  position: relative;
  padding: 0.45rem 0 0.45rem 1.4rem;
  color: var(--ink-dim);
  font-size: 0.92rem;
  border-bottom: 1px solid var(--line);
}
.room__points li::before {
  content: "—";
  position: absolute; left: 0;
  color: var(--room-acc, var(--acc));
}
.room__points--struggles li::before { content: "✕"; font-size: 0.7em; top: 0.75rem; }
.room__tech {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 1.6rem;
}
.room__tech li {
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 0.35rem 0.8rem;
  color: var(--ink-dim);
}
.room__link {
  display: inline-block;
  margin-top: 1.6rem;
  color: var(--room-acc, var(--acc));
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.2rem;
}
.room__link[hidden] { display: none; }

@media (max-width: 960px) {
  .room__content {
    left: var(--gutter); right: var(--gutter);
    width: auto;
    top: auto; bottom: 0;
    transform: none;
    max-height: 56vh;
    padding-bottom: 2rem;
    mask-image: linear-gradient(to bottom, transparent 0, black 2rem);
  }
  .room__close { top: 1rem; right: 1rem; }
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--line);
  padding: clamp(2rem, 5vh, 3.5rem) var(--gutter) 1.6rem;
  overflow: hidden;
}
.footer__giant {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 12.2vw, 13rem);
  line-height: 0.85;
  text-align: center;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(236, 237, 238, 0.16);
  user-select: none;
  margin-bottom: clamp(2rem, 5vh, 3.5rem);
}
.footer__bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  padding-top: 1.4rem;
}
.footer__bar a { transition: color 0.3s; }
.footer__bar a:hover { color: var(--acc); }
.footer__time { color: var(--ink-dim); }

/* ============================================================
   Process — scroll-drawn SVG
   ============================================================ */
.process__wrap { position: relative; }
.process__svg {
  position: absolute; top: 0; left: 0;
  width: 110px; height: 100%;
  overflow: visible;
}
.process__svg path {
  fill: none;
  stroke-width: 1.5px;
  stroke-linecap: round;
}
.process__track { stroke: rgba(236, 237, 238, 0.12); }
.process__draw { stroke: var(--acc); filter: drop-shadow(0 0 6px rgba(200, 255, 79, 0.45)); }

.process__steps { display: flex; flex-direction: column; }
.step {
  position: relative;
  padding: 0 0 0 calc(110px + 2.5rem);
  min-height: 250px;
  display: flex; flex-direction: column; justify-content: center;
}
.step__dot {
  position: absolute;
  left: calc(55px - 7px); top: 50%;
  width: 14px; height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  border: 1.5px solid rgba(236, 237, 238, 0.3);
  background: var(--bg);
  transition: background-color 0.5s, border-color 0.5s, box-shadow 0.5s;
  z-index: 1;
}
.step.is-active .step__dot {
  background: var(--acc);
  border-color: var(--acc);
  box-shadow: 0 0 18px rgba(200, 255, 79, 0.55);
}
@media (min-width: 961px) {
  .step:nth-child(even) { padding-left: calc(110px + 2.5rem + 24vw); }
}
.step__head { display: flex; align-items: baseline; gap: 1.2rem; }
.step__idx { color: var(--acc); }
.step__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  letter-spacing: -0.015em;
  color: var(--ink-faint);
  transition: color 0.5s;
}
.step.is-active .step__name { color: var(--ink); }
.step__body {
  color: var(--ink-dim);
  max-width: 30rem;
  margin-top: 0.8rem;
  font-size: 0.96rem;
}

/* ============================================================
   Playground — 3D stage
   ============================================================ */
/* the stage is pinned by ScrollTrigger, which locks the measured layout
   width — so go full-bleed via section padding, never negative margins */
.play { padding-left: 0; padding-right: 0; }
.play > .section__head { margin-left: var(--gutter); margin-right: var(--gutter); }

.play__stage {
  position: relative;
  height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 50% 50%, #101019 0%, transparent 70%),
    var(--bg);
  cursor: grab;
}
.play__stage:active { cursor: grabbing; }
.play__stage::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(236, 237, 238, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 237, 238, 0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at center, black 25%, transparent 78%);
}
.play__word {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(5rem, 19vw, 17rem);
  letter-spacing: 0.02em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(236, 237, 238, 0.22);
  user-select: none;
}
#playCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.play__hud {
  position: absolute; top: 5.5rem; left: 1.8rem;
  color: var(--ink-dim);
  display: flex; flex-direction: column; gap: 0.35rem;
  text-transform: none;
}
.play__hud-row span { color: var(--acc); }
.play__state {
  position: absolute; top: 5.5rem; right: 1.8rem;
  color: var(--ink-dim);
}
.play__hint {
  position: absolute; bottom: 1.6rem; left: 50%;
  transform: translateX(-50%);
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ============================================================
   Under the hood — terminal + telemetry
   ============================================================ */
.hood__heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 4.5vw, 3.6rem);
  letter-spacing: -0.015em;
  line-height: 1.1;
  max-width: 56rem;
}
.hood__sub {
  color: var(--ink-dim);
  max-width: 38rem;
  margin-top: 1.2rem;
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}
.hood__grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}

.term {
  background: #0b0c11;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.term__bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(236, 237, 238, 0.025);
}
.term__bar p { color: var(--ink-faint); margin-left: 0.6rem; }
.term__dot { width: 11px; height: 11px; border-radius: 50%; }
.term__dot--r { background: #ff5f57; }
.term__dot--y { background: #febc2e; }
.term__dot--g { background: #28c840; }
.term__body {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.75;
  padding: 1.2rem 1.3rem 1.4rem;
  height: 420px;
  overflow-y: auto;
  color: var(--ink-dim);
  cursor: text;
  overscroll-behavior: contain;
}
.term__body a { color: var(--acc); text-decoration: underline; text-underline-offset: 3px; }
.term__line { white-space: pre-wrap; word-break: break-word; }
.term__sigil { color: var(--acc); }
.term__typed { color: var(--ink); }
.term__caret {
  display: inline-block;
  width: 0.55em; height: 1.05em;
  background: var(--acc);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: caret 1.1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.term__input {
  position: absolute; bottom: 0; left: 0;
  width: 1px; height: 1px;
  opacity: 0; border: 0; padding: 0;
}

.tele {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
  background: var(--bg-2);
}
.tele__title { color: var(--acc); margin-bottom: 0.9rem; }
.tele__list li {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.62rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.68rem;
}
.tele__list li:last-child { border-bottom: none; }
.tele__list li span { flex: 1; }
.tele__list li b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
#fpsSpark { width: 140px; height: 26px; opacity: 0.9; }
.tele__note { margin-top: 1rem; color: var(--ink-faint); font-size: 0.78rem; }

/* ============================================================
   Contact extras — 2D dot field + scribble
   ============================================================ */
.contact { position: relative; overflow: hidden; }
.contact__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.contact__pre, .contact__title, .contact .btn--big, .contact__links { position: relative; }
.contact__talk { position: relative; display: inline-block; }
.contact__scribble {
  position: absolute;
  inset: -14% -7%;
  width: 114%; height: 128%;
  overflow: visible;
  pointer-events: none;
}
.contact__scribble path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3px;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.9;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .nav__links { display: none; }

  .hero__foot { flex-direction: column; align-items: flex-start; }
  .hero__hint { display: none; }

  .about__grid { grid-template-columns: repeat(2, 1fr); }
  .about__stat { border-right: none; padding-left: 0; border-bottom: 1px solid var(--line); padding-bottom: 1.6rem; }
  .about__stat:nth-child(odd) { border-right: 1px solid var(--line); padding-right: 1.5rem; }
  .about__stat:nth-child(even) { padding-left: 1.5rem; }
  .about__stat:nth-last-child(-n+2) { border-bottom: none; }

  .card {
    grid-template-columns: 1fr;
    min-height: 0;
    top: 4.5rem;
  }
  .card__visual { min-height: 13rem; order: -1; }
  .card__mono { font-size: clamp(5rem, 22vw, 8rem); }

  .more__row { grid-template-columns: 1fr; gap: 0.35rem; }
  .more__tech { text-align: left; }

  .caps__grid { grid-template-columns: 1fr; }

  .xp__row { grid-template-columns: 1fr; gap: 0.3rem; }
  .xp__org { text-align: left; }

  .process__svg { width: 56px; }
  .step { padding-left: calc(56px + 1.4rem); min-height: 250px; }
  .step__dot { left: calc(28px - 6px); width: 12px; height: 12px; margin-top: -6px; }

  .play__hud { top: 1.1rem; left: 1.2rem; font-size: 0.6rem; }
  .play__state { top: 1.1rem; right: 1.2rem; font-size: 0.6rem; }
  .play__hint { bottom: 1.1rem; font-size: 0.58rem; }

  .hood__grid { grid-template-columns: 1fr; }
  .term__body { height: 340px; }

  .footer__bar { justify-content: center; text-align: center; }
}

@media (max-width: 560px) {
  :root { --section-gap: 5.5rem; }
  .nav { padding: 1rem var(--gutter); }
  .nav__status { font-size: 0.58rem; padding: 0.45rem 0.8rem; }
  .hero { padding-bottom: 2.2rem; }
  .hero__sub { font-size: 0.92rem; }
  .card { padding: 1.25rem; top: 3.5rem; }
  .card__visual { min-height: 11rem; }
  .card__desc { font-size: 0.92rem; }
  .card__chip { font-size: 0.6rem; }
  .btn--big { width: 100%; justify-content: center; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .split .ch { transform: none; }
  .hero__eyebrow, .hero__sub, .btn--primary, .hero__hint, .contact__pre { opacity: 1; }
  .about__statement .wd { opacity: 1; }
}
