/* Villa Ndao-Fall, the 360° visit: the same night-glass language as the
   maquette (eclate.css): a dark ground, frosted panels, warm gold accent. */
:root {
  --ink: #f4f1ea;
  --ink-2: rgba(244, 241, 234, 0.74);
  --ink-3: rgba(244, 241, 234, 0.48);
  --line: rgba(255, 255, 255, 0.16);
  --glass: rgba(16, 18, 20, 0.5);
  --glass-2: rgba(16, 18, 20, 0.7);
  --accent: #e2c48e;
  --bg: #0d0e0f;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Geist', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--sans); font-weight: 300; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
.mono { font-family: var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: grab; touch-action: none; }
#view.dragging { cursor: grabbing; }
#fade { position: fixed; inset: 0; background: #0b0c0d; opacity: 1; pointer-events: none; transition: opacity .45s ease; z-index: 5; }
#fade.clear { opacity: 0; }

/* ---- the passages: gold rings on the floor, the room's name on hover ---- */
#spots { position: fixed; inset: 0; pointer-events: none; z-index: 6; }
.spot { position: absolute; left: 0; top: 0; pointer-events: auto; display: flex; align-items: center; gap: 10px; transform: translate(-27px, -27px); }
.spot .ring { width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--accent); background: rgba(226, 196, 142, 0.18); box-shadow: 0 0 0 6px rgba(226, 196, 142, 0.12), 0 6px 20px rgba(0,0,0,.35); display: grid; place-items: center; transition: transform .2s, background .2s; }
.spot .ring::after { content: ''; width: 12px; height: 12px; border-top: 2px solid var(--ink); border-right: 2px solid var(--ink); transform: rotate(-45deg) translate(-2px, 2px); }
.spot .lb { padding: 7px 12px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 13px; white-space: nowrap; opacity: 0.92; }
.spot:hover .ring, .spot:focus-visible .ring { transform: scale(1.12); background: rgba(226, 196, 142, 0.35); }
.spot.stairs .ring::after { transform: rotate(-135deg) translate(-2px, 2px); }

/* ---- header ---- */
#bar { position: fixed; z-index: 10; top: max(14px, env(safe-area-inset-top, 0px)); left: max(14px, env(safe-area-inset-left, 0px)); right: max(14px, env(safe-area-inset-right, 0px)); height: 56px; display: flex; align-items: center; gap: 18px; padding: 0 10px 0 22px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.brand { text-decoration: none; letter-spacing: 0.2em; font-size: 13px; font-weight: 400; white-space: nowrap; }
#bar nav { display: flex; gap: 4px; margin: 0 auto; }
.tagline { margin: 0 auto; font-size: 10px; color: var(--ink-3); }
#bar nav a { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); text-decoration: none; padding: 8px 12px; border-radius: 999px; }
#bar nav a:hover { color: var(--ink); }
#bar nav a[aria-current] { color: var(--ink); background: rgba(255,255,255,0.1); }
.pill { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.06); }
.pill:hover { background: rgba(255,255,255,0.14); }
.pill.small { padding: 8px 12px; font-size: 9.5px; }
.pill.done { background: var(--accent); color: #141516; border-color: var(--accent); }

/* ---- the room's card ---- */
#card { position: fixed; z-index: 10; left: max(18px, env(safe-area-inset-left, 0px)); bottom: max(18px, env(safe-area-inset-bottom, 0px)); width: min(400px, calc(100vw - 36px)); padding: 22px 24px 18px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.eyebrow { font-size: 10px; color: var(--ink-2); margin: 0 0 10px; }
#card h1 { margin: 0; font-weight: 300; font-size: 30px; letter-spacing: -0.02em; line-height: 1.08; text-wrap: balance; }
#card .meta { font-size: 10px; color: var(--accent); margin: 10px 0 0; }
#card .line { font-size: 14px; line-height: 1.6; color: var(--ink-2); margin: 10px 0 0; }
.card-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.card-actions #copy { margin-left: auto; }
#c-count { font-size: 10px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.round { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; }
.round:hover { background: rgba(255,255,255,0.12); }
.round i { width: 8px; height: 8px; border-top: 1.4px solid var(--ink); border-right: 1.4px solid var(--ink); }
#prev i { transform: rotate(-135deg) translate(-1px, 1px); }
#next i { transform: rotate(45deg) translate(-1px, 1px); }
.round b { font-weight: 300; font-size: 20px; line-height: 1; }

/* ---- the plan ---- */
#map { position: fixed; z-index: 10; right: max(18px, env(safe-area-inset-right, 0px)); bottom: max(18px, env(safe-area-inset-bottom, 0px)); width: 280px; padding: 12px; border-radius: 18px; background: var(--glass-2); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.map-head { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 8px; font-size: 10px; color: var(--ink-3); }
.floors { display: flex; gap: 2px; padding: 2px; border-radius: 999px; background: rgba(255,255,255,0.06); }
.floors button { font-size: 9px; padding: 5px 10px; border-radius: 999px; color: var(--ink-3); }
.floors button.on { color: #141516; background: var(--accent); }
#map svg { display: block; width: 100%; height: auto; }
.m-plot { fill: rgba(255,255,255,0.03); stroke: rgba(255,255,255,0.2); stroke-width: 0.18; }
.m-pool { fill: rgba(111,196,226,0.38); }
.m-walls rect { fill: var(--ink); }
svg[data-floor="0"] .m-walls[data-f="1"], svg[data-floor="1"] .m-walls[data-f="0"] { display: none; }
svg[data-floor="1"] .m-walls-ghost { display: block; }
.m-walls-ghost { display: none; opacity: 0.15; }
.m-walls-ghost rect { fill: var(--ink); }
svg[data-floor="0"] .m-dot[data-f="1"], svg[data-floor="1"] .m-dot[data-f="0"] { display: none; }
.m-dot { fill: rgba(226,196,142,0.28); stroke: var(--accent); stroke-width: 0.24; cursor: pointer; }
.m-dot:hover { fill: var(--accent); }
.m-dot[data-off] { fill: rgba(255,255,255,0.08); stroke: rgba(255,255,255,0.28); pointer-events: none; }
.m-dot.cur { fill: var(--accent); stroke: #fff; }
.m-cone { fill: rgba(226,196,142,0.32); }

/* ---- every room ---- */
#rooms { position: fixed; z-index: 20; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 20px 20px; background: rgba(13,14,15,0.94); border-left: 1px solid var(--line); overflow-y: auto; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.rooms-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rooms-head h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 0; }
#rooms-list h3 { font-family: var(--mono); font-weight: 400; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin: 22px 0 8px; }
#rooms-list ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#rooms-list button { width: 100%; text-align: left; border-radius: 12px; overflow: hidden; background: rgba(255,255,255,0.05); border: 1px solid transparent; }
#rooms-list button:hover, #rooms-list button.cur { border-color: var(--accent); }
#rooms-list img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; background: #1a1c1e; }
#rooms-list span { display: block; padding: 8px 10px 10px; font-size: 12.5px; line-height: 1.3; }
#rooms-list button:disabled { cursor: default; opacity: 0.45; }
#rooms-list button:disabled:hover { border-color: transparent; }
#rooms-list em { display: block; margin-top: 4px; font-style: normal; font-size: 8.5px; color: var(--ink-3); }
.rooms-note { font-size: 9.5px; color: var(--ink-3); margin: 4px 0 0; line-height: 1.6; }

#hint { position: fixed; z-index: 9; left: 50%; top: 86px; transform: translateX(-50%); font-size: 10px; color: var(--ink-2); padding: 8px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); transition: opacity .6s; white-space: nowrap; }
#hint.off { opacity: 0; pointer-events: none; }
#loading { position: fixed; z-index: 7; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 11px; color: var(--ink-2); opacity: 0; transition: opacity .3s; pointer-events: none; }
#loading.on { opacity: 1; }

@media (max-width: 900px) {
  #bar nav, .tagline { display: none; }
  #bar { justify-content: space-between; }
  #bar { gap: 10px; padding-left: 18px; }
  .brand { font-size: 11px; }
  #map { top: 84px; bottom: auto; width: 160px; padding: 8px; }
  .map-head { display: none; }
  #card { padding: 16px 18px 14px; }
  #card h1 { font-size: 24px; }
  #card .line { display: none; }
  #hint { top: auto; bottom: 210px; font-size: 9px; }
  .spot .lb { display: none; }
}
@media (prefers-reduced-motion: reduce) { #fade { transition: none; } }
