/* Emergence with Leroy "Roy" Dingle
   Layout idea: a Lowcountry tide. Pages open on dark estuary water and rise into pale marsh light for reading.
   All colors and fonts are set here, once. */

:root {
  --estuary: #0f2a2e;      /* deep water: page tops, footer */
  --estuary-2: #1a3d42;    /* lines on water */
  --foam: #e9eee9;         /* light reading ground */
  --sand: #dfe4d9;         /* alternate band */
  --panel: #f6f8f4;        /* raised surfaces */
  --ink: #15292c;
  --ink-soft: #4d6064;
  --spartina: #5f6a2f;     /* marsh grass: small labels */
  --ember: #d39a3c;        /* low sun on water: the one accent */
  --ember-hi: #e2ab4f;
  --rule: #c7d0c7;
  --on-water: #e8efe9;
  --on-water-soft: #a9bdb8;

  --display: "Young Serif", "Iowan Old Style", Georgia, serif;
  --text: "Newsreader", "Iowan Old Style", Georgia, serif;

  --measure: 36rem;
  --wide: 72rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --foam: #11211f; --sand: #162926; --panel: #1a2e2b; --ink: #e3ebe5; --ink-soft: #9fb2ad;
    --spartina: #b2bb76; --rule: #2c403d; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --foam: #11211f; --sand: #162926; --panel: #1a2e2b; --ink: #e3ebe5; --ink-soft: #9fb2ad;
  --spartina: #b2bb76; --rule: #2c403d; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--foam); color: var(--ink);
  font-family: var(--text); font-size: 1.1875rem; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 0.25em; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.1; }
h3 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); line-height: 1.2; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Bands carry the side gutter; .inner sets the width */
.band { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.inner { max-width: var(--wide); margin: 0 auto; }
.section { padding-block: clamp(4rem, 9vw, 7rem); }
.sand { background: var(--sand); }
.water { background: var(--estuary); color: var(--on-water); }
.label { font-style: italic; color: var(--spartina); font-size: 1rem; }
.water .label { color: var(--ember); }
.stack { display: grid; gap: 1.2rem; }
.prose { display: grid; gap: 1.2rem; max-width: var(--measure); }
.soft { color: var(--ink-soft); }
.water .soft { color: var(--on-water-soft); }

/* ---------- Header ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--estuary); }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--estuary); color: var(--on-water); border-bottom: 1px solid var(--estuary-2); }
.top .inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.9rem; position: relative; }
.mark { font-family: var(--display); font-size: 1.25rem; text-decoration: none; letter-spacing: 0.02em; white-space: nowrap; }
.mark span { color: var(--on-water-soft); font-family: var(--text); font-style: italic; font-size: 0.95rem; margin-left: 0.5rem; letter-spacing: 0; }
.nav { display: flex; gap: 1.4rem; align-items: center; font-size: 1rem; }
.nav a { text-decoration: none; color: var(--on-water-soft); padding-block: 0.25rem; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--on-water); }
.nav a[aria-current="page"] { color: var(--on-water); border-bottom-color: var(--ember); }
.menu-btn { display: none; background: none; border: 1px solid var(--estuary-2); color: var(--on-water); font: 1rem var(--text); padding: 0.4rem 0.9rem; border-radius: 999px; cursor: pointer; }
@media (max-width: 900px) {
  .mark span { display: none; }
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--estuary); padding: 0.5rem 0 1.25rem; border-bottom: 1px solid var(--estuary-2); }
  .nav.open { display: flex; }
  .nav a { padding: 0.75rem 0; font-size: 1.1rem; border-bottom: 1px solid var(--estuary-2); }
  .nav a[aria-current="page"] { border-bottom-color: var(--estuary-2); color: var(--ember); }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font: 500 1rem/1.1 var(--text); text-decoration: none; cursor: pointer; padding: 0.95rem 1.4rem; border-radius: 999px; border: 1px solid transparent; text-align: center; }
.btn-ember { background: var(--ember); color: #1a1408; }
.btn-ember:hover { background: var(--ember-hi); }
.btn-ghost { border-color: var(--on-water-soft); color: var(--on-water); background: none; }
.btn-ghost:hover { border-color: var(--on-water); }
.btn-ink { background: var(--ink); color: var(--foam); }
.btn-ink:hover { opacity: 0.9; }
.btn-ink:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-line { border-color: var(--rule); color: var(--ink); background: none; }
.btn-line:hover { border-color: var(--ink); }
.actions { display: flex; gap: 0.85rem; flex-wrap: wrap; align-items: center; }

/* ---------- Home hero: headline and its reflection ---------- */
.hero { overflow: hidden; }
.hero .inner { padding-block: clamp(3.5rem, 9vw, 7rem) 0; }
.headline, .reflection { font-family: var(--display); font-size: clamp(3rem, 10.5vw, 8.4rem); line-height: 0.98; letter-spacing: -0.025em; margin: 0; }
.waterline { height: 1px; background: var(--on-water-soft); opacity: 0.5; margin-top: 0.6rem; transform-origin: left; animation: draw 1.6s ease-out both; }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.reflection-wrap { height: clamp(5.5rem, 15vw, 11rem); overflow: hidden; }
.reflection { transform: scaleY(-1); opacity: 0.22; filter: url(#ripple); user-select: none; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 35%, #000 100%); mask-image: linear-gradient(to bottom, transparent 35%, #000 100%); }
.hero-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: end; padding-block: 0 clamp(3rem, 6vw, 4.5rem); }
.hero-foot p { max-width: 32rem; color: var(--on-water-soft); font-size: 1.25rem; }
.hero-foot strong { color: var(--on-water); font-weight: 400; }
@media (max-width: 760px) { .hero-foot { grid-template-columns: 1fr; } }

/* ---------- Inner page heading ---------- */
.page-head .inner { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2.75rem, 6vw, 4.5rem); display: grid; gap: 1rem; }
.page-head h1 { font-size: clamp(2.6rem, 6.5vw, 5rem); line-height: 1.02; letter-spacing: -0.02em; max-width: 16ch; }
.page-head p.lede { color: var(--on-water-soft); font-size: 1.25rem; max-width: 34rem; }
.page-head .waterline { max-width: 100%; margin-top: 0.5rem; }

/* ---------- Two-column layouts ---------- */
.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.split.center { align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.pull { font-family: var(--display); font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.25; }

/* ---------- Books ---------- */
.book-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 4.5rem); }
@media (max-width: 860px) { .book-row { grid-template-columns: 1fr; } }
.book { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 1.75rem; align-items: start; }
.cover { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; box-shadow: 0 1.25rem 2.5rem -1rem rgba(10, 30, 30, 0.55); }
.book .meta { display: grid; gap: 0.7rem; min-width: 0; }
.book p.soft { font-size: 1.05rem; }
@media (max-width: 480px) { .book { grid-template-columns: 1fr; } .book .cover { max-width: 12rem; } }

.book-detail { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
@media (max-width: 760px) { .book-detail { grid-template-columns: 1fr; } .book-detail .cover { max-width: 16rem; } }

.formats { list-style: none; padding: 0; margin: 0.5rem 0 0; border-top: 1px solid var(--rule); }
.formats li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 0.95rem 0; border-bottom: 1px solid var(--rule); }
.formats .what { display: grid; }
.formats .what small { color: var(--ink-soft); font-size: 0.95rem; }
.formats a { white-space: nowrap; }
@media (max-width: 480px) { .formats li { grid-template-columns: 1fr; } }

/* ---------- Audiobooks ---------- */
.audio-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
@media (max-width: 860px) { .audio-row { grid-template-columns: 1fr; } }
.audio-card { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: clamp(1.25rem, 3vw, 2rem); display: grid; gap: 1.25rem; align-content: start; }
.audio-top { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.audio-top .stack { gap: 0.4rem; }
.facts-line { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; font-size: 0.95rem; color: var(--ink-soft); }
.sample { display: grid; gap: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.sample audio { width: 100%; }
.sample .missing { font-size: 0.95rem; color: var(--ink-soft); font-style: italic; }
.audio-card .buy { display: grid; gap: 0.6rem; }
.audio-card .buy small { color: var(--ink-soft); font-size: 0.92rem; }
.also { font-size: 0.98rem; color: var(--ink-soft); }

.steps-row { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; counter-reset: s; }
.steps-row li { counter-increment: s; display: grid; gap: 0.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.steps-row li::before { content: counter(s); font-family: var(--display); font-size: 1.6rem; color: var(--ember); line-height: 1; }
@media (max-width: 760px) { .steps-row { grid-template-columns: 1fr; } }

.faq { display: grid; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); padding: 1rem 0; }
.faq summary { cursor: pointer; font-family: var(--display); font-size: 1.2rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ember); font-family: var(--text); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin-top: 0.75rem; color: var(--ink-soft); max-width: var(--measure); }

/* ---------- Reflection tool ---------- */
.tool { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: 1.5rem; background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: clamp(1.25rem, 3vw, 2.25rem); }
.gauge { position: relative; border-left: 1px solid var(--rule); display: grid; grid-template-rows: repeat(4, 1fr); min-height: 18rem; }
.gauge span { font-size: 0.8rem; color: var(--ink-soft); padding-left: 0.45rem; align-self: end; line-height: 1; font-variant-numeric: tabular-nums; }
.gauge .fill { position: absolute; left: -2px; bottom: 0; width: 3px; background: var(--ember); height: 25%; transition: height 0.6s ease; }
.tool-body { display: grid; gap: 1.1rem; min-width: 0; }
.tool .step { font-style: italic; color: var(--spartina); font-size: 1rem; }
textarea, input, select { width: 100%; font: 1.05rem/1.5 var(--text); color: var(--ink); background: var(--foam); border: 1px solid var(--rule); border-radius: 4px; padding: 0.8rem 1rem; }
textarea { min-height: 9rem; resize: vertical; line-height: 1.6; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--ember); outline-offset: -1px; }
.tool-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.linkish { background: none; border: 0; padding: 0.5rem 0; font: 1rem var(--text); color: var(--ink-soft); text-decoration: underline; text-underline-offset: 0.25em; cursor: pointer; }
.linkish:disabled { opacity: 0.35; cursor: default; }
.summary dl { margin: 0; display: grid; gap: 1rem; }
.summary dt { font-style: italic; color: var(--spartina); font-size: 0.95rem; }
.summary dd { margin: 0.2rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.status { font-size: 0.95rem; color: var(--ink-soft); min-height: 1.4em; }

/* ---------- Watch prompts ---------- */
.prompts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--estuary-2); }
.prompts li { padding: 1.75rem 1.5rem 0 0; display: grid; gap: 0.75rem; align-content: start; }
.prompts li + li { padding-left: 1.5rem; border-left: 1px solid var(--estuary-2); }
.prompts .theme { font-style: italic; color: var(--on-water-soft); font-size: 1rem; }
.prompts p { color: var(--on-water-soft); font-size: 1.02rem; }
@media (max-width: 860px) { .prompts { grid-template-columns: 1fr; } .prompts li + li { border-left: 0; padding-left: 0; border-top: 1px solid var(--estuary-2); } .prompts li { padding-bottom: 1.5rem; } }
.video-slot { aspect-ratio: 16 / 9; max-width: 100%; background: var(--estuary); color: var(--on-water-soft); display: grid; place-items: center; text-align: center; padding: 1.5rem; border-radius: 6px; font-size: 1rem; }
.video-slot iframe { width: 100%; height: 100%; border: 0; border-radius: 6px; }

/* ---------- Portrait & bio ---------- */
.portrait { margin: 0; }
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 25%; border-radius: 4px; }
.portrait figcaption { font-style: italic; color: var(--ink-soft); font-size: 0.95rem; margin-top: 0.75rem; }
.table-wrap { overflow-x: auto; }
.tide-table { width: 100%; border-collapse: collapse; font-size: 1.02rem; }
.tide-table caption { text-align: left; font-style: italic; color: var(--spartina); padding-bottom: 0.6rem; font-size: 0.95rem; }
.tide-table th, .tide-table td { text-align: left; padding: 0.7rem 0.75rem 0.7rem 0; border-top: 1px solid var(--rule); vertical-align: top; }
.tide-table th { font-weight: 500; white-space: nowrap; width: 8.5rem; }
.tide-table td { color: var(--ink-soft); }

/* ---------- Speaking ---------- */
.topics { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.topic { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1rem 3rem; padding: 2rem 0; border-bottom: 1px solid var(--rule); }
.topic p { color: var(--ink-soft); }
@media (max-width: 760px) { .topic { grid-template-columns: 1fr; } }
.formats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.formats-grid > div { display: grid; gap: 0.5rem; align-content: start; padding-top: 1.25rem; border-top: 1px solid var(--estuary-2); }
@media (max-width: 760px) { .formats-grid { grid-template-columns: 1fr; } }
.form { display: grid; gap: 1.1rem; background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: clamp(1.25rem, 3vw, 2.25rem); }
.form .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }
.form label { display: grid; gap: 0.35rem; font-size: 1rem; }
.form label span { color: var(--ink-soft); }

/* ---------- Closing band & footer ---------- */
.close .inner { padding-block: clamp(3.5rem, 7vw, 5.5rem) 2.5rem; display: grid; gap: 2rem; }
.close .line { font-family: var(--display); font-size: clamp(1.9rem, 4.6vw, 3.3rem); line-height: 1.1; max-width: 22ch; }
.close .sig { font-style: italic; color: var(--ember); font-size: 1.3rem; }
.site-foot { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; font-size: 0.95rem; color: var(--on-water-soft); border-top: 1px solid var(--estuary-2); padding-top: 1.5rem; margin-top: 1rem; }
.site-foot nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-foot a { color: var(--on-water-soft); text-decoration: none; }
.site-foot a:hover { color: var(--on-water); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .waterline { animation: none; }
  .gauge .fill { transition: none; }
}

/* Pre-launch placeholder for a buy button that has no link yet */
.soon { display: inline-flex; align-items: center; justify-content: center; padding: 0.9rem 1.3rem; border-radius: 999px; border: 1px dashed var(--rule); color: var(--ink-soft); font-size: 1rem; font-style: italic; white-space: nowrap; }

/* Beach photo band: the photo fades into the water on its right; the tide line sits beside it */
.shore { line-height: normal; }
.shore-photo { margin: 0 auto; max-width: 1400px; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: center; }
.shore-photo img { width: 100%; aspect-ratio: 1024 / 571; object-fit: cover;
  -webkit-mask-image: linear-gradient(to right, #000 62%, transparent 100%); mask-image: linear-gradient(to right, #000 62%, transparent 100%); }
.shore-photo .pull { padding: 2rem max(16px, env(safe-area-inset-right, 0px)) 2rem 1rem; color: var(--on-water); max-width: 18em; }
@media (max-width: 760px) {
  .shore-photo { grid-template-columns: 1fr; }
  .shore-photo img { -webkit-mask-image: linear-gradient(to bottom, #000 75%, transparent 100%); mask-image: linear-gradient(to bottom, #000 75%, transparent 100%); }
  .shore-photo .pull { padding: 0.5rem max(16px, env(safe-area-inset-right, 0px)) 2.5rem max(16px, env(safe-area-inset-left, 0px)); max-width: none; }
}

/* Logo */
.mark { display: inline-flex; align-items: center; gap: 0.7rem; }
.mark img { width: 40px; height: 40px; flex: none; }
.sign-off { display: flex; align-items: center; gap: 1rem; }
.sign-off img { width: 72px; height: 72px; }
