/* The Immense Vault: his brand (light grey paper, bold black Helvetica-style type, handwritten notes) by day,
   his shop after closing by night. One CTA colour (black by day, white by night), hairlines, no badges. */
@font-face { font-family: Heros; src: url('../fonts/heros-bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: Heros; src: url('../fonts/heros-regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Hand; src: url('../fonts/hand.woff2') format('woff2'); font-display: swap; }

:root {
  --ink: #f3efe8;
  --ink-2: rgba(243, 239, 232, 0.62);
  --line: rgba(243, 239, 232, 0.16);
  --sheet: rgba(18, 18, 19, 0.94);
  --cta-bg: #f3efe8;
  --cta-ink: #0d0d0d;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
body[data-look='day'] {
  --ink: #111111;
  --ink-2: rgba(17, 17, 17, 0.6);
  --line: rgba(17, 17, 17, 0.14);
  --sheet: rgba(244, 243, 240, 0.96);
  --cta-bg: #111111;
  --cta-ink: #f4f3f0;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  min-height: 100dvh;
  font-family: Heros, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #0b0b0c;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  touch-action: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }

/* ---------- the room behind the 3D (the canvas is transparent) */
.bg { position: fixed; inset: 0; pointer-events: none; }
.bg-night {
  background:
    radial-gradient(60% 44% at 50% 46%, rgba(70, 52, 30, 0.42) 0%, rgba(20, 16, 12, 0.2) 55%, rgba(0, 0, 0, 0) 100%),
    linear-gradient(180deg, #0c0c0d 0%, #0a0a0b 58%, #121112 72%, #0c0c0c 100%);
}
.bg-day {
  opacity: 0;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .05 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>"),
    radial-gradient(70% 50% at 50% 42%, #efeeeb 0%, #e6e5e1 60%, #dddcd8 100%),
    linear-gradient(180deg, #e9e8e5 0%, #e4e3df 64%, #d9d8d3 100%);
}
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; transition: opacity .9s ease; }
body[data-mode='gate'] #c { opacity: 0; }

/* ---------- top bar */
.top {
  position: fixed; left: 0; right: 0; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + var(--safe-t)) 18px 10px;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.logo { display: block; height: 24px; }
.logo img { height: 24px; width: auto; display: block; transition: opacity .4s ease; }
.logo .logo-b { position: absolute; opacity: 0; }
body[data-look='day'] .logo .logo-b { opacity: 1; }
body[data-look='day'] .logo .logo-w { opacity: 0; }
.top-r { display: flex; align-items: center; gap: 14px; }
.lang { display: flex; gap: 2px; }
.lang button { font-size: 13px; padding: 8px 6px; color: var(--ink-2); transition: color .2s ease; }
.lang button.on { color: var(--ink); font-weight: 700; }
.info-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line);
  font-size: 14px; line-height: 28px; text-align: center; color: var(--ink);
}

/* ---------- the way in */
.gate {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 0 22px calc(34px + var(--safe-b));
  max-width: 560px;
  transition: opacity .6s ease, transform .6s ease;
}
.gate.gone { opacity: 0; transform: translateY(12px); pointer-events: none; }
.gate-kicker { margin: 0 0 6px; font-size: 14px; color: var(--ink-2); }
.gate-title { margin: 0; font-size: clamp(56px, 17vw, 112px); line-height: .9; letter-spacing: -0.035em; font-weight: 700; }
.gate-sub { margin: 14px 0 22px; font-size: 16px; line-height: 1.35; color: var(--ink-2); max-width: 30ch; }
.gate-bar { height: 1px; background: var(--line); margin: 0 0 22px; overflow: hidden; }
.gate-bar i { display: block; height: 100%; background: var(--ink); transform-origin: 0 50%; transform: scaleX(.03); transition: transform .3s ease; }
body.ready .gate-bar { opacity: 0; transition: opacity .4s ease .2s; }
.soft-note { margin: 16px 0 0; font-size: 12px; color: var(--ink-2); max-width: 36ch; }

.cta {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 24px; border-radius: 999px;
  background: var(--cta-bg); color: var(--cta-ink);
  font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: transform .18s ease, opacity .3s ease, background .3s ease, color .3s ease;
}
.cta:hover { transform: translateY(-1px); }
.cta:active { transform: scale(.98); }
.cta:disabled { opacity: .35; cursor: default; transform: none; }

/* ---------- controls under the case */
.controls {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 12;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px calc(18px + var(--safe-b));
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .5s ease, transform .5s ease;
}
body[data-mode='case'] .controls, body[data-mode='float'] .controls { opacity: 1; transform: none; pointer-events: auto; }
.switch { display: inline-flex; align-items: center; gap: 12px; height: 44px; padding: 0 4px; }
.track {
  position: relative; width: 52px; height: 30px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04);
  transition: background .3s ease, border-color .3s ease;
}
body[data-look='day'] .track { background: rgba(17, 17, 17, 0.9); border-color: transparent; }
.knob {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #f3efe8; box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  transition: transform .35s cubic-bezier(.3, .7, .2, 1);
}
body[data-look='day'] .knob { transform: translateX(22px); background: #f4f3f0; }
.sw-label { font-size: 14px; font-weight: 700; }
.pill {
  height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 14px; font-weight: 700;
  transition: transform .18s ease, background .3s ease;
}
.pill:hover { transform: translateY(-1px); }
.pill:active { transform: scale(.98); }
body[data-mode='float'] .pill { background: var(--cta-bg); color: var(--cta-ink); border-color: transparent; }

/* ---------- the product sheet (On / Vestiaire anatomy: brand, name, one meta line, price + one button) */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 14;
  padding: 16px 20px calc(14px + var(--safe-b));
  background: var(--sheet);
  border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  transform: translateY(105%);
  transition: transform .55s cubic-bezier(.3, .7, .2, 1), background .4s ease;
}
body[data-mode='piece'] .sheet { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 13px; color: var(--ink-2); }
.x { width: 36px; height: 36px; margin: -8px -8px 0 0; display: grid; place-items: center; }
.x svg, .sheet-nav svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sheet h2 { margin: 2px 0 4px; font-size: 21px; line-height: 1.15; letter-spacing: -0.01em; font-weight: 700; max-width: 26ch; }
.meta { margin: 0 0 14px; font-size: 14px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 10px; }
.spin-hint { font-family: Hand, 'Comic Sans MS', cursive; font-size: 15px; }
.sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.price { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.sheet .cta { height: 46px; padding: 0 20px; font-size: 14px; }
.sheet-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.sheet-nav button { width: 40px; height: 36px; display: grid; place-items: center; }

/* ---------- handwritten notes + arrows on the close-up, and the hints */
.notes { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.arrows { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.note {
  position: absolute; left: 0; top: 0;
  font-family: Hand, 'Comic Sans MS', cursive; font-size: 19px; line-height: 1.1; white-space: nowrap;
  color: var(--ink); opacity: 0; transition: opacity .35s ease;
}
.note.on { opacity: 1; }
.arrow { fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .35s ease; }
.arrow.on { opacity: .9; }
.hint { position: fixed; left: 0; top: 0; z-index: 11; pointer-events: none; opacity: 0; transition: opacity .6s ease; }
.hint.on { opacity: 1; }
.hint .hand { font-family: Hand, 'Comic Sans MS', cursive; font-size: 21px; color: var(--ink); white-space: nowrap; }
.hint .arrow { opacity: .9; }
.hint-svg { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; }
.hint-svg.small { position: static; width: 60px; height: 40px; }
.hint-lights { left: 26px; top: auto; bottom: calc(66px + var(--safe-b)); display: flex; align-items: flex-end; gap: 2px; }
.hint-grab { left: 50%; top: auto; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%); }
body:not([data-mode='case']) #hintTap, body:not([data-mode='case']) .hint-lights { opacity: 0; }
body:not([data-mode='float']) .hint-grab { opacity: 0; }

/* ---------- about + the no-3D list */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(0, 0, 0, .45); padding: 20px; }
.modal[hidden] { display: none; }
.card { max-width: 380px; background: var(--sheet); color: var(--ink); border-radius: 18px; padding: 22px; border: 1px solid var(--line); }
.card h3 { margin: 0 0 10px; font-size: 18px; }
.card p { margin: 0 0 12px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.card .small { font-size: 12px; }
.card .cta { margin-top: 6px; }
.flat { position: fixed; inset: 0; z-index: 30; overflow: auto; padding: 80px 22px 40px; background: #e6e5e1; color: #111; touch-action: pan-y; }
.flat[hidden] { display: none; }
.flat h1 { font-size: 48px; margin: 0 0 8px; letter-spacing: -0.03em; }
.flat ul { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid rgba(0, 0, 0, .14); }
.flat li a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 0; border-bottom: 1px solid rgba(0, 0, 0, .14); text-decoration: none; }
.flat .ft { font-weight: 700; font-size: 15px; }
.flat .fm { grid-row: 2; font-size: 13px; color: rgba(0, 0, 0, .55); }
.flat .fp { grid-row: 1 / span 2; align-self: center; font-weight: 700; }
body[data-mode='flat'] #c, body[data-mode='flat'] .controls, body[data-mode='flat'] .gate { display: none; }
.debug { position: fixed; left: 8px; top: 64px; z-index: 50; margin: 0; padding: 6px 8px; font: 11px/1.35 ui-monospace, monospace; background: rgba(0, 0, 0, .72); color: #9f9; border-radius: 6px; pointer-events: none; white-space: pre; }
.by { position: fixed; right: 14px; bottom: calc(4px + var(--safe-b)); z-index: 9; margin: 0; font-size: 10px; color: var(--ink-2); opacity: .55; pointer-events: none; }
body[data-mode='piece'] .by, body[data-mode='case'] .by, body[data-mode='float'] .by { opacity: 0; }

/* computers: the sheet becomes a card on the right */
@media (min-width: 900px) and (pointer: fine) {
  .sheet { left: auto; right: 24px; bottom: 24px; width: 380px; border-radius: 18px; border: 1px solid var(--line); transform: translateX(calc(100% + 40px)); }
  body[data-mode='piece'] .sheet { transform: none; }
  .gate { padding-left: 56px; padding-bottom: 64px; }
  .controls { justify-content: flex-start; gap: 22px; padding-left: 40px; padding-bottom: 32px; }
  .hint-lights { left: 46px; bottom: 82px; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .controls, .gate, .cta, .pill, .knob { transition-duration: .01s !important; }
}
