:root {
  --bg: #13111c;
  --accent: #818cf8;
  --cta: #f97316;
  --text: #fafafa;
  --muted: rgba(250, 250, 250, 0.6);
  --line: rgba(250, 250, 250, 0.14);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(1rem, 2.4vw, 2.25rem);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  background: var(--bg);
}
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-stopped {
  overflow: hidden;
}
body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
img {
  display: block;
  max-width: 100%;
}
::selection {
  background: var(--accent);
  color: var(--bg);
}

/* Loader */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: var(--pad);
}
.loader .pct {
  font-size: clamp(5rem, 22vw, 22rem);
  line-height: 0.8;
  font-weight: 500;
  letter-spacing: -0.06em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.loader .tag {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding-bottom: 0.5rem;
}
.loader .bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 3px;
  width: 100%;
  background: var(--cta);
  transform-origin: left;
  transform: scaleX(0);
}

/* Header */
header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--pad);
  padding-right: calc(var(--pad) + 8.25rem);
  pointer-events: none;
}
header > * {
  pointer-events: auto;
}
.logo,
.link {
  mix-blend-mode: difference;
}
.logo {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.1rem;
}
.link {
  position: relative;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 1px;
  width: 100%;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.6s var(--ease);
}
.link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Index */
#track {
  position: relative;
}
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}
.slide {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 0);
}
.slide + .slide {
  clip-path: inset(100% 0 0 0);
}
.media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #2a2552, #13111c 60%, #3b1d12);
}
.media img {
  position: absolute;
  inset: -8% 0;
  width: 100%;
  height: 116%;
  object-fit: cover;
  will-change: transform;
}
.media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(19, 17, 28, 0.55) 0%,
      rgba(19, 17, 28, 0.05) 35%,
      rgba(19, 17, 28, 0.85) 100%
    ),
    linear-gradient(120deg, rgba(129, 140, 248, 0.28), transparent 55%);
}
.title {
  position: absolute;
  left: var(--pad);
  bottom: calc(var(--pad) * 4);
  font-size: clamp(3.2rem, 12.5vw, 15rem);
  line-height: 0.9;
  font-weight: 500;
  letter-spacing: -0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.title .w {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.08em;
  vertical-align: top;
}
.title .ch {
  display: inline-block;
  will-change: transform;
}
.meta {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.meta .m {
  display: inline-block;
  overflow: hidden;
}
.meta .m span {
  display: inline-block;
}
.num {
  position: absolute;
  top: calc(var(--pad) * 3.4);
  right: var(--pad);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  overflow: hidden;
}
.num span {
  display: block;
}

.counter {
  position: absolute;
  top: 50%;
  left: var(--pad);
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.counter i {
  display: block;
  width: 2px;
  height: 28px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.counter i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.7s var(--ease);
}
.counter i.on::after {
  transform: scaleY(1);
}

.cta {
  position: absolute;
  right: var(--pad);
  bottom: var(--pad);
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 1.4rem;
  border-radius: 999px;
  background: var(--cta);
  color: #13111c;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  transition:
    transform 0.5s var(--ease),
    background 0.3s;
}
.cta:hover {
  transform: scale(1.06);
  background: var(--text);
}
.cta svg {
  width: 14px;
  height: 14px;
  transition: transform 0.5s var(--ease);
}
.cta:hover svg {
  transform: translate(3px, -3px);
}
.hint {
  position: absolute;
  left: 50%;
  bottom: var(--pad);
  z-index: 6;
  transform: translateX(-50%);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.hint b {
  display: block;
  width: 1px;
  height: 38px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.hint b::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 50%;
  background: var(--accent);
  animation: drip 1.8s var(--ease) infinite;
}
@keyframes drip {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(200%);
  }
}

/* Hero */
#hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--pad);
}
.h-media {
  position: absolute;
  inset: -14% 0 0 0;
  background: linear-gradient(135deg, #2a2552, #13111c 60%, #3b1d12);
  overflow: hidden;
}
.h-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 100% 50%;
  opacity: 0.925;
}
.h-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(19, 17, 28, 0.6),
      rgba(19, 17, 28, 0.1) 40%,
      #13111c 100%
    ),
    radial-gradient(
      70% 60% at 15% 85%,
      rgba(129, 140, 248, 0.35),
      transparent 70%
    );
}
.h-title {
  position: relative;
  z-index: 2;
  font-size: clamp(3rem, 10.5vw, 13rem);
  line-height: 0.92;
  font-weight: 500;
  letter-spacing: -0.06em;
  text-transform: uppercase;
}

.h-title .ln {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
}
.h-title .ln > span {
  display: block;
  will-change: transform;
}
.h-title em {
  font-style: normal;
  color: var(--accent);
}

.h-title .eyebrow {
  font-size: 1rem;
  letter-spacing: 0;
}

.h-row {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-top: clamp(1.25rem, 3vw, 2.5rem);
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.h-row p {
  max-width: 36ch;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
  color: var(--text);
}
.avail {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.avail::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cta);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.6);
  }
  70%,
  100% {
    box-shadow: 0 0 0 10px rgba(249, 115, 22, 0);
  }
}

/* Reference image per project */
.ref {
  position: absolute;
  top: 0;
  bottom: 0;
  right: var(--pad);
  z-index: 4;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.ref-in {
  pointer-events: auto;
  width: clamp(150px, 17vw, 280px);
}
.ref-img {
  aspect-ratio: 4/5;
  overflow: hidden;
  border-radius: 4px;
  background: linear-gradient(135deg, #2a2552, #13111c);
  outline: 1px solid var(--line);
}
.ref-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}
.ref-in:hover .ref-img img {
  transform: scale(1.08);
}
.ref-cap {
  display: flex;
  justify-content: space-between;
  margin-top: 0.7rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.ref-cap b {
  color: var(--accent);
  font-weight: 500;
}

/* Custom cursor (fine pointers only) */
.cur,
.cur-dot {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 999;
  pointer-events: none;
  display: none;
  opacity: 0;
}
.fine,
.fine * {
  cursor: none !important;
}
.fine .cur,
.fine .cur-dot {
  display: flex;
}
.cur {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--text);
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--bg);
  mix-blend-mode: difference;
  transition:
    background 0.3s,
    border-color 0.3s;
}
.cur.link {
  background: var(--text);
}
.cur.view {
  background: var(--cta);
  border-color: var(--cta);
  mix-blend-mode: normal;
}
.cur-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text);
  mix-blend-mode: difference;
}

/* Panel (case study / info) */
.panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
  clip-path: inset(100% 0 0 0);
  visibility: hidden;
}
.panel .inner {
  position: relative;
}
.crumbs {
  position: fixed;
  top: var(--pad);
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: none;
  gap: 0.6rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  mix-blend-mode: difference;
}
.crumbs.on {
  display: flex;
}
.crumbs a,
.crumbs span {
  opacity: 0.6;
}
.crumbs span:last-child {
  opacity: 1;
}
.p-hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
}
.p-hero img {
  position: absolute;
  inset: -12% 0;
  width: 100%;
  height: 124%;
  object-fit: cover;
}
.p-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(19, 17, 28, 0.2),
    rgba(19, 17, 28, 0.9)
  );
}
.p-hero h2 {
  position: absolute;
  z-index: 2;
  left: var(--pad);
  bottom: var(--pad);
  font-size: clamp(3rem, 11vw, 13rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
  font-weight: 500;
  text-transform: uppercase;
}
.p-body {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--pad);
  padding: clamp(4rem, 12vw, 10rem) var(--pad);
}
.p-body .lbl {
  grid-column: 1/4;
  color: var(--accent);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding-top: 0.5rem;
}
.p-body .txt {
  grid-column: 4/12;
  font-size: clamp(1.4rem, 3vw, 2.8rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.p-body .row {
  display: contents;
}
.p-body .row + .row .lbl,
.p-body .row + .row .txt {
  border-top: 1px solid var(--line);
  padding-top: 2rem;
  margin-top: 2rem;
}
.p-body .txt.sm {
  font-size: clamp(1.1rem, 1.8vw, 1.6rem);
  color: var(--muted);
}
.p-shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--pad);
  padding: 0 var(--pad) clamp(4rem, 10vw, 8rem);
}
.p-shots .s {
  aspect-ratio: 4/5;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(135deg, #2a2552, #13111c);
}
.p-shots .s:nth-child(2) {
  margin-top: 20vh;
}
.p-shots img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.p-end {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  text-align: center;
  padding: var(--pad);
}
.p-end .cta {
  position: static;
  font-size: 0.95rem;
  padding: 1.2rem 2rem;
}
.p-end small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
}
.p-pct {
  position: fixed;
  right: var(--pad);
  bottom: var(--pad);
  z-index: 90;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  display: none;
}
.p-pct.on {
  display: block;
}
.close {
  position: fixed;
  top: var(--pad);
  right: calc(var(--pad) + 8.25rem);
  z-index: 95;
  display: none;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  mix-blend-mode: difference;
}
.close.on {
  display: block;
}

/* Resume button: always visible, above panels */
.resume {
  position: fixed;
  top: calc(var(--pad) - 0.55rem);
  right: var(--pad);
  z-index: 96;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  background: var(--cta);
  color: #13111c;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition:
    transform 0.5s var(--ease),
    background 0.3s,
    box-shadow 0.3s;
}
.resume:hover {
  transform: scale(1.06);
  background: var(--text);
  box-shadow: 0 8px 30px rgba(249, 115, 22, 0.35);
}
.resume:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.resume svg {
  width: 13px;
  height: 13px;
  transition: transform 0.5s var(--ease);
}
.resume:hover svg {
  transform: translateY(2px);
}

@media (max-width: 760px) {
  .resume {
    padding: 0.6rem 0.9rem;
    font-size: 0.7rem;
  }
  header {
    padding-right: calc(var(--pad) + 6.5rem);
  }
  .close {
    right: calc(var(--pad) + 6.5rem);
  }
  .p-body .lbl,
  .p-body .txt {
    grid-column: 1/-1;
  }
  .p-shots {
    grid-template-columns: 1fr;
  }
  .p-shots .s:nth-child(2) {
    margin-top: 0;
  }
  .counter {
    display: none;
  }
  .hint {
    display: none;
  }
  .ref {
    align-items: flex-start;
    padding-top: 20vh;
  }
  .ref-in {
    width: 30vw;
  }
  .h-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .title {
    bottom: calc(var(--pad) * 4.6);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hint b::after {
    animation: none;
  }
}

/* Footer */
.foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.4rem var(--pad);
  background: var(--bg);
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.foot .note {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.9rem;
}
.tilde {
  display: inline-block;
  min-width: 1.8em;
  margin: 0 0.15em;
  padding: 0.05em 0.5em;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  transition:
    background 0.3s,
    color 0.3s,
    border-color 0.3s;
}
.tilde:hover,
.tilde:focus-visible {
  background: var(--cta);
  border-color: var(--cta);
  color: #13111c;
  outline: none;
}
.flink {
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  color: var(--text);
  transition: color 0.3s;
}
.flink:hover {
  color: var(--accent);
}
@media (max-width: 760px) {
  .foot {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* =====================================================================
   1. DOS OVERLAY — CSS
   ===================================================================== */
#dos {
  --dos-font:
    "VT323", "Px437 IBM VGA 8x16", "Perfect DOS VGA 437", "Courier New",
    monospace;
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  background: #000;
  color: #aaa;
  font-family: var(--dos-font);
  font-size: clamp(18px, 2.3vw, 26px);
  line-height: 1.15;
  overflow: hidden;
}
#dos.open {
  display: block;
}
#dos,
#dos * {
  cursor: default !important;
} /* beats custom-cursor rules on the host site */
#dos [hidden] {
  display: none !important;
}
html.dos-open {
  overflow: hidden;
}

#dos .screen {
  position: absolute;
  inset: 0;
  padding: clamp(0.8rem, 3vw, 2.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  text-shadow: 0 0 6px rgba(170, 170, 170, 0.35);
}
#dos pre {
  margin: 0;
  font: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}
#dos .dim {
  color: #777;
}
#dos .hi {
  color: #fff;
}
#dos #dos-line {
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 1.15em;
}
#dos .blk {
  animation: dosblink 1.06s steps(1) infinite;
}
@keyframes dosblink {
  50% {
    opacity: 0;
  }
}

/* CRT: scanlines + vignette + faint flicker */
#dos::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.28) 3px
  );
}
#dos::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 21;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.55) 100%
  );
  animation: dosflick 6s infinite;
}
@keyframes dosflick {
  0%,
  100% {
    opacity: 1;
  }
  47% {
    opacity: 0.96;
  }
  50% {
    opacity: 0.88;
  }
  53% {
    opacity: 0.97;
  }
}

#dos .dhint {
  position: absolute;
  right: 1rem;
  bottom: 0.5rem;
  z-index: 22;
  font-size: 0.62em;
  color: #666;
  letter-spacing: 0.05em;
}
#dos-input {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  border: 0;
  padding: 0;
  background: none;
  color: transparent;
}

/* Gorillas canvas */
#dos .game {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem 1rem 1.6rem;
}
#dos .gstage {
  position: relative;
  width: min(100%, calc((100vh - 4rem) * 640 / 350));
  aspect-ratio: 640/350;
}
#dos canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  background: #0000aa;
}
#dos .gin {
  position: absolute;
  top: 2%;
  color: #fff;
  text-shadow: 1px 1px #000;
  font-size: clamp(14px, 2.3vw, 24px);
  line-height: 1.1;
  white-space: pre;
}
#dos #gin0 {
  left: 2%;
}
#dos #gin1 {
  right: 2%;
}

@media (prefers-reduced-motion: reduce) {
  #dos::after {
    animation: none;
  }
  #dos .blk {
    animation: none;
  }
}
