/* ============================================================
   The Chain - landing page styles
   Dark theme, teal-on-black to match the cover.
   Mobile-first, responsive, accessible. System fonts only.
   ============================================================ */

:root {
  --bg:        #0a0e0e;   /* near-black background */
  --bg-raised: #111717;   /* slightly lifted panels */
  --bg-card:   #0e1414;
  --teal:      #38e0d8;   /* primary accent */
  --teal-dim:  #2bb6af;   /* hover/darker accent */
  --teal-deep: #0d2f2c;   /* faint teal wash */
  --text:      #e8efee;   /* off-white body text */
  --text-mute: #9fb2b0;   /* muted secondary text */
  --line:      #1d2a29;   /* hairline borders */
  --focus:     #7df0ea;   /* focus ring */

  --maxw: 1080px;
  --maxw-narrow: 720px;
  --radius: 10px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
          Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;          /* ~17px */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a { color: var(--teal); }
a:hover { color: var(--teal-dim); }

p { margin: 0 0 1rem; }

/* ---- Accessibility helpers ---- */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--teal);
  color: #04100f;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius) 0;
  font-weight: 700;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
  color: #04100f;
}

/* Visible, high-contrast focus for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Layout containers ---- */

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
}
.container--narrow { max-width: var(--maxw-narrow); }

.section {
  padding-block: 3rem;
  border-top: 1px solid var(--line);
}

.section h2 {
  font-size: 1.6rem;
  line-height: 1.2;
  margin: 0 0 1rem;
  letter-spacing: 0.01em;
}
.section h2::after {
  content: "";
  display: block;
  width: 3rem;
  height: 3px;
  margin-top: 0.6rem;
  background: var(--teal);
  border-radius: 2px;
}

cite.title {
  font-style: italic;
  color: var(--text);
}

.note {
  color: var(--text-mute);
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease,
              border-color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--teal);
  color: #04100f;
  border-color: var(--teal);
}
.btn--primary:hover {
  background: var(--teal-dim);
  border-color: var(--teal-dim);
  color: #04100f;
}

.btn--secondary {
  background: transparent;
  color: var(--teal);
  border-color: var(--teal);
}
.btn--secondary:hover {
  background: var(--teal-deep);
  color: var(--teal);
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(56, 224, 216, 0.10), transparent 60%),
    radial-gradient(90% 60% at 0% 100%, rgba(56, 224, 216, 0.06), transparent 55%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}

.hero__inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 3.5rem 1.25rem;
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.hero__title {
  font-size: clamp(2.75rem, 9vw, 4.75rem);
  line-height: 1.02;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.hero__author {
  font-size: 1.15rem;
  color: var(--text-mute);
  margin: 0 0 1.5rem;
  letter-spacing: 0.04em;
}

.hero__tagline {
  font-size: clamp(1.15rem, 3.5vw, 1.5rem);
  line-height: 1.4;
  color: var(--text);
  max-width: 34ch;
  margin: 0 0 2rem;
  font-weight: 500;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hero__cover img {
  width: 100%;
  max-width: 340px;
  margin-inline: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow:
    0 0 0 1px rgba(56, 224, 216, 0.15),
    0 18px 50px rgba(0, 0, 0, 0.55);
}

/* ============================================================
   Hook (lede)
   ============================================================ */

.section--hook { padding-block: 2.5rem; }

.lede {
  font-size: clamp(1.25rem, 3.5vw, 1.7rem);
  line-height: 1.45;
  color: var(--text);
  max-width: 40ch;
  margin: 0 auto;
  text-align: center;
  font-weight: 500;
}

/* ============================================================
   Story / Why / generic prose sections
   ============================================================ */

.section--story p,
.section--why p { max-width: 60ch; }

.comps { color: var(--text-mute); }

/* ============================================================
   Author
   ============================================================ */

.author {
  display: grid;
  gap: 1.75rem;
  align-items: start;
}

.author__photo img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  object-position: top center;
  border-radius: 50%;
  border: 2px solid var(--teal);
}

.author__bio p { max-width: 60ch; }

/* ============================================================
   Early reader list (email capture)
   ============================================================ */

.section--signup {
  background: var(--bg-raised);
}

.signup-form { margin-top: 1.25rem; }

.signup-form__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.signup-form__input {
  flex: 1 1 240px;
  min-width: 0;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}
.signup-form__input::placeholder { color: #6d807e; }
.signup-form__input:focus {
  border-color: var(--teal);
}

.signup-form__consent {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-mute);
}
.signup-form__consent label {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  cursor: pointer;
}
.signup-form__consent input {
  margin-top: 0.2rem;
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--teal);
}
.signup-form__consent a { color: var(--teal); }

.signup-form__status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
}
.signup-form__status[data-state="success"] {
  background: var(--teal-deep);
  border: 1px solid var(--teal);
  color: var(--text);
}
.signup-form__status[data-state="error"] {
  background: #2a1414;
  border: 1px solid #b65b5b;
  color: #f3d9d9;
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2rem;
  color: var(--text-mute);
  font-size: 0.9rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--text-mute); text-decoration: underline; }
.site-footer a:hover { color: var(--teal); }

/* ============================================================
   Standalone pages (privacy)
   ============================================================ */

.page {
  max-width: var(--maxw-narrow);
  margin-inline: auto;
  padding: 3rem 1.25rem 4rem;
}
.page h1 { font-size: 2rem; line-height: 1.15; margin-top: 0; }
.page h2 { font-size: 1.3rem; margin-top: 2rem; }
.page a.back { display: inline-block; margin-bottom: 1.5rem; }

/* ============================================================
   Responsive: two-column layouts on wider screens
   ============================================================ */

@media (min-width: 720px) {
  .author {
    grid-template-columns: 160px 1fr;
    gap: 2.25rem;
    align-items: center;
  }
}

@media (min-width: 880px) {
  .hero__inner {
    grid-template-columns: 1.25fr 0.75fr;
    gap: 3.5rem;
    padding-block: 5rem;
  }
  .hero__cover { order: 2; }
  .hero__cover img { max-width: 320px; }
  .section { padding-block: 4rem; }
}

/* ============================================================
   Motion / contrast preferences
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
