/* ═══════════════════════════════════════════════════════════════════════════
   LATHY — design system
   Bone #EDE8DF · Espresso #3B2F2A · Camel #B89B78 · Charcoal #1C1C1C · Stone #9C968C
   Playfair Display (headlines) · Inter (body)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bone: #EDE8DF;
  --espresso: #3B2F2A;
  --camel: #B89B78;
  --charcoal: #1C1C1C;
  --stone: #9C968C;

  --display: "Playfair Display", "Times New Roman", Times, serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --bar-h: 64px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

/* the hidden attribute must win: the built-in email field hides itself as soon
   as a MailerLite embed is pasted into the marked slot */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--charcoal);
  color: var(--bone);
  font-family: var(--body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  overscroll-behavior: none;
}

body { touch-action: none; }
body[data-view="page"] { touch-action: pan-y; }

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

img { display: block; max-width: 100%; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  appearance: none;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 0;
  background: var(--bone);
  color: var(--espresso);
  font-family: var(--body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  padding: 14px 26px;
  line-height: 1;
  transition: background-color .35s var(--ease), color .35s var(--ease), opacity .35s var(--ease);
}
.btn:hover { background: #e1dacd; }
.btn:active { transform: translateY(1px); }
.btn--dark { background: var(--espresso); color: var(--bone); }
.btn--dark:hover { background: #4a3c35; }
.btn--ghost {
  background: transparent;
  color: var(--espresso);
  border-color: rgba(59, 47, 42, .32);
  padding: 12px 22px;
}
.btn--ghost:hover { background: var(--espresso); color: var(--bone); border-color: var(--espresso); }
.btn:focus-visible, .arrow:focus-visible, .hamburger:focus-visible,
.menu a:focus-visible, .topbar__mark:focus-visible, .piece__close:focus-visible,
.modal__close:focus-visible {
  outline: 1px solid var(--camel);
  outline-offset: 3px;
}

/* ── Fields ───────────────────────────────────────────────────────────────── */

.field {
  appearance: none;
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(237, 232, 223, .34);
  border-radius: 0;
  color: var(--bone);
  font-family: var(--body);
  font-size: 16px;
  font-weight: 300;
  letter-spacing: .02em;
  text-align: center;
  padding: 11px 4px;
  transition: border-color .4s var(--ease);
}
.field::placeholder { color: rgba(237, 232, 223, .46); }
.field:focus { outline: none; border-bottom-color: var(--camel); }
.email-form--dark .field {
  color: var(--espresso);
  border-bottom-color: rgba(59, 47, 42, .28);
}
.email-form--dark .field::placeholder { color: rgba(59, 47, 42, .42); }
.email-form--dark .field:focus { border-bottom-color: var(--camel); }

.email-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  width: min(88vw, 300px);
}
.form-note {
  min-height: 15px;
  margin: -6px 0 0;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--stone);
  text-align: center;
}
.email-form--dark .form-note { color: #8b8378; }

/* ── Intro ────────────────────────────────────────────────────────────────── */

.intro {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--charcoal);
  display: grid;
  place-items: center;
  transition: opacity 900ms var(--ease);
}
.intro__mark {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.6rem, 9vw, 6.4rem);
  letter-spacing: .42em;
  text-indent: .42em;
  color: var(--bone);
}
.intro.is-gone { opacity: 0; pointer-events: none; }

/* ── Corridor hint ────────────────────────────────────────────────────────── */

.hint {
  position: fixed;
  left: 0; right: 0;
  bottom: clamp(28px, 7vh, 64px);
  z-index: 12;
  margin: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: .22em;
  color: rgba(237, 232, 223, .58);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 1.2s var(--ease), transform 1.2s var(--ease);
  pointer-events: none;
}
.hint.is-on { opacity: 1; transform: none; }

/* ── Gate ─────────────────────────────────────────────────────────────────── */

.gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  pointer-events: none;
}
.gate.is-on { opacity: 1; transform: none; pointer-events: auto; }
.gate.is-leaving { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.gate.is-nudged .email-form .field { border-bottom-color: var(--camel); }
.gate.is-nudged .btn { background: var(--camel); }
.gate form[hidden], .ml-slot:empty { display: none; }

/* ── Top bar (inner world only) ───────────────────────────────────────────── */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 55;
  height: calc(var(--bar-h) + 26px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 44px);
  background: linear-gradient(to bottom, rgba(237, 232, 223, .78), rgba(237, 232, 223, 0));
  opacity: 0;
  pointer-events: none;
  transition: opacity 900ms var(--ease);
}
body[data-entered="true"] .topbar { opacity: 1; pointer-events: auto; }
body[data-view="entrance"] .topbar { opacity: 0 !important; pointer-events: none !important; }
.topbar__mark {
  font-family: var(--display);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: .34em;
  text-indent: .34em;
  color: var(--espresso);
  text-decoration: none;
}
.hamburger {
  appearance: none;
  border: 0;
  background: transparent;
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  gap: 6px;
  grid-auto-flow: row;
  cursor: pointer;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 23px;
  height: 1.5px;
  background: var(--espresso);
  transition: transform .45s var(--ease), opacity .3s var(--ease);
}
.hamburger.is-open span:nth-child(1) { transform: translateY(3.75px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { transform: translateY(-3.75px) rotate(-45deg); }

/* ── Menu ─────────────────────────────────────────────────────────────────── */

.menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bone);
  display: flex;
  align-items: center;
  padding: calc(var(--bar-h)) clamp(28px, 9vw, 130px) 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .55s var(--ease), visibility .55s;
}
.menu.is-open { opacity: 1; visibility: visible; }
.menu__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: clamp(8px, 1.8vh, 18px); }
.menu__list a {
  display: inline-block;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.85rem, 5vw, 3.3rem);
  line-height: 1.12;
  color: var(--espresso);
  text-decoration: none;
  transition: color .35s var(--ease), transform .45s var(--ease);
}
.menu__list a:hover, .menu__list a:focus-visible { color: var(--camel); transform: translateX(10px); }
.menu__list a[aria-current="page"] { color: var(--camel); }

/* ── Inner pages ──────────────────────────────────────────────────────────── */

.pages { position: relative; z-index: 30; }
.page {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--bone);
  color: var(--espresso);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  transition: opacity .6s var(--ease), visibility .6s;
}
.page.is-open { opacity: 1; visibility: visible; }
.page__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: calc(var(--bar-h) + 54px) clamp(22px, 5vw, 64px) 110px;
}
.page__label {
  margin: 0 0 14px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--stone);
}
.page__title {
  margin: 0 0 clamp(30px, 6vh, 58px);
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  line-height: 1.14;
  letter-spacing: .005em;
  color: var(--espresso);
}

/* Volumes */
.volume { max-width: 720px; margin: 0 auto; text-align: center; }
.volume__cover { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--espresso); }
.volume__meta { margin: 34px 0 10px; font-size: 10px; letter-spacing: .34em; text-transform: uppercase; color: var(--stone); }
.volume__title { margin: 0 0 18px; font-family: var(--display); font-weight: 400; font-size: clamp(1.5rem, 3.2vw, 2rem); color: var(--espresso); }
.volume__excerpt { margin: 0 auto; max-width: 470px; font-size: 15px; line-height: 1.85; color: rgba(59, 47, 42, .78); }
.volume__rule { width: 56px; height: 1px; margin: clamp(38px, 7vh, 62px) auto clamp(26px, 5vh, 40px); background: rgba(59, 47, 42, .18); border: 0; }
.volume__empty {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.02rem;
  color: var(--stone);
}

/* Collection I */
.page--bleed .page__inner { max-width: none; padding-left: 0; padding-right: 0; }
.page--bleed .page__head { padding: calc(var(--bar-h) + 54px) clamp(22px, 5vw, 64px) clamp(26px, 5vh, 46px); max-width: 1180px; margin: 0 auto; }
.look { display: flex; flex-direction: column; gap: 0; }
.look__item { position: relative; width: 100%; height: min(86vh, 880px); overflow: hidden; background: var(--espresso); }
.look__item img { width: 100%; height: 100%; object-fit: cover; }
.look__notify { position: absolute; right: clamp(16px, 3.6vw, 42px); bottom: clamp(16px, 3.6vw, 42px); }

/* The House */
.house { max-width: 600px; margin: 0 auto; text-align: center; }
.house p {
  margin: 0 0 1.55em;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.02rem, 1.5vw, 1.16rem);
  line-height: 1.95;
  color: #332A26;
}
.house p:last-child { margin-bottom: 0; }
.house__mark {
  display: block;
  margin-top: clamp(38px, 7vh, 64px);
  font-family: var(--display);
  font-size: .9rem;
  letter-spacing: .32em;
  text-indent: .32em;
  color: var(--stone);
}

/* Shop */
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 272px), 1fr)); gap: clamp(24px, 3.4vw, 46px); }
.shop__card { display: flex; flex-direction: column; }
.shop__media { position: relative; overflow: hidden; background: var(--bone); }
.shop__media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform 1.1s var(--ease); }
.shop__card:hover .shop__media img { transform: scale(1.02); }
.shop__name { margin: 20px 0 6px; font-family: var(--display); font-weight: 400; font-size: 1.06rem; color: var(--espresso); }
.shop__price { margin: 0 0 16px; font-size: 12px; letter-spacing: .14em; color: var(--stone); }
.shop__card .btn { align-self: flex-start; }

/* ── Studio: arrows + garment panel ───────────────────────────────────────── */

.arrows {
  position: fixed;
  right: clamp(18px, 3.4vw, 40px);
  bottom: clamp(18px, 4vh, 42px);
  z-index: 35;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .8s var(--ease);
}
body[data-entered="true"][data-view="studio"] .arrows { opacity: 1; pointer-events: auto; }
.arrow {
  appearance: none;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(237, 232, 223, .3);
  background: rgba(28, 28, 28, .38);
  color: var(--bone);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  transition: background-color .3s var(--ease), transform .2s var(--ease);
  touch-action: none;
}
.arrow svg { width: 20px; height: 20px; }
.arrow:active, .arrow.is-held { background: rgba(28, 28, 28, .62); transform: scale(.96); }

.piece {
  position: fixed;
  left: 50%;
  bottom: clamp(22px, 5vh, 52px);
  transform: translate(-50%, 14px);
  z-index: 36;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 248px;
  padding: 24px 30px 26px;
  background: rgba(237, 232, 223, .95);
  border: 1px solid rgba(59, 47, 42, .12);
  box-shadow: 0 24px 60px rgba(28, 28, 28, .18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.piece.is-open { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.piece__name {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.18rem;
  color: var(--espresso);
  text-align: center;
}
.piece__close, .modal__close {
  appearance: none;
  position: absolute;
  top: 8px; right: 10px;
  width: 28px; height: 28px;
  border: 0;
  background: transparent;
  color: var(--stone);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color .3s var(--ease);
}
.piece__close:hover, .modal__close:hover { color: var(--espresso); }

/* ── Notify modal ─────────────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s var(--ease), visibility .5s;
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(28, 28, 28, .42); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal__card {
  position: relative;
  width: min(90vw, 430px);
  padding: clamp(28px, 5vw, 44px) clamp(22px, 5vw, 44px) clamp(26px, 4vw, 40px);
  background: var(--bone);
  color: var(--espresso);
  text-align: center;
  box-shadow: 0 34px 90px rgba(0, 0, 0, .3);
  transform: translateY(10px);
  transition: transform .55s var(--ease);
}
.modal.is-open .modal__card { transform: none; }
.modal__title { margin: 0 0 10px; font-family: var(--display); font-weight: 400; font-size: 1.5rem; }
.modal__line { margin: 0 0 26px; font-size: 13px; line-height: 1.7; color: rgba(59, 47, 42, .72); }
.modal__card .email-form { width: 100%; margin: 0 auto; }
.modal .form-note { color: #8b8378; }

/* ── Dissolve + failure ───────────────────────────────────────────────────── */

.dissolve {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--bone);
  opacity: 0;
  pointer-events: none;
  transition: opacity 820ms var(--ease);
}
.dissolve.is-on { opacity: 1; }

.fatal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--charcoal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  text-align: center;
  padding: 32px;
}
.fatal__mark {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.9rem, 6vw, 3rem);
  letter-spacing: .4em;
  text-indent: .4em;
  color: var(--bone);
}
.fatal__line { margin: 0; font-size: 13px; letter-spacing: .1em; color: var(--stone); }

.noscript {
  position: fixed;
  inset: 0;
  margin: 0;
  z-index: 95;
  background: var(--charcoal);
  color: var(--bone);
  display: grid;
  place-items: center;
  font-family: var(--display);
  letter-spacing: .28em;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .page__inner { padding-bottom: 84px; }
  .look__item { height: 64vh; }
  .piece { bottom: 96px; }          /* clear of the walk arrows */
  .arrows { right: 16px; bottom: 18px; gap: 8px; }
  .arrow { width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .001ms !important; }
}
