/* =========================================================
   Alperen Güveli — Personal site
   Cyberpunk glassmorphism · Mars scene · neon accent
   ========================================================= */

:root {
  --bg: #05060a;
  --bg-deep: #020308;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hi: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-hi: rgba(255, 255, 255, 0.16);
  --text: #e8ecf2;
  --text-dim: #8a93a6;
  --text-faint: #525a6b;

  --accent: #00ff9d;
  --accent-dim: #00d882;
  --accent-glow: 0 0 0 1px rgba(0, 255, 157, 0.35), 0 0 30px rgba(0, 255, 157, 0.25), 0 0 80px rgba(0, 255, 157, 0.12);
  --accent-soft: rgba(0, 255, 157, 0.12);

  --mars: #c2410c;
  --mars-glow: #ff6b3d;

  --radius: 14px;
  --radius-lg: 22px;
  --radius-sm: 8px;

  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Space Grotesk', -apple-system, sans-serif;
  --body: 'Inter', -apple-system, sans-serif;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg: #f5efe6;
  --bg-deep: #ede4d4;
  --surface: rgba(255, 255, 255, 0.55);
  --surface-hi: rgba(255, 255, 255, 0.75);
  --border: rgba(20, 15, 10, 0.09);
  --border-hi: rgba(20, 15, 10, 0.18);
  --text: #1a1410;
  --text-dim: #5a5248;
  --text-faint: #8a8276;
  --accent: #0d7c4f;
  --accent-dim: #0a6340;
  --accent-glow: 0 0 0 1px rgba(13, 124, 79, 0.4), 0 0 24px rgba(13, 124, 79, 0.18);
  --accent-soft: rgba(13, 124, 79, 0.1);
}

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

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  position: relative;
}

/* -------- Background scene -------- */
#mars-scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, transparent 40%, rgba(0,0,0,0.6) 100%);
}

[data-theme="light"] .grain { opacity: 0.15; mix-blend-mode: multiply; }
[data-theme="light"] .vignette { background: radial-gradient(ellipse at 50% 40%, transparent 45%, rgba(90, 60, 30, 0.25) 100%); }

#root { position: relative; z-index: 2; }

/* -------- Glass panel primitive -------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-radius: var(--radius);
}

/* -------- Nav -------- */
.nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  padding-left: 18px;
  background: rgba(10, 12, 18, 0.55);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
}

[data-theme="light"] .nav {
  background: rgba(255, 250, 240, 0.7);
}

.nav-logo {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  padding-right: 12px;
  margin-right: 4px;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.nav-logo:hover { color: var(--accent); }

.nav-logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

.nav-items {
  display: flex;
  gap: 2px;
}

.nav a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  transition: all 0.25s var(--ease);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.nav a:hover { color: var(--text); background: var(--surface-hi); }

.nav-lang {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: rgba(0,0,0,0.25);
  border-radius: 999px;
  margin-left: 6px;
  border: 1px solid var(--border);
}

[data-theme="light"] .nav-lang { background: rgba(0,0,0,0.04); }

.nav-lang button {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: all 0.2s;
}

.nav-lang button.active {
  background: var(--accent);
  color: #001a10;
}

[data-theme="light"] .nav-lang button.active { color: #f5efe6; }

.nav-theme {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  margin-left: 6px;
  transition: all 0.25s;
}

.nav-theme:hover { color: var(--text); border-color: var(--border-hi); }

/* -------- Layout -------- */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}

section {
  position: relative;
  padding: 120px 0;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.section-label::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--accent);
}

h1, h2, h3 {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

h2 {
  font-size: clamp(40px, 5.5vw, 72px);
  margin-bottom: 48px;
  max-width: 900px;
}

h2 .faded { color: var(--text-faint); }

/* -------- Hero -------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 160px 0 100px;
  position: relative;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
  margin-bottom: 32px;
  letter-spacing: 0.04em;
}

.hero-eyebrow .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

.hero h1 {
  font-size: clamp(56px, 9vw, 124px);
  letter-spacing: -0.045em;
  line-height: 0.92;
  margin-bottom: 28px;
}

.hero h1 .line { display: block; }

.hero h1 .accent-word {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
  font-family: 'Space Grotesk', serif;
}

.hero-sub {
  font-size: 19px;
  color: var(--text-dim);
  max-width: 560px;
  margin-bottom: 44px;
  line-height: 1.55;
}

.hero-sub strong {
  color: var(--text);
  font-weight: 500;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

/* -------- Buttons -------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.3s var(--ease);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent);
  color: #001a10;
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
}

[data-theme="light"] .btn-primary { color: #f5efe6; }

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--accent), 0 0 40px rgba(0,255,157,0.5), 0 0 100px rgba(0,255,157,0.2);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  backdrop-filter: blur(12px);
}

.btn-ghost:hover {
  background: var(--surface-hi);
  border-color: var(--border-hi);
}

.btn .arrow {
  transition: transform 0.3s var(--ease);
}

.btn:hover .arrow { transform: translateX(3px); }

/* -------- Hero side stats -------- */
.hero-meta {
  position: absolute;
  right: 32px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  text-align: right;
  letter-spacing: 0.08em;
}

.hero-meta-item {
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  border-radius: 8px;
}

.hero-meta-item strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-family: var(--sans);
  letter-spacing: -0.01em;
  margin-top: 4px;
}

.hero-meta-item .acc { color: var(--accent); }

/* -------- Services -------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.service-card {
  position: relative;
  padding: 36px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(140%);
  border-radius: var(--radius-lg);
  transition: all 0.4s var(--ease);
  overflow: hidden;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

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

.service-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-4px);
}

.service-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-bottom: 48px;
}

.service-title {
  font-family: var(--sans);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  line-height: 1.05;
}

.service-desc {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 24px;
  flex: 1;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  padding: 5px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 4px;
  letter-spacing: 0.05em;
}

[data-theme="light"] .service-tag { background: rgba(0,0,0,0.03); }

/* -------- Works / portfolio -------- */
.works-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.work-cell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.work-cell.span-3 { grid-column: span 3; }
.work-cell.span-2 { grid-column: span 2; }
.work-cell.span-4 { grid-column: span 4; }
.work-cell.span-6 { grid-column: span 6; }

.work-card {
  position: relative;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  backdrop-filter: blur(16px);
  cursor: pointer;
  transition: transform 0.4s var(--ease), border-color 0.3s var(--ease);
  aspect-ratio: 4 / 3;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
}

.work-cell.span-2 .work-card { aspect-ratio: 1 / 1; }
.work-cell.span-4 .work-card { aspect-ratio: 16 / 10; }

.work-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-4px);
}

.work-card:hover .work-visual {
  transform: scale(1.03);
}

/* Frosted glass strip — bottom of card, holds title + CTA */
.work-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: #0a0a0e;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

[data-theme="light"] .work-strip {
  background: #0a0a0e;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}

.work-strip-title {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-strip-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  transition: color 0.25s var(--ease), gap 0.25s var(--ease);
}

[data-theme="light"] .work-strip-cta { color: rgba(20, 15, 10, 0.6); }

.work-strip-cta svg {
  transition: transform 0.25s var(--ease);
}

.work-card:hover .work-strip {
  background: #13131a;
  border-top-color: rgba(255, 255, 255, 0.16);
}
[data-theme="light"] .work-card:hover .work-strip {
  background: #13131a;
  border-top-color: rgba(255, 255, 255, 0.16);
}

.work-card:hover .work-strip-cta {
  color: var(--accent);
  gap: 10px;
}
.work-card:hover .work-strip-cta svg { transform: translateX(2px); }

@media (max-width: 640px) {
  .work-strip { padding: 12px 14px; }
  .work-strip-title { font-size: 14px; }
  .work-strip-cta { font-size: 9.5px; }
}

.work-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  transition: transform 0.6s var(--ease);
  overflow: hidden;
  border-radius: inherit;
}

.work-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.75) 100%);
}

[data-theme="light"] .work-visual::after {
  background: linear-gradient(180deg, transparent 30%, rgba(20,15,10,0.55) 100%);
}

/* -------- Animated work visuals -------- */
.wv {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, rgba(0,0,0,0.35) 80%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, #000 55%, rgba(0,0,0,0.35) 80%, transparent 100%);
  opacity: 0.95;
}

/* image rotator (real screenshots) — edge-to-edge */
.wv-image {
  -webkit-mask-image: none;
          mask-image: none;
  overflow: hidden;
  background: #0a0a0a;
}
.wv-image-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
}

/* Cross-fade cycles by image count: each image is on for ~4s.
   Visible window = (100/N - 5)% of cycle, then 5% fade-out, then idle, then 5% fade-in. */
.wv-image-2 .wv-image-frame { animation: wv-image-2 8s linear infinite; }
.wv-image-3 .wv-image-frame { animation: wv-image-3 12s linear infinite; }
.wv-image-4 .wv-image-frame { animation: wv-image-4 16s linear infinite; }
.wv-image-5 .wv-image-frame { animation: wv-image-5 20s linear infinite; }

@keyframes wv-image-2 {
  0%, 45%    { opacity: 1; }
  50%, 95%   { opacity: 0; }
  100%       { opacity: 1; }
}
@keyframes wv-image-3 {
  0%, 28.33% { opacity: 1; }
  33.33%, 95% { opacity: 0; }
  100%       { opacity: 1; }
}
@keyframes wv-image-4 {
  0%, 20%    { opacity: 1; }
  25%, 95%   { opacity: 0; }
  100%       { opacity: 1; }
}
@keyframes wv-image-5 {
  0%, 15%    { opacity: 1; }
  20%, 95%   { opacity: 0; }
  100%       { opacity: 1; }
}

/* Image card adapts to screenshot aspect ratio.
   span-6 keeps the native ~2.08:1 (no crop, no bars).
   Smaller cells use 4:3 with object-fit:contain so content stays fully visible. */
.work-card-image {
  aspect-ratio: 1873 / 897;
  min-height: 0;
}
.work-cell.span-3 .work-card-image,
.work-cell.span-2 .work-card-image,
.work-cell.span-4 .work-card-image {
  aspect-ratio: 4 / 3;
}
.work-cell.span-3 .work-card-image .wv-image-frame,
.work-cell.span-2 .work-card-image .wv-image-frame,
.work-cell.span-4 .work-card-image .wv-image-frame {
  object-fit: contain;
  padding: 14px 14px 56px;
}
@media (max-width: 640px) {
  .work-cell.span-3 .work-card-image .wv-image-frame,
  .work-cell.span-2 .work-card-image .wv-image-frame,
  .work-cell.span-4 .work-card-image .wv-image-frame {
    padding: 10px 10px 52px;
  }
}
.work-card-image .work-visual::after {
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.7) 88%, rgba(0,0,0,0.92) 100%);
}
[data-theme="light"] .work-card-image .work-visual::after {
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.6) 88%, rgba(0,0,0,0.85) 100%);
}
.work-card:hover .wv-image-frame { animation-play-state: paused; }

.work-card:hover .wv { opacity: 1; }

/* stats — bars rising + pulse tick */
.wv-bar {
  transform: scaleY(0);
  animation: wv-bar-grow 1.8s var(--ease-out) forwards, wv-bar-breathe 4s ease-in-out infinite 1.8s;
}
@keyframes wv-bar-grow { to { transform: scaleY(1); } }
@keyframes wv-bar-breathe {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.88); }
}
.wv-tick {
  animation: wv-tick-blink 1.8s ease-in-out infinite;
}
.wv-tick-ring {
  transform-origin: 360px 30px;
  animation: wv-tick-ring 1.8s ease-out infinite;
  fill-opacity: 0.4;
}
@keyframes wv-tick-blink {
  0%, 60%, 100% { opacity: 1; }
  80% { opacity: 0.35; }
}
@keyframes wv-tick-ring {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(3); opacity: 0; }
}

/* wave */
.wv-wave-a { animation: wv-wave-pan 8s ease-in-out infinite; transform-origin: center; }
.wv-wave-b { animation: wv-wave-pan 11s ease-in-out infinite reverse; }
.wv-wave-c { animation: wv-wave-pan 7s ease-in-out infinite; }
@keyframes wv-wave-pan {
  0%, 100% { transform: translateX(0) translateY(0); }
  50% { transform: translateX(-20px) translateY(-6px); }
}

/* pulse / EKG */
.wv-ekg {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: wv-ekg-draw 3.2s linear infinite;
}
@keyframes wv-ekg-draw {
  0% { stroke-dashoffset: 1000; }
  60% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -1000; }
}

/* orbit */
.wv-orbit-a { transform-origin: 0 0; animation: wv-spin 6s linear infinite; }
.wv-orbit-b { transform-origin: 0 0; animation: wv-spin 9s linear infinite reverse; }
.wv-orbit-c { transform-origin: 0 0; animation: wv-spin 4s linear infinite; }
@keyframes wv-spin { to { transform: rotate(360deg); } }

/* pipeline — handled by animateMotion on circles */
.wv-pipeline { }

/* particles — drifting dust */
.wv-dust {
  animation: wv-drift 4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes wv-drift {
  0%, 100% { transform: translate(0,0); opacity: 0.35; }
  50% { transform: translate(6px, -10px); opacity: 0.9; }
}

/* graph — line draw */
.wv-graph-line {
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  animation: wv-graph-draw 3.5s var(--ease-out) infinite;
}
.wv-graph-fill {
  opacity: 0;
  animation: wv-graph-fade 3.5s var(--ease-out) infinite;
}
.wv-graph-dot {
  opacity: 0;
  animation: wv-graph-dot 3.5s ease-in-out infinite;
}
@keyframes wv-graph-draw {
  0% { stroke-dashoffset: 500; }
  60%, 100% { stroke-dashoffset: 0; }
}
@keyframes wv-graph-fade {
  0%, 40% { opacity: 0; }
  70%, 100% { opacity: 1; }
}
@keyframes wv-graph-dot {
  0%, 50% { opacity: 0; transform: scale(0); }
  70%, 100% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .wv * { animation: none !important; }
  .wv-bar { transform: scaleY(1); }
  .wv-ekg, .wv-graph-line { stroke-dashoffset: 0; }
}

/* -------- Work modal -------- */
.work-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(14px);
  animation: wm-fade 0.25s var(--ease-out);
}
[data-theme="light"] .work-modal {
  background: rgba(20, 15, 10, 0.55);
}
@keyframes wm-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.work-modal-inner {
  width: min(900px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-lg);
  padding: 0;
  position: relative;
  animation: wm-pop 0.32s var(--ease-out);
}
@keyframes wm-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.work-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: white;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  backdrop-filter: blur(10px);
}
.work-modal-close:hover {
  background: var(--accent);
  color: #001a10;
  border-color: var(--accent);
}

.work-modal-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.work-modal-visual.work-card-image {
  aspect-ratio: 1873 / 897;
}
.work-modal-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 70%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
}

.work-modal-body {
  padding: 28px 32px 32px;
}
.work-modal-meta {
  display: flex;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.work-modal-meta span:first-child { color: var(--accent); }
.work-modal-title {
  font-family: var(--sans);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin-bottom: 16px;
  color: var(--text);
}
.work-modal-desc {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 720px;
}

@media (max-width: 640px) {
  .work-modal { padding: 16px; }
  .work-modal-body { padding: 22px 22px 26px; }
}

/* -------- Stack -------- */
.stack-wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
}

.stack-lead {
  padding-right: 32px;
}

.stack-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
}

.stack-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12.5px;
  transition: all 0.2s;
  cursor: default;
}

.stack-item:hover { padding-left: 8px; }

.stack-item:hover .stack-name { color: var(--accent); }

.stack-num {
  color: var(--text-faint);
  font-size: 10.5px;
  letter-spacing: 0.1em;
}

.stack-name {
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: color 0.2s;
}

.stack-cat {
  color: var(--text-faint);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* -------- About -------- */
.about-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 64px;
  align-items: start;
  max-width: 760px;
}

.about-photo {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, #2a0f08 0%, #5a1810 50%, #c2410c 100%);
  border: 1px solid var(--border);
}

.about-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 12px),
    radial-gradient(circle at 30% 40%, rgba(255,180,120,0.3), transparent 60%);
}

.about-photo-label {
  position: absolute;
  bottom: 18px;
  left: 18px;
  right: 18px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.15em;
  display: flex;
  justify-content: space-between;
}

.about-body p {
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.about-body p.lead {
  font-size: 22px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 28px;
  font-family: var(--sans);
  letter-spacing: -0.015em;
  font-weight: 400;
}

.about-body p strong { color: var(--text); font-weight: 500; }

.about-signature {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 40px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
}

.about-signature div strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  margin-top: 4px;
  font-family: var(--sans);
  letter-spacing: -0.01em;
}

/* -------- Process -------- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  counter-reset: step;
}

.process-step {
  position: relative;
  padding: 36px 28px 36px 0;
  border-top: 1px solid var(--border);
  counter-increment: step;
}

.process-step + .process-step { padding-left: 28px; border-left: 1px solid var(--border); }

.process-step::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 0;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  transform: translateY(-50%);
}

.process-step + .process-step::before { left: 28px; }

.process-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-bottom: 18px;
}

.process-num::before { content: '0' counter(step) ' / '; color: var(--text-faint); }

.process-title {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.process-desc {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.55;
}

.process-duration {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
  margin-top: 20px;
  letter-spacing: 0.08em;
}

/* -------- Contact -------- */
.contact-head {
  margin-bottom: 48px;
  max-width: 720px;
}

.contact-head h2 { margin-bottom: 20px; }

.contact-stats {
  display: flex;
  gap: 32px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.contact-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-stat .stat-label {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.contact-stat .stat-value {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.04em;
}

/* Triage tracks */
.tracks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 14px;
}

.track-card {
  position: relative;
  text-align: left;
  font: inherit;
  color: inherit;
  padding: 24px 22px 70px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 240px;
  overflow: hidden;
}

.track-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}

.track-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-3px);
}
.track-card:hover::before { opacity: 1; }

.track-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.track-card.active::before { opacity: 1; }

.track-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--text-faint);
}

.track-title {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text);
  line-height: 1.2;
}

.track-desc {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.55;
}

.track-meta {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  display: flex;
  justify-content: flex-start;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.track-card.active .track-meta { color: var(--accent); border-top-color: var(--accent); }

.track-cta {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-faint);
  transition: all 0.3s var(--ease);
}
.track-card:hover .track-cta {
  background: var(--accent);
  color: #001a10;
  border-color: var(--accent);
  transform: rotate(-45deg);
}
.track-card.active .track-cta {
  background: var(--accent);
  color: #001a10;
  border-color: var(--accent);
}

.tracks-hint {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: center;
  letter-spacing: 0.04em;
  margin-bottom: 32px;
}

@media (max-width: 900px) {
  .tracks-grid { grid-template-columns: 1fr; gap: 12px; }
  .track-card { min-height: 0; padding: 20px 20px 60px; }
}

.contact-wrap {
  display: block;
}

.contact-lead h2 { margin-bottom: 28px; }

.contact-desc {
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 440px;
}

.contact-direct {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: all 0.3s var(--ease);
  font-family: var(--mono);
  font-size: 13px;
}

.contact-link:hover {
  border-color: var(--accent);
  background: var(--surface-hi);
  transform: translateX(4px);
}

.contact-link .label {
  color: var(--text-faint);
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  width: 70px;
  flex-shrink: 0;
}

.contact-link .arrow-icon {
  margin-left: auto;
  color: var(--text-faint);
  transition: all 0.3s;
}

.contact-link:hover .arrow-icon {
  color: var(--accent);
  transform: rotate(-45deg);
}

/* -------- Form -------- */
.contact-form {
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(140%);
  border-radius: var(--radius-lg);
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.form-header-title {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.form-header-intro {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.55;
  max-width: 520px;
}

.form-header-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  transition: border-color 0.25s;
  resize: none;
  outline: none;
}

.form-group select {
  font-family: var(--body);
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1L6 6L11 1' stroke='%238a93a6' stroke-width='1.5' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 4px center;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-faint); }

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.chip {
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.04em;
}

.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.form-submit {
  margin-top: 4px;
  justify-content: center;
  padding: 16px 28px;
  flex-shrink: 0;
  white-space: nowrap;
}
.form-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-footer {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.form-direct {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-left: auto;
}

.form-direct-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  transition: color 0.2s;
  line-height: 1.4;
}
.form-direct-link span:first-child {
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--text-faint);
  margin-bottom: 2px;
}
.form-direct-link:hover { color: var(--accent); }
.form-direct-link:hover span:first-child { color: var(--accent); }

.form-success {
  padding: 18px 20px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 13.5px;
  line-height: 1.55;
  margin-top: 20px;
}

.form-error {
  padding: 18px 20px;
  background: rgba(255, 80, 80, 0.08);
  border: 1px solid rgba(255, 80, 80, 0.4);
  border-radius: var(--radius);
  color: #ff8080;
  font-size: 13.5px;
  line-height: 1.55;
  margin-top: 20px;
}

@media (max-width: 640px) {
  .form-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .form-footer { gap: 18px; }
  .form-direct { margin-left: 0; }
  .form-submit { width: 100%; }
}

/* -------- Footer -------- */
.footer {
  padding: 60px 0 40px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  flex-wrap: wrap;
}

.footer-big {
  font-family: var(--sans);
  font-size: clamp(80px, 14vw, 220px);
  line-height: 0.85;
  letter-spacing: -0.05em;
  font-weight: 400;
  color: var(--text);
  opacity: 0.08;
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 80px;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
}

.footer-col {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.8;
}

.footer-col strong {
  display: block;
  color: var(--text-faint);
  font-weight: 400;
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.footer-col a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
  display: block;
}

.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  z-index: 2;
}

/* -------- Scroll ticker -------- */
.ticker {
  position: relative;
  padding: 24px 0;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
}

[data-theme="light"] .ticker { background: rgba(255,255,255,0.3); }

.ticker-track {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  animation: ticker 38s linear infinite;
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text-dim);
}

.ticker-track .item {
  display: inline-flex;
  align-items: center;
  gap: 48px;
}

.ticker-track .item::after {
  content: '✦';
  color: var(--accent);
  font-size: 16px;
}

@keyframes ticker {
  to { transform: translateX(-50%); }
}

/* -------- Tweaks panel (host-provided) -------- */
.tweaks-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  padding: 14px 18px;
  background: rgba(10, 12, 18, 0.85);
  border: 1px solid var(--border-hi);
  backdrop-filter: blur(20px);
  border-radius: 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  display: none;
  align-items: center;
  gap: 14px;
  text-transform: uppercase;
}

[data-theme="light"] .tweaks-panel { background: rgba(255,250,240,0.92); }

.tweaks-panel.visible { display: flex; }

.tweaks-panel .toggle {
  display: flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}

.tweaks-panel .toggle button {
  background: transparent;
  border: none;
  color: var(--text-faint);
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  cursor: pointer;
  border-radius: 999px;
  letter-spacing: 0.1em;
}

.tweaks-panel .toggle button.active {
  background: var(--accent);
  color: #001a10;
}

[data-theme="light"] .tweaks-panel .toggle button.active { color: #f5efe6; }

/* -------- Responsive -------- */
@media (max-width: 900px) {
  section { padding: 80px 0; }
  .services-grid, .works-grid, .stack-wrap, .about-wrap, .contact-wrap { grid-template-columns: 1fr !important; gap: 20px; }
  .work-cell.span-3, .work-cell.span-2, .work-cell.span-4, .work-cell.span-6 { grid-column: span 1; }
  .work-cell.span-2 .work-card, .work-cell.span-4 .work-card { aspect-ratio: 4 / 3; }
  .process-grid { grid-template-columns: 1fr; }
  .process-step + .process-step { padding-left: 0; border-left: none; border-top: 1px solid var(--border); }
  .process-step + .process-step::before { left: 0; }
  .hero { padding: 120px 0 70px; }
  .hero h1 { font-size: clamp(40px, 11vw, 64px); letter-spacing: -0.04em; line-height: 0.98; }
  .hero-sub { font-size: 16px; margin-bottom: 32px; }
  .hero-ctas { gap: 10px; flex-wrap: wrap; }
  .hero-meta { display: none; }
  .ticker { padding: 12px 0; }
  .ticker-track { font-size: 16px; gap: 28px; }
  .ticker-track .item { gap: 28px; }
  .ticker-track .item::after { font-size: 11px; }
  .form-row { grid-template-columns: 1fr; }
  .nav { top: 12px; padding-left: 14px; font-size: 11px; }
  .nav-items { display: none; }
  .container { padding: 0 20px; }
}
