:root {
  --canvas: #f2e7c1;
  --card-canvas: #f7f1da;
  --surface: #faf7ec;
  --surface-soft: #fdf9ea;
  --ink-strong: #2f2f2f;
  --ink-soft: #4a4a4a;
  --line: #d4c9b8;
  --accent: #fcbf04;
  --accent-rose: #e91e63;
  --focus: #1d4ed8;
  --shadow: 0 20px 50px rgba(47, 47, 47, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.65;
  background:
    linear-gradient(180deg, rgba(47, 47, 47, 0.88), rgba(47, 47, 47, 0.75)),
    radial-gradient(circle at 15% 10%, rgba(181, 219, 219, 0.6), transparent 34%),
    radial-gradient(circle at 90% 12%, rgba(246, 165, 166, 0.54), transparent 28%),
    linear-gradient(180deg, #faf7ec 0%, #f2e7c1 52%, #f7efd0 100%);
  background-blend-mode: multiply, screen, screen, normal;
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 46px;
}

.page-hero,
.notify-card,
.support-card,
.story-controls,
.story-rail,
.chapter-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.page-hero {
  background: var(--canvas);
  border-radius: 26px;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.welcome-card__details {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(250, 247, 236, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  padding: 16px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: start;
}

.welcome-card__details--brand-only {
  grid-template-columns: 1fr;
  grid-column: 2;
  grid-row: 1 / span 3;
  justify-items: center;
  align-self: center;
  justify-self: end;
  margin-top: 0;
}

.welcome-card__details-copy {
  display: grid;
  gap: 14px;
}

.welcome-card__section {
  display: grid;
  gap: 8px;
}

.welcome-card__heading {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ff9100;
}

.muted {
  margin: 0;
  color: var(--ink-soft);
}

.welcome-card__contacts {
  display: grid;
  gap: 8px;
}

.welcome-card__contact-row {
  margin: 0;
  display: grid;
  gap: 4px;
}

.welcome-card__contact-label {
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

.welcome-card__contact-row a {
  color: #115e59;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.welcome-card__brandmark {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(242, 231, 193, 0.4);
  align-self: stretch;
}

.welcome-card__logo-shell {
  width: 220px;
  height: 220px;
  border-radius: 42px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.16), rgba(190, 18, 60, 0.14));
  border: 1px solid rgba(47, 47, 47, 0.12);
  overflow: hidden;
}

.welcome-card__logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 1.0;
}

.eyebrow {
  margin: 0;
  color:  #ff9100;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3.2vw, 2.3rem);
}

.summary {
  margin: 0;
  color: var(--ink-soft);
  max-width: 80ch;
}

.summary-stack {
  display: grid;
  gap: 10px;
}

.notify-card,
.support-card {
  margin-top: 14px;
  background: rgba(250, 247, 236, 0.94);
  padding: 16px;
}

.notify-card h2,
.support-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.page-shell h2 {
  color: var(--accent-rose);
}

.notify-card p,
.support-card p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  max-width: 78ch;
}

.longform-copy p {
  max-width: none;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 1.28rem;
  line-height: 1.75;
}

.notify-card__grid {
  margin-top: 10px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr);
  align-items: start;
}

.notify-card__contacts {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(253, 249, 234, 0.7);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.notify-card__contacts .welcome-card__heading {
  margin: 0;
}

.notify-form {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  max-width: 620px;
}

.notify-form label {
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 600;
}

.notify-form__row {
  display: flex;
  gap: 8px;
}

.notify-form input[type="email"] {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink-strong);
  font: inherit;
}

.notify-form button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--surface-soft);
  color: var(--ink-strong);
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.notify-form__consent {
  display: flex;
  align-items: start;
  gap: 8px;
  font-weight: 400;
  color: var(--ink-soft);
}

.form-note {
  margin: 4px 0 0;
  font-size: 0.88rem;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.privacy-note {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.form-status {
  margin: 6px 0 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface-soft);
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.form-status--success {
  border-color: rgba(15, 118, 110, 0.45);
  background: rgba(15, 118, 110, 0.1);
  color: #115e59;
}

.form-status--error {
  border-color: rgba(190, 18, 60, 0.45);
  background: rgba(190, 18, 60, 0.1);
  color: #881337;
}

.honeypot {
  position: absolute;
  left: -9999px;
}

.story-controls {
  margin-top: 18px;
  padding: 14px;
  background: rgba(250, 247, 236, 0.92);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.story-controls button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--surface-soft);
  color: var(--ink-strong);
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 700;
}

.story-controls__progress {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
}

.story-layout {
  margin-top: 18px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
}

.story-rail {
  background: var(--card-canvas);
  padding: 14px;
  align-self: start;
  position: sticky;
  top: 14px;
}

.story-rail h2 {
  margin: 0;
  font-size: 1.05rem;
}

.story-rail p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.9rem;
}

.chapter-rail-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.chapter-rail-item {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink-strong);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: center;
  text-align: left;
}

.chapter-rail-item__number {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
}

.chapter-rail-item__name {
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-strong);
}

.chapter-rail-item:disabled {
  opacity: 1;
  color: var(--ink-strong);
}

.chapter-rail-item__chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.chapter-rail-item__chip--canary {
  background: rgba(15, 118, 110, 0.14);
  color: #115e59;
}

.chapter-rail-item__chip--grey {
  background: rgba(217, 119, 6, 0.14);
  color: #9a3412;
}

.chapter-rail-item__chip--harm {
  background: rgba(190, 18, 60, 0.14);
  color: #881337;
}

.chapter-rail-item--active {
  border-color: rgba(47, 47, 47, 0.45);
}

.chapter-card {
  background: rgba(250, 247, 236, 0.96);
  padding: 18px;
}

.chapter-card__header {
  display: grid;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.chapter-label {
  margin: 0;
  color:  #ff9100;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.chapter-card__header h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
}

.chapter-subtitle {
  margin: 0;
  color: var(--ink-soft);
}

.chapter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chapter-meta span {
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.chapter-section {
  margin-top: 14px;
}

.chapter-section h3 {
  margin: 0 0 8px;
}

.chapter-section--split {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.moment-stack {
  display: grid;
  gap: 10px;
}

.moment-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--surface);
}

.moment-card__header h4 {
  margin: 4px 0 0;
}

.moment-card__year {
  margin: 0;
  color: #78350f;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pill-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--surface-soft);
  font-size: 0.85rem;
}

.placeholder-line {
  height: 0.75rem;
  background: linear-gradient(90deg, rgba(212, 201, 184, 0.45), rgba(212, 201, 184, 0.8), rgba(212, 201, 184, 0.45));
  border-radius: 999px;
  margin: 8px 0;
}

.placeholder-line--short {
  width: 70%;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .page-hero {
    grid-template-columns: 1fr;
  }

  .welcome-card__details {
    grid-template-columns: 1fr;
  }

  .welcome-card__details--brand-only {
    grid-column: auto;
    grid-row: auto;
    justify-self: center;
    margin-top: 10px;
  }

  .notify-card__grid {
    grid-template-columns: 1fr;
  }

  .story-layout {
    grid-template-columns: 1fr;
  }

  .story-controls {
    flex-wrap: wrap;
    justify-content: center;
  }

  .story-controls__progress {
    width: 100%;
    text-align: center;
  }

  .story-rail {
    position: static;
  }

  .chapter-section--split {
    grid-template-columns: 1fr;
  }

  .notify-form__row {
    flex-direction: column;
  }
}
