@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500&family=DM+Sans:wght@400;500&display=swap');

:root {
  --ink: #302421;
  --muted: #68554b;
  --ivory: #f6f0e5;
  --accent: #6e3546;
  --line: rgba(48,36,33,.22);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', Arial, sans-serif;
  --pad: clamp(22px, 3.4cqw, 60px);
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { background: #ded3be; color: var(--ink); font: 400 12px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { border: 0; background: none; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 5px; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
[hidden] { display: none !important; }

#experience { position: fixed; inset: 0; container-type: size; overflow: hidden; }
#experience[data-phone-check] { width: 390px; height: 844px; left: calc(50% - 195px); top: 20px; right: auto; bottom: auto; transform: scale(.8); transform-origin: 50% 0; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: 0; }
#world:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
#experience:before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg,rgba(246,240,229,.30),transparent 17%); }

header { position: absolute; inset: 0 0 auto; z-index: 5; display: flex; align-items: center; gap: 24px; padding: max(23px,env(safe-area-inset-top)) var(--pad); pointer-events: none; }
header > * { pointer-events: auto; }
.brand { font: 400 30px/1 var(--serif); letter-spacing: .15em; }
.brand span { display: block; margin-top: 7px; color: var(--muted); font: 400 7px/1.4 var(--sans); letter-spacing: .12em; }
.brand img { max-width: 130px; max-height: 52px; object-fit: contain; }
.sound { margin-left: auto; padding: 12px 0; min-height: 44px; font-size: 10px; }
.sound:before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 7px; border: 1px solid currentColor; border-radius: 50%; vertical-align: 1px; }
.sound[aria-pressed='true']:before { background: currentColor; }
#menu-toggle { min-height: 44px; padding: 10px 0 10px 7px; display: flex; align-items: center; gap: 10px; font-size: 11px; }
#menu-toggle span { font-size: 19px; line-height: 1; transition: transform .25s; }
#menu-toggle[aria-expanded='true'] span { transform: rotate(45deg); }
.header-note { display: none; }

.editorial { position: absolute; z-index: 2; left: var(--pad); bottom: 95px; max-width: 285px; width: 29cqw; pointer-events: none; }
.eyebrow { display: block; margin-bottom: 12px; font-size: 8px; color: var(--muted); letter-spacing: .13em; }
h1 { font: 400 clamp(36px,3.5cqw,46px)/.98 var(--serif); letter-spacing: -.025em; margin: 0 0 15px; text-wrap: balance; }
#subtitle { display: none; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.8; max-width: 230px; }
body:not([data-scene='0']) .editorial { bottom: 95px; max-width: 270px; }
body:not([data-scene='0']) h1 { font-size: clamp(32px,3.2cqw,44px); }
body:not([data-scene='0']) #subtitle { display: none; }

#spaces { position: absolute; z-index: 8; right: var(--pad); top: 88px; width: 238px; display: flex; flex-direction: column; padding: 16px; background: rgba(246,240,229,.97); border: 1px solid rgba(48,36,33,.10); box-shadow: 0 14px 40px rgba(48,36,33,.12); color: var(--ink); }
#spaces button { position: relative; text-align: left; padding: 12px 10px; font: 400 24px/1.25 var(--serif); color: var(--muted); }
#spaces button:hover, #spaces button.active { color: var(--accent); background: rgba(110,53,70,.05); }
#spaces button.active:after { content: ''; position: absolute; right: 10px; top: 50%; width: 4px; height: 4px; background: var(--accent); border-radius: 50%; }

#interaction { position: absolute; z-index: 4; right: var(--pad); bottom: max(33px,env(safe-area-inset-bottom)); width: 210px; display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 12px; }
#hint { margin: 0; font-size: 10px; line-height: 1.7; max-width: 205px; color: var(--muted); }
.interaction-title, #interaction-title { display: none; }
.swatches { display: flex; gap: 18px; margin: 5px; }
.swatches button { position: relative; width: 22px; height: 22px; background: var(--swatch,#b67166); border-radius: 50%; outline: 1px solid rgba(48,36,33,.35); outline-offset: 3px; }
.swatches button:before { content: ''; position: absolute; inset: -10px; border-radius: 50%; }
.swatches button.active { outline: 2px solid var(--accent); outline-offset: 5px; }
.swatches button:focus-visible { outline: 2px solid var(--accent); outline-offset: 7px; }
#light, #alignment { appearance: none; -webkit-appearance: none; width: 170px; height: 2px; background: var(--line); margin: 17px 0; cursor: pointer; accent-color: var(--accent); }
#light::-webkit-slider-thumb, #alignment::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 9px rgba(110,53,70,.07); }
#light::-moz-range-thumb, #alignment::-moz-range-thumb { border: 0; width: 15px; height: 15px; background: var(--accent); border-radius: 50%; }
#interaction label { width: 100%; font-size: 10px; color: var(--muted); }
#gallery-open, #secret-enter { padding: 10px 0; min-height: 44px; font-size: 10px; color: var(--accent); border-bottom: 1px solid var(--accent); }

footer { position: absolute; z-index: 4; bottom: max(30px,env(safe-area-inset-bottom)); left: var(--pad); max-width: calc(100% - 280px); font-size: 10px; color: var(--ink); }
footer a { display: inline-block; padding: 9px 0; }
footer .location { display: block; }
footer .discovery, footer .counter, .counter, .controls, .chapter-strip, #credits-open { display: none !important; }
#progress { position: absolute; z-index: 6; bottom: 0; inset-inline: 0; height: 2px; background: rgba(48,36,33,.06); pointer-events: none; }
#progress .fill { height: 100%; width: 0; background: rgba(110,53,70,.60); }

#loading { position: absolute; inset: 0; z-index: 100; background: #eee7dc; color: var(--ink); display: flex; align-items: center; justify-content: center; flex-direction: column; transition: opacity .7s,visibility .7s; }
#loading.hidden, #loading.loaded { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-word { font: 400 clamp(36px,5cqw,60px)/1 var(--serif); letter-spacing: .18em; padding-left: .18em; }
.loading-line { margin-top: 24px; font-size: 10px; color: var(--muted); }
#loading p { font-size: 10px; color: var(--muted); }
#gallery { padding: 0; border: 0; width: min(760px,90vw); max-height: 88dvh; color: var(--ink); background: #eee7dc; box-shadow: 0 30px 100px #0005; }
#gallery::backdrop { background: rgba(25,18,19,.75); }
.dialog-inner { position: relative; padding: 42px; }
.dialog-inner .close { position: absolute; top: 8px; right: 10px; font-size: 27px; width: 44px; height: 44px; }
.dialog-inner h2 { font: 400 39px/1.05 var(--serif); margin: 20px 0 12px; }
.dialog-inner p { font-size: 12px; line-height: 1.7; }
.dialog-inner > a { display: inline-block; padding: 10px 0; font-size: 11px; text-decoration: underline; text-underline-offset: 5px; }
#gallery-images { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin: 24px 0; }
#gallery-images img { display: block; width: 100%; max-height: 60dvh; object-fit: contain; }
#fallback, .static-fallback { position: absolute; z-index: 110; inset: 0; background: #eee7dc; color: var(--ink); padding: var(--pad); display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
#fallback h2, .static-fallback h2 { font: 400 48px/1 var(--serif); max-width: 550px; }
#fallback p, .static-fallback p { max-width: 440px; color: var(--muted); line-height: 1.9; }
#fallback a, .static-fallback a { padding: 14px 24px; border: 1px solid var(--line); margin-top: 18px; }
body.in-studio { --ink: #f6f0e5; --muted: #ddd0bf; --accent: #e4bdc7; --line: rgba(246,240,229,.4); }
body.in-studio #spaces, body.in-studio #gallery { color: #302421; --ink: #302421; --muted: #68554b; --accent: #6e3546; }

@container (max-width: 700px) {
  #experience > * { --pad: 22px; }
  header { padding: max(18px,env(safe-area-inset-top)) var(--pad); gap: 18px; }
  .brand { font-size: 26px; }
  .brand span { font-size: 6px; letter-spacing: .1em; }
  .sound { font-size: 9px; }
  #menu-toggle { font-size: 10px; gap: 7px; }
  .editorial { width: 68%; max-width: 255px; bottom: 112px; }
  h1 { font-size: clamp(34px,9cqw,39px); }
  #subtitle { display: none; }
  .eyebrow { font-size: 7px; margin-bottom: 10px; }
  body:not([data-scene='0']) .editorial { bottom: 142px; max-width: 230px; }
  body:not([data-scene='0']) h1 { font-size: 35px; }
  #spaces { top: 80px; width: 210px; }
  #interaction { width: 155px; bottom: max(28px,env(safe-area-inset-bottom)); gap: 8px; }
  #hint { font-size: 9px; max-width: 155px; }
  #light, #alignment { width: 145px; }
  footer { bottom: max(25px,env(safe-area-inset-bottom)); font-size: 9px; max-width: calc(100% - 205px); }
  footer .location { font-size: 0; }
  footer .location a { font-size: 9px; }
  #gallery-open, #secret-enter { font-size: 9px; }
  .dialog-inner { padding: 32px 22px; }
  .dialog-inner h2 { font-size: 32px; }
  #gallery-images { grid-template-columns: 1fr; }
}
@container (max-width: 370px) {
  #experience > * { --pad: 18px; }
  header { gap: 13px; }
  .brand { font-size: 24px; }
  .brand span { font-size: 5px; }
  .sound { font-size: 8px; }
  #menu-toggle { font-size: 9px; }
  #interaction { width: 135px; }
  #light, #alignment { width: 130px; }
  footer { max-width: 135px; font-size: 8px; }
}
@container (max-height: 620px) and (min-width: 701px) {
  header { padding-block: 15px; }
  .editorial, body:not([data-scene='0']) .editorial { bottom: 94px; }
  h1 { font-size: 42px; }
  body:not([data-scene='0']) h1 { font-size: 36px; }
  #spaces { top: 70px; }
  #interaction { bottom: 24px; }
  footer { bottom: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* The opening atelier is darker at floor level; keep its lettering off the wall details. */
body[data-scene='0'] .editorial, body[data-scene='0'] footer, body[data-scene='2'] .editorial, body[data-scene='2'] footer, body[data-scene='2'] #interaction { color: #f6f0e5; text-shadow: 0 1px 10px rgba(17,12,12,.35); }
body[data-scene='0'] .editorial .eyebrow, body[data-scene='2'] .editorial .eyebrow, body[data-scene='2'] #hint { color: #ece1d1; }
#experience:after { content: ''; position: absolute; z-index: 1; left: 0; bottom: 0; width: min(580px,56cqw); height: 280px; pointer-events: none; background: radial-gradient(ellipse at 0% 100%,rgba(20,14,14,.55),transparent 76%); opacity: 0; }
body[data-scene='0'] #experience:after { opacity: 1; }
@container (max-width: 700px) {
  #experience:after { width: 90cqw; height: 300px; }
}

header { color: #302421; }
.brand span { color: #68554b; }
body[data-scene='2'] #light { background: rgba(246,240,229,.4); accent-color: #f6f0e5; }
body[data-scene='2'] #light::-webkit-slider-thumb { background: #f6f0e5; box-shadow: 0 0 0 9px rgba(246,240,229,.08); }
body[data-scene='2'] #light::-moz-range-thumb { background: #f6f0e5; }

/* the fan-made note stays visible on every screen (2 Oct 2026) */
footer .fan { display: block; margin-top: 2px; opacity: .78; font-size: 10px; }
@media (max-width: 760px) { footer .fan { font-size: 9px; } }
