/* ─────────────────────────────────────────────────────────────────────────
   QCF Renewal Landing Page
   Aesthetic: editorial / climate-engineering — refined, not generic
   Palette: strict ETS — #FFFFFF, #000000, #1A80ED
   Type: Fraunces (display serif, "personal" voice) + MaisonNeue / Helvetica Neue
         (body, matches energytransitionshow.com main site)
   ─────────────────────────────────────────────────────────────────────────
   Body font chain mirrors the live ETS site:
     'MaisonNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif
   MaisonNeue is a licensed face. If the .woff2 files are self-hosted under
   /fonts/, declare them via @font-face below. Otherwise the chain falls
   through to Helvetica Neue (Mac/iOS), Helvetica (older Mac), then Arial
   (Windows) — exactly the same experience the live site provides to
   visitors without the licensed font.
   ───────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT@9..144,400..700,0..100&display=swap');

/* Optional: self-host MaisonNeue here if license allows.
   Drop the .woff2 files in /fonts/ and uncomment.

@font-face {
  font-family: 'MaisonNeue';
  src: url('/fonts/MaisonNeue-Book.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'MaisonNeue';
  src: url('/fonts/MaisonNeue-Demi.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'MaisonNeue';
  src: url('/fonts/MaisonNeue-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
*/

:root {
  /* Strict ETS palette — three colors, period */
  --ets-white:  #ffffff;
  --ets-black:  #000000;
  --ets-blue:   #1A80ED;
  --ets-blue-deep: #0F5BAB;

  /* Off-white paper for the page background — gives editorial warmth
     without breaking the three-color rule (it reads as "white" but isn't cold) */
  --paper:      #fafaf7;
  --paper-edge: #f0efe9;
  --hairline:   #e8e8e3;
  --hairline-strong: #1a1a1a;

  /* Functional grays derived from black at fixed opacities — no warm grays */
  --ink-100: rgba(0, 0, 0, 1);
  --ink-80:  rgba(0, 0, 0, 0.80);
  --ink-60:  rgba(0, 0, 0, 0.60);
  --ink-45:  rgba(0, 0, 0, 0.45);
  --ink-25:  rgba(0, 0, 0, 0.25);
  --ink-10:  rgba(0, 0, 0, 0.10);

  /* State accents — used sparingly, only on the icon ring + eyebrow */
  --state-success: #0F7A3A;
  --state-warn:    #8a5a00;

  /* Type scale — clamp() for fluid sizing */
  --display-size:  clamp(2rem, 4.6vw, 3rem);     /* 32 → 48 */
  --eyebrow-size:  0.75rem;                       /* 12px */
  --body-size:     clamp(0.9375rem, 1.4vw, 1.0625rem);  /* 15 → 17 */
  --meta-size:     0.8125rem;                     /* 13 */
  --fine-size:     0.75rem;                       /* 12 */

  /* Spacing scale */
  --gutter:        clamp(1.5rem, 3vw, 2.5rem);
  --card-pad:      clamp(2rem, 4vw, 3.25rem);

  /* Motion */
  --reveal-duration: 0.55s;
  --reveal-easing: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ets-black);
  font-family: 'MaisonNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: var(--body-size);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';  /* DM Sans alt characters */
}

/* Atmospheric paper background — radial vignette, no flat color */
body {
  background:
    radial-gradient(ellipse 90vw 80vh at 50% 0%, var(--paper) 0%, var(--paper-edge) 100%),
    var(--paper-edge);
  min-height: 100vh;
  position: relative;
}

/* ─────────────────────── Page chrome — top hairline rule with brand mark */

body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--ets-blue);
  z-index: 100;
}

/* ─────────────────────── Card */

main.card {
  max-width: 600px;
  margin: clamp(2rem, 6vw, 5rem) auto;
  background: var(--ets-white);
  border: 1px solid var(--hairline);
  border-radius: 0;  /* sharp editorial corners — no soft rounding */
  position: relative;
}

/* Decorative hairline at top of card — ETS blue, mimics the page chrome */
main.card::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px; right: -1px;
  height: 4px;
  background: var(--ets-blue);
}

/* ─────────────────────── Header band */

.card__header {
  padding: clamp(2rem, 4vw, 2.75rem) var(--card-pad) clamp(1.5rem, 3vw, 2rem) var(--card-pad);
  border-bottom: 1px solid var(--hairline);
  text-align: center;
}

.card__logo-link {
  display: inline-block;
  transition: opacity 0.2s ease;
}
.card__logo-link:hover { opacity: 0.7; }

.card__logo {
  display: inline-block;
  max-width: 280px;
  width: 100%;
  height: auto;
}

/* ─────────────────────── Body — state sections */

.card__body {
  padding: clamp(2.25rem, 4.5vw, 3.5rem) var(--card-pad) clamp(2rem, 4vw, 3rem) var(--card-pad);
  text-align: center;
}

/* State icon: circular badge with hairline border + colored accent ring underneath */

.state-icon {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto clamp(1.5rem, 3vw, 2rem) auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ets-white);
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
}

.state-icon::after {
  /* Subtle outer ring in brand color to echo the ETS sun radiating motif */
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid var(--ink-10);
  pointer-events: none;
}

.state-icon svg {
  width: 32px;
  height: 32px;
  color: var(--ets-black);
  stroke-width: 1.25;  /* slightly heavier than Streamline's default 1px */
}

/* State-specific accent colors — applied as outer ring + icon stroke */
.state-icon--success { border-color: var(--state-success); }
.state-icon--success svg { color: var(--state-success); }
.state-icon--success::after { border-color: var(--state-success); opacity: 0.18; inset: -10px; }

.state-icon--warn { border-color: var(--state-warn); }
.state-icon--warn svg { color: var(--state-warn); }
.state-icon--warn::after { border-color: var(--state-warn); opacity: 0.18; inset: -10px; }

.state-icon--brand { border-color: var(--ets-blue); }
.state-icon--brand svg { color: var(--ets-blue); }
.state-icon--brand::after { border-color: var(--ets-blue); opacity: 0.18; inset: -10px; }

/* ─────────────────────── Typography */

.eyebrow {
  margin: 0 0 1rem 0;
  font-family: 'MaisonNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: var(--eyebrow-size);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-60);
}
.eyebrow--success { color: var(--state-success); }
.eyebrow--warn    { color: var(--state-warn); }

.headline {
  margin: 0 0 1.25rem 0;
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 96, "SOFT" 30;
  font-size: var(--display-size);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ets-black);
  text-wrap: balance;
}

.body {
  margin: 0 auto 1.25rem auto;
  max-width: 44ch;
  font-size: var(--body-size);
  line-height: 1.55;
  color: var(--ink-80);
}

.meta {
  margin: 1.25rem 0 0 0;
  font-size: var(--meta-size);
  color: var(--ink-45);
}

a {
  color: var(--ets-blue);
  text-decoration: none;
  border-bottom: 1px solid var(--ets-blue);
  transition: opacity 0.2s ease;
}
a:hover { opacity: 0.65; }

/* ─────────────────────── Pill */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.25rem 0 0 0;
  padding: 0.5rem 1rem;
  font-family: 'MaisonNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: var(--meta-size);
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 999px;
  border: 1px solid;
}
.pill--success {
  color: var(--state-success);
  background: rgba(15, 122, 58, 0.06);
  border-color: rgba(15, 122, 58, 0.24);
}

/* ─────────────────────── Spinner (loading state) */

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  margin: 0.5rem auto 0 auto;
  border: 1.5px solid var(--ink-10);
  border-top-color: var(--ets-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────────── CTA button (noscript fallback only) */

.cta-button {
  display: inline-block;
  margin: 1rem 0 0 0;
  padding: 1rem 2rem;
  font-family: 'MaisonNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ets-white);
  background: var(--ets-blue);
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.2s ease;
}
.cta-button:hover { background: var(--ets-blue-deep); }
.cta-button:focus-visible { outline: 2px solid var(--ets-black); outline-offset: 3px; }

.link-button {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  color: var(--ets-blue);
  border-bottom: 1px solid var(--ets-blue);
  cursor: pointer;
}

/* ─────────────────────── Footer */

.card__footer {
  padding: clamp(2rem, 4vw, 2.75rem) var(--card-pad) clamp(2rem, 4vw, 2.75rem) var(--card-pad);
  background: var(--paper);
  border-top: 1px solid var(--hairline);
  text-align: center;
}

.footer-eyebrow {
  margin: 0 0 1rem 0;
  font-family: 'MaisonNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: var(--fine-size);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-45);
}

.footer-logo-link { display: inline-block; }
.footer-logo {
  display: inline-block;
  width: 140px;
  height: auto;
}

.footer-fineprint {
  margin: 1.5rem auto 0 auto;
  max-width: 38ch;
  font-size: var(--fine-size);
  line-height: 1.65;
  color: var(--ink-45);
}

.footer-fineprint a {
  color: var(--ink-60);
  border-bottom-color: var(--ink-25);
}
.footer-fineprint a:hover { color: var(--ets-blue); border-bottom-color: var(--ets-blue); }

/* ─────────────────────── Reveal animation: staggered on state transition */

[data-state-section] { transition: opacity 0.2s ease; }

[data-state-section][hidden] { display: none; }

[data-state-section]:not([hidden]) > * {
  opacity: 0;
  transform: translateY(12px);
  animation: reveal var(--reveal-duration) var(--reveal-easing) forwards;
}

[data-state-section]:not([hidden]) > .state-icon { animation-delay: 0ms; }
[data-state-section]:not([hidden]) > .eyebrow    { animation-delay: 100ms; }
[data-state-section]:not([hidden]) > .headline   { animation-delay: 180ms; }
[data-state-section]:not([hidden]) > .body       { animation-delay: 260ms; }
[data-state-section]:not([hidden]) > .pill       { animation-delay: 340ms; }
[data-state-section]:not([hidden]) > .meta       { animation-delay: 400ms; }

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─────────────────────── Mobile */

@media (max-width: 600px) {
  main.card {
    margin: 0;
    border-left: none;
    border-right: none;
  }
  body { background: var(--ets-white); }
}

/* ─────────────────────── Reduced motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .spinner { animation: spin 1.5s linear infinite; }  /* keep spinner usable */
}

/* ─────────────────────── Dark mode (system pref) */

@media (prefers-color-scheme: dark) {
  :root {
    --ets-white: #0e0e10;
    --ets-black: #f5f5f5;
    --paper: #0a0a0c;
    --paper-edge: #050506;
    --hairline: #2a2a2e;
    --hairline-strong: #f5f5f5;
    --ink-100: rgba(245, 245, 245, 1);
    --ink-80:  rgba(245, 245, 245, 0.80);
    --ink-60:  rgba(245, 245, 245, 0.60);
    --ink-45:  rgba(245, 245, 245, 0.45);
    --ink-25:  rgba(245, 245, 245, 0.25);
    --ink-10:  rgba(245, 245, 245, 0.10);
    --state-success: #4ade80;
    --state-warn:    #fbbf24;
  }
}
