/* Dwell with Maya — editorial white theme (v8)
   Mobile-first: base styles target ~390px phones; min-width queries scale up. */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* palette — white + warm neutrals */
  --bg: #ffffff;
  --bg-soft: #f7f5f1;
  --ink: #1b1b19;
  --ink-2: #3a3833;
  --muted: #5b5a55;          /* 6.9:1 on white */
  --eyebrow: #6b6a64;        /* 5.4:1 on white, 5.0:1 on --bg-soft */
  --line: #e6e3dd;
  --line-strong: #d3cfc7;
  --shadow: 0 1px 2px rgba(27, 27, 25, 0.04), 0 18px 40px -22px rgba(27, 27, 25, 0.22);

  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;

  /* type scale — tuned so 390px phones get a deliberate, not merely shrunk, scale */
  --fs-hero: clamp(2.75rem, 1.6rem + 5.6vw, 5.25rem);
  --fs-h1: clamp(2.25rem, 1.5rem + 3.6vw, 3.9rem);
  --fs-h2: clamp(1.7rem, 1.3rem + 1.9vw, 2.5rem);
  --fs-h3: clamp(1.4rem, 1.25rem + 0.5vw, 1.6rem);
  --fs-lede: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  --fs-pull: clamp(1.45rem, 1.1rem + 1.8vw, 2.1rem);
  --fs-body: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);

  /* spacing rhythm */
  --gutter: 1.5rem;
  --section: clamp(4rem, 2.75rem + 5vw, 7rem);
  --section-tight: clamp(2.75rem, 2rem + 3vw, 4.5rem);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
[id] { scroll-margin-top: 6rem; }
html.modal-open { overflow: hidden; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--ink); color: #fff; padding: 0.75rem 1.1rem;
  font-family: var(--sans); font-size: 13px; letter-spacing: 0.08em; text-decoration: none;
}
.skip:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 680px; margin: 0 auto; }
section.block { padding: var(--section) 0; }
section.block.tight { padding: var(--section-tight) 0; }

/* Soft band: warm paper that fades in and out of white, so sections
   dissolve into each other instead of cutting hard. */
.band {
  background: linear-gradient(180deg, var(--bg) 0, var(--bg-soft) clamp(3rem, 8vw, 6rem),
    var(--bg-soft) calc(100% - clamp(3rem, 8vw, 6rem)), var(--bg) 100%);
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.nav.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 8px 24px -20px rgba(27, 27, 25, 0.35); }
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0.7rem var(--gutter) 0.35rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
}
.wordmark {
  font-family: var(--serif); font-size: 1.2rem; letter-spacing: 0.02em;
  text-decoration: none; white-space: nowrap; line-height: 1.2;
}
.wordmark em { font-style: italic; color: var(--ink-2); }
.nav-links { display: flex; justify-content: center; gap: 1.6rem; list-style: none; }
.nav-links a {
  position: relative; display: inline-block; padding: 0.7rem 0;
  font-family: var(--sans); font-size: 11.5px; letter-spacing: 0.16em;
  text-transform: uppercase; text-decoration: none; color: var(--muted); white-space: nowrap;
  transition: color 0.25s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.45rem; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: center;
  transition: transform 0.35s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- type ---------- */
.eyebrow {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--eyebrow); margin-bottom: 1.25rem;
}
h1, h2, h3 { font-weight: 400; text-wrap: balance; }
h1 { font-size: var(--fs-h1); line-height: 1.08; letter-spacing: -0.012em; margin-bottom: 1.25rem; }
h2 { font-size: var(--fs-h2); line-height: 1.18; letter-spacing: -0.005em; margin-bottom: 1.1rem; }
h3 { font-size: var(--fs-h3); line-height: 1.2; }
h1 em, h2 em, h3 em { font-style: italic; }
p { text-wrap: pretty; }
.lede { font-size: var(--fs-lede); line-height: 1.6; color: var(--muted); }
.lede.ink { color: var(--ink); }
.prose p {
  font-family: var(--sans); font-size: var(--fs-body); line-height: 1.8; color: var(--muted);
  margin-bottom: 1.35rem;
}
.prose p:last-child { margin-bottom: 0; }
.prose p.lede { font-family: var(--serif); font-size: var(--fs-lede); line-height: 1.6; color: var(--ink); }
/* About page: one voice throughout — all paragraphs match the lede */
.about .prose p { font-family: var(--serif); font-size: var(--fs-lede); line-height: 1.65; color: var(--ink); margin-bottom: 1.5rem; }
.about .prose p:last-child { margin-bottom: 0; }

/* hairline with a centred dot — a quiet section mark */
.rule {
  position: relative; width: 88px; height: 1px; margin: 2.25rem 0;
  background: linear-gradient(90deg, var(--line-strong) 0 38%, transparent 38% 62%, var(--line-strong) 62%);
}
.rule::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px;
  margin: -2px 0 0 -2px; border-radius: 50%; background: var(--eyebrow);
}
.rule.center { margin-left: auto; margin-right: auto; }
.pull {
  font-size: var(--fs-pull); font-style: italic; line-height: 1.45;
  color: var(--ink); margin: 0;
}
.center { text-align: center; }

/* ---------- hero ---------- */
.hero {
  position: relative; display: flex; align-items: flex-end; overflow: hidden;
  min-height: 82vh; min-height: 82svh;
}
.hero img.bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 47% 50%;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(24, 24, 22, 0.62) 0%, rgba(24, 24, 22, 0.2) 42%, rgba(24, 24, 22, 0.04) 100%);
}
.hero-text {
  position: relative; z-index: 1; color: #fff; width: 100%;
  max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter) clamp(3rem, 8vw, 5.5rem);
}
.hero-text .eyebrow { color: #e4e2dc; }
.hero-text h1 { font-size: var(--fs-hero); line-height: 1.02; margin-bottom: 0.6rem; }
.hero-text .tagline { font-size: clamp(1.2rem, 1rem + 1vw, 1.65rem); font-style: italic; color: #f1f0ec; }
.hero-cta { margin-top: 1.75rem; }
.hero-cta .btn { width: 100%; }
.hero-note { margin-top: 0.85rem; font-family: var(--sans); font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: #e4e2dc; }
.hero-text :focus-visible { outline-color: #fff; }

/* ---------- images ---------- */
.banner { height: clamp(260px, 55vw, 560px); overflow: hidden; }
.banner img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 72%; }
.figure { overflow: hidden; border-radius: 2px; background: var(--bg-soft); }
.figure img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- page header ---------- */
.page-head { max-width: 760px; padding: clamp(3rem, 2rem + 4vw, 5.5rem) 0 clamp(2rem, 1.5rem + 2vw, 3.25rem); }
.page-head h1 { margin-bottom: 1rem; }
.page-head .lede { max-width: 38em; }

/* ---------- section heading ---------- */
.section-head { max-width: 680px; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem); }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--line); border-radius: 2px;
  padding: 1.75rem 1.5rem 1.6rem; text-decoration: none;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.3s;
}
.card .num {
  font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--eyebrow);
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem;
}
.card .num::after { content: ""; flex: 0 0 28px; height: 1px; background: var(--line-strong); }
.card h2, .card h3 { font-size: var(--fs-h3); margin-bottom: 0.7rem; }
.card p { font-family: var(--sans); font-size: 15px; line-height: 1.7; color: var(--muted); }

/* linked cards (home): image, lift and arrow on hover */
a.card { padding: 0; overflow: hidden; }
a.card .card-img { aspect-ratio: 3 / 2; overflow: hidden; background: var(--bg-soft); }
a.card .card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
a.card .card-body { display: flex; flex-direction: column; flex: 1; padding: 1.5rem 1.5rem 1.6rem; }
.card .go {
  display: inline-flex; align-items: center; gap: 0.6rem; margin-top: auto; padding-top: 1.25rem;
  font-family: var(--sans); font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink);
}
.card .go::after {
  content: "\2192"; content: "\2192" / "";
  font-size: 14px; letter-spacing: 0; transition: transform 0.35s var(--ease);
}
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); }
a.card:hover .card-img img { transform: scale(1.035); }
a.card:hover .go::after { transform: translateX(5px); }
a.card:focus-visible { outline-offset: 4px; }

/* ---------- split rows ---------- */
.split { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center; }
.split + .split { margin-top: var(--section-tight); }
.split .figure { aspect-ratio: 4 / 5; }
.split h2 { margin-bottom: 1rem; }

/* ---------- placeholder note ---------- */
.soon {
  border: 1px solid var(--line); background: var(--bg);
  padding: 2rem 1.5rem; text-align: center; max-width: 620px; margin: 0 auto;
}
.soon p:not(.eyebrow) { font-family: var(--sans); font-size: 15px; line-height: 1.7; color: var(--muted); }
.soon .eyebrow { margin-bottom: 0.9rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px;
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: #fff; background: var(--ink); border: 1px solid var(--ink); border-radius: 2px;
  padding: 0.95rem 2.4rem; cursor: pointer; text-decoration: none;
  transition: background 0.25s, color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn:hover { background: var(--ink-2); transform: translateY(-1px); box-shadow: 0 10px 22px -14px rgba(27, 27, 25, 0.6); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn[disabled] { opacity: 0.6; cursor: progress; transform: none; box-shadow: none; }
.btn-block { width: 100%; }
/* light variant for dark photo backgrounds */
.btn-light { color: var(--ink); background: #fff; border-color: #fff; }
.btn-light:hover { background: #f1f0ec; }

.link-btn {
  background: none; border: 0; cursor: pointer; padding: 0.6rem 0.25rem;
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-strong);
  text-underline-offset: 5px; transition: color 0.2s, text-decoration-color 0.2s;
}
.link-btn:hover { color: var(--ink); text-decoration-color: currentColor; }

/* ---------- forms ---------- */
.signup {
  background: var(--bg); border: 1px solid var(--line); border-radius: 2px; box-shadow: var(--shadow);
  padding: 2.5rem 1.4rem; text-align: center; margin: 0 auto; max-width: 660px;
}
.signup h2 { margin-bottom: 0.9rem; }
.signup > p:not(.eyebrow) { font-family: var(--sans); font-size: 15px; line-height: 1.75; color: var(--muted); margin: 0 auto 1.75rem; max-width: 30em; }
.signup .fields { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1.25rem; text-align: left; }
.signup .btn { width: 100%; }
.field { display: block; }
.field span { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.5rem; }
.field span i { font-style: normal; letter-spacing: 0.06em; text-transform: none; color: var(--eyebrow); }
/* 16px minimum keeps iOS Safari from zooming on focus */
.field input {
  width: 100%; font-family: var(--sans); font-size: 16px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: 2px; padding: 0.85rem 1rem; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder { color: #8f8d87; }
.field input:hover { border-color: #b9b4aa; }
.field input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(27, 27, 25, 0.1); }
.field input[aria-invalid="true"] { border-color: #9a3b2e; }
.form-note { font-family: var(--sans); font-size: 13.5px; color: var(--muted); margin-top: 1rem; min-height: 1.4em; }
.form-note.is-error { color: #9a3b2e; }
.form-done { font-size: 1.25rem; font-style: italic; color: var(--ink); padding: 1.5rem 0; }

/* ---------- footer ---------- */
footer.site { background: var(--bg-soft); border-top: 1px solid var(--line); margin-top: var(--section-tight); }
.footer-inner {
  max-width: 1120px; margin: 0 auto; padding: 3rem var(--gutter) 2.5rem;
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem; text-align: center;
}
footer.site .wordmark { font-size: 1.3rem; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1.5rem; }
.footer-links a, .footer-links button {
  display: inline-block; padding: 0.55rem 0; background: none; border: 0; cursor: pointer;
  font-family: var(--sans); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); text-decoration: underline; text-decoration-color: transparent;
  text-underline-offset: 6px; transition: color 0.2s, text-decoration-color 0.2s;
}
.footer-links a:hover, .footer-links button:hover { color: var(--ink); text-decoration-color: currentColor; }
footer.site .meta {
  font-family: var(--sans); font-size: 11.5px; letter-spacing: 0.12em; color: var(--eyebrow);
  padding-top: 1.25rem; border-top: 1px solid var(--line); width: 100%; max-width: 420px;
}

/* ---------- email popup ---------- */
.letters { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.letters[hidden] { display: none; }
.letters-backdrop {
  position: absolute; inset: 0; background: rgba(27, 27, 25, 0.45);
  opacity: 0; transition: opacity 0.35s var(--ease);
}
.letters-panel {
  position: relative; width: 100%; max-height: calc(100vh - 1rem); max-height: calc(100dvh - 1rem);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-top: 1px solid var(--line); border-radius: 4px 4px 0 0;
  padding: 2.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -20px 50px -30px rgba(27, 27, 25, 0.5);
  transform: translateY(24px); opacity: 0;
  transition: transform 0.45s var(--ease), opacity 0.35s var(--ease);
}
.letters.is-open .letters-backdrop { opacity: 1; }
.letters.is-open .letters-panel { transform: none; opacity: 1; }
.letters-panel .eyebrow { margin-bottom: 0.9rem; }
.letters-panel h2 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.2rem); margin-bottom: 0.6rem; padding-right: 2rem; }
.letters-desc { font-family: var(--sans); font-size: 15px; line-height: 1.65; color: var(--muted); margin-bottom: 1.5rem; }
.letters-form .field + .field { margin-top: 0.9rem; }
.letters-form .btn { margin-top: 1.25rem; }
.letters-form .form-note { margin-top: 0.75rem; text-align: center; }
.letters-form .form-note:empty { min-height: 0; margin-top: 0; }
.letters-close {
  position: absolute; top: 0.5rem; right: 0.5rem; width: 44px; height: 44px;
  display: grid; place-items: center; background: none; border: 0; border-radius: 50%;
  color: var(--muted); cursor: pointer; transition: color 0.2s, background 0.2s;
}
.letters-close:hover { color: var(--ink); background: var(--bg-soft); }
.letters-close svg { width: 18px; height: 18px; }
.letters-dismiss { display: block; margin: 0.75rem auto 0; }
.letters-done { text-align: center; padding: 1rem 0 0.5rem; }
.letters-done p { font-size: 1.3rem; font-style: italic; line-height: 1.5; }
.letters-done p:focus { outline: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- scroll reveal (only when JS + motion are available) ---------- */
.reveal-on .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal-on .reveal.is-in { opacity: 1; transform: none; }

/* ---------- ≥600px: large phones / small tablets ---------- */
@media (min-width: 600px) {
  :root { --gutter: 2rem; }
  .nav-inner { flex-direction: row; justify-content: space-between; padding: 0.55rem var(--gutter); gap: 1.5rem; }
  .wordmark { font-size: 1.3rem; }
  .nav-links { gap: 2rem; }
  .nav-links a { font-size: 12px; }
  .cards.six { grid-template-columns: 1fr 1fr; }
  .signup { padding: 3.25rem 3rem; }
  .signup .fields { grid-template-columns: 1fr 1fr; }
  .signup .btn { width: auto; }
  .hero-cta .btn { width: auto; }
  .soon { padding: 2.5rem; }
  .letters { align-items: center; padding: 1.5rem; }
  .letters-panel {
    max-width: 460px; max-height: calc(100vh - 3rem); max-height: calc(100dvh - 3rem);
    border: 1px solid var(--line); border-radius: 2px; padding: 3rem 2.75rem 2.25rem;
    box-shadow: 0 40px 80px -40px rgba(27, 27, 25, 0.55);
  }
  .footer-inner { padding: 3.5rem var(--gutter) 3rem; }
}

/* ---------- ≥900px: desktop ---------- */
@media (min-width: 900px) {
  .cards { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
  .cards.six { grid-template-columns: repeat(3, 1fr); }
  .card { padding: 2.25rem 2rem 2rem; }
  a.card .card-img { aspect-ratio: 4 / 3; }
  a.card .card-body { padding: 1.75rem 2rem 2rem; }
  .split { grid-template-columns: 1fr 1fr; gap: clamp(3rem, 6vw, 6rem); }
  .split.flip > .figure { order: 2; }
  .split .figure { aspect-ratio: 3 / 4; }
  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; flex-wrap: wrap; }
  footer.site .meta { order: 3; max-width: none; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  a.card:hover, .btn:hover { transform: none; }
}
