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

:root {
  --ink: #4a453c;
  --ink-muted: #8a8073;
  --surface-top: #F6F2EC;
  --surface-mid: #EEE9E1;
  --surface-bottom: #EAE4DB;
  --shadow-rest: 0 18px 40px rgba(45, 35, 25, 0.13);
  --shadow-lift: 0 26px 60px rgba(45, 35, 25, 0.28);
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-sans);
  background: linear-gradient(180deg, var(--surface-top) 0%, #F2EFE9 30%, var(--surface-mid) 70%, var(--surface-bottom) 100%);
  overflow-x: hidden;
}

.plaster-texture {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}

/* ── Menu frame ── */

.menu-frame {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 52px;
  border: 0;
  z-index: 200;
}

/* ── Surface & stacks ── */

.surface {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  padding-top: 52px;
}

.stack-area {
  position: relative;
  pointer-events: none;
}

.polaroid {
  position: absolute;
  top: 0;
  left: 0;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
  transition: box-shadow 0.25s ease;
  box-shadow: var(--shadow-rest);
}

.polaroid img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  pointer-events: none;
  -webkit-user-drag: none;
}

.polaroid.landscape {
  width: min(1040px, 72vw);
}

.polaroid.portrait {
  width: min(820px, 58vw);
}

.polaroid.lifted {
  cursor: grabbing;
  box-shadow: var(--shadow-lift);
  transition: box-shadow 0.15s ease;
}

/* Desktop layout */
@media (min-width: 768px) {
  .surface {
    height: 200vh;
    min-height: 0;
  }

  .stack-area {
    position: absolute;
  }

  .stack-area[data-stack="0"] {
    top: 1.5rem;
    left: 3%;
    width: min(820px, 44vw);
    height: calc(100vh - 52px - 1.5rem);
  }

  .stack-area[data-stack="1"] {
    top: 1.5rem;
    left: 52%;
    right: auto;
    width: min(820px, 42vw);
    height: calc(100vh - 52px - 1.5rem);
  }

  .stack-area[data-stack="2"] {
    top: 100vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(1040px, 72vw);
    height: calc(100vh - 52px);
  }

  /* Screen 1: both stacks must fit side-by-side without clipping */
  .polaroid[data-stack="0"].landscape,
  .polaroid[data-stack="1"].landscape {
    width: min(1040px, 42vw);
  }

  .polaroid[data-stack="0"].portrait,
  .polaroid[data-stack="1"].portrait {
    width: min(820px, 33vw);
  }
}

/* Mobile layout */
@media (max-width: 767px) {
  .surface {
    display: flex;
    flex-direction: column;
  }

  .stack-area {
    min-height: 100vh;
    width: 100%;
    flex-shrink: 0;
  }

  .polaroid.landscape,
  .polaroid.portrait {
    width: 78vw;
  }
}

/* ── See more cue ── */

.see-more {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink-muted);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.see-more.is-hidden {
  opacity: 0;
}

.see-more__label {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.see-more__chevron {
  width: 1.25rem;
  height: 1.25rem;
  animation: bob 1.6s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

@media (prefers-reduced-motion: reduce) {
  .see-more__chevron {
    animation: none;
  }
}

/* ── Reset ── */

.reset-btn {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 150;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: rgba(246, 242, 236, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(74, 69, 60, 0.12);
  border-radius: 2px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.reset-btn:hover {
  color: var(--ink);
  border-color: rgba(74, 69, 60, 0.25);
}

/* ── Overlay ── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.overlay[hidden] {
  display: none;
}

.overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 35, 25, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.overlay__panel {
  position: relative;
  z-index: 1;
  width: min(540px, 100%);
  max-height: min(90vh, 860px);
  overflow-y: auto;
  background: #F8F5F0;
  border: 1px solid rgba(74, 69, 60, 0.1);
  border-radius: 3px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 24px 64px rgba(45, 35, 25, 0.18);
}

.overlay__close {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
}

.overlay__close:hover {
  color: var(--ink);
}

.overlay__title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.overlay__intro {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ink);
  margin-bottom: 1rem;
}

.field {
  display: block;
  margin-bottom: 1rem;
}

.field__label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

.field__optional {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.68rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"] {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(74, 69, 60, 0.18);
  border-radius: 2px;
  padding: 0.6rem 0.75rem;
}

.field input:focus {
  outline: none;
  border-color: rgba(74, 69, 60, 0.4);
}

.field__helper {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--ink-muted);
  line-height: 1.4;
}

.fieldset {
  border: none;
  margin: 1.5rem 0 1.25rem;
  padding: 0;
}

.fieldset__legend {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.fieldset__intro {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink-muted);
  margin-bottom: 0.85rem;
}

.checkbox-list {
  list-style: none;
}

.checkbox-list li + li {
  margin-top: 0.45rem;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink);
  cursor: pointer;
}

.checkbox input {
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: var(--ink);
}

.things-to-know {
  margin: 1.5rem 0 1.25rem;
  padding: 1rem 0 0;
  border-top: 1px solid rgba(74, 69, 60, 0.1);
}

.things-to-know__title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--ink-muted);
  margin-bottom: 0.6rem;
}

.things-to-know ul {
  list-style: none;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

.things-to-know li {
  position: relative;
  padding-left: 0.85rem;
}

.things-to-know li::before {
  content: "·";
  position: absolute;
  left: 0;
}

.submit-btn {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #F8F5F0;
  background: var(--ink);
  border: none;
  border-radius: 2px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.submit-btn:hover {
  background: #3a3530;
}

.overlay__thankyou {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
  padding: 1rem 0;
}

.overlay__thankyou[hidden] {
  display: none;
}

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