/* LETSGETMADE — The Atelier splash */
:root {
  --ink: #efe7da;
  --ink-dim: #c9bfae;
  --paper: #f4f0e8;
  --black: #0f0d0c;
  --brass: #c9a45c;
  --wax: #7e2a1f;
  --serif-d: 'Libre Caslon Display', Georgia, serif;
  --serif: 'Libre Caslon Text', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --bebas: 'Bebas Neue', 'Oswald', 'Arial Narrow', sans-serif;
  --tex: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='t'><feTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .32 0'/></filter><rect width='160' height='160' filter='url(%23t)'/></svg>");
  --gilt: linear-gradient(90deg, #6e5020, #e9cc85 45%, #b48a3e 60%, #6e5020);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--black); color: var(--ink); overflow: hidden; }
body { font-family: var(--serif); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }

/* ---------------- Intro ---------------- */
#intro {
  position: fixed; inset: 0; z-index: 50; background: #0a0908;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  transition: opacity 1.1s var(--ease-io), visibility 1.1s;
}
#intro.done { opacity: 0; visibility: hidden; }
.intro-mark { font-family: var(--bebas); font-size: clamp(34px, 6.4vw, 72px); letter-spacing: .32em; padding-left: .32em; line-height: 1; }
.intro-mark span span { opacity: 0; display: inline-block; transform: translateY(6px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.intro-mark.go span span { opacity: 1; transform: none; }
.intro-line { width: 0; height: 1px; background: var(--brass); transition: width 1.4s var(--ease-io) .5s; }
.intro-mark.go + .intro-line { width: min(240px, 50vw); }

/* ---------------- Viewport + stage ---------------- */
#viewport {
  position: fixed; inset: 0; overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; background: var(--black);
}
#viewport::-webkit-scrollbar { display: none; }
#stage-wrap { position: relative; }
#stage {
  position: absolute; left: 0; top: 0; width: 1600px; height: 900px; transform-origin: 0 0;
  filter: brightness(.18) saturate(.6); transition: filter 2.2s var(--ease-io);
}
body.lit #stage { filter: none; }

/* ---------------- Drawn room ---------------- */
#room { position: absolute; inset: 0; overflow: hidden; }
#room.photo { background-size: cover; background-position: center; }
.r-wall {
  position: absolute; left: 0; top: 0; width: 1600px; height: 772px;
  background:
    radial-gradient(ellipse 260px 380px at 440px -40px, rgba(255, 196, 132, .17), transparent 70%),
    radial-gradient(ellipse 260px 380px at 760px -40px, rgba(255, 196, 132, .17), transparent 70%),
    radial-gradient(ellipse 260px 380px at 1060px -40px, rgba(255, 196, 132, .15), transparent 70%),
    radial-gradient(ellipse 900px 520px at 730px 330px, rgba(255, 220, 180, .05), transparent 70%),
    linear-gradient(180deg, #2b2621 0%, #241f1b 55%, #1c1815 100%);
}
.r-wall::after {
  content: ''; position: absolute; inset: 0; opacity: .22; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 .9 0'/></filter><rect width='300' height='300' filter='url(%23n)'/></svg>");
}
.r-ceiling { position: absolute; left: 0; top: 0; width: 1600px; height: 22px; background: linear-gradient(#0d0b0a, #171411); }
.r-ceiling i { position: absolute; top: 8px; width: 34px; height: 6px; border-radius: 3px; background: #ffe2b8; box-shadow: 0 0 18px 6px rgba(255, 200, 140, .35); }
.r-base { position: absolute; left: 0; top: 760px; width: 1600px; height: 14px; background: #121010; }
.r-floor {
  position: absolute; left: 0; top: 774px; width: 1600px; height: 126px;
  background:
    linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.15) 40%, rgba(0,0,0,.4)),
    repeating-linear-gradient(90deg, #3a2618 0 118px, #2f1f14 118px 120px, #43301f 120px 236px, #2f1f14 236px 238px);
}
.r-rug { position: absolute; left: 330px; top: 790px; width: 840px; height: 110px; background: #2a2626; box-shadow: inset 0 0 0 6px #232020, inset 0 0 0 7px #4a4238; opacity: .95; }

/* shelving */
.r-shelf { position: absolute; left: 1180px; top: 30px; width: 392px; height: 742px; background: #0c0b0a; box-shadow: -18px 0 40px rgba(0,0,0,.45); }
.r-shelf .bay { position: absolute; left: 14px; width: 364px; background: linear-gradient(180deg, #120f0d, #1d1814); overflow: hidden; }
.r-shelf .bay::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: #ffd9a8; box-shadow: 0 0 22px 8px rgba(255, 190, 120, .45); }
.r-shelf .bay::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 70% 90% at 50% 0%, rgba(255, 190, 120, .22), transparent 70%); }
.r-shelf .board { position: absolute; left: 0; width: 392px; height: 14px; background: linear-gradient(#1a1714, #0a0908); }
.r-shelf .doors { position: absolute; left: 14px; top: 694px; width: 364px; height: 48px; background: #11100e; box-shadow: inset 182px 0 0 -181px #050505; }
.r-shelf .doors i { position: absolute; top: 18px; width: 30px; height: 3px; background: var(--brass); }

/* sofa */
.r-sofa { position: absolute; left: 400px; top: 628px; width: 690px; height: 152px; }
.r-sofa .back { position: absolute; left: 30px; right: 30px; top: 0; height: 80px; border-radius: 14px 14px 4px 4px; background: linear-gradient(180deg, #232120, #121110); box-shadow: inset 0 2px 0 rgba(255,255,255,.05); }
.r-sofa .seat { position: absolute; left: 22px; right: 22px; top: 70px; height: 58px; border-radius: 8px; background: linear-gradient(180deg, #2a2725, #141312); box-shadow: inset 0 3px 0 rgba(255,255,255,.06); }
.r-sofa .seat::after { content: ''; position: absolute; left: 33.3%; right: 33.3%; top: 0; bottom: 0; border-left: 1px solid #0b0a09; border-right: 1px solid #0b0a09; }
.r-sofa .arm { position: absolute; top: 34px; width: 40px; height: 98px; border-radius: 10px; background: linear-gradient(180deg, #252321, #111010); }
.r-sofa .arm.l { left: 0; } .r-sofa .arm.r { right: 0; }
.r-sofa .leg { position: absolute; bottom: 4px; width: 8px; height: 22px; background: #0a0909; }
.r-sofa .pillow { position: absolute; top: 36px; width: 120px; height: 52px; border-radius: 10px; }

/* lamp + tree */
.r-lamp { position: absolute; left: 250px; top: 300px; width: 90px; height: 474px; }
.r-lamp .glow { position: absolute; left: -150px; top: -120px; width: 390px; height: 390px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 196, 120, .38), rgba(255, 180, 110, .08) 45%, transparent 70%); }
.r-lamp .shade { position: absolute; left: 10px; top: 0; width: 70px; height: 62px; border-radius: 6px 6px 2px 2px; background: linear-gradient(90deg, #e9d6b4, #f8ead0 50%, #d9c19a); box-shadow: 0 0 30px rgba(255,200,140,.5); }
.r-lamp .pole { position: absolute; left: 44px; top: 62px; width: 3px; height: 404px; background: linear-gradient(90deg, #8a6a2e, #e2c27c, #8a6a2e); }
.r-lamp .base { position: absolute; left: 20px; bottom: 0; width: 50px; height: 8px; border-radius: 50%; background: #b8924c; }
.r-tree { position: absolute; left: 20px; top: 140px; width: 280px; height: 634px; }
.r-tree svg { width: 100%; height: 100%; overflow: visible; }

/* ---------------- Interactive items ---------------- */
#items { position: absolute; inset: 0; }
.item {
  position: absolute; padding: 0; border: 0; background: none; cursor: pointer;
  opacity: 0; transform: translateY(6px);
  transition: opacity 1s var(--ease), transform .45s var(--ease), box-shadow .45s var(--ease), filter .45s var(--ease);
}
body.lit .item { opacity: 1; transform: none; }
.item:focus-visible { outline: 2px solid var(--brass); outline-offset: 6px; }
.item.is-open { visibility: hidden; }

.frame {
  background: #0d0c0b; padding: 7px; box-shadow: 4px 9px 18px rgba(0,0,0,.55), 0 0 0 1px #1c1a18 inset;
}
.frame .pic { width: 100%; height: 100%; background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.frame.mat .pic { border: 9px solid #e8e1d3; outline: 1px solid #bfb5a2; outline-offset: -10px; }
.frame::after { content: ''; position: absolute; inset: 7px; background: linear-gradient(160deg, rgba(255,255,255,.07), transparent 40%); pointer-events: none; }
body.lit .frame:hover { transform: translateY(-4px) scale(1.02); box-shadow: 6px 18px 30px rgba(0,0,0,.6), 0 0 0 1px rgba(201,164,92,.5); }

.book {
  border-radius: 4px 4px 2px 2px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background-image:
    linear-gradient(90deg, rgba(0,0,0,.62) 0%, rgba(0,0,0,.18) 9%, rgba(255,255,255,.16) 24%, rgba(255,255,255,.06) 40%, rgba(0,0,0,.08) 62%, rgba(0,0,0,.42) 88%, rgba(0,0,0,.7) 100%),
    var(--tex);
  background-size: 100% 100%, 120px 120px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.12), inset 0 -2px 0 rgba(0,0,0,.4), 3px 0 5px rgba(0,0,0,.55), -1px 0 2px rgba(0,0,0,.4);
}
.book .spine {
  position: relative; z-index: 1; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; text-transform: uppercase;
  font-family: var(--serif-d); letter-spacing: .12em;
  text-shadow: 0 1px 0 rgba(0,0,0,.65), 0 -1px 0 rgba(255,255,255,.12);
}
.book.gilt .spine { background: linear-gradient(180deg, #7a5a24, #f0d48e 45%, #b48a3e 60%, #7a5a24); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 1px 0 rgba(0,0,0,.7)); }
.book::before, .book::after {
  content: ''; position: absolute; left: 0; right: 0; height: 7px;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(0,0,0,.35) 60%, rgba(255,255,255,.06));
  border-top: 1px solid rgba(0,0,0,.35);
}
.book::before { top: 9%; } .book::after { bottom: 9%; }
.book .band-rule { position: absolute; left: 12%; right: 12%; height: 1px; background: var(--gilt); opacity: .9; }
body.lit .book:hover { transform: translateY(-14px); }

.object { display: flex; align-items: flex-end; justify-content: center; }
.object svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 6px 8px rgba(0,0,0,.6)); }
body.lit .object:hover { transform: translateY(-5px); filter: brightness(1.15); }

.hotspot { background: transparent; border-radius: 10px; }
body.lit .hotspot:hover, .hotspot:focus-visible { box-shadow: 0 0 0 1px rgba(201,164,92,.7), 0 0 28px rgba(255,200,140,.35); }
#room.photo ~ #items .book:hover { transform: translateY(-6px); }
#room.photo ~ #items .book .spine { letter-spacing: .08em; }
.face.front.object-face.photo-crop { background-size: cover; background-position: center; padding: 0; }
.item.placed img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 4px 4px rgba(0,0,0,.55)); }
.face.front.object-face.photo-crop.studio::after { display: none; }
.face.front.object-face.photo-crop::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, transparent 45%, rgba(12,10,9,.85) 100%); }

.sound-btn { position: absolute; left: 14px; bottom: 14px; z-index: 3; min-height: 36px; padding: 0 14px; border: 1px solid rgba(239,231,218,.55); background: rgba(10,9,8,.6); color: var(--ink); font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; transition: opacity .4s, background .3s; }
.sound-btn.on { background: var(--ink); color: var(--black); }
.card.flipped .sound-btn { opacity: 0; pointer-events: none; }

/* ---------------- Chrome ---------------- */
.chrome { position: fixed; left: 0; right: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 18px max(20px, env(safe-area-inset-left)); pointer-events: none; opacity: 0; transition: opacity 1.4s var(--ease) .8s; }
body.lit .chrome { opacity: 1; }
.chrome-top { top: 0; justify-content: center; background: linear-gradient(rgba(10,9,8,.7), transparent); }
.chrome-bottom { bottom: 0; justify-content: space-between; padding-bottom: max(18px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(10,9,8,.75)); }
.wordmark { font-family: var(--bebas); font-size: 30px; letter-spacing: .34em; padding-left: .34em; line-height: 1; }
.tagline, .hint { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-dim); }
.hint { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.dibbs-btn { pointer-events: auto; cursor: pointer; border: 1px solid rgba(239,231,218,.6); background: rgba(15,13,12,.4); padding: 12px 18px; min-height: 44px; font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; transition: background .3s, color .3s; }
.dibbs-btn:hover { background: var(--ink); color: var(--black); }

#swipe-hint { white-space: nowrap; position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 6; display: none; font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink); background: rgba(10,9,8,.6); padding: 8px 14px; border: 1px solid rgba(239,231,218,.25); transition: opacity .6s; }
#swipe-hint span::before { content: '← '; } #swipe-hint span::after { content: ' →'; }
body.narrow.lit #swipe-hint { display: block; }
#swipe-hint.gone { opacity: 0; }

/* ---------------- Overlay / cards ---------------- */
#overlay { position: fixed; inset: 0; z-index: 20; }
#overlay[hidden] { display: none; }
.backdrop { position: absolute; inset: 0; background: rgba(6,5,4,.0); backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); transition: background .6s var(--ease), backdrop-filter .6s var(--ease), -webkit-backdrop-filter .6s var(--ease); }
#overlay.on .backdrop { background: rgba(6,5,4,.82); backdrop-filter: blur(6px) saturate(.7); -webkit-backdrop-filter: blur(6px) saturate(.7); }

.card { position: fixed; transform-origin: 0 0; perspective: 1800px; cursor: pointer; }
.card.anim { transition: transform .62s var(--ease-io); }
.card .inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .9s var(--ease-io); }
.card.flipped .inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; box-shadow: 0 40px 90px rgba(0,0,0,.7); }
.face.back { transform: rotateY(180deg); background: var(--paper); color: #1c1b19; padding: clamp(22px, 5%, 44px); display: flex; flex-direction: column; justify-content: center; gap: 12px; overflow-y: auto; }
.face.back { justify-content: space-between; }
.face.back::before { content: ''; position: absolute; inset: 10px; border: 1px solid rgba(28,27,25,.18); pointer-events: none; }
.face.back .back-body { display: flex; flex-direction: column; gap: 12px; margin: auto 0; }
.face.back .back-mark { font-family: var(--bebas); font-size: 15px; letter-spacing: .3em; text-transform: uppercase; color: #8a7f70; text-align: center; padding-top: 14px; }
.face.back .eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #5a5249; }
.face.back h2 { margin: 0; font-family: var(--serif-d); font-weight: 400; font-size: clamp(24px, 4.2vmin, 40px); line-height: 1.1; }
.face.back p { margin: 0; font-size: clamp(14px, 2.1vmin, 17px); line-height: 1.6; }
.face.back .rule { width: 48px; height: 1px; background: var(--brass); }

.face.front.frame-face { background: #0d0c0b; padding: 2.2%; }
.face.front.frame-face .pic { width: 100%; height: 100%; background-size: cover; background-position: center; }
.face.front.frame-face.mat .pic { border: clamp(10px, 4%, 26px) solid #e8e1d3; }
.face.front.frame-face video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }

.face.front.book-face {
  display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 14% 12% 12% 16%; text-align: center; border-radius: 3px 6px 6px 3px;
  background-image:
    linear-gradient(90deg, rgba(0,0,0,.55) 0%, rgba(255,255,255,.10) 3%, rgba(0,0,0,.35) 6.5%, rgba(255,255,255,.06) 8%, transparent 14%, rgba(255,255,255,.05) 55%, rgba(0,0,0,.25) 100%),
    radial-gradient(ellipse at 40% 25%, rgba(255,255,255,.10), transparent 60%),
    var(--tex);
  background-size: 100% 100%, 100% 100%, 140px 140px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.4), 0 40px 90px rgba(0,0,0,.7);
}
.face.front.book-face::before { content: ''; position: absolute; left: 14%; right: 7%; top: 5.5%; bottom: 5.5%; border: 1px solid; border-color: inherit; opacity: .55; pointer-events: none; }
.face.front.book-face::after { content: ''; position: absolute; left: calc(14% + 6px); right: calc(7% + 6px); top: calc(5.5% + 6px); bottom: calc(5.5% + 6px); border: 1px solid; border-color: inherit; opacity: .3; pointer-events: none; }
.book-face .b-top { font-family: var(--bebas); font-size: clamp(14px, 2.6vmin, 20px); letter-spacing: .3em; opacity: .85; }
.book-face .b-title { font-family: var(--serif-d); font-size: clamp(26px, 6vmin, 52px); line-height: 1.05; text-shadow: 0 1px 0 rgba(0,0,0,.55), 0 -1px 0 rgba(255,255,255,.1); }
.book-face.gilt .b-title, .book-face.gilt .b-top, .book-face.gilt .b-author { background: linear-gradient(180deg, #7a5a24, #f0d48e 45%, #b48a3e 62%, #7a5a24); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 1px 0 rgba(0,0,0,.6)); }
.book-face .b-rule { width: 30%; height: 1px; background: currentColor; opacity: .6; }
.book-face .b-author { font-family: var(--serif); font-style: italic; font-size: clamp(13px, 2.4vmin, 18px); }

.face.front.object-face { background: radial-gradient(circle at 50% 40%, #2b2621, #0f0d0c 75%); display: flex; align-items: center; justify-content: center; padding: 14%; }
.face.front.object-face svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 20px 30px rgba(0,0,0,.7)); }

.form-card { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%); opacity: 0; width: min(92vw, 520px); background: var(--paper); color: #1c1b19; padding: 40px 34px 34px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 40px 90px rgba(0,0,0,.7); transition: opacity .5s var(--ease), transform .6s var(--ease); }
#overlay.on .form-card { opacity: 1; transform: translate(-50%, -50%); }
.form-card h2 { margin: 0; font-family: var(--serif-d); font-weight: 400; font-size: 40px; }
.form-card p { margin: 0; line-height: 1.6; }
.form-card label { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.form-card input { min-height: 48px; padding: 0 14px; border: 1px solid #1c1b19; background: #fbf9f4; font: inherit; font-size: 16px; color: #1c1b19; }
.form-card button[type=submit] { min-height: 48px; border: 0; background: #1c1b19; color: var(--paper); font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }

.close-btn { position: fixed; z-index: 22; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(239,231,218,.5); background: rgba(15,13,12,.75); cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .4s var(--ease) .25s, background .3s; }
#overlay.on .close-btn { opacity: 1; }
.close-btn:hover { background: var(--ink); }
.close-btn:hover svg path { stroke: var(--black); }
.close-btn svg { width: 16px; height: 16px; }
.close-btn svg path, .nav svg path { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.form-card .close-btn { position: absolute; right: 10px; top: 10px; border-color: rgba(28,27,25,.4); background: transparent; }
.form-card .close-btn svg path { stroke: #1c1b19; }

.nav { position: fixed; top: 50%; z-index: 21; width: 48px; height: 48px; margin-top: -24px; border: 0; background: none; cursor: pointer; opacity: 0; transition: opacity .4s var(--ease) .3s; }
.nav svg { width: 26px; height: 26px; }
.nav.prev { left: max(8px, 2vw); } .nav.next { right: max(8px, 2vw); }
#overlay.on .nav { opacity: .75; }
#overlay.on .nav:hover { opacity: 1; }
#overlay.form .nav, #overlay.form .card-hint { display: none; }
.card-hint { position: fixed; left: 0; right: 0; bottom: max(22px, env(safe-area-inset-bottom)); margin: 0; text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-dim); opacity: 0; transition: opacity .4s var(--ease) .35s; z-index: 21; }
#overlay.on .card-hint { opacity: 1; }

@media (max-width: 700px) {
  .tagline { display: none; }
  .hint { position: static; transform: none; font-size: 10px; letter-spacing: .12em; }
  .wordmark { font-size: 24px; }
  .nav { top: auto; bottom: 64px; margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
