/* ==========================================================================
   JD Bright — The Resilient Mind
   Shared stylesheet for index.html and support.html
   ========================================================================== */

:root {
  --paper:  #F1F3F0;   /* page background — pale mist */
  --wash:   #E3E8E3;   /* quiet section background */
  --ink:    #17252A;   /* deep petrol, primary text */
  --stone:  #5E6E6B;   /* secondary text */
  --hair:   #C9D2CC;   /* hairline rules */
  --accent: #3E7C6E;   /* muted teal-green */

  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --body: "Karla", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", monospace;

  --measure: 34rem;    /* comfortable reading width */
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1rem, 0.97rem + 0.2vw, 1.075rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }

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

.wrap {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 10;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* --- Masthead ------------------------------------------------------------ */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.75rem 0;
}

.wordmark {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.masthead nav a {
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 500;
  text-decoration: none;
  color: var(--stone);
}
.masthead nav a:hover,
.masthead nav a[aria-current="page"] { color: var(--accent); }

/* --- Hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  padding-block: clamp(3.5rem, 11vh, 7rem) clamp(3.5rem, 9vh, 6rem);
  overflow: hidden;
  display: grid;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  align-items: center;
}

@media (min-width: 56rem) {
  .hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }
}

/* Signature element: a still-pond ripple behind the title.
   Stillness after the thought lands — the book's whole idea, drawn once. */
.ripple {
  position: absolute;
  top: 46%;
  left: 50%;
  translate: -50% -50%;
  width: min(46rem, 130%);
  aspect-ratio: 1;
  pointer-events: none;
  z-index: 0;
}
.ripple circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 0.35;
  opacity: 0;
  transform-origin: 50% 50%;
  animation: spread 14s cubic-bezier(0.16, 0.6, 0.3, 1) infinite;
}
.ripple circle:nth-child(2) { animation-delay: 3.5s; }
.ripple circle:nth-child(3) { animation-delay: 7s; }
.ripple circle:nth-child(4) { animation-delay: 10.5s; }

@keyframes spread {
  0%   { scale: 0.12; opacity: 0; }
  12%  { opacity: 0.5; }
  100% { scale: 1; opacity: 0; }
}

.hero > *:not(.ripple) { position: relative; z-index: 1; }

@media (min-width: 56rem) {
  .ripple {
    top: 50%;
    left: auto;
    right: 4%;
    translate: 0 -50%;
    width: min(34rem, 46%);
  }
}

/* Book cover */
.cover {
  margin: 0;
  justify-self: center;
}
.cover img {
  display: block;
  width: 100%;
  max-width: 20rem;
  height: auto;
  border-radius: 2px;
  box-shadow:
    0 1px 2px rgba(23, 37, 42, 0.10),
    0 18px 40px -12px rgba(23, 37, 42, 0.28);
}

/* Call to action */
.cta-row { margin: 2.25rem 0 0; }
.cta-row--center { margin-top: 2.5rem; text-align: center; }

.cta {
  display: inline-block;
  font-family: var(--body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 0.85rem 1.6rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.cta:hover,
.cta:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.greeting {
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  margin: 0 0 1.4rem;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.6rem, 1.4rem + 6vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 18ch;
}
.hero h1 .sub {
  display: block;
  font-style: italic;
  font-weight: 200;
  font-size: 0.5em;
  letter-spacing: 0;
  color: var(--stone);
  margin-top: 0.5rem;
}

.hero .promise {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.5rem);
  line-height: 1.5;
  color: var(--ink);
  max-width: 30ch;
  margin: 2.25rem 0 0;
}

/* Load-in: lines settle rather than arrive. */
.settle { opacity: 0; animation: settle 1.1s ease-out forwards; }
.settle-1 { animation-delay: 0.05s; }
.settle-2 { animation-delay: 0.25s; }
.settle-3 { animation-delay: 0.5s; }

@keyframes settle {
  from { opacity: 0; transform: translateY(0.6rem); }
  to   { opacity: 1; transform: none; }
}

/* --- Sections ------------------------------------------------------------ */

.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section--wash { background: var(--wash); }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.75rem;
}

.section h2 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 1.5rem;
  max-width: 24ch;
}

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.15rem; color: var(--stone); }
.prose p:last-child { margin-bottom: 0; }
.prose .lead { color: var(--ink); }

/* Statement list — hairline rows, no bullets, no false numbering */
.statements {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  max-width: 46rem;
  border-top: 1px solid var(--hair);
}
.statements li {
  border-bottom: 1px solid var(--hair);
  padding: 1.15rem 0 1.15rem 1.9rem;
  position: relative;
}
.statements li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.85rem;
  width: 0.7rem;
  height: 1px;
  background: var(--accent);
}

/* Benefits — nine paired statements */
.benefits {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0;
  grid-template-columns: 1fr;
}
.benefits li {
  padding: 1.4rem 0;
  border-top: 1px solid var(--hair);
}
.benefits li:last-child { border-bottom: 1px solid var(--hair); }
.benefits b {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
}
.benefits span { color: var(--stone); }

@media (min-width: 48rem) {
  .benefits {
    grid-template-columns: 1fr 1fr;
    column-gap: 3.5rem;
  }
  .benefits li:nth-last-child(2) { border-bottom: 1px solid var(--hair); }
}

/* --- Closing line -------------------------------------------------------- */

.closing { padding-block: clamp(4rem, 10vw, 7rem); text-align: center; }
.closing p {
  font-family: var(--display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.4rem, 1rem + 2vw, 2.4rem);
  line-height: 1.35;
  max-width: 22ch;
  margin: 0 auto;
}

/* --- Support page -------------------------------------------------------- */

.support-intro { max-width: var(--measure); }
.support-intro p { color: var(--stone); }

.addresses {
  margin: 3rem 0 0;
  max-width: 46rem;
  border-top: 1px solid var(--hair);
}

.address {
  border-bottom: 1px solid var(--hair);
  padding: 1.5rem 0;
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 40rem) {
  .address {
    grid-template-columns: 6rem 1fr auto;
    align-items: center;
    gap: 1.5rem;
  }
}

.ticker {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.ticker small {
  display: block;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--stone);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.address code {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
  word-break: break-all;
  color: var(--ink);
}

.copy {
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 2px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  justify-self: start;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.copy:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.copy[data-copied="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.note {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--stone);
  max-width: 46rem;
}

/* --- Footer -------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--hair);
  padding-block: 2.25rem 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--stone);
}
.site-footer a { text-decoration: none; }
.site-footer p { margin: 0; }

/* --- Motion preference --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .settle { opacity: 1; animation: none; }
  .ripple circle { animation: none; opacity: 0.18; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
