:root {
  --navy: #023761; --navy-deep: #01223d; --red: #ff1100;
  --glass: rgb(2 34 61 / 0.62); --glass-strong: rgb(2 34 61 / 0.82);
  --line: rgb(255 255 255 / 0.14); --line-strong: rgb(255 255 255 / 0.3);
  --text: #f4f7fb; --muted: #b6c3d3;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif; --body: "Barlow", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; overflow: hidden; background: var(--navy); color: var(--text); font-family: var(--body); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#scene:active { cursor: grabbing; }
.fade { position: fixed; inset: 0; z-index: 4; background: var(--navy-deep); opacity: 0; pointer-events: none; transition: opacity 0.35s ease; }
.fade.is-on { opacity: 1; }

/* loader: the original Marazzo splash, refined */
.loader { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(70% 60% at 50% 45%, #0a4b80, var(--navy) 60%, var(--navy-deep)); transition: opacity 0.7s var(--ease), visibility 0.7s; }
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__inner { width: min(264px, 62vw); display: grid; gap: 18px; justify-items: center; }
.loader img { width: 100%; height: auto; }
.loader__bar { width: 100%; height: 3px; background: rgb(255 255 255 / 0.14); border-radius: 3px; overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 0; background: var(--red); box-shadow: 0 0 12px rgb(255 17 0 / 0.7); transition: width 0.25s linear; }
.loader__msg { font-family: var(--cond); font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* top bar */
.top { position: fixed; z-index: 10; top: 0; left: 0; right: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: max(16px, env(safe-area-inset-top)) 20px 28px; background: linear-gradient(rgb(1 34 61 / 0.55), rgb(1 34 61 / 0)); pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { width: 200px; height: auto; filter: drop-shadow(0 2px 8px rgb(0 0 0 / 0.4)); }
.mode { position: relative; display: flex; padding: 4px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.mode button { position: relative; z-index: 1; border: 0; background: none; padding: 9px 22px; border-radius: 999px; font-family: var(--cond); font-weight: 600; font-size: 1rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); transition: color 0.3s; }
.mode button[aria-selected="true"] { color: #fff; }
.mode__pill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--red); box-shadow: 0 4px 18px -4px rgb(255 17 0 / 0.8); transition: translate 0.4s var(--ease); }
.mode.is-int .mode__pill { translate: 100% 0; }
.tools { justify-self: end; display: flex; gap: 8px; }
.icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: background 0.2s, border-color 0.2s; }
.icon:hover { background: var(--glass-strong); border-color: var(--line-strong); }
.icon[aria-pressed="true"] { border-color: rgb(255 17 0 / 0.75); }
.icon[aria-pressed="true"] svg { color: #fff; }

/* camera views */
.views { position: fixed; z-index: 10; right: 20px; top: 50%; translate: 0 -50%; display: grid; gap: 6px; transition: opacity 0.4s; }
.views button { border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 10px; padding: 8px 14px; font-family: var(--cond); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.82rem; color: var(--muted); transition: color 0.2s, border-color 0.2s, background 0.2s; }
.views button:hover { color: #fff; border-color: var(--line-strong); }
.views button.is-active { color: #fff; border-color: rgb(255 17 0 / 0.75); }

/* hint */
.hint { position: fixed; z-index: 9; left: 50%; bottom: 190px; translate: -50% 0; display: flex; gap: 18px; font-size: 0.85rem; color: var(--text); opacity: 0.85; pointer-events: none; text-shadow: 0 1px 8px rgb(0 0 0 / 0.8); transition: opacity 1s; white-space: nowrap; }
.hint span + span::before { content: "·"; margin-right: 18px; color: var(--red); }
.hint.is-hidden { opacity: 0; }

/* colour panel */
.panel { position: fixed; z-index: 10; left: 50%; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 30px); translate: -50% 0; width: min(720px, calc(100vw - 24px)); padding: 16px 20px 18px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); box-shadow: 0 20px 50px -20px rgb(0 0 0 / 0.6); transition: opacity 0.4s var(--ease), translate 0.4s var(--ease); }
.panel__head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.panel__label { font-family: var(--cond); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); padding-right: 14px; border-right: 2px solid var(--red); }
.panel__name { font-family: var(--cond); font-weight: 700; font-size: 1.7rem; line-height: 1; letter-spacing: 0.08em; text-transform: uppercase; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.swatch { display: grid; justify-items: center; gap: 8px; border: 0; background: none; padding: 6px 2px; border-radius: 12px; transition: background 0.2s; }
.swatch:hover { background: rgb(255 255 255 / 0.06); }
.swatch__chip { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, rgb(255 255 255 / 0.75), rgb(255 255 255 / 0) 34%), radial-gradient(circle at 50% 120%, rgb(0 0 0 / 0.45), rgb(0 0 0 / 0) 60%), var(--c); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.25), 0 6px 14px -4px rgb(0 0 0 / 0.6); transition: box-shadow 0.25s, transform 0.25s var(--ease); }
.swatch:hover .swatch__chip { transform: scale(1.06); }
.swatch[aria-checked="true"] .swatch__chip { box-shadow: 0 0 0 2px var(--navy-deep), 0 0 0 4px var(--red), 0 6px 14px -4px rgb(0 0 0 / 0.6); }
.swatch__name { font-family: var(--cond); font-weight: 600; font-size: 0.74rem; line-height: 1.15; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); text-align: center; }
.swatch[aria-checked="true"] .swatch__name { color: #fff; }

/* interior mode */
body.is-int .panel { opacity: 0; translate: -50% 30px; pointer-events: none; }
body.is-int .views { opacity: 0; pointer-events: none; }
body.is-int #btnRotate { visibility: hidden; }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; z-index: 60; background: var(--navy); }

@media (max-width: 760px) {
  .top { grid-template-columns: 1fr auto; padding: max(12px, env(safe-area-inset-top)) 12px 22px; row-gap: 10px; }
  .brand { width: 140px; }
  .mode { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .mode button { padding: 8px 18px; font-size: 0.92rem; }
  .icon { width: 40px; height: 40px; }
  .views { top: auto; bottom: 200px; right: 50%; translate: 50% 0; display: flex; }
  .views button { padding: 7px 11px; font-size: 0.76rem; }
  .hint { bottom: 246px; font-size: 0.8rem; }
  .panel { padding: 12px 12px 14px; border-radius: 18px; }
  .panel__head { margin-bottom: 10px; }
  .panel__name { font-size: 1.35rem; }
  .swatches { gap: 2px; }
  .swatch__chip { width: 38px; height: 38px; }
  .swatch__name { font-size: 0.64rem; letter-spacing: 0.06em; }
}
.loader__msg { text-align: center; max-width: 80vw; line-height: 1.5; }
.loader__retry { border: 0; border-radius: 999px; padding: 10px 26px; background: var(--red); color: #fff; font-family: var(--cond); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.9rem; }

/* back link (both views) */
.backlink { position: fixed; z-index: 11; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); translate: -50% 0; display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px 4px 6px; border-radius: 999px; font-size: 0.82rem; font-weight: 500; color: var(--muted); text-decoration: none; text-shadow: 0 1px 6px rgb(0 0 0 / 0.8); white-space: nowrap; transition: color 0.2s, background 0.2s; }
.backlink svg { width: 16px; height: 16px; }
.backlink:hover { color: #fff; background: var(--glass); }
.hint { bottom: 220px; }
@media (max-width: 760px) { .views { bottom: 230px; } .hint { bottom: 276px; } }
