/* IBLACK — design tokens
   void: near-black field
   paper: warm off-white ink
   haze: secondary
   line: hairlines
   glass: single optical layer for product reveal only
*/
:root {
  --void: #050505;
  --ink: #0a0a0a;
  --panel: #101010;
  --paper: #f0ede6;
  --haze: #7a7874;
  --line: #1c1c1c;
  --signal: #c9c4b8;
  --glass: rgba(255, 255, 255, 0.04);
  --glass-edge: rgba(255, 255, 255, 0.08);
  --font-display: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Consolas, monospace;
  --pad: clamp(20px, 4vw, 48px);
  --nav-h: 64px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--void);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 1px solid var(--paper);
  outline-offset: 4px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--haze);
}

/* film grain — almost invisible */
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.035;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ─── Nav ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--pad);
  background: linear-gradient(to bottom, rgba(5, 5, 5, 0.85), rgba(5, 5, 5, 0));
  pointer-events: none;
}

.nav > * {
  pointer-events: auto;
}

.nav-brand {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.14em;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a,
.nav-ext {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--haze);
  transition: color 0.25s ease;
}

.nav-links a:hover,
.nav-ext:hover,
.nav-brand:hover {
  color: var(--paper);
}

.nav-ext {
  justify-self: end;
}

/* ─── Hero ─── */
.hero {
  position: relative;
  height: 200vh;
}

.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--nav-h) + 28px) var(--pad) 40px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 55% at 50% 58%, rgba(255, 255, 255, 0.045), transparent 70%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(255, 255, 255, 0.02), transparent 70%);
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  will-change: opacity;
}

/* same center stage for wordmark + bridge line */
.hero-stage {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 0;
}

.hero-title {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  z-index: 2;
  will-change: transform, opacity;
}

.hero-line {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(64px, 13vw, 176px);
  line-height: 0.85;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  color: var(--paper);
  user-select: none;
  transform-origin: center center;
  will-change: transform, letter-spacing, opacity;
}

/* Bridge sits in the exact same center slot */
.bridge {
  grid-area: 1 / 1;
  z-index: 1;
  max-width: 720px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}

.bridge-line {
  font-weight: 800;
  font-size: clamp(28px, 4.4vw, 56px);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.bridge-word {
  display: block;
}

.bridge-word:nth-child(2) {
  color: var(--haze);
}

.bridge-sub {
  margin-top: 24px;
}

.hero-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  will-change: opacity;
}

.hero-tag {
  max-width: 220px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--haze);
}

.scroll-hint {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scroll-line {
  display: block;
  width: 48px;
  height: 1px;
  background: var(--haze);
  transform-origin: left center;
  animation: pulse-line 2.4s ease-in-out infinite;
}

@keyframes pulse-line {
  0%,
  100% {
    transform: scaleX(0.35);
    opacity: 0.4;
  }
  50% {
    transform: scaleX(1);
    opacity: 1;
  }
}

/* ─── Work ─── */
.work {
  position: relative;
  padding: 18vh var(--pad) 12vh;
  border-top: 1px solid var(--line);
}

.work-head {
  max-width: 720px;
  margin-bottom: 8vh;
}

.work-label {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
}

.work-name {
  font-weight: 800;
  font-size: clamp(40px, 7vw, 88px);
  letter-spacing: -0.04em;
  line-height: 1;
}

.work-desc {
  max-width: 420px;
  color: var(--haze);
  font-size: 15px;
  margin-bottom: 28px;
}

.work-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  transition: border-color 0.25s ease, color 0.25s ease;
}

.work-link:hover {
  border-color: var(--paper);
}

/* product reveal — glass is environment, not a card system */
.reveal-wrap {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
}

.reveal-glass {
  position: absolute;
  inset: 8% 4% auto;
  height: 70%;
  border-radius: 40% 40% 30% 30%;
  background: radial-gradient(
    ellipse at 50% 40%,
    rgba(255, 255, 255, 0.055),
    transparent 68%
  );
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.device {
  position: relative;
  z-index: 1;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--glass-edge);
  background: var(--ink);
  box-shadow: 0 50px 140px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateY(72px) scale(0.94);
  opacity: 0.2;
  transition: transform 1.25s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 1.05s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.work.is-in .device {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.device-chrome {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #0c0c0c;
}

.device-dots {
  display: flex;
  gap: 6px;
}

.device-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2a2a2a;
}

.device-url {
  flex: 1;
  text-align: center;
  color: #4a4a4a;
}

.device-screen {
  display: grid;
  grid-template-columns: 168px 1fr;
  min-height: min(72vh, 640px);
}

/* Gamebox UI mock */
.gb-side {
  border-right: 1px solid var(--line);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: #080808;
}

.gb-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.06em;
  background: var(--paper);
  color: var(--void);
}

.gb-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 13px;
  color: var(--haze);
}

.gb-nav .is-active {
  color: var(--paper);
}

.gb-side-foot {
  margin-top: auto;
  color: #3a3a3a;
}

.gb-main {
  padding: 28px 28px 32px;
  background: linear-gradient(180deg, #0b0b0b 0%, #080808 100%);
}

.gb-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.gb-top h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.gb-search {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #4a4a4a;
  min-width: 120px;
  text-align: center;
}

.gb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.gb-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0e0e0e;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.gb-card:hover {
  border-color: #333;
  transform: translateY(-2px);
}

.gb-art {
  aspect-ratio: 16 / 10;
  background: #151515;
}

.gb-card.c1 .gb-art {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2218 45%, #0d0d0d 100%);
}
.gb-card.c2 .gb-art {
  background: linear-gradient(160deg, #12141a 0%, #1c2430 50%, #0a0a0c 100%);
}
.gb-card.c3 .gb-art {
  background: linear-gradient(145deg, #161412 0%, #2c241c 40%, #101010 100%);
}
.gb-card.c4 .gb-art {
  background: linear-gradient(120deg, #0f1210 0%, #1a2820 55%, #0b0b0b 100%);
}
.gb-card.c5 .gb-art {
  background: linear-gradient(150deg, #141218 0%, #221c28 50%, #0c0c0e 100%);
}
.gb-card.c6 .gb-art {
  background: linear-gradient(135deg, #101010 0%, #2a2a2a 40%, #0a0a0a 100%);
}

.gb-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 12px 14px;
  gap: 8px;
}

.gb-info strong {
  font-size: 13px;
  font-weight: 600;
}

.gb-info .mono {
  font-size: 10px;
  color: #4a4a4a;
}

.work-foot {
  margin-top: 6vh;
  text-align: center;
}

/* ─── About ─── */
.about {
  padding: 22vh var(--pad);
  border-top: 1px solid var(--line);
}

.about-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: start;
}

.about-eyebrow {
  margin-bottom: 24px;
}

.about-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.about-right {
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: var(--haze);
  font-size: 15px;
  line-height: 1.7;
}

.about-contact {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.about-contact a {
  color: var(--paper);
  font-size: 18px;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  align-self: flex-start;
  padding-bottom: 4px;
  transition: border-color 0.25s ease;
}

.about-contact a:hover {
  border-color: var(--paper);
}

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--line);
  padding: 28px var(--pad) 36px;
}

.footer-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.14em;
}

.footer-links {
  margin-left: auto;
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--haze);
  transition: color 0.25s ease;
}

.footer-links a:hover {
  color: var(--paper);
}

/* ─── Responsive ─── */
@media (max-width: 860px) {
  .nav {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    display: none;
  }

  .device-screen {
    grid-template-columns: 1fr;
  }

  .gb-side {
    display: none;
  }

  .gb-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about-right {
    padding-top: 0;
  }

  .hero-tag {
    max-width: 160px;
    font-size: 12px;
  }
}

@media (max-width: 520px) {
  .gb-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .gb-main {
    padding: 18px;
  }

  .footer-links {
    margin-left: 0;
    width: 100%;
  }
}

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

  .scroll-line {
    animation: none;
  }

  .bridge,
  .device {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
