:root {
  --paper: #F7F5F0;
  --surface: #ECE8DF;
  --ink: #141518;
  --muted: #66635C;
  --accent: #A8382A;
  --cedar: #8A5630;
  --obsidian: #0E1013;
  --line: rgba(20, 21, 24, 0.12);
  --line-dark: rgba(255, 255, 255, 0.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Jost', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.serif { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; }
.mb-28 { margin-bottom: 28px; }
.mt-16 { margin-top: 16px; }
.loader-kicker { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; }
.loader-sub { font-size: 12px; color: #9C9890; }
.brand-foot { color: var(--ink); letter-spacing: 0.16em; }

header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 3vw, 40px);
  background: rgba(247, 245, 240, 0.90);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand-word { font-size: 16px; font-weight: 600; letter-spacing: 0.22em; color: var(--ink); }
.brand-sub { font-size: 11px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}
.nav-btn:hover { color: var(--ink); background: rgba(20, 21, 24, 0.06); }
.nav-btn.active { background: var(--ink); color: var(--paper); }

.hero {
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 54px) clamp(16px, 3vw, 40px) 24px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 28px;
  align-items: end;
  border-bottom: 1px solid var(--line);
}
.hero h1 { font-size: clamp(36px, 5vw, 66px); line-height: 0.98; letter-spacing: -0.015em; color: var(--ink); }
.hero-kicker { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.hero-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 24px; font-size: 13px; }
.meta-item span { display: block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.meta-item strong { font-weight: 500; color: var(--ink); }

section { max-width: 1440px; margin: 0 auto; padding: clamp(24px, 3.5vw, 48px) clamp(16px, 3vw, 40px); }
.panel { display: none; }
.panel.active { display: block; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.sec-head h2 { font-size: clamp(26px, 3vw, 38px); line-height: 1.1; }
.sec-note { font-size: 13px; color: var(--muted); }

.stage-wrap {
  position: relative;
  width: 100%;
  height: min(72vh, 680px);
  min-height: 400px;
  background: var(--obsidian);
  border-radius: 14px;
  overflow: hidden;
}
#three-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#three-canvas:active { cursor: grabbing; }
.stage-hud-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  flex-wrap: wrap;
}
.stage-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(14, 16, 19, 0.72);
  backdrop-filter: blur(12px);
  color: #F7F5F0;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: #38C976; }
.dot-off { background: #E0A24C; }
.stage-hud-bottom {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.cam-bar, .ctrl-bar {
  pointer-events: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: rgba(14, 16, 19, 0.74);
  backdrop-filter: blur(12px);
  padding: 6px;
  border-radius: 12px;
}
.cam-btn {
  border: none;
  background: transparent;
  color: rgba(247, 245, 240, 0.78);
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  padding: 7px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 150ms ease;
}
.cam-btn:hover { background: rgba(255, 255, 255, 0.10); color: #fff; }
.cam-btn.active { background: #F7F5F0; color: var(--obsidian); font-weight: 500; }
.gpu-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.03em;
}
.gpu-btn:disabled { opacity: 0.55; cursor: wait; }
.sun-ctl { display: flex; align-items: center; gap: 8px; padding: 0 8px; color: #F7F5F0; font-size: 11px; }
.sun-ctl input { width: 105px; accent-color: #E2A354; }

#gpu-overlay { position: absolute; inset: 0; display: none; background: #0B0C0E; z-index: 20; }
#gpu-overlay.open { display: block; }
#gpu-overlay img { width: 100%; height: 100%; object-fit: contain; }
.gpu-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: rgba(14, 16, 19, 0.85);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
}
.gpu-badge {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(14, 16, 19, 0.82);
  color: #F7F5F0;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
}
#loader-3d {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--obsidian);
  color: #F7F5F0;
  z-index: 10;
  transition: opacity 400ms ease;
}
#loader-3d.done { opacity: 0; pointer-events: none; }

.comp-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.seg { display: inline-flex; background: var(--surface); padding: 4px; border-radius: 999px; gap: 4px; }
.seg button {
  border: none;
  background: transparent;
  padding: 7px 15px;
  border-radius: 999px;
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.seg button.active { background: var(--ink); color: var(--paper); font-weight: 500; }
.compare-box {
  position: relative;
  width: 100%;
  max-width: 1325px;
  margin: 0 auto;
  aspect-ratio: 2650 / 1900;
  background: #FFFFFF;
  border-radius: 12px;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  touch-action: none;
  cursor: ew-resize;
  border: 1px solid var(--line);
}
.compare-box.scale-250 { aspect-ratio: 2600 / 1900; }
.compare-box *, body.no-select, body.no-select * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-drag: none !important;
}
.compare-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  background: #FFFFFF;
  pointer-events: none;
  display: block;
}
#comp-top { clip-path: inset(0 50% 0 0); }
#comp-top.slate-cad { filter: invert(0.84) contrast(1.12); }
.cinema-wrap { margin-top: 34px; }
.cinema-frame {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: var(--obsidian);
  border: 1px solid var(--line);
}
#cinema-video { width: 100%; aspect-ratio: 16 / 9; display: block; background: var(--obsidian); }
#comp-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--accent); pointer-events: none; }
#comp-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  cursor: ew-resize;
}
.comp-tag {
  position: absolute;
  top: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 21, 24, 0.78);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}
.comp-tag.left { left: 14px; }
.comp-tag.right { right: 14px; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.art-card {
  background: #FFFFFF;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: zoom-in;
  transition: transform 200ms ease;
}
.art-card:hover { transform: translateY(-2px); }
.art-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: var(--surface); }
.art-card.tall img { aspect-ratio: 3 / 4; object-fit: contain; background: #FAF9F6; }
.art-meta { padding: 14px 16px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.art-meta h3 { font-size: 15px; font-weight: 500; }
.art-meta span { font-size: 11px; color: var(--muted); }

.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.dl-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 20px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: border-color 160ms ease, transform 160ms ease;
}
.dl-item:hover { border-color: var(--ink); transform: translateY(-2px); }
.dl-ext { display: inline-block; font-size: 11px; letter-spacing: 0.14em; color: var(--accent); text-transform: uppercase; }
.dl-item h3 { font-size: 17px; font-weight: 500; margin-top: 4px; }
.dl-item p { font-size: 13px; color: var(--muted); line-height: 1.45; }
.dl-action { font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); }

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(10, 11, 14, 0.94);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#lightbox.open { display: flex; }
#lightbox img { max-width: 96vw; max-height: 84vh; object-fit: contain; border-radius: 6px; }
#lb-cap { color: #F7F5F0; margin-top: 14px; font-size: 13px; letter-spacing: 0.04em; text-align: center; }
#lb-close {
  position: absolute;
  top: 18px;
  right: 22px;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
}

footer {
  max-width: 1440px;
  margin: 24px auto 0;
  padding: 24px clamp(16px, 3vw, 40px) 42px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 820px) {
  header { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 16px; }
  nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .nav-btn { white-space: nowrap; font-size: 12px; padding: 8px 12px; min-height: 38px; }
  .hero { grid-template-columns: 1fr; gap: 18px; }
  .hero-meta { grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .stage-wrap { height: 60vh; min-height: 360px; }
  .stage-hud-bottom { gap: 6px; }
  .cam-bar, .ctrl-bar { width: 100%; justify-content: space-between; }
  .cam-btn { font-size: 11px; padding: 7px 9px; }
  .comp-toolbar { flex-direction: column; align-items: stretch; }
  .seg { justify-content: space-between; }
  .seg button { flex: 1; font-size: 12px; padding: 8px 10px; }
  .comp-tag { font-size: 10px; padding: 4px 9px; top: 8px; }
  #comp-knob { width: 42px; height: 42px; }
}
