:root {
  --bg: #16181d;
  --surface: #1d2027;
  --surface-2: #242832;
  --border: #2e333e;
  --text: #e3e0d8;
  --muted: #9a9fa9;
  --faint: #6c717c;
  --accent: #9cc5a1;
  --accent-soft: rgba(156, 197, 161, 0.12);
  --warm: #d8b98f;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  --radius: 14px;
  --max: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f3f0e9;
  --surface: #faf8f3;
  --surface-2: #eeeae1;
  --border: #ddd8cc;
  --text: #2a2c31;
  --muted: #646872;
  --faint: #8d909a;
  --accent: #4d7d58;
  --accent-soft: rgba(77, 125, 88, 0.1);
  --warm: #9a6b34;
  --shadow: 0 10px 30px rgba(60, 50, 30, 0.08);
  color-scheme: light;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { font-family: var(--mono); font-weight: 500; font-size: 15px; letter-spacing: -0.01em; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 28px; margin-left: auto; font-size: 14px; color: var(--muted); }
.nav-links a { transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.theme-toggle {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  border: 1px solid var(--border); color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--faint); }
.i-moon { display: none; }
:root[data-theme="light"] .i-sun { display: none; }
:root[data-theme="light"] .i-moon { display: block; }

/* Hero */
.hero { padding-top: 96px; padding-bottom: 56px; }
.eyebrow { font-family: var(--mono); font-size: 13px; color: var(--accent); margin-bottom: 20px; }
.hero h1 {
  font-size: clamp(36px, 6vw, 60px);
  line-height: 1.08; letter-spacing: -0.035em; font-weight: 600;
  max-width: 820px;
}
.hero h1 em { font-style: normal; color: var(--muted); }
.lead { margin-top: 22px; max-width: 620px; font-size: 18px; color: var(--muted); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 32px; font-size: 14px; color: var(--muted); }
.hero-meta strong { color: var(--text); font-weight: 600; margin-right: 6px; }
.hero-actions { display: flex; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; height: 44px; padding: 0 20px;
  border-radius: 10px; font-size: 14px; font-weight: 500;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--faint); }

/* Banner */
.banner-wrap { padding-bottom: 24px; }
.banner {
  position: relative; overflow: hidden;
  border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface);
  aspect-ratio: 16 / 7;
}
.banner-track { display: flex; height: 100%; transition: transform 0.7s cubic-bezier(.65, 0, .35, 1); }
.slide { position: relative; flex: 0 0 100%; height: 100%; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10, 11, 14, 0.82) 0%, rgba(10, 11, 14, 0.15) 55%, transparent 100%);
}
.slide-info { position: absolute; left: 32px; bottom: 64px; right: 32px; z-index: 2; color: #eeebe4; }
.slide-info .tag-row { margin-bottom: 10px; }
.slide-info h3 { font-size: clamp(22px, 3.2vw, 34px); letter-spacing: -0.02em; font-weight: 600; }
.slide-info p { color: #c4c1ba; max-width: 560px; margin-top: 6px; font-size: 15px; }
.slide-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse at 20% 20%, var(--accent-soft), transparent 60%),
    radial-gradient(ellipse at 85% 80%, rgba(216, 185, 143, 0.1), transparent 55%),
    var(--surface);
}
.slide-placeholder span {
  font-family: var(--mono); font-size: clamp(56px, 12vw, 140px); font-weight: 500;
  color: var(--faint); opacity: 0.35; letter-spacing: -0.04em; user-select: none;
}
.banner-controls {
  position: absolute; z-index: 3; right: 20px; bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.banner-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(20, 22, 27, 0.55); color: #eeebe4; font-size: 20px; line-height: 1;
  display: grid; place-items: center; backdrop-filter: blur(6px);
  transition: background 0.2s;
}
.banner-btn:hover { background: rgba(20, 22, 27, 0.8); }
.banner-dots { display: flex; gap: 6px; }
.banner-dots button { width: 7px; height: 7px; border-radius: 99px; background: rgba(238, 235, 228, 0.35); transition: width 0.3s, background 0.3s; }
.banner-dots button.active { width: 22px; background: #eeebe4; }

/* Sections */
.section { padding-top: 96px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 40px; }
.section-index { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.section-head h2 { font-size: clamp(26px, 3.5vw, 34px); letter-spacing: -0.025em; font-weight: 600; }

/* About */
.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; }
.about-text p { color: var(--muted); font-size: 17px; }
.about-text p + p { margin-top: 16px; }
.about-stack h3, .group-title {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); margin-bottom: 16px;
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.tag {
  font-family: var(--mono); font-size: 12px; padding: 4px 10px;
  border-radius: 7px; background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border);
}
.tag-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.slide-info .tag { background: rgba(255, 255, 255, 0.1); color: #e3e0d8; border-color: rgba(255, 255, 255, 0.12); }

/* Services */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.service { background: var(--bg); padding: 28px; transition: background 0.25s; }
.service:hover { background: var(--surface); }
.service .num { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.service h3 { font-size: 17px; font-weight: 600; margin: 14px 0 8px; letter-spacing: -0.01em; }
.service p { font-size: 14.5px; color: var(--muted); }

/* Projects */
.group-title { margin-top: 8px; }
.group-title + .projects { margin-bottom: 56px; }
.group-note { color: var(--muted); font-size: 14.5px; margin: -6px 0 20px; max-width: 640px; }
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card:hover { transform: translateY(-3px); border-color: var(--faint); box-shadow: var(--shadow); }
.card-media { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; position: relative; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.card:hover .card-media img { transform: scale(1.03); }
.card-media.contain { padding-top: 16px; background: radial-gradient(ellipse at 50% 0%, var(--accent-soft), transparent 70%), var(--surface-2); }
.card-media.contain img { object-fit: contain; object-position: center top; }
.card-media .ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-family: var(--mono); font-size: 40px; color: var(--faint); opacity: 0.5;
  background: radial-gradient(ellipse at 30% 20%, var(--accent-soft), transparent 70%), var(--surface-2);
}
.badge {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--mono); font-size: 11px; padding: 3px 9px; border-radius: 6px;
  background: rgba(20, 22, 27, 0.65); color: #e3e0d8; backdrop-filter: blur(6px);
}
.card-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body h4 { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.card-body p { font-size: 14.5px; color: var(--muted); flex: 1; }
.card-links { display: flex; gap: 16px; margin-top: 6px; font-size: 13.5px; }
.card-links a { color: var(--accent); display: inline-flex; align-items: center; gap: 4px; }
.card-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.card-private { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-top: 6px; }

/* Gallery */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filter {
  font-size: 13px; padding: 6px 14px; border-radius: 99px;
  border: 1px solid var(--border); color: var(--muted);
  transition: all 0.2s;
}
.filter:hover { color: var(--text); border-color: var(--faint); }
.filter.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.gallery { columns: 3 280px; column-gap: 16px; }
.g-item {
  break-inside: avoid; margin-bottom: 16px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface); cursor: zoom-in; position: relative;
}
.g-item img { width: 100%; height: auto; transition: transform 0.5s; }
.g-item:hover img { transform: scale(1.03); }
.g-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 14px 10px;
  font-size: 13px; color: #eeebe4;
  background: linear-gradient(to top, rgba(10, 11, 14, 0.75), transparent);
  opacity: 0; transition: opacity 0.25s;
}
.g-item:hover figcaption { opacity: 1; }
.g-empty {
  break-inside: avoid; margin-bottom: 16px; border-radius: 12px;
  border: 1px dashed var(--border); aspect-ratio: 4 / 3;
  display: grid; place-items: center; text-align: center; padding: 20px;
  color: var(--faint); font-size: 13px; font-family: var(--mono);
}
.g-empty strong { display: block; color: var(--muted); font-family: var(--font); font-size: 15px; font-weight: 500; margin-bottom: 4px; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 11, 14, 0.92);
  display: flex; align-items: center; justify-content: center; padding: 48px 64px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox figure { max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lightbox img { max-height: calc(100vh - 140px); max-width: 100%; border-radius: 10px; object-fit: contain; }
.lightbox figcaption { color: #c4c1ba; font-size: 14px; }
.lb-close, .lb-nav { position: absolute; color: #eeebe4; font-size: 32px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; transition: background 0.2s; }
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, 0.08); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

/* Footer */
.footer {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 120px; padding-top: 28px; padding-bottom: 40px;
  border-top: 1px solid var(--border); font-size: 13px;
}

.footer-right { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); transition: color 0.2s; }
.footer-link:hover { color: var(--accent); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s, transform 0.7s; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Responsive */
@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; gap: 40px; }
  .services { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .container { padding: 0 16px; }
  .nav-links { display: none; }
  .theme-toggle { margin-left: auto; }
  .hero { padding-top: 64px; padding-bottom: 40px; }
  .banner { aspect-ratio: 4 / 3; border-radius: 16px; }
  .slide-info { left: 20px; right: 20px; bottom: 60px; }
  .slide-info p { font-size: 14px; }
  .services, .projects { grid-template-columns: 1fr; }
  .section { padding-top: 72px; }
  .lightbox { padding: 56px 8px; }
  .lb-nav { bottom: 8px; top: auto; }
}
