@font-face {
  font-family: Inter;
  src: url("/web/fonts/inter.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  font: 16px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #17352e;
  --green: #173f35;
  --bright: #d6edae;
  --muted: #66736d;
  --line: #dce2df;
  --paper: #f6f8f6;
  --white: #fff;
  --error: #a12626;
  --radius: 16px;
  --shadow: 0 12px 36px #18392e0b;
  --content-width: min(1320px, calc(100% - 64px));
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100svh; margin: 0; }
h1, h2, p { margin: 0; }
h1, h2 { line-height: 1.15; letter-spacing: -.035em; text-wrap: balance; }
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 4vw, 3.7rem);
  font-weight: 500;
}
a { color: inherit; }
:focus-visible { outline: 3px solid #458169; outline-offset: 4px; }

.site-header { background: var(--green); color: var(--white); }
.site-header :focus-visible { outline-color: var(--bright); }
.site-header-inner {
  display: flex;
  align-items: center;
  gap: clamp(22px, 3vw, 40px);
  min-height: 84px;
  width: var(--content-width);
  margin-inline: auto;
}
.wordmark, .elaunch-link, #scene-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
  text-decoration: none;
}
.wordmark {
  gap: 10px;
  width: fit-content;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.04em;
}
.wordmark img { flex: none; }
#scene-nav { display: flex; gap: clamp(12px, 2vw, 28px); }
#scene-nav a { gap: 5px; color: #d5e2dc; font-size: .9rem; }
#scene-nav a:hover, #scene-nav a[aria-current] { color: var(--white); }
#scene-nav a[aria-current]::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--bright);
}
.elaunch-link {
  gap: 8px;
  margin-inline-start: auto;
  padding: 8px 14px;
  border: 1px solid #b4d0c3;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
}
.elaunch-link:hover { background: #295448; }

.gallery, .viewer { width: var(--content-width); margin-inline: auto; }
.gallery { padding-block: 32px 50px; }
.gallery-heading { margin-bottom: 24px; }
.gallery-heading p { margin-top: 12px; max-width: 740px; color: var(--muted); text-wrap: pretty; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.65vw, 24px);
}
.scene-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color 180ms ease;
}
.scene-card:hover { border-color: #78998b; }
.scene-cover { aspect-ratio: 1.5; overflow: hidden; background: #181d1a; }
.scene-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.scene-card[data-scene=eyeful-apartment] .scene-cover { background: #161b1c; }
.scene-card[data-scene=eyeful-apartment] .scene-cover img { object-fit: contain; padding: 8px; }
.scene-card-body {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  justify-items: start;
  gap: 8px;
  padding: clamp(16px, 2vw, 25px);
  border-top: 1px solid var(--line);
}
.scene-card h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.5rem, 2.25vw, 2rem);
  font-weight: 500;
}
.scene-category {
  color: #547164;
  font-size: .75rem;
  letter-spacing: .11em;
  font-weight: 700;
  text-transform: uppercase;
}
.scene-description, .scene-help { color: var(--muted); text-wrap: pretty; }
.scene-description { font-size: .9rem; }
.scene-open {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  margin-top: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  color: var(--green);
  background: var(--bright);
  font-size: .9rem;
  font-weight: 600;
}

.viewer { padding-block: 30px 35px; }
.scene-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 18px;
  margin-bottom: 20px;
}
.scene-heading h1 { font-size: clamp(2rem, 3.6vw, 3.2rem); }
.viewer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 282px;
  align-items: start;
  gap: 16px;
}
#viewport {
  position: relative;
  isolation: isolate;
  min-height: clamp(460px, 69vh, 850px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #161b1c center / cover no-repeat;
}
#viewport canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; }
.viewer-message {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 12px;
  max-width: calc(100% - 24px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 10px 14px;
}
#error { color: var(--error); }
#controls {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}
fieldset { min-width: 0; margin: 0; border: 0; padding: 0; }
legend, .slider { margin-bottom: 7px; padding: 0; font-size: .9rem; font-weight: 650; }
.control-grid { display: grid; gap: 7px; }
.control-grid.palette { grid-template-columns: repeat(3, minmax(0, 1fr)); }
button {
  min-height: 44px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: var(--white);
  font: 600 .9rem/1.35 Inter, system-ui, sans-serif;
  cursor: pointer;
}
button:hover { background: #eef3ef; }
button[aria-pressed=true] { border-color: #a4be89; background: var(--bright); }
#room-views button { text-align: left; padding-inline: 11px; }
.slider { display: grid; gap: 3px; margin: 0; }
.slider input { width: 100%; min-height: 44px; margin: 0; accent-color: var(--green); }
.scene-help { font-size: .9rem; }
.source-link { display: flex; width: fit-content; align-items: center; min-height: 44px; text-underline-offset: 4px; }

@media (max-width: 920px) {
  :root { --content-width: calc(100% - 40px); }
  .viewer-layout { grid-template-columns: minmax(0, 1fr) 224px; }
  #controls { padding: 14px; }
}
@media (max-width: 700px) {
  .site-header-inner { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding-block: 9px; }
  #scene-nav { grid-row: 2; grid-column: 1 / -1; justify-content: space-between; flex-wrap: wrap; gap: 0 8px; }
  .gallery { padding-top: 25px; }
  .gallery-grid, .viewer-layout { grid-template-columns: minmax(0, 1fr); }
  .gallery-grid { gap: 16px; }
  .viewer { padding-block: 24px 25px; }
  #viewport { min-height: max(350px, 52svh); }
  .control-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .scene-card { transition: none; } }
