/* ---------- tokens ---------- */
:root {
  --cream: #f4f0e8;
  --cream-deep: #efe9df;
  --ink: #2b2620;
  --char: #1a1410;
  --stone: #5a4f42;
  --mist: #6e655a;
  --brass: #b8884a;
  --hairline: rgba(43, 38, 32, 0.12);

  --font-serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream-deep);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- page ---------- */
.page {
  max-width: 880px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 3.5rem 3rem;
  display: flex;
  flex-direction: column;
  background: var(--cream);
}

.page-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--mist);
}

.page-middle {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem 0;
}

.wordmark {
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  margin: 0 0 1.5rem;
  color: var(--ink);
}

.tagline {
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink);
  margin: 0 0 1.75rem;
  max-width: 26rem;
}

.menu { color: var(--stone); font-size: 1rem; line-height: 2; max-width: 30rem; }
.menu p { margin: 0; }

.page-bottom { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--ink);
  color: var(--cream);
  border: none;
  padding: 1rem 1.85rem;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}
.cta:hover, .cta:focus-visible { background: var(--char); outline: none; }
.cta-arrow { font-size: 1rem; }

.cta-note {
  font-size: 0.78rem;
  color: var(--mist);
  font-style: italic;
  margin: 0;
}

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.modal[hidden] { display: none; }

.modal-shroud {
  position: absolute; inset: 0;
  background: rgba(43, 38, 32, 0.4);
}

.modal-card {
  position: relative;
  background: var(--cream);
  width: 100%; max-width: 1400px;
  max-height: 94dvh; overflow-y: auto;
  padding: 1.75rem 2.5rem 1.5rem;
  border-radius: 4px;
  box-shadow: 0 12px 48px rgba(43, 38, 32, 0.25);
}

.modal-close {
  position: absolute; top: 1.25rem; right: 1.5rem;
  background: transparent; border: none; cursor: pointer;
  font-size: 1.5rem; color: var(--mist); font-family: var(--font-serif);
  line-height: 1; padding: 0.25rem 0.5rem;
}
.modal-close:hover { color: var(--ink); }

.modal-header {
  text-align: center; padding-bottom: 1rem;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 1.25rem;
}
.modal-eyebrow {
  font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--brass); margin-bottom: 0.5rem;
}
.modal-title {
  font-size: 1.5rem; font-weight: 400; letter-spacing: 0.05em;
  margin: 0 0 0.5rem; color: var(--ink);
}
.modal-subtitle {
  font-style: italic; color: var(--mist); font-size: 0.95rem; margin: 0;
}

/* ---------- tiers ---------- */
.tiers {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}

.tier {
  border: 1px solid var(--hairline);
  padding: 1.5rem 1.25rem;
  background: #fbf8f1;
  border-radius: 2px;
  display: flex; flex-direction: column;
  transition: opacity 0.2s, border-color 0.2s;
}
.tier--featured { border-color: var(--ink); border-width: 1.5px; }

.tier-summary { display: flex; flex-direction: column; }

.tiers.has-selection { grid-template-columns: 1fr; }
.tiers.has-selection .tier:not(.tier--selected) { display: none; }
.tier--selected { border-color: var(--ink) !important; border-width: 1.5px !important; padding: 1.75rem 2rem; }
.tier--selected .tier-cta { display: none; }

/* Expanded tier on desktop: marketing summary left, form right */
@media (min-width: 720px) {
  .tier--selected {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr);
    column-gap: 3rem;
    align-items: start;
  }
  .tier--selected .tier-summary { grid-column: 1; }
  .tier--selected .tier-form {
    grid-column: 2;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }
}

.tier-name {
  font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--mist); margin-bottom: 0.4rem;
}
.tier-num {
  font-size: 0.65rem; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--brass); margin-bottom: 0.75rem;
}
.tier-deposit { font-size: 1.6rem; font-weight: 400; }
.tier-deposit-note { font-size: 0.75rem; color: var(--mist); font-style: italic; margin-bottom: 1rem; }
.tier-perks { list-style: none; padding: 0; margin: 0 0 1rem; font-size: 0.8rem; color: var(--stone); line-height: 1.7; flex: 1; }
.tier-perks li { padding-left: 1rem; position: relative; margin-bottom: 0.25rem; }
.tier-perks li::before { content: '\2014'; position: absolute; left: 0; color: var(--brass); }
.tier-spots {
  font-size: 0.7rem; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--mist); margin-bottom: 0.75rem;
}
.tier-cta {
  background: var(--ink); color: var(--cream); border: none;
  padding: 0.75rem 1rem; font-family: var(--font-serif);
  font-size: 0.75rem; letter-spacing: 0.25em; text-transform: uppercase;
  cursor: pointer;
  margin-top: auto;
}
.tier-cta:hover { background: var(--char); }
.tier-cta--outline { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.tier-cta--outline:hover { background: var(--ink); color: var(--cream); }

/* ---------- inline tier form (revealed on select) ---------- */
.tier-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--hairline); }
.tier-form[hidden] { display: none; }

.tier-form label {
  display: block; font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--mist); margin: 0.5rem 0 0.3rem;
}
.tier-form label:first-child { margin-top: 0; }
.tier-form input[type="text"], .tier-form input[type="email"] {
  width: 100%; padding: 0.55rem 0.5rem;
  border: 1px solid var(--hairline); background: var(--cream);
  font-family: var(--font-serif); font-size: 0.95rem; color: var(--ink);
  border-radius: 2px;
}
.tier-form input:focus { outline: none; border-color: var(--ink); }

.tier-form-stripe { margin: 0.3rem 0; min-height: 40px; }

/* Wrapper that keeps the error message and Reserve button stuck to the
   bottom of the modal's scroll area, so a validation error is never hidden
   below the fold. */
.tier-form-bottom {
  position: sticky; bottom: -1.5rem;
  background: var(--cream);
  margin-top: 0.85rem;
  padding-bottom: 0.85rem;
  border-top: 1px solid var(--hairline);
}
.tier-form-actions {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 0.85rem;
}
.tier-form-back { background: none; border: none; color: var(--mist); font-family: var(--font-serif); font-style: italic; cursor: pointer; padding: 0; font-size: 0.85rem; }
.tier-form-back:hover { color: var(--ink); }
.tier-form-submit { background: var(--ink); color: var(--cream); border: none; padding: 0.75rem 1.25rem; font-family: var(--font-serif); font-size: 0.75rem; letter-spacing: 0.25em; text-transform: uppercase; cursor: pointer; }
.tier-form-submit[disabled] { opacity: 0.5; cursor: not-allowed; }

.tier-form-error {
  color: #a93f2f; font-size: 0.85rem; font-style: italic;
  padding: 0.6rem 0 0;
}
.tier-form-error:empty { padding: 0; }

/* ---------- timeline ---------- */
.timeline { margin: 0 0 1.25rem; padding: 1rem 0 1.25rem; border-bottom: 1px solid var(--hairline); }
.timeline-title { font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--mist); margin-bottom: 0.85rem; text-align: center; }
.timeline-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; font-size: 0.82rem; color: var(--stone); line-height: 1.5; text-align: center; }
.timeline-when { font-size: 0.65rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--brass); margin-bottom: 0.3rem; }
.timeline-step p { margin: 0; }
.timeline-step em { color: var(--ink); font-style: italic; }

/* ---------- confirmation state ---------- */
.confirm { text-align: center; padding: 3rem 1rem 1rem; }
.confirm-check { font-size: 2rem; color: var(--brass); margin-bottom: 1rem; }
.confirm-title { font-size: 1.4rem; font-weight: 400; letter-spacing: 0.05em; color: var(--ink); margin: 0 0 0.5rem; }
.confirm-body { color: var(--stone); font-style: italic; }

/* ---------- mobile (< 720px) ---------- */
@media (max-width: 719px) {
  .page { padding: 2rem 1.5rem; }

  .page-top {
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
  }

  .wordmark { font-size: 1.75rem; letter-spacing: 0.35em; }
  .tagline { font-size: 1rem; }
  .menu { font-size: 0.9rem; line-height: 1.85; }

  .cta { width: 100%; justify-content: center; padding: 1rem; }

  /* modal goes near-full-screen; dvh handles iOS Safari's collapsing URL bar */
  .modal { padding: 0; }
  .modal-card {
    max-height: 100dvh; height: 100dvh; max-width: none;
    border-radius: 0; padding: 1.75rem 1.5rem;
  }

  .modal-title { font-size: 1.25rem; }

  .tiers { grid-template-columns: 1fr; gap: 0.85rem; }

  .timeline-row { grid-template-columns: 1fr; gap: 1rem; }

  .tier-form-actions { gap: 1rem; }

  /* Once a tier is selected on mobile, drop the perks list — the user
     already chose; freeing ~150px makes room for the form fields and
     Stripe Elements within the visible viewport. */
  .tier--selected .tier-perks { display: none; }
}

/* ---------- ultra-small phones (< 380px) ---------- */
@media (max-width: 379px) {
  .modal-card { padding: 1.25rem 1rem; }
  .tier { padding: 1rem 0.85rem; }
  .tier--selected { padding: 1rem; }
  .wordmark { font-size: 1.5rem; letter-spacing: 0.3em; }
}
