:root {
  --black: #0c0d0d;
  --paper: #f5f1e9;
  --ink: #171715;
  --gold: #b98a3c;
  --line: #d8d1c6;
  --cream: #f5f0e7;
  --graphite: #50585b;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  padding: 0;
  background: #1c1b18;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button, a { color: inherit; font: inherit; }
a { text-decoration: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  width: 100%;
  min-height: 86px;
  padding: 20px clamp(24px, 3.5vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(245, 240, 231, 0.97);
  border-bottom: 1px solid rgba(30, 27, 24, 0.18);
  position: relative;
  z-index: 20;
}

.brand { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 13px; line-height: 1; }
.brand-mark { position: relative; width: 30px; height: 30px; display: grid; place-items: center; }
.brand-mark::before { content: ""; position: absolute; top: 0; left: 0; width: 6px; height: 6px; background: var(--gold); box-shadow: 24px 0 var(--gold), 0 24px var(--gold), 24px 24px var(--gold); }
.brand-diamond { width: 18px; height: 18px; border: 4px solid var(--graphite); transform: rotate(45deg); }
.brand-word { color: var(--black); font-size: 1.32rem; font-weight: 500; letter-spacing: 0.27em; }
.menu-toggle { display: none; width: 46px; height: 46px; padding: 11px; background: transparent; border: 1px solid var(--black); cursor: pointer; }
.menu-line { display: block; width: 100%; height: 2px; margin: 5px 0; background: var(--black); transition: transform 180ms ease, opacity 180ms ease; }
.main-nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: 12px clamp(14px, 1.6vw, 24px); }
.main-nav a { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; transition: color 160ms ease; }
.main-nav a:hover,
.main-nav a:focus-visible { color: var(--gold); }
.main-nav a:nth-child(3) { position: relative; margin-left: 2px; padding-left: clamp(18px, 1.5vw, 24px); }
.main-nav a:nth-child(3)::before { content: ""; position: absolute; left: 0; top: 50%; width: 2px; height: 24px; background: #6d4935; transform: translateY(-50%); }

.site-footer {
  width: 100%;
  padding: 36px clamp(24px, 5vw, 80px) 42px;
  display: grid;
  grid-template-columns: minmax(250px, 1.25fr) repeat(2, minmax(150px, 0.65fr)) minmax(280px, 1fr);
  gap: clamp(30px, 4vw, 64px);
  color: #ded8cf;
  background: #1f1d1a;
}
.site-footer a { color: inherit; }
.brand-light { width: fit-content; color: var(--paper) !important; }
.brand-light .brand-word { color: #d8bb78; }
.footer-brand p { max-width: 290px; margin: 22px 0; color: #bdb6ac; font-size: 0.88rem; line-height: 1.6; }
.footer-brand small { color: #8e887f; font-size: 0.7rem; }
.footer-column { padding-left: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; border-left: 1px solid rgba(255, 255, 255, 0.25); }
.footer-column h2 { margin: 2px 0 10px; color: #d8bb78; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.footer-column a { font-size: 0.76rem; line-height: 1.35; }
.footer-column a:hover,
.footer-column a:focus-visible { color: #d8bb78; }
.footer-social > div { display: flex; flex-wrap: wrap; gap: 9px 20px; }

.viewer-shell {
  width: min(1500px, 100%);
  height: min(820px, calc(100vh - 126px));
  margin: 20px auto;
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 2.35fr) minmax(390px, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  background: var(--black);
  box-shadow: 0 22px 65px rgba(0,0,0,0.42);
}

.model-port {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  color: #f5f1e9;
  background: radial-gradient(circle at 50% 48%, #292723 0, #121313 48%, #090a0a 78%);
}

.port-heading { position: absolute; z-index: 10; top: 26px; left: 30px; }
.viewer-trail {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 10px 13px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 5px;
  background: rgba(8,9,9,0.58);
  color: rgba(255,255,255,0.58);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.viewer-trail a {
  color: #fff;
}
.viewer-trail > span:first-of-type { color: var(--gold); }
.viewer-trail a:hover,
.viewer-trail a:focus-visible { color: var(--gold); outline: none; }
.port-heading > span { display: block; margin-bottom: 8px; color: rgba(255,255,255,0.48); font-size: 0.58rem; letter-spacing: 0.14em; }
.port-heading p { margin: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; }

.model-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.model-stage model-viewer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  --poster-color: transparent;
  --progress-bar-color: var(--gold);
}

.model-loading {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 86px;
  width: min(270px, 58%);
  transform: translateX(-50%);
  color: rgba(255,255,255,0.72);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.model-loading i {
  height: 2px;
  margin-top: 9px;
  display: block;
  background: linear-gradient(90deg, var(--gold) var(--model-progress, 0%), rgba(255,255,255,0.18) 0);
}

.model-loading.is-complete { opacity: 0; visibility: hidden; }

.location-dot {
  position: relative;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f7f1e8;
  box-shadow: 0 0 0 2px #121313, 0 0 0 3px rgba(255,255,255,0.55), 0 4px 9px rgba(0,0,0,0.5);
  cursor: pointer;
}

.location-dot span { width: 6px; height: 6px; display: block; margin: auto; border-radius: 50%; background: #9b6642; }
.location-dot:hover, .location-dot:focus-visible, .location-dot.is-active { background: #dcb56e; }
.location-dot:focus-visible { outline: 3px solid white; outline-offset: 5px; }

.port-instruction { position: absolute; left: 30px; bottom: 28px; margin: 0; color: rgba(255,255,255,0.54); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; }
.port-controls { position: absolute; right: 24px; bottom: 20px; z-index: 10; display: flex; overflow: hidden; border: 1px solid rgba(255,255,255,0.22); border-radius: 9px; background: rgba(10,10,10,0.7); }
.port-controls button { width: 43px; height: 43px; padding: 0; border: 0; border-right: 1px solid rgba(255,255,255,0.15); background: transparent; color: white; cursor: pointer; }
.port-controls button:last-child { border-right: 0; }
.port-controls button:hover, .port-controls button:focus-visible { background: var(--gold); color: var(--black); }

.space-panel { min-width: 0; overflow-y: auto; background: var(--paper); }
.panel-heading { position: sticky; top: 0; z-index: 3; padding: 27px 28px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: rgba(245,241,233,0.96); }
.panel-heading p { margin: 0 0 7px; color: #7a7166; font-size: 0.55rem; font-weight: 700; letter-spacing: 0.12em; }
.panel-heading h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.3rem; font-weight: 400; }
.panel-heading > a { font-size: 1.5rem; line-height: 1; }
.space-list { padding: 0 18px 20px; }

.space-card {
  width: 100%;
  min-height: 142px;
  padding: 15px 9px;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.space-card img { width: 132px; height: 108px; display: block; object-fit: cover; filter: saturate(0.86) contrast(0.96); }
.space-card span { min-width: 0; }
.space-card strong, .space-card small { display: block; }
.space-card strong { margin-bottom: 7px; font-family: Georgia, "Times New Roman", serif; font-size: 0.98rem; font-weight: 400; }
.space-card small { color: #5f5a53; font-size: 0.7rem; line-height: 1.45; }
.space-card b { font-size: 1.1rem; font-weight: 400; }
.space-card:hover, .space-card:focus-visible, .space-card.is-active { background: #ebe1d2; box-shadow: inset 3px 0 var(--gold); }
.space-card:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

@media (max-width: 980px) {
  body { display: block; padding: 0; background: var(--black); }
  .viewer-shell { width: 100%; height: auto; min-height: calc(100vh - 82px); margin: 0; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .model-port { height: 70vh; min-height: 560px; }
  .space-panel { overflow: visible; }
  .space-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .model-port { height: 62vh; min-height: 480px; }
  .port-heading { top: 20px; left: 20px; }
  .port-instruction { left: 20px; bottom: 76px; }
  .port-controls { right: 16px; bottom: 16px; }
  .space-list { grid-template-columns: 1fr; padding-inline: 12px; }
}

@media (max-width: 1050px) {
  .site-header { min-height: 82px; padding: 14px 24px; align-items: center; flex-direction: row; gap: 20px; }
  .brand { gap: 11px; }
  .brand-mark { width: 27px; height: 27px; }
  .brand-mark::before { width: 5px; height: 5px; box-shadow: 22px 0 var(--gold), 0 22px var(--gold), 22px 22px var(--gold); }
  .brand-diamond { width: 16px; height: 16px; }
  .brand-word { font-size: 1.14rem; letter-spacing: 0.22em; }
  .menu-toggle { display: block; margin-left: auto; }
  .menu-toggle[aria-expanded="true"] .menu-line:nth-of-type(2) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-line:nth-of-type(3) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] .menu-line:nth-of-type(4) { transform: translateY(-7px) rotate(-45deg); }
  .main-nav { position: absolute; top: 100%; left: 0; right: 0; display: grid; gap: 0; padding: 10px 24px 22px; background: var(--cream); border-bottom: 1px solid var(--black); box-shadow: 0 18px 30px rgba(30, 27, 24, 0.12); opacity: 0; visibility: hidden; transform: translateY(-10px); transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease; }
  .main-nav.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
  .main-nav a { padding: 16px 0; border-bottom: 1px solid rgba(30, 27, 24, 0.13); font-size: 0.76rem; }
  .main-nav a:nth-child(3) { margin-left: 0; padding-left: 0; }
  .main-nav a:nth-child(3)::before { display: none; }
  .main-nav a:last-child { border-bottom: 0; }
  .site-footer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .site-footer { padding-inline: 20px; grid-template-columns: 1fr; }
  .footer-column { padding: 24px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.25); border-left: 0; }
}

.location-dot[hidden] { display:none !important; }
