/* ============================================================
   takeofftogether.org — flagship stylesheet
   Dawn hero, manifesto, principles, email capture.
   ============================================================ */

:root {
  --paper:   #F7F0E1;   /* warm cream, the page ground */
  --ink:     #23201C;   /* warm near-black text */

  --predawn: #2E2A4E;   /* deep predawn indigo (top of sky) */
  --violet:  #6B4E7A;   /* violet */
  --rose:    #E4735A;   /* rose */
  --amber:   #F0A63C;   /* amber (CTA + accent) */

  --sky: linear-gradient(
    180deg,
    var(--predawn) 0%,
    var(--violet)  32%,
    var(--rose)    64%,
    var(--amber)   84%,
    var(--paper)   100%
  );

  --ink-soft: #4A443C;     /* secondary text on paper */
  --ink-faint: #6E6457;    /* tertiary text on paper */
  --paper-warm: #FBF6EA;   /* slightly lighter cream for cards */
  --rule: rgba(35, 32, 28, 0.16);

  --maxw: 68rem;
  --maxw-prose: 38rem;

  --ff-display: "Spectral", Georgia, "Times New Roman", serif;
  --ff-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ----------------------------- reset ----------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--ff-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--ff-display); font-weight: 800; line-height: 1.08; }
p { margin: 0; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 3px; border-radius: 2px; }

/* ============================================================ HERO */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--sky);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(4rem, 12vh, 9rem) 1.5rem 5rem;
}

/* soft scrim so hero text keeps AA contrast across the gradient */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 70% at 50% 18%, rgba(46, 42, 78, 0.55) 0%, rgba(46, 42, 78, 0) 62%),
    linear-gradient(180deg, rgba(46, 42, 78, 0) 38%, rgba(46, 42, 78, 0.18) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 18ch;
  color: var(--paper);
  text-shadow: 0 2px 14px rgba(46, 42, 78, 0.35);
}

.hero__eyebrow {
  font-family: var(--ff-body);
  font-weight: 600;
  font-size: clamp(0.7rem, 1.6vw, 0.95rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(247, 240, 225, 0.92);
  margin-bottom: clamp(1.2rem, 3.5vh, 2.2rem);
}

.hero__title {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: clamp(3rem, 11vw, 7.5rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0 0 clamp(1.1rem, 3vw, 1.8rem);
}

.hero__subhead {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: clamp(1.05rem, 2.6vw, 1.7rem);
  line-height: 1.35;
  font-style: italic;
  color: rgba(247, 240, 225, 0.96);
  max-width: 26ch;
  margin: 0 auto;
}

/* ---- the rising formation (inline SVG) ---- */
.formation {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 11%;
  width: 100%;
  height: 46%;
  z-index: 1;
  overflow: visible;
}
.formation use {
  fill: var(--paper);
  /* soft shadow reads the flock against any part of the dawn */
  filter: drop-shadow(0 2px 3px rgba(46, 42, 78, 0.45))
          drop-shadow(0 0 1px rgba(46, 42, 78, 0.5));
  opacity: 0.92;
}
.formation use:nth-child(odd) { opacity: 0.86; }
.formation use:nth-child(3n)  { opacity: 0.95; }

/* ---- scroll cue ---- */
.scroll-cue {
  position: absolute;
  z-index: 2;
  bottom: clamp(1.2rem, 4vh, 2.4rem);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--paper);
  font-family: var(--ff-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.92;
}
.scroll-cue__label { text-shadow: 0 1px 6px rgba(46, 42, 78, 0.4); }
.scroll-cue__arrow {
  font-size: 1.1rem;
  line-height: 1;
  animation: nudge 2.2s ease-in-out infinite;
}
.scroll-cue:hover { opacity: 1; }

/* ============================================================ MANIFESTO */
.manifesto {
  background: var(--paper);
  padding: clamp(4.5rem, 11vh, 8rem) 1.5rem;
}
.manifesto__inner {
  max-width: var(--maxw-prose);
  margin: 0 auto;
}
.manifesto__lead {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3.4vw, 2.15rem);
  line-height: 1.32;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 1.8rem;
}
.manifesto p {
  font-family: var(--ff-display);
  font-weight: 500;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}
.manifesto p:last-child { margin-bottom: 0; }
.manifesto em {
  font-style: italic;
  font-weight: 700;
  color: var(--ink);
}

/* ----------------------------- divider ----------------------------- */
.divider {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0;
  background: var(--paper);
  color: var(--amber);
}
.divider svg {
  width: 2.4rem;
  height: auto;
  opacity: 0.9;
}

/* ============================================================ PRINCIPLES */
.principles {
  background: var(--paper);
  padding: clamp(2rem, 6vh, 4rem) 1.5rem clamp(4.5rem, 11vh, 8rem);
}
.principles__heading {
  max-width: var(--maxw);
  margin: 0 auto 2.5rem;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -0.015em;
  color: var(--ink);
  font-style: italic;
}
.principles__list {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(2rem, 5vw, 3.5rem) clamp(2rem, 5vw, 4rem);
}
.principle__title {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 0.55rem;
  position: relative;
  padding-top: 0.2rem;
}
.principle__title::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2.2rem;
  height: 3px;
  background: var(--amber);
  border-radius: 2px;
}
.principle__line {
  font-family: var(--ff-body);
  font-weight: 400;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 32ch;
}

/* ============================================================ JOIN */
.join {
  background: var(--paper);
  padding: clamp(4rem, 10vh, 7rem) 1.5rem;
}
.join__inner {
  max-width: 36rem;
  margin: 0 auto;
  text-align: center;
}
.join__invitation {
  font-family: var(--ff-display);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(1.5rem, 3.6vw, 2.3rem);
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 2rem;
}
.join__form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: stretch;
  margin: 0 auto;
  max-width: 30rem;
}
.join__field {
  flex: 1 1 16rem;
  display: flex;
  flex-direction: column;
  text-align: left;
}
.join__label {
  font-family: var(--ff-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
  padding-left: 0.1rem;
}
.join__input {
  font: inherit;
  font-size: 1.05rem;
  font-family: var(--ff-body);
  padding: 0.85rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--paper-warm);
  color: var(--ink);
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.join__input::placeholder { color: rgba(35, 32, 28, 0.4); }
.join__input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(240, 166, 60, 0.35);
}
.join__button {
  flex: 0 0 auto;
  align-self: flex-end;
  font-family: var(--ff-body);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  padding: 0.85rem 1.6rem;
  background: var(--amber);
  color: var(--ink);
  border: 2px solid var(--amber);
  border-radius: 4px;
  transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}
.join__button:hover { background: #E89A2C; border-color: #E89A2C; }
.join__button:active { transform: translateY(1px); }
.join__button:focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 3px;
}
.join__button[aria-busy="true"] {
  background: #D89324;
  border-color: #D89324;
  cursor: progress;
}

.join__status {
  flex: 1 0 100%;
  min-height: 1.4rem;
  margin: 0.85rem 0 0;
  font-family: var(--ff-body);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-soft);
}
.join__status.is-success { color: #5d4a1a; }
.join__status.is-error   { color: #9a3a26; }
.join__status.is-busy    { color: var(--ink-faint); }

/* ============================================================ FOOTER */
.footer {
  background: var(--paper);
  padding: clamp(2.5rem, 6vh, 4rem) 1.5rem;
  text-align: center;
  border-top: 1px solid var(--rule);
}
.footer__line {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  color: var(--ink);
  margin-bottom: 0.6rem;
}
.footer__links {
  font-family: var(--ff-body);
  font-size: 0.92rem;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}
.footer__link {
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.footer__link:hover { color: var(--ink); border-color: var(--amber); }
.footer__sep { color: var(--ink-faint); opacity: 0.6; }

/* ============================================================ LOAD MOTION
   One quiet, orchestrated moment: the sky settles (hero content fades up)
   and the formation drifts upward into place. Only when motion is allowed.
   Default (no-animation) state is the fully-composed final state. */
@media (prefers-reduced-motion: no-preference) {
  .hero__eyebrow,
  .hero__title,
  .hero__subhead,
  .scroll-cue {
    opacity: 0;
    transform: translateY(18px);
    animation: settle 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  }
  .hero__eyebrow { animation-delay: 0.15s; }
  .hero__title   { animation-delay: 0.30s; }
  .hero__subhead { animation-delay: 0.50s; }
  .scroll-cue    { animation-delay: 0.85s; }

  .formation__group {
    transform: translateY(54px);
    opacity: 0;
    animation: rise 2.8s cubic-bezier(0.16, 0.52, 0.25, 1) forwards;
    animation-delay: 0.35s;
  }

  @keyframes settle {
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes rise {
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes nudge {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(5px); }
  }
}

/* When motion is reduced, show the composed state; keep the scroll-cue still. */
@media (prefers-reduced-motion: reduce) {
  .scroll-cue__arrow { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* ============================================================ RESPONSIVE */
@media (max-width: 600px) {
  .principles__list {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }
  .hero__content { max-width: 22ch; }
  .join__form { flex-direction: column; align-items: stretch; }
  .join__button { width: 100%; }
  .formation { height: 42%; bottom: 9%; }
}

@media (max-width: 360px) {
  .hero__eyebrow { letter-spacing: 0.14em; }
  .footer__links { font-size: 0.85rem; }
}

/* Respect users who want less motion at the OS level for smooth scroll */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
