/* =====================================================================
   Compassion Springs Foundation — Coming Soon
   Editorial dark theme · "hope and light into the darkness"
   ===================================================================== */

/* ---- Design tokens -------------------------------------------------- */
:root {
  /* Surfaces (warm near-black) */
  --bg:        #0a0a0b;
  --bg-soft:   #0d0d0f;

  /* Ink */
  --fg:        #f2f0ec;
  --fg-muted:  #9b9aa0;
  --fg-faint:  #5e5d65;

  /* Hairlines */
  --line:      rgba(242, 240, 236, 0.09);
  --line-2:    rgba(242, 240, 236, 0.15);

  /* Light (the accent — warm, restrained) */
  --gold:      #e7b574;
  --gold-lift: #f6d9a8;
  --gold-soft: rgba(231, 181, 116, 0.13);

  /* Type */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --pad-x: clamp(1.25rem, 5vw, 4.5rem);
}

/* ---- Reset ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

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

body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--gold-soft); color: var(--gold-lift); }

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

/* =====================================================================
   ATMOSPHERE
   ===================================================================== */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: #08080a; }

/* the lighthouse photograph (slight overscan so parallax never bares an edge) */
.bg__photo {
  position: absolute; inset: -3.5%;
  background-color: #08080a;
  background-image: url("assets/hero.jpg");
  background-size: cover;
  background-position: 64% 42%;
  background-repeat: no-repeat;
  will-change: transform;
}

/* cinematic scrim: heavy on the left (where the words live), clear on the
   right (so the lighthouse and its light read), with a soft top + base. */
.bg__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg,
      rgba(7, 7, 9, 0.93) 0%,
      rgba(7, 7, 9, 0.80) 26%,
      rgba(7, 7, 9, 0.46) 50%,
      rgba(7, 7, 9, 0.14) 72%,
      rgba(7, 7, 9, 0) 90%),
    linear-gradient(180deg,
      rgba(7, 7, 9, 0.55) 0%,
      rgba(7, 7, 9, 0) 20%,
      rgba(7, 7, 9, 0) 58%,
      rgba(7, 7, 9, 0.82) 100%);
}

.bg__grain {
  position: absolute; inset: 0;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.bg__vignette {
  position: absolute; inset: 0;
  background: radial-gradient(130% 120% at 50% 0%, transparent 60%, rgba(0, 0, 0, 0.45) 100%);
}

/* =====================================================================
   FRAME / LAYOUT
   ===================================================================== */
.frame {
  position: relative;
  min-height: 100svh;
  max-width: 1240px;
  margin-inline: auto;
  padding: clamp(1.4rem, 3.5vh, 2.4rem) var(--pad-x) clamp(1.6rem, 3.5vh, 2.4rem);
  display: flex;
  flex-direction: column;
}

/* ---- Masthead ------------------------------------------------------- */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: clamp(1.2rem, 3vh, 1.8rem);
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 0.7rem; }
.brand__mark { width: 30px; height: 30px; display: grid; place-items: center; }
.brand__mark svg { width: 100%; height: 100%; }

.brand__name {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
  color: var(--fg);
}
.brand__name span { display: block; color: var(--fg-faint); font-weight: 400; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(242, 240, 236, 0.015);
}
.status__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(231, 181, 116, 0.55);
  animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(231, 181, 116, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(231, 181, 116, 0); }
  100% { box-shadow: 0 0 0 0 rgba(231, 181, 116, 0); }
}

/* ---- Hero ----------------------------------------------------------- */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(2.5rem, 8vh, 5rem) 0;
  max-width: 50ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.headline {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.7rem, 7.2vw, 5.25rem);
  line-height: 1.015;
  letter-spacing: -0.022em;
  margin-top: 1.5rem;
  color: var(--fg);
  text-wrap: balance;
}
.headline em {
  font-style: italic;
  font-weight: 500;
  background: linear-gradient(180deg, var(--gold-lift), var(--gold));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  text-shadow: 0 0 38px rgba(231, 181, 116, 0.25);
}

.lede {
  margin-top: 1.6rem;
  max-width: 46ch;
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.65;
  color: var(--fg-muted);
}

/* ---- Countdown ------------------------------------------------------ */
.launch {
  margin-top: clamp(2.2rem, 5vh, 3rem);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
}
.launch__label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.count {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  font-family: var(--mono);
}
.count__seg { display: inline-flex; align-items: baseline; gap: 0.4rem; }
.count__seg b {
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.count__seg i {
  font-style: normal;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.count__sep { color: var(--line-2); font-size: 1.1rem; }

/* ---- Signup --------------------------------------------------------- */
.cta { margin-top: clamp(2.4rem, 6vh, 3.4rem); width: 100%; max-width: 460px; }
.cta__label {
  font-size: 0.92rem;
  color: var(--fg-muted);
  margin-bottom: 0.85rem;
}

.subscribe { display: flex; gap: 0.6rem; }
.subscribe__input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.95rem;
  color: var(--fg);
  background: rgba(242, 240, 236, 0.025);
  border: 1px solid var(--line-2);
  border-radius: 11px;
  padding: 0.8rem 1rem;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.subscribe__input::placeholder { color: var(--fg-faint); }
.subscribe__input:focus {
  outline: none;
  border-color: rgba(231, 181, 116, 0.6);
  background: rgba(242, 240, 236, 0.04);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.subscribe__btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  color: #2b1c08;
  cursor: pointer;
  padding: 0.8rem 1.2rem;
  border: none;
  border-radius: 11px;
  background: linear-gradient(180deg, var(--gold-lift), var(--gold));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 8px 22px rgba(231, 181, 116, 0.18);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), filter 0.22s var(--ease);
}
.subscribe__btn svg { width: 15px; height: 15px; }
.subscribe__btn:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 12px 28px rgba(231, 181, 116, 0.28);
}
.subscribe__btn:active { transform: translateY(0); }

.subscribe__msg {
  min-height: 1.3em;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--gold);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.subscribe__msg.show { opacity: 1; transform: none; }
.subscribe__msg.error { color: #e88f7d; }

/* ---- Colophon / footer ---------------------------------------------- */
.colophon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: clamp(1.2rem, 3vh, 1.8rem);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--fg-faint);
}
.colophon__links { display: inline-flex; gap: 1.3rem; }
.colophon__links a {
  color: var(--fg-muted);
  transition: color 0.2s var(--ease);
  position: relative;
}
.colophon__links a:hover { color: var(--gold); }
.colophon__domain { color: var(--fg-faint); text-transform: lowercase; letter-spacing: 0.02em; }

/* =====================================================================
   REVEAL
   ===================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: rise 0.85s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* =====================================================================
   UTILITIES
   ===================================================================== */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 560px) {
  .br-lg { display: none; }
  .subscribe { flex-direction: column; }
  .subscribe__btn { justify-content: center; padding: 0.85rem; }
  .count__seg b { font-size: 1.35rem; }
  .colophon { gap: 0.6rem; }
  .colophon__domain { width: 100%; }

  /* keep the lighthouse in frame and darken evenly for legibility */
  .bg__photo { background-position: 62% 36%; }
  .bg__scrim {
    background:
      linear-gradient(180deg,
        rgba(7, 7, 9, 0.88) 0%,
        rgba(7, 7, 9, 0.66) 32%,
        rgba(7, 7, 9, 0.68) 60%,
        rgba(7, 7, 9, 0.93) 100%);
  }
}

@media (max-width: 380px) {
  .count { gap: 0.4rem; }
  .count__sep { display: none; }
}

/* =====================================================================
   REDUCED MOTION
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .status__dot { animation: none; }
  .bg__dawn, .bg__sun { transition: none !important; }
}
