:root {
  --bg: #0b0b0d;
  --bg-elevated: #131316;
  --bg-card: #17171b;
  --border: #232327;
  --text: #eae8e3;
  --text-muted: #8b8b92;
  --text-dim: #58585f;
  --accent: #3fb6ad;      /* teal, pulled from the pool render */
  --accent-warm: #d99a53; /* amber, pulled from the warehouse lights */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-width: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

@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; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- NAV ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 6vw;
  backdrop-filter: blur(10px);
  background: rgba(11,11,13,0.7);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}
.nav-logo .dot { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 36px;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  transition: color 0.2s ease;
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:focus-visible,
.btn:focus-visible,
.work-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.dots span { animation: blink 1.4s infinite; opacity: 0; }
.dots span:nth-child(1) { animation-delay: 0s; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%,20%{opacity:0;} 50%{opacity:1;} 100%{opacity:0;} }

.nav-burger { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; }
.nav-burger span { width: 22px; height: 2px; background: var(--text); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 6vw 80px;
  overflow: hidden;
}

.hero-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, black 0%, transparent 75%);
  opacity: 0.5;
}

.hero-inner { position: relative; z-index: 2; max-width: 680px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}

.hero-tagline {
  color: var(--text-muted);
  font-size: 1.08rem;
  max-width: 540px;
  margin-bottom: 40px;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 14px 26px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: inline-block;
}
.btn-primary {
  background: var(--accent);
  color: #06141a;
  font-weight: 500;
}
.btn-primary:hover { background: #56cbc1; transform: translateY(-1px); }
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* signature: wireframe cube */
.hero-cube {
  position: absolute;
  right: 8vw;
  top: 50%;
  transform: translateY(-50%);
  perspective: 900px;
  z-index: 1;
}
.cube {
  width: 180px;
  height: 180px;
  position: relative;
  transform-style: preserve-3d;
  animation: spin 22s linear infinite;
}
.face {
  position: absolute;
  width: 180px;
  height: 180px;
  border: 1px solid var(--accent);
  opacity: 0.35;
  background: rgba(63, 182, 173, 0.03);
}
.front  { transform: translateZ(90px); }
.back   { transform: translateZ(-90px) rotateY(180deg); }
.right  { transform: rotateY(90deg) translateZ(90px); }
.left   { transform: rotateY(-90deg) translateZ(90px); }
.top    { transform: rotateX(90deg) translateZ(90px); }
.bottom { transform: rotateX(-90deg) translateZ(90px); }

@keyframes spin {
  from { transform: rotateX(0deg) rotateY(0deg); }
  to   { transform: rotateX(360deg) rotateY(360deg); }
}

@media (max-width: 900px) {
  .hero-cube { display: none; }
}

/* ---------- STATS ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat {
  padding: 40px 6vw;
  border-left: 1px solid var(--border);
}
.stat:first-child { border-left: none; }
.stat-number {
  display: block;
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 6px;
}
.stat-label {
  color: var(--text-muted);
  font-size: 0.92rem;
}

@media (max-width: 700px) {
  .stats { grid-template-columns: 1fr; }
  .stat { border-left: none; border-top: 1px solid var(--border); }
  .stat:first-child { border-top: none; }
}

/* ---------- SECTION HEADS ---------- */
.section-head { margin-bottom: 48px; }
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-warm);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 600;
}

/* ---------- ABOUT ---------- */
.about {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 120px 6vw;
}
.about-body {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 44px;
}
.about-body p:first-child { color: var(--text); }

.about-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tool {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
}

/* ---------- WORK ---------- */
.work {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 6vw 120px;
}
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}
.work-card {
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.work-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.work-img { aspect-ratio: 4 / 3; overflow: hidden; }
.work-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.work-card:hover .work-img img { transform: scale(1.06); }
.work-meta { padding: 18px 20px 22px; }
.work-meta h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.work-meta p { color: var(--text-muted); font-size: 0.9rem; }

.view-toggle {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.view-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.view-btn:hover { border-color: var(--accent); color: var(--text); }
.view-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #06141a;
  font-weight: 500;
}
.view-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.work-card-empty {
  cursor: default;
  border-style: dashed;
}
.work-card-empty:hover { border-color: var(--border); transform: none; }
.work-img-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    135deg,
    var(--bg-elevated),
    var(--bg-elevated) 10px,
    var(--bg-card) 10px,
    var(--bg-card) 20px
  );
}
.empty-mark {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

/* ---------- CONTACT ---------- */
.contact {
  border-top: 1px solid var(--border);
  padding: 120px 6vw;
}
.contact-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.contact-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 600;
  margin: 14px 0 18px;
}
.contact-sub { color: var(--text-muted); margin-bottom: 36px; }
.contact-email { margin-bottom: 28px; }
.socials {
  display: flex;
  justify-content: center;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.socials a:hover { color: var(--accent); }

/* ---------- FOOTER ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  padding: 26px 6vw 40px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6,6,7,0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 5vw;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 24px; right: 32px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}
.lightbox-close:hover { color: var(--accent); }

/* ---------- RESPONSIVE NAV ---------- */
@media (max-width: 760px) {
  .nav-links, .nav-status { display: none; }
  .nav-burger { display: flex; }
}