/* ============================================================
   LANDING + INTERACTIVE ROOM
   ============================================================ */

/* ---- fixed site nav (transparent, maroon text) ---- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; gap: 16px;
  padding: 12px clamp(16px, 3vw, 40px);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
}
.site-nav.scrolled {
  background: color-mix(in oklch, var(--bg) 72%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom-color: color-mix(in oklch, var(--maroon) 30%, transparent);
}
.site-nav .sn-links { display: flex; flex: 1; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px; }
.sn-link {
  font-family: var(--display); font-size: 15px; letter-spacing: .01em;
  color: var(--maroon); background: none; border: 0; cursor: pointer;
  padding: 8px 13px; border-radius: 999px; position: relative;
  transition: all .2s var(--ease);
}
.sn-link:hover { color: var(--maroon-dim); background: color-mix(in oklch, var(--maroon) 12%, transparent); }
.sn-link.active { color: var(--maroon); }
.sn-link.active::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 3px; height: 2px;
  background: var(--maroon); border-radius: 2px;
}

/* dark mode: nav links + accents turn gold */
:root[data-theme="dark"] .sn-link { color: var(--gold); }
:root[data-theme="dark"] .sn-link:hover { color: var(--gold-deep); background: color-mix(in oklch, var(--gold) 14%, transparent); }
:root[data-theme="dark"] .sn-link.active { color: var(--gold); }
:root[data-theme="dark"] .sn-link.active::after { background: var(--gold); }
:root[data-theme="dark"] .site-nav.scrolled { border-bottom-color: color-mix(in oklch, var(--gold) 28%, transparent); }

/* ---- hero ---- */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 0.5fr 1.5fr;
  align-items: center;
  gap: 0.5vw;
  padding: 64px 2vw 2vh;
  position: relative;
  overflow: hidden;
}

/* floating hint over the room */
.explore-float {
  position: absolute; z-index: 40; pointer-events: none;
  top: clamp(78px, 11vh, 140px); left: 45%; right: auto; transform: translateX(-50%) rotate(-3deg);
  font-family: var(--display); font-style: italic;
  font-size: clamp(22px, 2.4vw, 34px); color: var(--maroon);
  text-align: center; line-height: 1.1;
  display: flex; align-items: flex-end; gap: 8px;
  animation: floatBob 3.4s var(--ease) infinite;
}
.explore-float .ef-arrow {
  font-family: var(--mono); font-style: normal; font-size: 30px; color: var(--gold-deep);
  transform: translateY(2px); display: inline-block;
}
@keyframes floatBob { 0%,100% { transform: translateX(-50%) rotate(-3deg) translateY(0); } 50% { transform: translateX(-50%) rotate(-3deg) translateY(-7px); } }
@media (prefers-reduced-motion: reduce) { .explore-float { animation: none; } }
@media (max-width: 920px) { .explore-float { display: none; } }

/* scroll cue under the hero description */
.scroll-cue {
  margin-top: 80px; margin-left: 32%; transform: translateX(-50%);
  display: inline-flex; flex-direction: column; align-items: center; gap: 13px;
  font-family: var(--mono); font-size: 20px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-faint); background: none; border: 0; cursor: pointer; padding: 0;
  transition: color .2s var(--ease);
}
.scroll-cue:hover { color: var(--maroon); }
.scroll-cue .sc-arrow {
  font-family: var(--mono); font-size: 36px; line-height: 1; color: var(--maroon);
  animation: scrollBounce 1.8s var(--ease) infinite;
}
@keyframes scrollBounce { 0%,100% { transform: translateY(0); opacity: .55; } 50% { transform: translateY(6px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .scroll-cue .sc-arrow { animation: none; } }

/* ---- stacked sections ---- */
.scroll-section { scroll-margin-top: 60px; border-top: 1px solid var(--line); }
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---- left: identity ---- */
.identity { max-width: 600px; padding-left: 4vw; }
.identity .kicker {
  font-family: var(--mono); font-size: 13px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--maroon);
  display: flex; align-items: center; gap: 10px; margin-bottom: 26px;
}
.identity .kicker::before {
  content: ""; width: 30px; height: 1.5px; background: var(--maroon); display: inline-block;
}
.identity h1 {
  font-family: var(--display);
  font-size: clamp(48px, 7.8vw, 112px);
  line-height: .92; letter-spacing: -.02em;
  margin: 0; color: var(--ink); white-space: nowrap;
}
.identity h1 .ital { font-style: italic; }

.identity .welcome-eyebrow {
  display: inline-block;
  font-family: 'Caveat', cursive; font-size: clamp(30px, 3vw, 46px); font-weight: 600;
  color: var(--gold-deep); line-height: 1; margin: 0 0 18px 3px;
}
.identity .welcome-swash {
  display: block; width: clamp(108px, 11vw, 150px); height: 11px;
  color: var(--gold-deep); margin-top: 1px;
}

.identity .hero-tagline {
  margin-top: 26px; padding-left: 20px;
  border-left: 2px solid var(--maroon);
  font-size: clamp(17px, 1.55vw, 22px); line-height: 1.5;
  color: var(--ink-soft); max-width: 30ch; letter-spacing: .005em;
}

.identity .tagline-list {
  list-style: none; margin: 30px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.identity .tagline-list li {
  display: flex; align-items: center; gap: 14px; white-space: nowrap;
  font-family: var(--display); font-size: clamp(19px, 1.7vw, 24px); line-height: 1.1;
  color: var(--ink); letter-spacing: .005em;
}
.identity .disc-ico {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; color: var(--gold-deep);
}
.identity .disc-ico svg { width: 23px; height: 23px; }

.identity .explore-btn {
  margin-top: 38px; display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--display); font-size: clamp(18px, 1.7vw, 23px);
  color: #fff; background: var(--maroon);
  border: 1.5px solid var(--maroon); border-radius: 999px;
  padding: 13px 30px; cursor: pointer;
  transition: background .22s var(--ease), border-color .22s var(--ease), transform .22s var(--ease);
}
.identity .explore-btn:hover { background: var(--maroon-dim); border-color: var(--maroon-dim); transform: translateY(-2px); box-shadow: 0 12px 26px -14px rgba(80,20,20,.55); }
.identity .explore-btn .eb-arrow { font-family: var(--mono); font-size: .9em; transition: transform .25s var(--ease); }
.identity .explore-btn:hover .eb-arrow { transform: translateY(3px); }

/* ---- editorial CTA links ---- */
.identity .cta-row { margin-top: 40px; display: flex; gap: 26px; flex-wrap: wrap; }
.identity .cta {
  font-family: var(--display); font-style: italic; font-size: clamp(19px, 1.6vw, 23px);
  color: var(--ink); text-decoration: none; cursor: pointer;
  background: none; border: 0; padding: 0 0 3px;
  border-bottom: 1.5px solid var(--accent);
  display: inline-flex; align-items: center; gap: 8px;
  transition: gap .2s var(--ease), color .2s var(--ease);
}
.identity .cta:hover { gap: 13px; color: var(--gold-deep); }
.identity .cta .arr { font-style: normal; font-family: var(--mono); }
.identity .hint {
  margin-top: 44px; display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em;
  color: var(--ink-faint);
}
.identity .hint .diamond { color: var(--accent); font-size: 11px; }
.identity .nav-mini {
  margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px 8px; max-width: 30ch;
}
.identity .nav-mini button {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px;
  cursor: pointer; transition: all .25s var(--ease);
}
.identity .nav-mini button:hover {
  color: var(--ink); border-color: var(--accent);
  background: color-mix(in oklch, var(--accent) 12%, transparent);
}

/* ---- right: transparent room (no background box) ---- */
.room-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1104 / 618;     /* matches the reference canvas */
  overflow: visible;
  isolation: isolate;
  transform: translateX(34%) scale(1.6);
  transform-origin: center right;
}
@media (max-width: 1100px) { .room-frame { transform: translateX(20%) scale(1.4); } }
/* soft floor shadow that grounds the desk on the page */
.room-frame .floor {
  position: absolute; z-index: 0; pointer-events: none;
  left: 30%; top: 84%; width: 44%; height: 12%;
  background: radial-gradient(closest-side, rgba(40,28,12,.20), transparent 75%);
  filter: blur(6px);
  transition: opacity .5s var(--ease);
}
:root[data-theme="dark"] .room-frame .floor { background: radial-gradient(closest-side, rgba(0,0,0,.5), transparent 75%); }

/* ---- room objects ---- */
.obj {
  position: absolute;
  margin: 0; padding: 0; border: 0; background: none;
  display: block;
}
.obj img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;            /* hit area governed by wrapper */
  filter:
    drop-shadow(0 8px 12px rgba(40,28,12,.26))
    drop-shadow(0 0 0 color-mix(in oklch, var(--accent) 0%, transparent))
    drop-shadow(0 0 0 color-mix(in oklch, var(--accent) 0%, transparent));
  transition: transform .4s var(--ease), filter .4s var(--ease);
  transform-origin: center bottom;
}
:root[data-theme="dark"] .obj img {
  filter:
    drop-shadow(0 10px 16px rgba(0,0,0,.55))
    drop-shadow(0 0 0 color-mix(in oklch, var(--accent) 0%, transparent))
    drop-shadow(0 0 0 color-mix(in oklch, var(--accent) 0%, transparent));
}
.obj.static { pointer-events: none; }

.obj.hot { cursor: pointer; }
/* slight lift + a glow that fades in pure gold (matched filter lists = no dark flash) */
.obj.hot:hover img,
.obj.hot:focus-visible img {
  transform: translateY(-2px) scale(1.012);
  filter:
    drop-shadow(0 8px 12px rgba(40,28,12,.26))
    drop-shadow(0 0 15px color-mix(in oklch, var(--accent) 88%, transparent))
    drop-shadow(0 0 36px color-mix(in oklch, var(--accent) 55%, transparent));
}
:root[data-theme="dark"] .obj.hot:hover img,
:root[data-theme="dark"] .obj.hot:focus-visible img {
  filter:
    drop-shadow(0 10px 16px rgba(0,0,0,.55))
    drop-shadow(0 0 15px color-mix(in oklch, var(--accent) 88%, transparent))
    drop-shadow(0 0 36px color-mix(in oklch, var(--accent) 55%, transparent));
}
.obj.hot:focus-visible { outline: none; }

/* books: a super-light square box outlines the region on hover (no book-silhouette glow) */
.obj.bookglow img { opacity: 0 !important; }
.obj.bookglow::after { content: none; }

/* books overlay sits exactly atop baked shelf books; invisible until hover */
.obj.books img {
  opacity: 0;
  transition: opacity .3s var(--ease), transform .35s var(--ease), filter .35s var(--ease);
}
.obj.books:hover img,
.obj.books:focus-visible img {
  opacity: 1;
  transform: translateY(-3px) scale(1.02);
  filter:
    drop-shadow(0 0 14px color-mix(in oklch, var(--accent) 88%, transparent))
    drop-shadow(0 0 30px color-mix(in oklch, var(--accent) 55%, transparent))
    brightness(1.08);
}

/* ---- hover-only captions (no persistent figma markers) ---- */
.marker {
  position: absolute; z-index: 24;
  display: flex; flex-direction: column; align-items: center;
  transform: translate(-50%, -100%);
  pointer-events: none; white-space: nowrap;
}
.marker .label {
  font-family: var(--display); font-style: italic; font-size: clamp(13px, 1.2vw, 17px);
  letter-spacing: 0; line-height: 1.4;
  background: var(--accent); color: #1a140a;
  border-radius: 999px; padding: 0; max-width: 0; overflow: hidden;
  opacity: 0; transform: translateY(4px);
  box-shadow: 0 6px 18px -6px rgba(40,28,12,.5);
  transition: max-width .34s var(--ease), opacity .26s var(--ease), transform .26s var(--ease), padding .3s var(--ease);
}
.marker .leader {
  width: 1.5px; height: 0;
  background: linear-gradient(var(--accent), transparent);
  transition: height .3s var(--ease);
}
/* figma-tag variant (opt-in via Tweaks) */
.room-frame[data-labels="figma"] .marker .label {
  font-family: var(--mono); font-style: normal; font-size: 12.5px; letter-spacing: .02em;
  background: transparent; color: var(--accent); box-shadow: none;
}
.room-frame[data-labels="figma"] .obj.hot:hover + .marker .label,
.room-frame[data-labels="figma"] .obj.hot:focus-visible + .marker .label { padding: 0; }

/* reveal on hover of the linked object (immediately-preceding sibling) */
.obj.hot:hover + .marker .label,
.obj.hot:focus-visible + .marker .label,
.obj.hotspot:hover + .marker .label,
.obj.hotspot:focus-visible + .marker .label,
.marker.show .label { max-width: 260px; opacity: 1; transform: none; padding: 4px 14px; }
.obj.hot:hover + .marker .leader,
.obj.hot:focus-visible + .marker .leader,
.obj.hotspot:hover + .marker .leader,
.obj.hotspot:focus-visible + .marker .leader,
.marker.show .leader { height: 16px; }

/* ---- desk hotspots (books / lamp baked into the desk image) ---- */
.obj.hotspot { background: none; cursor: pointer; }
.obj.hotspot .halo {
  position: absolute; inset: -14% -12%;
  border-radius: 50%;
  background: radial-gradient(closest-side,
    color-mix(in oklch, var(--accent) 80%, transparent) 0%,
    color-mix(in oklch, var(--accent) 38%, transparent) 46%,
    transparent 72%);
  opacity: 0; transform: scale(.96);
  transition: opacity .35s var(--ease), transform .4s var(--ease);
  pointer-events: none;
}
.obj.hotspot:hover .halo,
.obj.hotspot:focus-visible .halo { opacity: 1; transform: scale(1); }
.obj.hotspot:focus-visible { outline: none; }

/* lamp glow puddle (only meaningful in dark) */
.lamp-glow {
  position: absolute; z-index: 3; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(245,210,120,.45), rgba(245,210,120,0) 72%);
  opacity: 0; transition: opacity .5s var(--ease);
  mix-blend-mode: screen;
}
.room-frame.lamp-on .lamp-glow { opacity: 1; }

/* responsive: stack on narrow screens */
@media (max-width: 920px) {
  .landing { grid-template-columns: 1fr; gap: 6vh; padding: 6vh 7vw; }
  .identity { order: 1; }
  .room-frame { order: 2; }
}

/* ============================================================
   POSITION EDITOR (press "e")
   ============================================================ */
.room-frame.editing { outline: 1px dashed color-mix(in oklch, var(--ink) 25%, transparent); }
.room-frame.editing .marker { display: none; }

.edit-obj {
  position: absolute; cursor: grab; touch-action: none;
  outline: 1.5px solid color-mix(in oklch, var(--maroon) 55%, transparent);
  outline-offset: -1px;
}
.edit-obj:active { cursor: grabbing; }
.edit-obj img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; opacity: .96; }
.edit-obj .edit-hotspot {
  position: absolute; inset: 0;
  background: color-mix(in oklch, var(--gold) 22%, transparent);
  border: 1.5px dashed var(--gold-deep);
}
.edit-obj.sel { outline: 2px solid var(--maroon); z-index: 999; }
.edit-obj.sel img { opacity: 1; filter: drop-shadow(0 0 10px color-mix(in oklch, var(--maroon) 60%, transparent)); }

.edit-tag {
  position: absolute; top: -18px; left: -1px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--maroon); color: #fff; padding: 1px 6px; border-radius: 4px 4px 0 0;
  white-space: nowrap; pointer-events: none;
}
.edit-handle {
  position: absolute; right: -6px; bottom: -6px; width: 14px; height: 14px;
  background: var(--gold); border: 2px solid #fff; border-radius: 3px;
  cursor: nwse-resize; box-shadow: 0 1px 4px rgba(0,0,0,.4); touch-action: none;
}

.edit-panel {
  position: fixed; left: 24px; bottom: 24px; z-index: 1000;
  width: 300px; max-height: 60vh; overflow: auto;
  background: color-mix(in oklch, var(--card) 96%, #000 2%);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 50px -22px rgba(0,0,0,.55);
  font-family: var(--mono); color: var(--ink);
  padding: 14px 15px;
}
.ep-head strong { font-size: 13px; }
.ep-hint { display: block; font-size: 9.5px; color: var(--ink-faint); line-height: 1.5; margin-top: 4px; }
.ep-rows { margin: 10px 0; border-top: 1px solid var(--line); }
.ep-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 4px; border-radius: 5px; font-size: 11px; white-space: nowrap; }
.ep-row.on { background: color-mix(in oklch, var(--gold) 22%, transparent); }
.ep-id { color: var(--gold-deep); }
.ep-box { color: var(--ink-soft); font-size: 10.5px; }
.ep-actions { display: flex; gap: 8px; }
.ep-actions button {
  flex: 1; font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  padding: 7px 8px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  transition: all .2s var(--ease);
}
.ep-actions button:hover { border-color: var(--gold); background: color-mix(in oklch, var(--gold) 12%, var(--bg)); }
