/* Theme tokens */
:root{
  --accent:#CF5D2B;
  --bg:#FAFAFA;
  --ink:#0A0A0A;
  --muted:#6B6B6B;
  --border:#E0E0E0;
  --radius:12px;
  --shadow:0 8px 24px rgba(0,0,0,.06);
  --shadow-lg:0 12px 32px rgba(0,0,0,.08);
  --header-h:69px;
  --spacing-xs:8px;
  --spacing-sm:16px;
  --spacing-md:24px;
  --spacing-lg:48px;
  --spacing-xl:96px;
}

/* Smooth transitions for theme switching */
body, .site-header, .intro-full, .services, .fun, section{
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Base */
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:"Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  color:var(--ink);
  background:var(--bg);
  line-height:1.5;
}
/* Ensure form controls inherit typography */
button, input, select, textarea{ font: inherit }
.site-header, section{ scroll-margin-top:80px }
@media (prefers-reduced-motion: reduce){ html{ scroll-behavior:auto } }
.container{width:min(1120px, 90vw); margin-inline:auto}
.section-pad{padding:var(--spacing-xl) 0}
.center{ text-align:center }
.muted{ color:var(--muted); font-weight:400 }
.display{ font-size: clamp(36px, 5vw, 64px); font-weight:700; letter-spacing:-0.02em; line-height:1.1 }
.lede{ font-size: clamp(17px, 2.2vw, 20px); color:var(--muted); max-width:54ch; margin:16px auto 32px; line-height:1.6; font-weight:400; word-break: normal; overflow-wrap: normal; hyphens: none; text-wrap: balance }
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0 }

/* Buttons and links */
.btn{ display:inline-block; padding:12px 24px; border-radius:var(--radius); font-weight:600; font-size:15px; letter-spacing:0.01em; text-decoration:none; line-height:1.4; transition: all .2s cubic-bezier(0.4, 0, 0.2, 1); min-width:140px; text-align:center; font-family:inherit; cursor:pointer; border:2px solid transparent }
.btn:active{ transform:translateY(1px) scale(0.98) }
.btn-accent{ background:var(--accent); color:#fff; border-color:var(--accent) }
.btn-accent:hover{ background:#B54F23; border-color:#B54F23; transform:translateY(-1px); box-shadow:var(--shadow) }
.btn-outline{ color:var(--ink); border-color:var(--ink); background:transparent }
.btn-outline:hover{ background:var(--ink); color:var(--bg); transform:translateY(-1px) }
.link-accent{ color:var(--accent); text-decoration:none; font-weight:500; border-bottom:1px solid transparent; transition:border-color .2s ease; padding-bottom:2px }
.link-accent:hover{ border-bottom-color:var(--accent) }
button:focus-visible, a:focus-visible, .nav-link:focus-visible{ outline:2px solid var(--accent); outline-offset:3px }

/* Header */
.site-header{ position:sticky; top:0; z-index:3000; background:color-mix(in srgb, var(--bg) 95%, white 5%); border-bottom:1px solid var(--border); backdrop-filter:saturate(120%) blur(12px); transition: all .3s ease }
.site-header.blend{ background:transparent; border-bottom-color:transparent; backdrop-filter:none }
.header-inner{ position:relative; display:flex; align-items:center; justify-content:space-between; gap:var(--spacing-sm); padding:16px 0 }
.brand{ display:flex; align-items:center; gap:12px; color:var(--ink); text-decoration:none; font-weight:700; transition:opacity .2s ease }
.brand:hover{ opacity:.7 }
.brand-logo{ height:32px; width:auto; display:block }
@media (min-width: 900px){ .brand-logo{ height:36px } }
.brand-logo.invert{ filter:invert(1) brightness(1.15) contrast(1.05) }

.primary-nav{ position:fixed; inset:0; z-index:4000; display:block; pointer-events:none; opacity:0;
  background:rgba(17,17,17,.94); backdrop-filter:saturate(120%) blur(6px); -webkit-backdrop-filter:saturate(120%) blur(6px);
  clip-path:circle(0 at var(--menu-x, 100%) var(--menu-y, 0));
  transition:opacity .25s ease, clip-path .55s cubic-bezier(.2,.7,.2,1);
  padding-top:env(safe-area-inset-top);
}
.primary-nav::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:3px;
  background:var(--accent);
  transform:scaleX(0);
  transform-origin:center;
  opacity:0;
  transition:transform .2s cubic-bezier(.4,0,.2,1), opacity .2s cubic-bezier(.4,0,.2,1);
}
.primary-nav.bottom-line-visible::after{
  transform:scaleX(1);
  opacity:1;
}
.primary-nav.open{ opacity:1; pointer-events:auto; clip-path:circle(140vmax at var(--menu-x, 100%) var(--menu-y, 0)); }
.primary-nav.pixels-building{ background:rgba(17,17,17,.94) }
.primary-nav .nav-inner{ position:absolute; inset:0; display:flex; align-items:center; justify-content:flex-start; padding:clamp(48px, 8vw, 120px); z-index:2 }
.menu-pixels{ position:absolute; inset:0; width:100%; height:100%; display:block; pointer-events:none; z-index:1 }
.nav-squares{
  position:absolute;
  right:clamp(48px, 8vw, 120px);
  bottom:clamp(48px, 8vw, 120px);
  display:grid;
  grid-template-columns:repeat(2, 40px);
  grid-template-rows:repeat(2, 40px);
  gap:8px;
  opacity:0;
  transform:translateY(24px) scale(0.6);
  transform-origin:center;
  transition:opacity .45s cubic-bezier(.2,.7,.2,1), transform .45s cubic-bezier(.2,.7,.2,1);
}
.primary-nav.open .nav-squares{
  opacity:1;
  transform:translateY(0) scale(1);
  transition-delay:.4s;
}
.nav-squares .square{ width:40px; height:40px; background:var(--accent); border-radius:4px; transition:transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) }
.primary-nav ul{ list-style:none; margin:0; padding:0; display:grid; gap:clamp(20px, 3vw, 32px); text-align:left }
.primary-nav a{
  display:inline-block;
  padding:8px 0;
  color:#ffffff;
  text-decoration:none;
  font-weight:700;
  font-size:clamp(45px, 7vw, 84px);
  letter-spacing:-0.02em;
  border-radius:8px;
  position:relative;
  transition:color .2s ease, letter-spacing .2s ease;
  will-change: opacity, transform;
  /* Start slightly off-screen so the pop animation looks clean */
  transform:translateY(80px) scale(0.8);
  opacity:0;
}
.primary-nav.open a{
  animation:menuItemPop .6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.primary-nav.open li:nth-child(1) a{ animation-delay:.05s }
.primary-nav.open li:nth-child(2) a{ animation-delay:.10s }
.primary-nav.open li:nth-child(3) a{ animation-delay:.15s }
.primary-nav.open li:nth-child(4) a{ animation-delay:.20s }
.primary-nav.open li:nth-child(5) a{ animation-delay:.25s }

.primary-nav a::after{ content:""; position:absolute; left:0; bottom:-6px; width:0; height:3px; background:var(--accent); border-radius:2px; transition:width .28s cubic-bezier(.4,0,.2,1) }
.primary-nav a.nav-link:hover::after{ width:100% }
.primary-nav a.active{ color:color-mix(in srgb, #fff 92%, var(--accent) 8%); letter-spacing:-0.015em }
.primary-nav a.active::after{ width:100% }
.primary-nav a:focus-visible{ outline:none }
@keyframes menuItemPop{
  0%{
    transform:translateY(80px) scale(0.8) rotateX(20deg);
    opacity:0
  }
  60%{
    transform:translateY(-8px) scale(1.05) rotateX(-5deg);
    opacity:1
  }
  100%{
    transform:translateY(0) scale(1) rotateX(0deg);
    opacity:1
  }
}


.skills-scroll {
  --tension: 0;
  position: relative;
}

.skills-tension-bar {
  position: sticky;
  top: var(--header-h); /* sit just below sticky header/nav */
  left: 0;
  right: 0;
  height: 4px;
  transform-origin: 0 50%;
  transform: scaleX(var(--tension));
  background: linear-gradient(90deg, #CF5D2B, #F19A5E);
  opacity: calc(0.3 + var(--tension) * 0.7);
  transition: transform 120ms ease-out, opacity 120ms ease-out;
  pointer-events: none;
  z-index: 10;
}

/* Burger → X */
.menu-toggle{ position:relative; display:inline-flex; width:44px; height:36px; align-items:center; justify-content:center; padding:0; background:transparent; border:none; color:var(--accent); cursor:pointer; isolation:isolate; z-index:2000 }
.menu-toggle:active{ transform:scale(.98) }
.menu-toggle .bar{ position:absolute; left:50%; top:50%; width:22px; height:2px; background:currentColor; border-radius:2px; transform-origin:center; transition: transform .22s cubic-bezier(.4,0,.2,1), opacity .22s ease }
.menu-toggle .bar:nth-child(1){ transform:translate(-50%, -6px) }
.menu-toggle .bar:nth-child(2){ transform:translateX(-50%) }
.menu-toggle .bar:nth-child(3){ transform:translate(-50%, 6px) }
.menu-toggle.is-open .bar:nth-child(1){ transform:translate(-50%, 0) rotate(45deg) }
.menu-toggle.is-open .bar:nth-child(2){ transform:translateX(calc(-50% + 25px)) rotate(-60deg) }
.menu-toggle.is-open .bar:nth-child(3){ transform:translate(-50%, 0) rotate(-45deg) }

/* Theme toggle button */
.theme-toggle{ position:relative; display:inline-flex; width:40px; height:40px; align-items:center; justify-content:center; padding:0; background:transparent; border:1.5px solid var(--border); border-radius:50%; color:var(--ink); cursor:pointer; transition: all .3s ease; margin-right:12px }
.theme-toggle:hover{ border-color:var(--accent); background:rgba(207,93,43,.08); transform:scale(1.05) }
.theme-toggle:active{ transform:scale(0.95) }
.theme-toggle svg{ width:20px; height:20px; transition: transform .3s ease }
.theme-toggle:hover svg{ transform:rotate(20deg) }
.theme-toggle .icon-sun, .theme-toggle .icon-moon{ position:absolute; transition: opacity .3s ease, transform .3s ease }
.theme-toggle .icon-moon{ opacity:0; transform:rotate(-90deg) scale(0.5) }

/* Hero */
.hero{ min-height:100svh; min-height:100dvh; display:grid; place-items:center; }
.hero-inner{ text-align:center; padding:0 0 }
.hero-logo{ color:var(--accent) }
.hero-video{ width: min(38vw, 420px); height:auto; display:block; margin-inline:auto }
.hero-logo-img{ height:96px; width:auto; opacity:.92; display:none }
@media (prefers-reduced-motion: reduce){
  .hero-video{ display:none }
  .hero-logo-img{ display:block }
}
.hero-scroll{ margin-top:56px; font-size:48px; color:var(--accent); display:inline-block; opacity:0; transform:translateY(8px); transition: opacity .45s ease, transform .45s ease }
.hero-scroll{ text-decoration:none; cursor:pointer }
.hero-scroll.appear{ animation:arrowIn .5s cubic-bezier(.2,.7,.2,1) both }
.hero-scroll.show{ opacity:1; transform:none; animation:arrowFloat 2.2s ease-in-out infinite }
@keyframes arrowIn{ 0%{ opacity:0; transform:translateY(-10px) scale(.96) } 60%{ opacity:1; transform:translateY(2px) scale(1.04) } 100%{ transform:translateY(0) scale(1) } }
@keyframes arrowFloat{0%{ transform:translateY(0) } 50%{ transform:translateY(6px) } 100%{ transform:translateY(0) }}

/* Intro */
.intro .btn{ margin-top:8px }
/* Full-height Intro (first redesign) */
.intro-full{ position:relative; min-height:100svh; display:grid; place-items:center; padding:0; overflow:hidden }
.intro-full::before{ content:""; position:absolute; left:0; right:0; top:0; height:140px; pointer-events:none; z-index:2; background:linear-gradient(to bottom, var(--bg) 0%, rgba(245,245,245,0) 100%) }
.intro-full::after{ content:""; position:absolute; left:0; right:0; bottom:-1px; height:260px; pointer-events:none; z-index:0;
  background: linear-gradient(to bottom, rgba(250,250,250,0) 0%, rgba(250,250,250,.65) 35%, var(--bg) 90%);
}
.intro-full .container{ padding: clamp(40px, 8vh, 96px) 0 }
.intro-backdrop{ position:absolute; inset:0; pointer-events:none; z-index:0 }
.intro-dots{ position:absolute; inset:0; width:100%; height:100%; display:block; z-index:1; pointer-events:none }
.intro-backdrop::before{ content:""; position:absolute; width:50vmin; height:50vmin; right:10%; top:15%; background:radial-gradient(circle at 30% 30%, rgba(207,93,43,.08), transparent 65%); filter:blur(40px); opacity:.6; transition:transform .3s ease, opacity .3s ease }
.intro-backdrop::after{ content:""; position:absolute; inset:0; background-image: radial-gradient(circle at 10% 85%, rgba(17,17,17,.03), transparent 40%), radial-gradient(circle at 80% 20%, rgba(207,93,43,.04), transparent 50%); opacity:.8 }
.intro-glow{ position:absolute; inset:0; pointer-events:none; z-index:0 }
.intro-title{ line-height:1.05 }
.intro .display, .intro-title{
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: none;
  text-wrap: balance;
}
@media (max-width:640px){
  .intro .display{ font-size: clamp(28px, 8vw, 40px) }
}
.intro-title .outline{ color:transparent; -webkit-text-stroke: 1px var(--ink) }
.site-header.blend + main .intro-full{ margin-top:-1px }
/* Intro typography warp */
.intro-warp .glyph{ display:inline-block; will-change:transform }

.external-icon {
  font-size: 0.7em;
  margin-left: 0.35em;
  opacity: 0.7;
  color: var(--muted);
  transition: color .2s ease;
}
.projects .card:hover .external-icon {
  color: var(--accent);
}

/* Skills Scroll Section */
.skills-scroll{
  position: relative;
  height: 600vh; /* 5 slides with proper scroll room */
  background: #0A0A0A;
  transition: background-color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Color states based on active slide */
.skills-scroll[data-active="intro"]{
  background: #0A0A0A;
}

.skills-scroll[data-active="game"]{
  background: #FAFAFA;
}

.skills-scroll[data-active="website"]{
  background: #0A0A0A;
}

.skills-scroll[data-active="webapp"]{
  background: #FAFAFA;
}

.skills-scroll[data-active="custom"]{
  background: #0A0A0A;
}

.skill-slide{
  position: sticky;
  top: var(--header-h); /* pin just below the nav */
  height: calc(100vh - var(--header-h)); /* fill viewport under header */
  display: grid;
  place-items: center;
  overflow: hidden;
  perspective: 1000px;
}

/* Text color based on parent background */
.skills-scroll[data-active="intro"] .skill-slide,
.skills-scroll[data-active="website"] .skill-slide,
.skills-scroll[data-active="custom"] .skill-slide{
  color: #FAFAFA;
}

.skills-scroll[data-active="game"] .skill-slide,
.skills-scroll[data-active="webapp"] .skill-slide{
  color: #0A0A0A;
}

.skill-content{
  text-align: center;
  max-width: 800px;
  padding: 0 5vw;
}

.skill-title{
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.skill-slide.active .skill-title{
  opacity: 1;
  transform: translateY(0);
}

.skill-name{
  font-size: clamp(42px, 7vw, 72px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 24px 0;
  opacity: 0;
  transform: translateY(-50px) rotateX(90deg);
  transform-origin: center bottom;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.skill-desc{
  font-size: clamp(18px, 2.5vw, 24px);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(-30px) rotateX(90deg);
  transform-origin: center bottom;
  transition: opacity 0.5s ease 0.15s, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s;
}

.skill-slide.active .skill-name{
  opacity: 1;
  transform: translateY(0) rotateX(0deg);
}

.skill-slide.active .skill-desc{
  opacity: 1;
  transform: translateY(0) rotateX(0deg);
}

/* Exit animations */
.skill-slide.exiting .skill-title,
.skill-slide.exiting .skill-name,
.skill-slide.exiting .skill-desc{
  opacity: 0;
  transform: translateY(50px) rotateX(-90deg);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

@media (max-width: 640px){
  .skill-title{
    font-size: clamp(36px, 10vw, 64px);
  }
  .skill-name{
    font-size: clamp(32px, 9vw, 52px);
  }
  .skill-desc{
    font-size: clamp(16px, 4vw, 20px);
  }
}

/* Projects */
.projects{ background:#0A0A0A; color:#FAFAFA; padding:120px 0; transition: background-color 0.3s ease, color 0.3s ease }
.projects .projects-head{ display:flex; flex-direction:column; align-items:start; text-align:left; gap:32px; margin-bottom:80px }
.projects .projects-head h2{ margin:0; font-size:clamp(56px, 10vw, 120px); font-weight:700; letter-spacing:-0.04em; line-height:0.9 }
.projects .projects-head .muted{ font-size:clamp(18px, 2.2vw, 24px); color:#888; max-width:none; margin-bottom:8px }

/* Project filters */
.project-filters{ display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:flex-start }
.filter-btn{ padding:12px 24px; border-radius:8px; font-size:16px; font-weight:600; letter-spacing:0; background:transparent; color:#666; border:2px solid #222; cursor:pointer; transition: all .25s cubic-bezier(0.4, 0, 0.2, 1); font-family:inherit }
.filter-btn:hover{ color:#FAFAFA; border-color:#444 }
.filter-btn.active{ background:var(--accent); color:#fff; border-color:var(--accent); font-weight:700 }
.filter-btn:active{ transform:scale(0.96) }

.card-grid{ display:grid; gap:24px; grid-template-columns:repeat(3, 1fr); min-height:400px; position:relative }
@media (max-width: 1200px){ .card-grid{ grid-template-columns:repeat(2, 1fr) } }
@media (max-width: 768px){ .card-grid{ grid-template-columns:1fr } }
.projects .card{ position:relative; background:#111; border:1px solid #1A1A1A; border-radius:4px; padding:0; color:#fff; transition: all .3s cubic-bezier(0.4, 0, 0.2, 1); transform-origin:center; z-index:1; will-change:transform, opacity; overflow:hidden; display:flex; flex-direction:column; cursor:pointer }
.projects .card.hide{ opacity:0; transform:scale(0.9); pointer-events:none; position:absolute; visibility:hidden; max-width:calc((100% - 24px * 2) / 3) }
.projects .card.shuffle-in{ animation:shuffleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards; transition:none; visibility:visible }
.projects .card:hover{ z-index:10; transform:translateY(-4px); border-color:#333 }
.card .tag{ position:absolute; top:20px; left:20px; z-index:2; font-size:10px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; background:rgba(0,0,0,.85); color:#FAFAFA; padding:6px 12px; border-radius:4px; backdrop-filter:blur(8px) }
.card .media{
  border-radius:0;
  overflow:hidden;
  margin-bottom:0;
  position:relative;
  background:#000;
  aspect-ratio:16/10;
  flex-shrink:0;
}

.card .media img,
.card .media video{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transform:scale(1);
  transition:transform .5s cubic-bezier(0.4, 0, 0.2, 1);
  position:relative;
  z-index:1;
}

.projects .card:hover .media img,
.projects .card:hover .media video{
  transform:scale(1.05);
}

.card-content{ padding:28px; display:flex; flex-direction:column; flex:1 }
.card h3{ font-size:clamp(24px, 3vw, 32px); font-weight:700; letter-spacing:-0.03em; margin:0 0 12px 0; line-height:1.1 }
.card p{ margin:0 0 auto 0; line-height:1.6; color:#999; font-size:15px }
.chips{ display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; padding-top:16px; border-top:1px solid #1A1A1A; text-transform: uppercase; }
.chip{ font-size:11px; color:#666; background:transparent; border:1px solid #222; padding:5px 10px; border-radius:4px; font-weight:600 }


@media (max-width:1000px){
  .projects-split.show-detail{ grid-template-columns:1fr }
  .project-detail{ position:fixed; inset:auto 12px 12px 12px; z-index:80; max-height:70vh; overflow:auto }
}

/* Project detail page */
.project-page{
  background:#0A0A0A;
  color:#FAFAFA;
  padding:160px 0;
}
.project-page-inner{
  display:grid;
  gap:32px;
}
.back-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:14px;
  text-decoration:none;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:0.12em;
}
.back-link:hover{
  color:var(--accent);
}
.project-shell{
  display:grid;
  grid-template-columns:minmax(0, 1.4fr) minmax(0, 1fr);
  gap:40px;
  align-items:flex-start;
}
.project-media-shell{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.project-media{
  position:relative;
  border-radius:4px;
  overflow:hidden;
  background:#000;
  box-shadow:var(--shadow-lg);
  /* Fix layout height so swapping images on mobile doesn't
     cause the page to jump while media loads */
  aspect-ratio:16/10;
}
.project-media-inner{
  width:100%;
  height:100%;
}
.project-media img,
.project-media video,
.project-media iframe{
  width:100%;
  height:100%;
  max-height:540px;
  object-fit:contain;
  display:block;
}
.project-content{
  display:flex;
  flex-direction:column;
  gap:18px;
}
.project-tag{
  font-size:12px;
  font-weight:700;
  letter-spacing:0.14em;
  text-transform:uppercase;
  color:#888;
}
.project-title{
  font-size:clamp(40px, 6vw, 64px);
  font-weight:700;
  letter-spacing:-0.04em;
  line-height:1;
  margin:0;
}
.project-description{
  margin:0;
  font-size:16px;
  line-height:1.7;
  color:#ccc;
}
.project-body{
  font-size:15px;
  line-height:1.7;
  color:#b5b5b5;
}
.project-body p{
  margin:0 0 12px 0;
}
.project-chips{
  margin-top:8px;
}

@media (max-width:640px){
  .project-page{
    padding:96px 0 80px;
  }
  .project-page-inner{
    gap:24px;
  }
}
.project-gallery{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
.project-gallery-item{
  border-radius:4px;
  overflow:hidden;
  background:#111;
  border:1px solid #222;
  width:80px;
  height:56px;
  cursor:pointer;
  opacity:0.7;
  transition:opacity .2s ease, transform .2s ease, border-color .2s ease;
}
.project-gallery-item img,
.project-gallery-item video{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}
.project-gallery-item.is-active{
  opacity:1;
  border-color:var(--accent);
  transform:translateY(-2px);
}
.project-media-arrow{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:32px;
  height:32px;
  border-radius:50%;
  border:none;
  background:rgba(0,0,0,.6);
  color:#FAFAFA;
  display:none;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index:2;
  transition:background .2s ease, transform .2s ease, opacity .2s ease;
}
.project-media-shell.has-multi .project-media-arrow{
  display:flex;
}
.project-media-arrow-prev{ left:8px; }
.project-media-arrow-next{ right:8px; }
.project-media-arrow:hover{
  background:rgba(0,0,0,.85);
  transform:translateY(-50%) scale(1.05);
}
.project-links{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:24px;
}
.project-links .btn{
  min-width:0;
}
.project-status{
  font-size:14px;
  color:#888;
}

.related-projects{
  margin-top:56px;
}
.related-projects h2{
  font-size:18px;
  letter-spacing:0.12em;
  text-transform:uppercase;
  color:#888;
  margin:0 0 16px 0;
}
.related-projects-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:16px;
}
.related-card{
  background:#111;
  border:1px solid #222;
  border-radius:4px;
  overflow:hidden;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  text-decoration:none;
  color:#FAFAFA;
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.related-card:hover{
  transform:translateY(-2px);
  box-shadow:0 12px 30px rgba(0,0,0,.45);
  border-color:#333;
}
.related-card-thumb{
  aspect-ratio:16/10;
  background:#000;
  width:100%;
  overflow:hidden;
}
.related-card-thumb img,
.related-card-thumb video{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.related-card-body{
  padding:12px 14px 14px;
}
.related-card-title{
  font-size:15px;
  font-weight:600;
  letter-spacing:-0.02em;
  margin:0 0 4px 0;
}
.related-card-tag{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:0.16em;
  color:#999;
}

@media (max-width:900px){
  .related-projects-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}
@media (max-width:640px){
  .related-projects-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width:900px){
  .project-shell{
    grid-template-columns:1fr;
  }
}

/* Nav projects sublist in overlay menu */
.primary-nav .nav-projects{
  position:relative;
}
.primary-nav .nav-inner > ul{
  position:relative;
}
.nav-projects-back{
  position:absolute;
  left:0;
  right:0;
  opacity:0;
  pointer-events:none;
  margin-top:16px;
  transform:translateY(4px);
}
.nav-projects-back .nav-back-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:14px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.18em;
  color:var(--muted);
  text-decoration:none;
}
.nav-projects-back .nav-back-link::before{
  content:"←";
  display:inline-block;
  transform:translateX(0);
  transition: transform .2s ease;
}
.nav-projects-back .nav-back-link:hover{
  color:var(--accent);
}
.nav-projects-back .nav-back-link:hover::before{
  transform:translateX(-3px);
}
.primary-nav .nav-projects-back .nav-back-link::after,
.primary-nav .nav-projects-sublist a::after{
  display:none;
}
.nav-projects-back.is-visible{
  position:static;
  opacity:1;
  pointer-events:auto;
  transform:none;
  animation:menuItemPop .6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.nav-projects-sublist{
  list-style:none;
  margin:8px 0 0 0;
  padding:0;
  display:none;
}
.primary-nav.projects-subopen .nav-projects-sublist{
  display:block;
}
.nav-projects-sublist li{
  margin-top:4px;
  opacity:0;
  transform:translateY(6px);
}
.nav-projects-sublist a{
  display:block;
  font-size:40px;
  font-weight:700;
  letter-spacing:0;
  padding:6px 0;
  color:#bbb;
  text-decoration:none;
  -webkit-tap-highlight-color:transparent;
}
@media (hover: hover) and (pointer: fine){
  .nav-projects-sublist a:hover{
    color:var(--accent);
  }
}
.primary-nav.projects-subopen .nav-projects-sublist li{
  opacity:1;
  transform:translateY(0);
  animation:menuItemPop .6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.primary-nav.projects-subclosing .nav-projects-sublist li{
  opacity:0;
  transform:translateY(8px);
}

@media (max-width:640px){
  .nav-projects-sublist a{
    font-size:32px;
    padding:4px 0;
  }
}

/* Main nav items fade when projects panel is open */
.primary-nav .nav-inner > ul > li{
  transition:opacity .4s ease, transform .4s ease;
}
.nav-main-hidden{
  opacity:0;
  pointer-events:none;
}

/* Fun CTA */
.fun{
  background:#FAFAFA;
  color:#0A0A0A;
  padding:160px 0;
  text-align:left;
  position:relative;
  overflow:hidden;
}
.fun::before{
  content:"";
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:1px;
  background:linear-gradient(90deg, transparent, #0A0A0A 50%, transparent);
  opacity:0.1;
}
.fun .container{
  max-width:1400px;
  margin:0 auto;
  padding:0 var(--spacing-md);
  display:grid;
  gap:48px;
}

.contact .container{
  padding:0 var(--spacing-md);
}
.fun h2{
  font-size:clamp(56px, 10vw, 120px);
  font-weight:700;
  letter-spacing:-0.04em;
  line-height:0.9;
  margin:0 0 16px 0;
}
.fun .lede{
  font-size:clamp(18px, 2.2vw, 24px);
  color:#666;
  margin:0 0 40px 0;
  max-width:600px;
}
.fun .btn-accent{
  display:inline-flex;
  align-items:center;
  gap:12px;
  padding:18px 36px;
  font-size:18px;
  font-weight:700;
  background:var(--accent);
  color:#fff;
  border:2px solid var(--accent);
  border-radius:8px;
  cursor:pointer;
  transition:all .3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family:inherit;
}
.fun .btn-accent:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 24px rgba(207,93,43,.3);
}
.fun .btn-accent:active{
  transform:translateY(0) scale(0.98);
}

/* Tech marquee */
.tech-marquee{
  background:#0A0A0A;
  color:#FAFAFA;
  padding:20px 0;
  border-top:1px solid rgba(250,250,250,0.04);
  border-bottom:1px solid rgba(250,250,250,0.04);
  overflow:hidden;
}
.tech-marquee .container{
  width:100%;
  max-width:none;
  padding-right:var(--spacing-md);
  padding-left:0;
}
.tech-marquee-inner{
  display:flex;
  align-items:center;
  gap:24px;
  position:relative;
}
.tech-marquee-label{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.18em;
  color:var(--muted);
  white-space:nowrap;
  position:relative;
  z-index:2;
  display:inline-flex;
  align-items:center;
  margin:-20px 0;
  padding:20px 16px;
  background:#0A0A0A;
}
.tech-marquee-track{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  gap:18px;
  white-space:nowrap;
}
.tech-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 14px;
  border-radius:4px;
  border:1px solid #333;
  background:#111;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.14em;
  color:#ccc;
}
@media (prefers-reduced-motion: reduce){
  .tech-marquee-track{
    transform:none !important;
  }
}
@media (max-width:640px){
  .tech-marquee{
    padding:16px 0;
  }
  .tech-marquee-inner{
    gap:16px;
  }
  .tech-marquee-label{
    font-size:11px;
  }
  .tech-pill{
    font-size:11px;
    padding:5px 12px;
    letter-spacing:0.12em;
  }
}

/* Contact Section */
.contact{
  background:#0A0A0A;
  color:#FAFAFA;
  padding:160px 0;
  text-align:left;
  position:relative;
}
.contact::before{
  content:"";
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:1px;
  background:linear-gradient(90deg, transparent, #FAFAFA 50%, transparent);
  opacity:0.1;
}
.contact h2{
  font-size:clamp(56px, 10vw, 120px);
  font-weight:700;
  letter-spacing:-0.04em;
  line-height:0.9;
  margin:0 0 16px 0;
}
.contact .lede{
  font-size:clamp(18px, 2.2vw, 24px);
  color:#888;
  margin:0 0 60px 0;
  max-width:600px;
}
.contact-form{
  max-width:700px;
  display:grid;
  gap:24px;
}
.contact-form .form-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:24px;
}
.contact-form .field{
  display:grid;
  gap:10px;
}
.contact-form label{
  font-size:13px;
  font-weight:600;
  letter-spacing:0.02em;
  color:#888;
  text-transform:uppercase;
}
.contact-form input,
.contact-form textarea{
  width:100%;
  border:2px solid #222;
  background:#111;
  color:#FAFAFA;
  border-radius:8px;
  padding:14px 18px;
  font:inherit;
  font-size:16px;
  transition:all .3s cubic-bezier(0.4, 0, 0.2, 1);
}
.contact-form input::placeholder,
.contact-form textarea::placeholder{
  color:#555;
}
.contact-form input:focus,
.contact-form textarea:focus{
  outline:none;
  border-color:#444;
  background:#161616;
  box-shadow:0 0 0 4px rgba(250,250,250,.05);
}
.contact-form textarea{
  resize:vertical;
  min-height:160px;
  line-height:1.6;
}
.contact-form .btn-accent{
  justify-self:start;
  padding:18px 36px;
  font-size:18px;
  font-weight:700;
  background:var(--accent);
  color:#fff;
  border:2px solid var(--accent);
  border-radius:8px;
  cursor:pointer;
  transition:all .3s cubic-bezier(0.4, 0, 0.2, 1);
}
.contact-form .btn-accent:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 24px rgba(207,93,43,.3);
}
.contact-form .btn-accent:active{
  transform:translateY(0) scale(0.98);
}

/* Footer */
.site-footer{
  background:var(--accent);
  color:#fff;
  padding:48px 0 32px;
}
.footer-content{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:48px;
}
.footer-nav{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  gap:24px;
  flex-wrap:wrap;
}
.footer-nav a{
  color:#fff;
  text-decoration:none;
  font-weight:500;
  font-size:15px;
  transition:opacity .2s ease;
}
.footer-nav a:hover{
  opacity:.75;
}
.footer-info{
  display:flex;
  flex-direction:column;
  gap:6px;
  text-align:center;
}
.footer-info a{
  color:#fff;
  text-decoration:none;
  font-weight:600;
  font-size:15px;
  transition:opacity .2s ease;
}
.footer-info a:hover{
  opacity:.85;
}
.footer-info .muted{
  color:rgba(255,255,255,.85);
  font-size:14px;
}
.footer-brand{
  display:flex;
  align-items:center;
  justify-content:flex-end;
}
.footer-brand img{
  height:90px;
  width:auto;
  opacity:.96;
}

/* Responsive */
@media (max-width:1000px){
  .card-grid{ grid-template-columns:repeat(2, 1fr); gap:var(--spacing-md); min-height:500px }
  .services-grid{ grid-template-columns:1fr; gap:var(--spacing-lg) }
  .service-list{ grid-template-columns:repeat(2, 1fr) }
}
@media (max-width:640px){
  .container{ width:min(1120px, 94vw) }
  .header-inner{ padding-inline:0 }
  .card-grid{ grid-template-columns:1fr; gap:var(--spacing-md); min-height:400px }
  .projects .card:hover .media img{ transform:scale(1.4) }
  .service-list{ grid-template-columns:1fr }
  .section-pad{ padding:72px 0 }
  .hero-video{ width:min(86vw, 560px) }
  .contact-form .form-row{ grid-template-columns:1fr }
  .contact-form .btn-accent{ width:100% }
  .footer-content{ grid-template-columns:1fr; text-align:center; gap:32px }
  .footer-nav{ justify-content:center; flex-direction:column; align-items:center; gap:16px }
  .footer-brand{ justify-content:center }
  .footer-brand img{ height:80px }
  .service-list{ gap:var(--spacing-lg) }

  /* Align Take a Break and Contact sections on mobile */
  .fun .container,
  .contact .container{
    width:100%;
    max-width:none;
    padding:0 var(--spacing-md);
  }
}

@media (max-width:420px){
  .hero-video{ width:min(92vw, 580px) }
  .display{ font-size:clamp(32px, 9vw, 48px) }
}

/* Reveal animations - Enhanced with dramatic transitions */
.reveal{ opacity:0; transform:translateY(32px) scale(0.96); transition: opacity .7s cubic-bezier(0.2, 0.7, 0.2, 1), transform .7s cubic-bezier(0.2, 0.7, 0.2, 1); will-change: transform, opacity }
.reveal.is-visible{ opacity:1; transform:translateY(0) scale(1) }

.reveal-scale{ opacity:0; transform:scale(.92) rotate(-1deg); transition: opacity .65s cubic-bezier(0.34, 1.56, 0.64, 1), transform .65s cubic-bezier(0.34, 1.56, 0.64, 1) }
.reveal-scale.is-visible{ opacity:1; transform:scale(1) rotate(0deg) }

.reveal-fade{ opacity:0; transform:translateY(8px); transition: opacity .8s ease, transform .8s ease }
.reveal-fade.is-visible{ opacity:1; transform:translateY(0) }

.reveal-slide-left{ opacity:0; transform:translateX(-60px); transition: opacity .7s cubic-bezier(0.2, 0.7, 0.2, 1), transform .7s cubic-bezier(0.2, 0.7, 0.2, 1) }
.reveal-slide-left.is-visible{ opacity:1; transform:translateX(0) }

.reveal-slide-right{ opacity:0; transform:translateX(60px); transition: opacity .7s cubic-bezier(0.2, 0.7, 0.2, 1), transform .7s cubic-bezier(0.2, 0.7, 0.2, 1) }
.reveal-slide-right.is-visible{ opacity:1; transform:translateX(0) }

.reveal{ transition-delay: var(--reveal-delay, 0ms) }

/* Disable body scroll when nav is open */
body.nav-open{ overflow:hidden }
/* While nav is open, lift header above overlay but disable interaction, except the burger */
body.nav-open .site-header{ z-index:10000; background:transparent; border-bottom-color:transparent; pointer-events:none }
body.nav-open .menu-toggle{ pointer-events:auto; z-index:10001 }

/* Hide site nav while mobile game overlay is active */
body.game-open .site-header{ visibility:hidden; pointer-events:none }
body.game-open .primary-nav{ display:none !important }

/* Project filter animations - Smooth shuffle effect */
@keyframes shuffleIn{
  0%{
    opacity:0;
    transform:translateY(32px) scale(0.94);
  }
  100%{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

/* Cookie Consent Banner */
.cookie-consent{
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  z-index:9999;
  background:rgba(10,10,10,.98);
  backdrop-filter:saturate(120%) blur(12px);
  -webkit-backdrop-filter:saturate(120%) blur(12px);
  border-top:1px solid rgba(207,93,43,.3);
  padding:24px;
  transform:translateY(100%);
  opacity:0;
  transition:transform .4s cubic-bezier(0.4, 0, 0.2, 1), opacity .4s ease;
  box-shadow:0 -8px 32px rgba(0,0,0,.4);
}

.cookie-consent.show{
  transform:translateY(0);
  opacity:1;
}

.cookie-consent-content{
  max-width:1120px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:32px;
  flex-wrap:wrap;
}

.cookie-consent-text{
  flex:1;
  min-width:280px;
}

.cookie-consent-text h3{
  color:#FAFAFA;
  font-size:clamp(18px, 2.5vw, 22px);
  font-weight:700;
  margin:0 0 8px 0;
  letter-spacing:-0.01em;
}

.cookie-consent-text p{
  color:#999;
  font-size:clamp(14px, 1.8vw, 16px);
  line-height:1.5;
  margin:0;
}

.cookie-consent-actions{
  display:flex;
  gap:12px;
  flex-shrink:0;
  flex-wrap:wrap;
}

.cookie-consent .cookie-btn{
  min-width:120px;
  padding:12px 24px;
  font-size:15px;
  white-space:nowrap;
}

.cookie-consent .btn-outline{
  color:#FAFAFA;
  border-color:#444;
  background:transparent;
}

.cookie-consent .btn-outline:hover{
  background:#FAFAFA;
  color:#0A0A0A;
  border-color:#FAFAFA;
}

@media (max-width:768px){
  .cookie-consent{
    padding:20px 16px;
  }

  .cookie-consent-content{
    flex-direction:column;
    align-items:stretch;
    gap:20px;
  }

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

  .cookie-consent .cookie-btn{
    width:100%;
    min-width:auto;
  }
}

@keyframes slideUp{
  from{
    transform:translateY(100%);
    opacity:0;
  }
  to{
    transform:translateY(0);
    opacity:1;
  }
}
