:root {
  --bg: #121212;
  --ink: #f5f3ee;
  --ink-soft: #9b988e;
  --line: #2e2d29;
  --accent: #ff5a3c;
  --panel: #1c1c19;
  --radius: 14px;
  --max: 1180px;
  --img-invert: 1;
  --thumb3-a: #4a4a48;
  --thumb3-b: #726b5c;
}

:root[data-theme="light"] {
  --bg: #f3f1ec;
  --ink: #14130f;
  --ink-soft: #55534a;
  --line: #d8d5cb;
  --panel: #e9e6dc;
  --img-invert: 0;
  --thumb3-a: #2a2a2a;
  --thumb3-b: #565248;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo-word {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}

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

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px clamp(20px, 5vw, 40px) 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  filter: invert(var(--img-invert));
}

.site-header .logo-mark {
  width: 75px;
  height: 75px;
}

.logo-word {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.logo-word.small { font-size: 0.95rem; }

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav {
  display: flex;
  gap: 32px;
  font-size: 0.95rem;
  font-weight: 500;
}

.site-nav a {
  position: relative;
  padding-bottom: 2px;
}

.site-nav a:hover { color: var(--ink-soft); }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: none;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  background: var(--panel);
  color: var(--accent);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-moon { display: none; }

[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------- Hero ---------- */

.hero-marquee-wrap {
  position: relative;
}

.hero-bg {
  position: absolute;
  bottom: 52px;
  right: 0px;
  width: min(48vw, 820px);
  height: auto;
  z-index: -1;
  pointer-events: none;
  user-select: none;
  filter: invert(var(--img-invert));
}

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(60px, 12vw, 120px) clamp(20px, 5vw, 40px) 60px;
}

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

.eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0;
}

.logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 0;
  background: linear-gradient(135deg, var(--panel), var(--line));
  border: 1px dashed var(--ink-soft);
  color: var(--ink-soft);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.logo-placeholder img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
}

.hero h1 {
  font-size: clamp(2.6rem, 8vw, 5.6rem);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  max-width: 14ch;
}

.hero h1 .accent { color: var(--accent); }

.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 34px;
}

.project-hero .hero-sub {
  padding-top: 20px;
  max-width: 66ch;
}

.project-hero {
  padding-bottom: 10px;
}

.project-gallery {
  padding-top: 0px;
}

.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--bg);
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn:hover { background: var(--accent); transform: translateY(-2px); }

/* ---------- Marquee ---------- */

.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  padding: 16px 0;
}

.marquee-track {
  display: flex;
  gap: 24px;
  white-space: nowrap;
  width: max-content;
  animation: scroll 22s linear infinite;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.marquee-group {
  display: flex;
  flex-shrink: 0;
  gap: 24px;
}

@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Sections common ---------- */

section:not(.hero):not(.marquee) {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(60px, 10vw, 100px) clamp(20px, 5vw, 40px);
  border-bottom: 1px solid var(--line);
}

.contact { border-bottom: none; }

.section-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 40px;
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 60px;
  align-items: start;
}

.about-lead {
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}

.stats {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.stat {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
}

.stat-label {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* ---------- Projects ---------- */

.project-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 0;
  overflow: hidden;
}

.project {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  background: var(--bg);
  padding: 28px;
  align-items: center;
  transition: background 0.2s ease;
}

.project:hover { background: var(--panel); }

.project-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.project-thumb {
  aspect-ratio: 16 / 10;
  border-radius: 0;
  background: linear-gradient(135deg, var(--panel), var(--line));
}

.thumb-1 { background: linear-gradient(135deg, #ffd7c9, #ff7a55); }
.thumb-2 { background: linear-gradient(135deg, #cfe0e8, #6f97ab); }
.thumb-3 { background: linear-gradient(135deg, var(--thumb3-a), var(--thumb3-b)); }

.project-info h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.project-tag {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

.project-desc {
  color: var(--ink-soft);
  margin: 0;
  max-width: 60ch;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.gallery-item {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: zoom-in;
  appearance: none;
  text-align: left;
}

.gallery-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.08);
}

.projects > .btn {
  margin-top: 24px;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 10, 10, 0.82);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 50;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-image {
  max-width: min(78vw, 980px);
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  cursor: zoom-out;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
}

.contact-lead {
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}

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

.contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 12px;
  border-radius: 0;
  font-size: 1rem;
  font-weight: 500;
  border-top: 1px solid var(--line);
  transition: background 0.2s ease, color 0.2s ease;
}

.contact-link:last-child {
  border-bottom: 1px solid var(--line);
}

.contact-link:hover {
  background: var(--panel);
  color: var(--accent);
}

.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.contact-icon svg { width: 100%; height: 100%; }

/* ---------- Footer ---------- */

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px clamp(20px, 5vw, 40px) 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---------- Responsive ---------- */

@media (max-width: 800px) {
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .project {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 20;
    width: 100vw;
    height: 100vh;
    background: var(--bg);
    border: none;
    border-radius: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: top;
    gap: 8px;
    padding: 100px clamp(20px, 5vw, 40px) 40px;
    transform: translateX(100%);
    transition: transform 0.32s ease;
    box-shadow: none;
    pointer-events: none;
  }

  .site-nav.open {
    transform: translateX(0);
    pointer-events: auto;
  }

  .site-nav a {
    width: 100%;
    padding: 14px 0;
    border-radius: 0;
    font-size: clamp(1.8rem, 7vw, 3rem);
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.03em;
  }

  .site-nav a:hover { color: var(--accent); background: none; }

  .nav-toggle {
    display: flex;
    position: relative;
    z-index: 21;
  }

  .hero-bg { display: none; }
}
