/* ─── What it is ───────────────────────────────────────────────
   Moments, not mechanics. Each beat is one thing Driftwood is like to live
   with, shown with the app's own surfaces (capture card, night screen,
   fragment cards) and a single line. home.css supplies tokens, nav, cards,
   footer and motion. Rowan Ellery's words throughout (synthetic DEV account). */

.page-whatis .nav-mark { opacity: 1; }
.page-whatis .nav:not(.is-solid) .nav-mark,
.page-whatis .nav:not(.is-solid) .nav-login { text-shadow: 0 0 18px var(--paper), 0 0 6px var(--paper); }

/* ─── Opening ─────────────────────────────────────────────── */
.wi-open {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: clamp(96px, 14vh, 140px) var(--gutter) clamp(170px, 30vh, 300px);
}
.wi-open-scene {
  position: absolute; inset: auto 0 0 0; height: 62%; z-index: -1;
  background: url("/assets/scenes/tide/mobile.webp") center 60% / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.6) 34%, #000 66%, #000 84%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.6) 34%, #000 66%, #000 84%, transparent 100%);
  opacity: .85;
}
@media (min-width: 768px) { .wi-open-scene { background-image: url("/assets/scenes/tide/desktop.webp"); background-position: center 62%; height: 50%; } }
.wi-open h1 { font-weight: normal; }
.wi-open h1, .wi-sub { position: relative; }
.wi-explore {
  position: relative; margin-top: clamp(18px, 3vh, 28px);
  display: inline-flex; align-items: baseline; gap: .35em;
  font-size: 15px; color: var(--deep);
  text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--driftwood) 45%, transparent); text-underline-offset: 4px;
}
.wi-explore::before { /* the same pocket of mist as the line above it */
  content: ""; position: absolute; inset: -14px -40px; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--paper) 90%, transparent) 40%, color-mix(in srgb, var(--paper) 0%, transparent));
}
.wi-explore span { transition: transform .3s ease; }
.wi-explore:hover { color: var(--charcoal); }
.wi-explore:hover span { transform: translateX(3px); }
.wi-sub::before { /* a pocket of mist so the line reads over the water */
  content: ""; position: absolute; inset: -24px -80px; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--paper) 94%, transparent) 45%, color-mix(in srgb, var(--paper) 0%, transparent));
}
.wi-eyebrow {
  display: block; margin-bottom: clamp(18px, 3vh, 28px);
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--driftwood);
}
.wi-title {
  display: block;
  font-family: var(--serif);
  font-size: clamp(52px, 8.4vw, 132px); line-height: .98; letter-spacing: -0.035em;
  color: var(--charcoal); text-wrap: balance;
}
.wi-sub {
  margin-top: clamp(20px, 3vh, 30px);
  font-family: var(--serif); font-style: italic;
  font-size: clamp(19px, 1.9vw, 25px); color: var(--driftwood);
}

/* ─── A moment ────────────────────────────────────────────── */
.moment { padding: clamp(80px, 14vh, 140px) var(--gutter); }
.moment-line {
  max-width: var(--col); margin: 0 auto clamp(28px, 4.5vh, 44px);
  font-family: var(--serif); font-style: italic;
  font-size: clamp(26px, 3vw, 40px); line-height: 1.15; letter-spacing: -0.01em;
  color: var(--charcoal); text-align: center; text-wrap: balance;
}
.moment-col { max-width: var(--col); margin: 0 auto; }

/* the typed line inside the capture card */
.wi-type { min-height: 1.5em; }
.wi-type .caret {
  display: inline-block; width: 1.5px; height: 1.05em; margin-left: 1px; vertical-align: -0.15em;
  background: var(--deep); animation: wi-blink 1.1s steps(1) infinite;
}
@keyframes wi-blink { 50% { opacity: 0; } }

/* ─── The night screen (src/components/night-capture.tsx palette) ─── */
.moment-night {
  --n-bg: #1A1917; --n-surface: #2A2825; --n-text: #B8B0A4; --n-accent: #6B8A9A;
  background: var(--n-bg); color: var(--n-text);
  padding-top: clamp(100px, 16vh, 170px); padding-bottom: clamp(110px, 18vh, 180px);
}
.moment-night .moment-line { color: var(--n-text); opacity: .9; font-style: normal; }
.night {
  max-width: 440px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 30px;
}
.night-mic {
  width: 104px; height: 104px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--n-surface); color: var(--n-accent);
  box-shadow: 0 0 0 14px color-mix(in srgb, var(--n-accent) 8%, transparent);
}
.night-hint { font-family: var(--serif); font-style: italic; font-size: 16px; opacity: .7; }
.night-field {
  width: 100%; min-height: 96px;
  border-radius: 16px; padding: 18px 22px;
  background: var(--n-surface); color: var(--n-text);
  font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.55; text-align: center;
}
.night-field .caret { background: var(--n-accent); }
.night-saved {
  height: 20px; font-family: var(--serif); font-style: italic; font-size: 14px;
  color: var(--n-accent); opacity: 0; transition: opacity 1s ease;
}
.night-saved.is-on { opacity: .85; }
.night-field.is-released::before { content: "\2026"; opacity: .3; } /* the app's empty box after a note is let go */

/* ─── It stays: pieces resting on the shore ───────────────── */
.moment-stays { position: relative; isolation: isolate; overflow: hidden; }
.moment-stays::before { /* islands in mist, very faint, behind the pieces */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("/assets/scenes/threads/mobile.webp") center / cover no-repeat;
  opacity: .22;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
}
@media (min-width: 768px) { .moment-stays::before { background-image: url("/assets/scenes/threads/desktop.webp"); } }
.resting { display: grid; gap: 18px; }
.resting .card { margin: 0; }
@media (min-width: 900px) {
  .resting { max-width: 960px; margin: 0 auto; grid-template-columns: 1fr 1fr; column-gap: 28px; row-gap: 22px; align-items: start; }
  .resting .card:nth-child(2) { margin-top: 48px; }
  .resting .card:nth-child(3) { margin-top: -24px; }
  .resting .card:nth-child(4) { margin-top: 22px; }
}
.wi-note { text-align: center; margin: -18px 0 clamp(24px, 4vh, 36px); }

/* ─── Months apart ────────────────────────────────────────── */
.apart { max-width: 900px; margin: 0 auto; display: grid; gap: 18px; }
.apart .gap {
  justify-self: center; width: 1px; height: clamp(60px, 12vh, 120px);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--driftwood) 40%, transparent), transparent);
}
@media (min-width: 900px) {
  .apart { grid-template-columns: 1fr 1fr; align-items: start; column-gap: 60px; }
  .apart .card:last-child { margin-top: clamp(120px, 20vh, 200px); }
  .apart .gap { display: none; }
}

/* ─── Words ─────────────────────────────────────────────── */
.wi-lede {
  max-width: 820px; margin: 0 auto clamp(30px, 5vh, 48px);
  font-family: var(--serif); font-size: clamp(24px, 2.7vw, 36px); line-height: 1.3; letter-spacing: -0.01em;
  color: var(--charcoal); text-align: center; text-wrap: balance;
}
.wi-after {
  max-width: 560px; margin: clamp(40px, 7vh, 64px) auto 0; text-align: center; text-wrap: balance;
  font-family: var(--serif); font-style: italic; font-size: clamp(19px, 1.8vw, 24px); line-height: 1.45; color: var(--n-text);
}
.wi-big {
  max-width: 900px; margin: 0 auto;
  font-family: var(--serif); font-size: clamp(36px, 5vw, 72px); line-height: 1.05; letter-spacing: -0.025em;
  color: var(--charcoal); text-align: center; text-wrap: balance;
}
.wi-body {
  max-width: 580px; margin: clamp(18px, 3vh, 26px) auto 0; text-align: center; text-wrap: balance;
  font-family: var(--serif); font-size: clamp(19px, 1.7vw, 23px); line-height: 1.5; color: var(--deep);
}
.wi-body + .apart { margin-top: clamp(40px, 7vh, 70px); }
.wi-still {
  margin-top: clamp(40px, 7vh, 70px); text-align: center;
  font-family: var(--serif); font-style: italic; font-size: clamp(26px, 3vw, 40px); color: var(--charcoal);
}

/* ─── Eido: the Eido scene, Eido's ink ────────────────────── */
.moment-eido { --eido-ink: #2c4756; position: relative; isolation: isolate; overflow: hidden; text-align: center; padding-top: clamp(100px, 16vh, 170px); padding-bottom: clamp(100px, 16vh, 170px); }
.eido-scene {
  position: absolute; inset: 0; z-index: -1;
  background: url("/assets/scenes/eido/mobile.webp") center 70% / cover no-repeat;
}
@media (min-width: 768px) { .eido-scene { background-image: url("/assets/scenes/eido/desktop.webp"); background-position: center 60%; } }
.eido-scene::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, var(--paper) 0%, color-mix(in srgb, var(--paper) 70%, transparent) 30%, color-mix(in srgb, var(--paper) 62%, transparent) 70%, var(--paper) 100%);
}
.wi-eido-h { font-family: var(--serif); font-weight: normal; font-size: clamp(48px, 7vw, 104px); line-height: 1; letter-spacing: -0.035em; }
.wi-eido-h a { color: var(--eido-ink); }
.wi-eido-line {
  max-width: 720px; margin: clamp(20px, 3.4vh, 30px) auto 0; text-wrap: balance;
  font-family: var(--serif); font-size: clamp(24px, 2.6vw, 34px); line-height: 1.3; color: var(--charcoal);
}

/* ─── The door ────────────────────────────────────────────── */
.wi-door { padding-top: clamp(130px, 22vh, 220px); }
.wi-door::before { display: none; } /* the homepage's tide-to-paper fade; this page is already paper above the door */
.wi-door .lead a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--driftwood) 45%, transparent); text-underline-offset: 3px; }
.wi-invite {
  max-width: 460px; margin: 22px auto 0; text-wrap: balance;
  font-size: 15px; line-height: 1.55; color: var(--deep);
}
.wi-door .wl-form { margin-top: 22px; }
.wi-cta {
  display: inline-block; margin-top: clamp(28px, 4vh, 40px);
  font-size: 15px; color: var(--paper); background: var(--charcoal);
  border-radius: 999px; padding: 14px 28px;
}
.wi-cta:hover { background: #3a332d; }

/* a solid bar once you're past the opening, so nothing shows through it */
.page-whatis .nav.is-solid { background: var(--paper); }

@media (max-width: 600px) {
  .resting .card:nth-child(n+3) { display: none; } /* two whole entries, not a fade mid-sentence */
  .resting .card { padding: 12px 14px; }
  .resting .card-body { font-size: 15px; line-height: 1.5; }
  .wi-lede { font-size: 22px; }
  .wi-open { padding-bottom: clamp(140px, 24vh, 220px); }
  .moment { padding-top: 56px; padding-bottom: 56px; }
  .moment-night { padding-top: 64px; padding-bottom: 64px; }
  .night { gap: 22px; }
  .night-mic { width: 84px; height: 84px; }
  .moment-line { margin-bottom: 24px; }
  .apart .gap { height: 36px; }
  .wi-door { padding-top: 96px; padding-bottom: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  .wi-type .caret { animation: none; }
  .night-saved { transition: none; }
}
