/* What the front page (home.css) and the app (app.css) share, loaded before them. */

/* ── Basics ── */
* { box-sizing: border-box; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

/* The logo: the word measured like a drawing. The width runs under it and on past it, the height rises from its end to the
   top of the f, with a 45° mark in the word's own colour at the start, the bend and the end (no. 17 in web/labs/heroes/logo-lab.html) */
.wordmark { display: inline-flex; align-items: center; font-size: 1.75rem; text-decoration: none; color: var(--cream); }
.logo { --t: max(1.5px, 0.055em); position: relative; display: inline-block; padding: 0 0.42em 0.3em 0; white-space: nowrap; font: 700 1em/1 var(--display); letter-spacing: -0.045em; }
.logo em { font: italic 600 1.06em/1 var(--accent); font-variation-settings: var(--accent-axes); letter-spacing: -0.01em; color: var(--brass); }
.logo::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0.08em; height: var(--t); background: var(--brass); }
.logo::after { content: ''; position: absolute; right: 0; top: 0.142em; bottom: 0.08em; width: var(--t); background: var(--brass); }
.logo i { position: absolute; bottom: calc(0.08em + var(--t) / 2); width: 0.3em; height: max(2px, 0.085em); background: currentColor; transform: translate(-50%, 50%) rotate(-45deg); }
.logo .s { left: 0; }
.logo .b, .logo .e { left: calc(100% - var(--t) / 2); }
.logo .e { bottom: auto; top: 0.142em; transform: translate(-50%, -50%) rotate(-45deg); }

/* ── The language menu (shared.js): a pill with a globe, the language's code and a chevron, in the bar's own colour; it
   opens a small paper card of the languages, each in its own words, the current one ticked. Before the script runs (or
   without it) the plain select shows, with a chevron of its own. ── */
.lang { position: relative; display: inline-flex; align-items: center; flex: none; }
.lang select { appearance: none; margin: 0; padding: 6px 22px 6px 10px; border: 0; border-radius: 999px; background: transparent; color: inherit;
  font: 500 0.75rem/1 var(--mono); letter-spacing: 0.1em; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(244, 239, 226, 0.22); }
.lang option { color: #10241e; }
.lang:not(.lang-on)::after { content: ''; position: absolute; right: 10px; top: 50%; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-70%) rotate(45deg); opacity: 0.7; pointer-events: none; }
.lang-btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 10px; border: 0; border-radius: 999px; cursor: pointer; color: inherit;
  background: rgba(244, 239, 226, 0.04); box-shadow: inset 0 0 0 1px rgba(244, 239, 226, 0.2); transition: background 0.15s, box-shadow 0.15s, color 0.15s; }
.lang-btn:hover, .lang-btn[aria-expanded='true'] { background: rgba(244, 239, 226, 0.09); box-shadow: inset 0 0 0 1px rgba(224, 180, 90, 0.75); color: #f4efe2; }
.lang-btn .globe { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.2; opacity: 0.75; transition: transform 0.4s ease; }
.lang-btn:hover .globe { transform: rotate(-20deg); }
.lang-btn b { font: 500 0.75rem/1 var(--mono); letter-spacing: 0.12em; }
.lang-btn i { width: 5px; height: 5px; margin: -3px 0 0 1px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); opacity: 0.7; transition: transform 0.2s, margin 0.2s; }
.lang-btn[aria-expanded='true'] i { margin-top: 3px; transform: rotate(-135deg); }
.lang-pop { position: absolute; z-index: 60; top: calc(100% + 12px); right: 0; min-width: 196px; padding: 6px; border-radius: 10px; background: #f7f4ee; color: #10241e; text-align: left;
  box-shadow: 0 0 0 1px rgba(16, 36, 30, 0.08), 0 2px 6px rgba(0, 0, 0, 0.18), 0 22px 44px -14px rgba(0, 0, 0, 0.6); transform-origin: top right; animation: lang-in 0.18s cubic-bezier(.2, .8, .2, 1); }
.lang-pop[hidden] { display: none; }
.lang-pop::before { content: ''; position: absolute; top: -5px; right: 22px; width: 10px; height: 10px; background: inherit; border-radius: 2px 0 0 0; transform: rotate(45deg); }
.lang-pop[data-left] { right: auto; left: 0; transform-origin: top left; }
.lang-pop[data-left]::before { right: auto; left: 22px; }
.lang-pop[data-up] { top: auto; bottom: calc(100% + 12px); transform-origin: bottom right; }
.lang-pop[data-up][data-left] { transform-origin: bottom left; }
.lang-pop[data-up]::before { top: auto; bottom: -5px; border-radius: 0 0 2px 0; }
.lang-kicker { margin: 6px 10px 8px; font: 500 0.625rem/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: rgba(16, 36, 30, 0.5); }
.lang-pop button { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto 14px; align-items: center; gap: 12px; width: 100%; padding: 10px 10px 10px 12px; border: 0; border-radius: 6px;
  background: none; color: inherit; font: 500 0.9375rem/1.2 var(--body); text-align: left; cursor: pointer; transition: background 0.12s; }
.lang-pop button:hover, .lang-pop button:focus-visible { background: rgba(16, 36, 30, 0.06); outline: none; }
.lang-pop button[aria-selected='true'] { background: rgba(224, 180, 90, 0.2); }
.lang-pop button small { font: 500 0.6875rem/1 var(--mono); letter-spacing: 0.12em; color: rgba(16, 36, 30, 0.45); }
.lang-pop .tick { width: 14px; height: 14px; fill: none; stroke: #9c6c1e; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.lang-pop button[aria-selected='true'] .tick { visibility: visible; }
@keyframes lang-in { from { opacity: 0; transform: translateY(-4px) scale(0.97); } }
.lang-pop[data-up] { animation-name: lang-up; }
@keyframes lang-up { from { opacity: 0; transform: translateY(4px) scale(0.97); } }
@media (prefers-reduced-motion: reduce) { .lang-pop { animation: none; } .lang-btn .globe { transition: none; } }

/* ── Buttons: the arrow steps on hover ── */
.btn:hover .arr { transform: translateX(4px); }

/* ── The title block's cells ── */
.tb:nth-child(1), .tb:nth-child(4) { border-left: 0; }
.tb:nth-child(n + 4) { border-top: 1px solid rgba(16, 36, 30, 0.3); }
.tb small { font: 500 0.625rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: #6b766f; }
.tb-wide { grid-column: span 2; }

/* shared.js swaps pictures with a short cross-fade */
img.fade { opacity: 0; }

/* ── Drop zones ── */
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 2px solid var(--brass); outline-offset: 6px; }
.drop .hint u { text-decoration-color: var(--brass); text-underline-offset: 3px; }
.drop:hover, .drop.over { background: rgba(224, 180, 90, 0.06); border-color: rgba(224, 180, 90, 0.8); }
.drop:hover svg, .drop.over svg { transform: translateY(-4px); }

/* ── The viewer (viewerBox in shared.js): the front page's screen and the listing embed (embed.html). The chosen room
   large; beside it a style menu when there is more than one, the dollhouse with numbered rooms, every room listed ── */
.vbox { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.v-map { display: grid; align-items: center; background: #f6f3ee; }
.v-map-in { position: relative; }
.v-map-in > img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.vbox .vpt { position: absolute; width: 32px; height: 32px; margin: -16px 0 0 -16px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  color: var(--cream); font: 600 0.8125rem/1 var(--body); background: var(--mat-deep); box-shadow: 0 0 0 2px var(--cream), 0 6px 14px -2px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s cubic-bezier(.2, 1.4, .4, 1), background 0.2s, color 0.2s, box-shadow 0.2s; }
.vbox .vpt:hover, .vbox .vpt[aria-pressed='true'] { transform: scale(1.15); color: var(--ink); background: var(--brass); box-shadow: 0 0 0 2px var(--ink), 0 0 0 6px rgba(224, 180, 90, 0.3), 0 8px 18px -4px rgba(0, 0, 0, 0.5); }
.v-shot { position: relative; margin: 0; cursor: zoom-in; }
.v-shot img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; transition: opacity 0.35s; }
.v-shot figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 12px; }
.v-shot b { font: italic var(--accent-weight) 1.375rem/1 var(--accent); font-variation-settings: var(--accent-axes); color: var(--brass); }
.v-shot figcaption > span { font: 500 0.75rem/1 var(--mono); color: rgba(244, 239, 226, 0.5); }
.v-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid rgba(244, 239, 226, 0.12); }
.v-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 4px; border: 0; border-radius: 4px; background: none; cursor: pointer; text-align: left; font-size: 0.875rem; color: rgba(244, 239, 226, 0.7); }
.v-list button i { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 600 0.6875rem/1 var(--body); font-style: normal; box-shadow: inset 0 0 0 1px rgba(244, 239, 226, 0.4); }
.v-list button:hover { color: var(--cream); background: rgba(244, 239, 226, 0.05); }
.v-list button[aria-pressed='true'] { color: var(--cream); }
.v-list button[aria-pressed='true'] i { background: var(--brass); color: var(--ink); box-shadow: none; }
.v-shot b .v-home { color: rgba(244, 239, 226, 0.75); }
.v-pick { position: relative; }
.v-pick-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 16px; border: 0; border-radius: 6px; cursor: pointer; text-align: left;
  background: rgba(244, 239, 226, 0.06); box-shadow: inset 0 0 0 1px rgba(244, 239, 226, 0.18); color: var(--cream); transition: box-shadow 0.2s, background 0.2s; }
.v-pick-btn:hover, .v-pick-btn[aria-expanded='true'] { background: rgba(244, 239, 226, 0.09); box-shadow: inset 0 0 0 1px var(--brass); }
.v-pick-btn small { font: 500 0.625rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(244, 239, 226, 0.55); }
.v-pick-btn b { flex: 1; font: italic var(--accent-weight) 1.25rem/1.1 var(--accent); font-variation-settings: var(--accent-axes); color: var(--brass); }
.v-pick-btn i { width: 9px; height: 9px; margin-top: -4px; border-right: 1.5px solid var(--brass); border-bottom: 1.5px solid var(--brass); transform: rotate(45deg); transition: transform 0.2s, margin 0.2s; }
.v-pick-btn[aria-expanded='true'] i { margin-top: 4px; transform: rotate(-135deg); }
.v-pick-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); display: grid; gap: 2px; max-height: 300px; overflow-y: auto; padding: 6px; border-radius: 8px;
  background: #102620; box-shadow: inset 0 0 0 1px rgba(244, 239, 226, 0.14), 0 18px 40px -12px rgba(0, 0, 0, 0.7); }
.v-pick-list[hidden] { display: none; }
.v-pick-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px; border: 0; border-radius: 5px; cursor: pointer; text-align: left; background: none; color: rgba(244, 239, 226, 0.8); font: 500 0.9375rem/1.2 var(--body); }
.v-pick-list button:hover, .v-pick-list button:focus-visible { background: rgba(244, 239, 226, 0.07); color: var(--cream); outline: none; }
.v-pick-list button[aria-selected='true'] { color: var(--brass); }
.v-pick-list button[aria-selected='true']::after { content: '✓'; margin-left: auto; padding-right: 6px; }
.v-pick-list img { width: 56px; height: 38px; flex: none; object-fit: cover; border-radius: 3px; }
.v-lead { padding: clamp(14px, 2vw, 24px); }
.v-side { display: flex; flex-direction: column; gap: 14px; padding: clamp(14px, 2vw, 24px); padding-left: 0; }
.v-side .v-map { overflow: hidden; border-radius: 4px; }
.v-side .v-list { padding-top: 10px; }
/* what closes the side (the embed's logo) sits in the box's bottom-right corner */
.v-side > :last-child:not(.v-list) { margin-top: auto; align-self: flex-end; }
@media (max-width: 960px) { .vbox { grid-template-columns: minmax(0, 1fr); } .v-side { padding-left: clamp(14px, 2vw, 24px); padding-top: 0; } }
@media (max-width: 760px) { .v-list { grid-template-columns: minmax(0, 1fr); } }

/* The room, full screen (RV in shared.js): the render fills the page edge to edge, the logo above it, the room's name set large over its foot
   under a small line naming the home and finish, and the controls in the bottom corner */
.room-view { position: fixed; inset: 0; z-index: 50; overflow: hidden; background: #08140f; color: var(--cream);
  opacity: 0; visibility: hidden; transition: opacity 0.45s ease, visibility 0s 0.45s; }
.room-view.open { opacity: 1; visibility: visible; transition: opacity 0.45s ease, visibility 0s; }
/* sized by script: the picture fills the screen when that takes no more than 1.3× its whole size, otherwise it's cropped 1.3× and bars take the rest */
.rv-img { position: absolute; left: 50%; top: var(--cy, 50%); width: var(--bw, 100%); height: var(--bh, 100%); max-width: none; transform: translate(-50%, -50%); object-fit: cover; opacity: 0; transition: opacity 0.8s ease; }
.rv-img.on { opacity: 1; }
/* one picture alone (a floor plan): no arrows, no count */
.room-view.single :is([data-rv-prev], [data-rv-next], .rv-count), .room-view.single .rv-done::before { display: none; }
.room-view.single .rv-done { margin-left: 0; }
/* shade at the top for the logo and a deeper one at the foot for the type */
.room-view::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(rgba(8, 20, 16, 0.55), transparent 22%), linear-gradient(transparent 46%, rgba(8, 20, 16, 0.3) 64%, rgba(8, 20, 16, 0.9)); }
.rv-top, .rv-foot { position: absolute; z-index: 2; left: 0; right: 0; padding-left: clamp(16px, 4vw, 56px); padding-right: clamp(16px, 4vw, 56px); }
.rv-top { top: 0; display: flex; align-items: center; justify-content: space-between; padding-top: clamp(16px, 3vh, 26px); }
/* the logo comes in once the room has, so it doesn't cross the page's own logo below */
.rv-top .wordmark { font-size: 1.375rem; opacity: 0; transition: opacity 0.25s ease; }
.room-view.open .rv-top .wordmark { opacity: 1; transition: opacity 0.9s ease 0.75s; }
.rv-foot { bottom: 0; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 48px; padding-bottom: clamp(20px, 4.5vh, 48px); }
.rv-cap { min-width: 0; flex: 1 1 520px; }
.rv-kicker { margin: 0 0 clamp(10px, 2vh, 18px); font: 500 0.75rem/1.3 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass); }
.rv-name { margin: 0; font: italic var(--accent-weight) clamp(3rem, 8.6vw, 8.25rem)/0.9 var(--accent); font-variation-settings: var(--accent-axes); letter-spacing: -0.025em; text-wrap: balance;
  text-shadow: 0 6px 50px rgba(0, 0, 0, 0.35); }
.rv-nav { display: flex; align-items: center; gap: 10px; }
.rv-count { display: flex; align-items: baseline; gap: 8px; margin: 0 12px 0 0; font-variant-numeric: tabular-nums; }
.rv-count b { font: 600 clamp(2rem, 3.4vw, 3.1rem)/1 var(--display); letter-spacing: -0.05em; }
.rv-count span { font: 500 0.8125rem/1 var(--mono); letter-spacing: 0.08em; opacity: 0.6; }
/* each room's words rise in, a beat apart */
.rv-cap.swap > *, .rv-count.swap b { animation: rv-in 0.75s cubic-bezier(.2, .8, .2, 1) both; }
.rv-cap.swap .rv-name { animation-delay: 0.06s; }
@keyframes rv-in { from { opacity: 0; transform: translateY(16px); } }
.rv-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(16, 36, 30, 0.45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(244, 239, 226, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08); transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
  color: var(--cream); font-size: 1.375rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.rv-btn:hover { background: var(--brass); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 246, 220, 0.6), 0 8px 20px -8px rgba(224, 180, 90, 0.6); transform: scale(1.06); }
.rv-close { width: 46px; height: 46px; }
/* a second close at the foot, within reach of a thumb, set apart from the arrows */
.rv-done { position: relative; width: auto; margin-left: 17px; padding: 0 20px 0 22px; border-radius: 999px; gap: 10px; grid-auto-flow: column; font: 500 0.75rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }
.rv-done span { font: 400 1.25rem/1 var(--body); letter-spacing: 0; }
.rv-done::before { content: ''; position: absolute; left: -15px; top: 12px; bottom: 12px; width: 1px; background: rgba(244, 239, 226, 0.3); }
