/* ============================================================
   Portfolio — dark, clean, green accent
   ============================================================ */

:root {
  --bg: #080a08;
  --bg-soft: #0b0e0b;
  --panel: #101410;
  --panel-2: #151a15;
  --line: #20261e;
  --line-strong: #2f382b;
  --ink: #f2f5ef;
  --muted: #a4ada0;
  --muted-2: #74806f;
  --accent: #86efac;
  --accent-2: #4ade80;
  --accent-soft: rgba(134, 239, 172, 0.12);
  --accent-line: rgba(134, 239, 172, 0.38);
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  --wrap: 1200px;
  --gut: clamp(20px, 5vw, 56px);
  --ease: cubic-bezier(0.22, 0.7, 0.25, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 560px at 50% -12%, rgba(134, 239, 172, 0.07), transparent 70%),
    radial-gradient(720px 420px at 84% 12%, rgba(74, 222, 128, 0.035), transparent 72%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

::selection {
  background: var(--accent);
  color: #06100a;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ------------------------------------------------------------
   Scroll reveal tweens
   ------------------------------------------------------------ */

.reveal {
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out),
    filter 0.9s var(--ease-out);
}

.js.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(4px);
}

.js.reveal-ready .reveal-plain {
  transform: none;
  filter: none;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ------------------------------------------------------------
   Ambient
   ------------------------------------------------------------ */

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  height: 2px;
  pointer-events: none;
}

.scroll-progress i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 12px rgba(134, 239, 172, 0.55);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.12s linear;
}

/* React Bits Light Rays — real WebGL2 shader, mounted natively */
.light-rays {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.light-rays__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.spark-canvas {
  position: fixed;
  inset: 0;
  z-index: 130;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ------------------------------------------------------------
   Skip link + page frame
   ------------------------------------------------------------ */

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  transform: translateY(-180%);
  padding: 11px 16px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.25s var(--ease-out);
}

.skip-link:focus-visible {
  transform: none;
}

.page {
  position: relative;
  z-index: 1;
  isolation: isolate;
  overflow-x: clip;
}

.wrap {
  width: min(var(--wrap), calc(100% - (var(--gut) * 2)));
  margin-inline: auto;
}

main {
  display: block;
}

/* ------------------------------------------------------------
   Header
   ------------------------------------------------------------ */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 10, 8, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  transition:
    background-color 0.4s var(--ease),
    border-color 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: rgba(134, 239, 172, 0.14);
  background: rgba(8, 10, 8, 0.92);
  box-shadow: 0 18px 50px -34px rgba(0, 0, 0, 0.95);
}

.nav-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(var(--wrap), calc(100% - (var(--gut) * 2)));
  height: 72px;
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-decoration: none;
  white-space: nowrap;
}

.brand::before {
  content: "";
  width: 2px;
  height: 18px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(134, 239, 172, 0.55);
  transition: height 0.35s var(--ease-out), background-color 0.35s var(--ease);
}

.brand:hover::before {
  height: 24px;
  background: var(--accent-2);
}

.brand-name {
  line-height: 1;
}

.nav-links {
  position: absolute;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 36px;
  transform: translateX(-50%);
}

.nav-link {
  position: relative;
  padding: 7px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 50% 100%;
  transition: transform 0.45s var(--ease-out);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.nav-toggle {
  display: none;
  align-content: center;
  justify-items: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

.nav-toggle:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.nav-toggle span {
  display: block;
  width: 15px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(2.75px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-2.75px) rotate(-45deg);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.3s var(--ease),
    border-color 0.3s var(--ease),
    color 0.3s var(--ease),
    transform 0.3s var(--ease-out);
}

.nav-btn span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-2);
  transition: color 0.3s var(--ease), transform 0.3s var(--ease-out);
}

.nav-btn:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.nav-btn:hover span {
  color: var(--accent);
  transform: translate(1px, -1px);
}

.nav-btn-solid {
  border-color: var(--accent);
  background: var(--accent);
  color: #06100a;
}

.nav-btn-solid:hover {
  border-color: #b6f7c8;
  background: #b6f7c8;
  color: #06100a;
  box-shadow: 0 12px 30px -16px rgba(134, 239, 172, 0.6);
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(152px, 21vh, 208px) max(var(--gut), calc((100% - var(--wrap)) / 2)) 48px;
  overflow: hidden;
  text-align: left;
}

.hero-rays {
  position: absolute;
  inset: -6% 0 0;
  z-index: 0;
  opacity: 0.66;
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 58%, transparent 96%);
  mask-image: linear-gradient(180deg, #000 0%, #000 58%, transparent 96%);
}

.hero > * {
  animation: rise 0.95s var(--ease-out) both;
}

.hero > .light-rays {
  animation: none;
}

.hero > .hero-title {
  animation: none;
}

.hero > *:not(.light-rays) {
  position: relative;
  z-index: 1;
}

.hero > *:nth-child(3) { animation-delay: 0.5s; }
.hero > *:nth-child(4) { animation-delay: 0.64s; }
.hero > *:nth-child(5) { animation-delay: 0.82s; }
.hero > *:nth-child(6) { animation-delay: 0.94s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.hero h1 {
  max-width: 1000px;
  margin-top: 0;
  font-size: clamp(48px, 7.2vw, 96px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.hero-title .hero-line {
  display: block;
}

.hero-title .hero-word {
  display: inline-block;
  animation: hero-word-rise 0.9s var(--ease-out) both;
  animation-delay: calc(0.06s + var(--i) * 0.06s);
  will-change: transform, opacity, filter;
}

@keyframes hero-word-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.accent-text {
  color: var(--accent);
}

.hero-lede {
  max-width: 620px;
  margin-top: 28px;
  font-size: 17.5px;
  line-height: 1.72;
  color: var(--muted);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.hero .hero-scroll {
  position: absolute;
  left: max(var(--gut), calc((100% - var(--wrap)) / 2));
  bottom: 34px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

.hero .hero-scroll:hover {
  color: var(--accent);
}

.hero-scroll-line {
  position: relative;
  display: block;
  width: 1px;
  height: 34px;
  overflow: hidden;
  background: rgba(134, 239, 172, 0.18);
}

.hero-scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, var(--accent));
  transform: translateY(-100%);
  animation: scroll-line 2.4s var(--ease) infinite;
}

@keyframes scroll-line {
  0% {
    transform: translateY(-100%);
  }
  55%,
  100% {
    transform: translateY(100%);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 26px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition:
    transform 0.35s var(--ease-out),
    background-color 0.3s var(--ease),
    border-color 0.3s var(--ease),
    color 0.3s var(--ease),
    box-shadow 0.35s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--panel-2);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #06100a;
  box-shadow: 0 14px 40px -20px rgba(134, 239, 172, 0.65);
}

.btn-primary:hover {
  border-color: #b6f7c8;
  background: #b6f7c8;
  color: #06100a;
  box-shadow: 0 18px 46px -18px rgba(134, 239, 172, 0.7);
}

.btn .btn-arrow {
  font-family: var(--mono);
  font-size: 13px;
  transition: transform 0.35s var(--ease-out);
}

.btn-primary:hover .btn-arrow {
  transform: translateY(3px);
}

/* ------------------------------------------------------------
   Sections
   ------------------------------------------------------------ */

.section {
  position: relative;
  padding: clamp(88px, 10vw, 132px) 0;
  scroll-margin-top: 96px;
}

.section-head {
  max-width: 780px;
  margin: 0 auto clamp(40px, 5vw, 64px);
  text-align: center;
}

.section h2 {
  margin-top: 0;
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.section-sub {
  max-width: 62ch;
  margin: 20px auto 0;
  font-size: 16.5px;
  line-height: 1.72;
  color: var(--muted);
  text-wrap: pretty;
}

/* ------------------------------------------------------------
   Game orbit
   ------------------------------------------------------------ */

.orbit {
  position: relative;
  margin-bottom: clamp(44px, 6vw, 72px);
}

.orbit-stage {
  position: relative;
  min-height: 0;
  perspective: 1500px;
}

.orbit-plane {
  display: flex;
  gap: 14px;
  width: 100%;
  padding: 8px 2px 24px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.orbit-plane::-webkit-scrollbar {
  display: none;
}

.orbit-card {
  flex: 0 0 min(76vw, 330px);
  z-index: var(--z, 10);
  scroll-snap-align: center;
}

.orbit-inner {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  box-shadow: 0 22px 54px -28px rgba(0, 0, 0, 0.9);
  transition:
    transform 0.5s var(--ease-out),
    border-color 0.4s var(--ease),
    box-shadow 0.5s var(--ease);
}

.orbit-shot {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--bg-soft);
  cursor: zoom-in;
}

.orbit-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out), filter 0.5s var(--ease);
}

.orbit-shot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04) 36%, rgba(0, 0, 0, 0.88) 100%);
  pointer-events: none;
}

.orbit-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  text-align: left;
}

.orbit-cap img {
  width: 22px;
  height: 22px;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  object-fit: cover;
}

.orbit-cap strong {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.orbit-play {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #3a4437;
  border-radius: 50%;
  background: rgba(8, 10, 8, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.3s var(--ease),
    transform 0.35s var(--ease-out),
    background-color 0.3s var(--ease),
    color 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.orbit-inner:hover .orbit-play,
.orbit-play:focus-visible {
  opacity: 1;
  transform: none;
}

.orbit-play:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #06100a;
}

.orbit.is-laid-out .orbit-stage {
  height: var(--stage-h, 390px);
}

.orbit.is-laid-out .orbit-plane {
  display: block;
  height: 100%;
  padding: 0;
  overflow: visible;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease-out);
}

.orbit.is-laid-out .orbit-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--card-w, 280px);
  transform:
    translate(-50%, -50%)
    translate3d(var(--x, 0px), var(--y, 0px), 0)
    rotate(var(--rot, 0deg));
  transition:
    transform 0.65s var(--ease-out),
    opacity 0.35s var(--ease),
    filter 0.35s var(--ease);
  will-change: transform;
}

.orbit.is-laid-out .orbit-card:hover,
.orbit.is-laid-out .orbit-card:focus-within {
  z-index: 40;
}

.orbit.is-laid-out .orbit-card:hover .orbit-inner,
.orbit.is-laid-out .orbit-card:focus-within .orbit-inner {
  transform: translateY(-8px) scale(1.035);
  border-color: var(--accent-line);
  box-shadow:
    0 34px 80px -32px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(134, 239, 172, 0.16),
    0 0 54px -24px rgba(134, 239, 172, 0.48);
}

.orbit.is-laid-out .orbit-card:hover .orbit-shot img,
.orbit.is-laid-out .orbit-card:focus-within .orbit-shot img {
  transform: scale(1.035);
}

.orbit.is-laid-out .orbit-card:hover .orbit-play,
.orbit.is-laid-out .orbit-card:focus-within .orbit-play {
  opacity: 1;
  transform: none;
}

.orbit.is-laid-out .orbit-plane:has(.orbit-card:hover) .orbit-card:not(:hover),
.orbit.is-laid-out .orbit-plane:has(.orbit-card:focus-within) .orbit-card:not(:focus-within) {
  opacity: 0.5;
  filter: saturate(0.65) brightness(0.75);
}

.orbit.is-visible .orbit-card .orbit-inner {
  animation: orbit-settle 0.85s var(--ease-out) both;
}

.orbit.is-visible .orbit-card:nth-child(2) .orbit-inner { animation-delay: 0.05s; }
.orbit.is-visible .orbit-card:nth-child(3) .orbit-inner { animation-delay: 0.1s; }
.orbit.is-visible .orbit-card:nth-child(4) .orbit-inner { animation-delay: 0.15s; }
.orbit.is-visible .orbit-card:nth-child(5) .orbit-inner { animation-delay: 0.2s; }
.orbit.is-visible .orbit-card:nth-child(6) .orbit-inner { animation-delay: 0.25s; }

@keyframes orbit-settle {
  from {
    transform: translateY(14px) scale(0.97);
  }
  to {
    transform: none;
  }
}

/* ------------------------------------------------------------
   Work cards — bento
   ------------------------------------------------------------ */

.project-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 250px;
  gap: 14px;
}

.project-grid .project:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
}

.project-grid .project:nth-child(2),
.project-grid .project:nth-child(5),
.project-grid .project:nth-child(6) {
  grid-column: span 2;
}

.project {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  transition:
    opacity 0.7s var(--ease-out),
    filter 0.7s var(--ease-out),
    border-color 0.4s var(--ease),
    box-shadow 0.5s var(--ease),
    transform 0.5s var(--ease-out);
}

.project:hover {
  transform: translateY(-3px);
  border-color: rgba(134, 239, 172, 0.42);
  box-shadow:
    0 30px 74px -44px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(134, 239, 172, 0.1);
}

/* hover scrim so the description stays legible over bright art */
.project::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(2, 6, 3, 0.26) 26%,
    rgba(2, 6, 3, 0.72) 52%,
    rgba(2, 6, 3, 0.94) 76%,
    rgba(2, 6, 3, 0.97) 100%
  );
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

.project:hover::before,
.project:focus-within::before {
  opacity: 1;
}

/* cursor-following edge light */
.project::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(
    230px circle at var(--mx, 50%) var(--my, 50%),
    rgba(205, 255, 218, 0.95),
    rgba(134, 239, 172, 0.3) 46%,
    transparent 74%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: calc(var(--near, 0) * 0.9);
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}

.bento-hit {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  background: var(--bg-soft);
  text-align: left;
  cursor: zoom-in;
}

.bento-hit:focus-visible {
  outline-offset: -4px;
  border-radius: inherit;
}

.bento-hit > img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.85s var(--ease-out), filter 0.6s var(--ease);
}

.project:hover .bento-hit > img {
  transform: scale(1.04);
}

.bento-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.26) 0%, transparent 34%, transparent 46%, rgba(2, 6, 3, 0.92) 100%);
  pointer-events: none;
}

.bento-spot {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(
    390px circle at var(--mx, 50%) var(--my, 50%),
    rgba(134, 239, 172, 0.15),
    transparent 66%
  );
  opacity: calc(var(--near, 0) * 0.9);
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}

.bento-info {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.45s var(--ease-out);
}

.project:hover .bento-info,
.project:focus-within .bento-info {
  transform: translateY(-2px);
}

.project-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.9);
}

.project-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bento-text {
  min-width: 0;
}

.bento-text strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}

.bento-text em {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(228, 240, 228, 0.66);
}

.bento-desc {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 78px;
  z-index: 3;
  display: -webkit-box;
  max-width: 52ch;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(242, 245, 239, 0.9);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s var(--ease), transform 0.45s var(--ease-out);
}

.project:hover .bento-desc,
.project:focus-within .bento-desc {
  opacity: 1;
  transform: none;
}

.bento-play {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #3a4437;
  border-radius: 50%;
  background: rgba(8, 10, 8, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  transition:
    background-color 0.3s var(--ease),
    color 0.3s var(--ease),
    border-color 0.3s var(--ease),
    transform 0.35s var(--ease-out);
}

.bento-play:hover,
.bento-play:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
  color: #06100a;
  transform: translate(1px, -1px) scale(1.04);
}

.project-grid .project:nth-child(1) .bento-text strong {
  font-size: 21px;
}

.project-grid .project:nth-child(1) .bento-desc {
  bottom: 84px;
  font-size: 14.5px;
}

/* ------------------------------------------------------------
   Systems
   ------------------------------------------------------------ */

.code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.code-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  transition:
    opacity 0.7s var(--ease-out),
    filter 0.7s var(--ease-out),
    transform 0.5s var(--ease-out),
    border-color 0.4s var(--ease),
    box-shadow 0.5s var(--ease);
}

.code-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(
    460px circle at var(--mx, 50%) var(--my, 0%),
    rgba(134, 239, 172, 0.08),
    transparent 68%
  );
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

.code-card:hover {
  transform: translateY(-3px);
  border-color: rgba(134, 239, 172, 0.32);
  box-shadow: 0 28px 68px -42px rgba(0, 0, 0, 0.95);
}

.code-card:hover::before {
  opacity: 1;
}

.code-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 46px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.code-bar span:first-child {
  color: var(--muted);
}

.code-bar span:last-child {
  color: var(--accent);
  opacity: 0.75;
}

.code-media {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #060806;
  cursor: zoom-in;
}

.code-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  transition: transform 0.65s var(--ease-out);
}

.code-card:hover .code-media img {
  transform: scale(1.015);
}

.code-card figcaption {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 26px;
}

.mini-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.code-card h3 {
  margin-top: 10px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.code-card p {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
}

/* ------------------------------------------------------------
   About
   ------------------------------------------------------------ */

.section-about .wrap {
  display: flex;
  justify-content: center;
}

.about-inner {
  max-width: 800px;
}

.section-about h2 {
  margin-top: 0;
  font-size: clamp(40px, 5.6vw, 72px);
}

.about-inner > p {
  max-width: 62ch;
  margin-top: 22px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--muted);
}

/* ------------------------------------------------------------
   Lightbox
   ------------------------------------------------------------ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 84px clamp(16px, 6vw, 88px);
  background: rgba(4, 6, 4, 0.96);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: min(1240px, 100%);
  transform: translateY(10px) scale(0.985);
  transition: transform 0.45s var(--ease-out);
}

.lightbox.is-open figure {
  transform: none;
}

.lightbox img {
  width: auto;
  max-width: 100%;
  max-height: 76vh;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.95);
}

.lightbox figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 6px 16px;
  text-align: center;
}

.lb-title {
  font-size: 15px;
  font-weight: 600;
}

.lb-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.lb-btn {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.3s var(--ease),
    border-color 0.3s var(--ease),
    color 0.3s var(--ease),
    transform 0.35s var(--ease-out);
}

.lb-btn:hover {
  border-color: var(--accent);
  background: var(--panel-2);
  color: var(--accent);
  transform: translateY(-1px);
}

.lb-btn:active {
  transform: translateY(1px);
}

.lb-close {
  top: 22px;
  right: 22px;
  font-size: 24px;
}

.lb-prev {
  top: 50%;
  left: 22px;
  transform: translateY(-50%);
}

.lb-prev:hover {
  transform: translateY(calc(-50% - 1px));
}

.lb-prev:active {
  transform: translateY(calc(-50% + 1px));
}

.lb-next {
  top: 50%;
  right: 22px;
  transform: translateY(-50%);
}

.lb-next:hover {
  transform: translateY(calc(-50% - 1px));
}

.lb-next:active {
  transform: translateY(calc(-50% + 1px));
}

body.no-scroll {
  overflow: hidden;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 1120px) {
  .nav-links {
    gap: 26px;
  }

  .hero h1 {
    font-size: clamp(46px, 7.4vw, 82px);
  }
}

@media (max-width: 1040px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 230px;
  }

  .project-grid .project:nth-child(1),
  .project-grid .project:nth-child(6) {
    grid-column: span 2;
    grid-row: span 1;
  }

  .project-grid .project:nth-child(2),
  .project-grid .project:nth-child(3),
  .project-grid .project:nth-child(4),
  .project-grid .project:nth-child(5) {
    grid-column: span 1;
    grid-row: span 1;
  }
}

@media (max-width: 1279px) {
  .orbit.is-laid-out .orbit-stage {
    height: auto;
    min-height: 0;
  }

  .orbit.is-laid-out .orbit-plane {
    display: flex;
    height: auto;
    padding: 8px 2px 24px;
    overflow-x: auto;
    transform: none;
    scroll-snap-type: x mandatory;
  }

  .orbit.is-laid-out .orbit-card {
    position: static;
    width: auto;
    flex: 0 0 min(76vw, 330px);
    transform: none;
    opacity: 1 !important;
    filter: none !important;
  }

  .orbit.is-laid-out .orbit-card:hover .orbit-inner,
  .orbit.is-laid-out .orbit-card:focus-within .orbit-inner {
    transform: translateY(-4px) scale(1.01);
  }

  .orbit.is-laid-out .orbit-play {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 900px) {
  .hero .hero-scroll {
    display: none;
  }

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

  .section-head {
    text-align: left;
  }

  .section-sub {
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .nav-inner {
    height: 64px;
  }

  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: grid;
  }

  .nav-links.is-open {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px;
    transform: none;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-soft);
    box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.95);
  }

  .nav-links.is-open .nav-link {
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 15px;
  }

  .nav-links.is-open .nav-link::after {
    display: none;
  }

  .nav-links.is-open .nav-link:hover,
  .nav-links.is-open .nav-link.is-active {
    background: var(--panel);
  }

  .brand {
    font-size: 15px;
  }

  .nav-btn {
    min-height: 38px;
    padding: 0 13px;
    font-size: 12.5px;
  }

  .hero {
    padding-top: 132px;
    padding-bottom: 40px;
  }

  .hero h1 {
    font-size: clamp(42px, 11vw, 64px);
    letter-spacing: -0.04em;
  }

  .hero-lede {
    font-size: 16px;
    line-height: 1.7;
  }

  .project-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 250px;
    gap: 14px;
  }

  .project-grid .project:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
  }

  .project-grid .project:nth-child(1) .bento-text strong {
    font-size: 19px;
  }

  .section h2 {
    font-size: clamp(32px, 8vw, 44px);
  }

  .section-sub {
    font-size: 16px;
  }

  .section {
    padding: 80px 0;
  }

  .code-media {
    aspect-ratio: 16 / 11;
  }

  .lightbox {
    padding: 76px 16px 96px;
  }

  .lightbox img {
    max-height: 70vh;
  }

  .lb-prev,
  .lb-next {
    top: auto;
    bottom: 24px;
    transform: none;
  }

  .lb-prev {
    left: calc(50% - 56px);
  }

  .lb-next {
    right: calc(50% - 56px);
  }

  .lb-prev:hover,
  .lb-prev:active,
  .lb-next:hover,
  .lb-next:active {
    transform: translateY(-1px);
  }
}

@media (max-width: 560px) {
  .nav-actions {
    gap: 8px;
  }

  .nav-btn-ghost {
    display: none;
  }

  .hero-actions {
    width: 100%;
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .brand-name {
    font-size: 14px;
  }

  .hero h1 {
    font-size: clamp(38px, 11.5vw, 52px);
  }

  .bento-info {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .bento-text strong {
    font-size: 16px;
  }

  .bento-desc {
    left: 12px;
    right: 12px;
    font-size: 13px;
  }

  .project-icon {
    width: 38px;
    height: 38px;
  }

  .code-card figcaption {
    padding: 22px;
  }

  .code-bar {
    height: 42px;
    padding: 0 14px;
    font-size: 9px;
  }

  .code-bar span:last-child {
    display: none;
  }
}

@media (hover: none) {
  .orbit-play {
    opacity: 1;
    transform: none;
  }

  .project::before {
    opacity: 1;
  }

  .bento-desc {
    opacity: 1;
    transform: none;
    -webkit-line-clamp: 2;
  }

  .project-grid .project:nth-child(1) .bento-desc {
    bottom: 78px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js.reveal-ready .reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .orbit.is-laid-out .orbit-plane {
    transform: none !important;
  }
}
