/* ── Tokens ─────────────────────────────────────── */
:root {
  --bg:    #FFFFFF;
  --fg:    #0C0C0C;
  --muted: #888888;
  --line:  rgba(0,0,0,0.10);
  --nav-h: 45px;
}
body.dark {
  --bg:    #1A1A1A;
  --fg:    #E8E4DC;
  --muted: #8A8A8A;
  --line:  rgba(255,255,255,0.10);
}

/* ── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }
button { cursor: pointer; }

/* ── Typography helpers ─────────────────────────── */
.mono  { font-family: 'Space Mono', monospace; }
.muted { color: var(--muted); }
.small { font-size: 0.7rem; letter-spacing: 0.1em; }

/* ── NAV ────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  height: var(--nav-h);
}
.nav__controls {
  display: flex;
  align-items: stretch;
  border-left: 1px solid var(--line);
}
.nav__toggle {
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  background: none;
  border: none;
  border-left: 1px solid var(--line);
  color: var(--fg);
  transition: color 0.2s, background 0.2s;
}
.nav__toggle:first-child { border-left: none; }
.nav__toggle:hover { color: var(--muted); }
.nav__item {
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-right: 1px solid var(--line);
  transition: color 0.2s;
}
.nav__item:last-child { border-right: none; }
.nav__item--brand {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: none;
}
.nav__item:hover { color: var(--muted); }

/* ── HERO ───────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: calc(100vh - var(--nav-h));
  padding: 60px 40px 0;
  border-bottom: 1px solid var(--line);
}
.hero__body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  justify-content: center;
}
.hero__tag {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero__wordmark {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(5rem, 18vw, 18rem);
  line-height: 0.88;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.hero__foot {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
.hero__foot span {
  padding: 14px 0 14px 20px;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-right: 1px solid var(--line);
}
.hero__foot span:last-child { border-right: none; }

/* ── INDEX — column headers ─────────────────────── */
.idx-cols {
  display: grid;
  grid-template-columns: 60px 1fr 1fr 40px;
  padding: 10px 20px;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

/* ── INDEX — accordion row ──────────────────────── */
.idx-row {
  border-bottom: 1px solid var(--line);
}
.idx-trig {
  width: 100%;
  display: grid;
  grid-template-columns: 60px 1fr 1fr 40px;
  align-items: center;
  padding: 18px 20px;
  background: none;
  border: none;
  text-align: left;
  transition: background 0.15s;
}
.idx-trig:hover { background: rgba(0,0,0,0.02); }
.idx-row--fixed .idx-trig { cursor: default; pointer-events: none; }
.idx-row--fixed .idx-panel { display: block; }
.idx-num  { font-size: 0.62rem; letter-spacing: 0.12em; color: var(--muted); }
.idx-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.idx-sub  { font-size: 0.62rem; letter-spacing: 0.08em; color: var(--muted); }
.idx-tog  {
  font-family: 'Space Mono', monospace;
  font-size: 1.1rem;
  color: var(--muted);
  text-align: right;
  transition: transform 0.25s;
}
.idx-trig[aria-expanded="true"] .idx-tog { transform: rotate(45deg); }

/* ── INDEX — panel ──────────────────────────────── */
.idx-panel {
  padding: 32px 20px 40px;
  border-top: 1px solid var(--line);
}

/* ── ABOUT inner ────────────────────────────────── */
.about-inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  align-items: start;
}
.about-photo img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
}
.about-right {
  display: flex;
  flex-direction: column;
}
.about-stmt {
  margin-top: 32px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.about-stmt .statement {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 3.5vw, 3.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

/* ── Data table ─────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table td {
  padding: 10px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.data-table .key {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
  padding-right: 24px;
  width: 110px;
}

/* ── Service content ────────────────────────────── */
.svc-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.svc-detail h4 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
}
.svc-detail p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 20px;
}
.svc-detail--solo {
  grid-column: 1 / -1;
  max-width: 520px;
}
.svc-imgs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}
.svc-imgs img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.svc-imgs--contain img {
  aspect-ratio: unset;
  object-fit: contain;
  background: transparent;
}
.platform-logos--color img {
  filter: none;
  opacity: 1;
}
.svc-video { margin-top: 16px; }
.svc-video video { width: 100%; display: block; }
.svc-video span { display: block; margin-top: 8px; }

.svc-img-full { margin-top: 16px; }
.svc-img-full img {
  width: 100%;
  max-height: 60vh;
  object-fit: cover;
}

/* ── Platform logos ─────────────────────────────── */
.platform-strip { margin-bottom: 16px; }
.platform-logos {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.platform-logos img {
  height: 28px;
  width: auto;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.6;
}

/* ── Feature list ───────────────────────────────── */
.feature-list {
  list-style: none;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  line-height: 2.2;
}
.feature-list li::before { content: '— '; }

/* ── Lamp slider ────────────────────────────────── */
.lamp-slider {
  margin-top: 16px;
  overflow: hidden;
}
.lamp-slider__track {
  display: flex;
  gap: 8px;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.lamp-slide {
  flex: 0 0 calc((100% - 16px) / 3);
}
.lamp-slide img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
}
.lamp-slider__ctrl {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}
.lamp-slider__ctrl button {
  background: none;
  border: 1px solid var(--line);
  width: 36px;
  height: 36px;
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  transition: border-color 0.2s;
}
.lamp-slider__ctrl button:hover { border-color: var(--fg); }
.lamp-slider__ctrl span { font-size: 0.65rem; letter-spacing: 0.1em; color: var(--muted); }

/* ── Service grid ───────────────────────────────── */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}
.svc-card {
  cursor: pointer;
  position: relative;
}
.svc-card__img {
  overflow: hidden;
  position: relative;
}
.svc-card__img img,
.svc-card__img video {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.svc-card:hover .svc-card__img img,
.svc-card:hover .svc-card__img video { transform: scale(1.04); }
.svc-card[data-svc="web3d"] .img-hover { display: none; position: absolute; inset: 0; width: 100%; height: 100%; }
.svc-card[data-svc="web3d"]:hover .img-default { opacity: 0; }
.svc-card[data-svc="web3d"]:hover .img-hover { display: block; opacity: 1; }.svc-card--active .svc-card__img::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--fg);
  pointer-events: none;
}
.svc-card__label {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
}

/* Service description panel */
.svc-desc {
  border-top: 1px solid var(--fg);
  margin-top: 2px;
  padding: 32px 0 40px;
  position: relative;
}
.svc-desc[hidden] { display: none; }
.svc-desc__close {
  position: absolute;
  top: 20px;
  right: 0;
  background: none;
  border: 1px solid var(--line);
  padding: 6px 14px;
  font-size: 0.65rem;
  transition: border-color 0.2s;
}
.svc-desc__close:hover { border-color: var(--fg); }
.svc-desc__title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 16px;
}
.svc-desc__text {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 600px;
}
.svc-desc__extra { margin-top: 20px; }
.svc-desc__extra img,
.svc-desc__extra video {
  max-height: 50vh;
  max-width: 100%;
  object-fit: contain;
}
.svc-desc__extra .platform-logos {
  margin-top: 16px;
}

/* ── Portfolio grid ─────────────────────────────── */
.port-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.port-proj { cursor: pointer; }
.port-proj-img {
  position: relative;
  overflow: hidden;
}
.port-proj-img img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.port-proj:hover .port-proj-img img { transform: scale(1.03); }
.port-proj-hover {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  opacity: 0;
  transition: opacity 0.25s;
}
.port-proj:hover .port-proj-hover { opacity: 1; }
.port-proj-meta {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 0 20px;
  border-bottom: 1px solid var(--line);
}
.port-proj-meta .mono { font-size: 0.6rem; letter-spacing: 0.12em; color: var(--muted); }
.port-proj-name { font-size: 0.82rem; }

/* ── Lamp overlay ───────────────────────────────── */
.lamp-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.lamp-overlay[hidden] { display: none; }
.lamp-overlay__hd {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.lamp-overlay__hd h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin-top: 4px;
}
.lamp-overlay__close {
  background: none;
  border: 1px solid var(--line);
  padding: 8px 16px;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  transition: border-color 0.2s;
}
.lamp-overlay__close:hover { border-color: var(--fg); }
.lamp-overlay__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 2px;
}
.lamp-cell img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}

/* ── Lightbox ───────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(255,255,255,0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: 1px solid var(--line);
  padding: 8px 16px;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  transition: border-color 0.2s;
}
.lightbox__close:hover { border-color: var(--fg); }
#lbImg {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
}

/* ── Contact ────────────────────────────────────── */
.section-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.contact__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding: 40px 20px 60px;
  border-bottom: 1px solid var(--line);
}
.contact__title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}
.contact__data { margin-bottom: 28px; }
.contact-link { text-decoration: underline; text-underline-offset: 3px; opacity: 0.8; }
.contact-link:hover { opacity: 1; }
.contact__intro {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--fg);
  opacity: 0.85;
  max-width: 480px;
}
.contact__ext-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ext-link {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
.ext-link:hover { color: var(--fg); }

/* ── Form ───────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.field label { font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.field input,
.field select,
.field textarea {
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  color: var(--fg);
  outline: none;
  resize: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--fg); }
.field input::placeholder,
.field textarea::placeholder { color: var(--muted); }
.form-submit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 14px 0;
  background: none;
  border: none;
  border-top: 1px solid var(--fg);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: opacity 0.2s;
}
.form-submit:hover { opacity: 0.5; }
.form-submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Footer ─────────────────────────────────────── */
.footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 20px;
  border-top: 1px solid var(--line);
}
.footer span {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
  .hero { padding: 40px 16px 0; }
  .hero__wordmark { font-size: clamp(4rem, 22vw, 8rem); }
  .hero__foot { grid-template-columns: 1fr; }
  .hero__foot span { border-right: none; border-bottom: 1px solid var(--line); }

  .idx-cols  { grid-template-columns: 44px 1fr 40px; }
  .idx-trig  { grid-template-columns: 44px 1fr 40px; }
  .idx-sub   { display: none; }
  .idx-panel { padding: 24px 16px 32px; }

  .about-inner { grid-template-columns: 200px 1fr; }
  .svc-content { grid-template-columns: 1fr; }
  .port-grid   { grid-template-columns: 1fr; }
  .lamp-overlay__grid { grid-template-columns: repeat(2, 1fr); }

  .contact__body { grid-template-columns: 1fr; gap: 40px; padding: 32px 16px 48px; }
  .footer { grid-template-columns: 1fr; gap: 8px; }
}
