/* ==========================================================================
   ClimateCloud - pre-launch landing page
   Palette + type system per ClimateCloud design guide (Tenways, 2026)
   ========================================================================== */

@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-var-latin.woff2') format('woff2');
  font-weight: 500 700;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-var-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --cc-bg: #020611;
  --cc-bg-alt: #061225;
  --cc-panel: #081A33;
  --cc-field: #0B213F;
  --cc-border: #2477AA;

  --cc-blue: #0874E8;
  --cc-cyan: #20D5FF;
  --cc-cyan-bright: #2FE0FF;

  --cc-heading: #F7FAFF;
  --cc-text: #C7D6EA;
  --cc-body: #B8C9DE;
  --cc-muted: #93A8C4;
  --cc-faint: #7189AE; /* AA contrast for small labels on navy panels */

  --cc-cta-start: #0756C9;
  --cc-cta-end: #006FA6;

  --cc-success: #32D89E;
  --cc-error: #FF6B7A;

  --hairline: rgba(36, 119, 170, 0.28);

  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  --radius-field: 10px;
  --radius-card: 20px;
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cc-bg);
  color: var(--cc-body);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--cc-heading);
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

a { color: var(--cc-cyan); text-decoration: none; }
a:hover { color: var(--cc-heading); }

:focus-visible {
  outline: 3px solid rgba(47, 224, 255, 0.55);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: rgba(8, 116, 232, 0.45); color: var(--cc-heading); }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(72px, 9vw, 116px); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 30px;
  border: 0;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.005em;
  color: #fff;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease,
              background-color 0.18s ease, border-color 0.18s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cc-cta-start) 0%, var(--cc-cta-end) 100%);
  box-shadow: 0 12px 32px rgba(0, 111, 166, 0.30), 0 0 24px rgba(32, 213, 255, 0.12);
}
.btn-primary:hover {
  transform: translateY(-2px);
  filter: saturate(1.12);
  box-shadow: 0 16px 40px rgba(0, 111, 166, 0.40), 0 0 30px rgba(32, 213, 255, 0.18);
  color: #fff;
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  cursor: default;
  filter: saturate(0.6) brightness(0.85);
  transform: none;
}

.btn-ghost {
  min-height: 44px;
  padding: 0 22px;
  background: rgba(8, 26, 51, 0.55);
  border: 1px solid rgba(32, 213, 255, 0.55);
  color: var(--cc-heading);
  font-weight: 600;
  font-size: 15px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  border-color: var(--cc-cyan);
  background: rgba(11, 33, 63, 0.75);
  color: #fff;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  background: transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(2, 6, 17, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: rgba(36, 119, 170, 0.35);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand { display: inline-flex; flex-direction: column; line-height: 1; gap: 5px; }

.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.03em;
  color: var(--cc-heading);
}
.brand-cloud {
  /* Vertical, matching the wordmark baked into the hero artwork */
  background: linear-gradient(180deg, #DFF8FF 0%, #20D5FF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-by {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--cc-muted);
}
.brand:hover .brand-word { color: #fff; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  /* Clears the artwork's top edge from the fixed header (user-set 50px) */
  padding-top: 50px;
  background: var(--cc-bg);
}

/* The artwork variant is chosen by the <picture> media queries (orientation x
   width). Always shown whole - never cropped - so the baked-in wordmark and
   tagline stay intact. The fixed header floats over its dark top edge. */
.hero-art img {
  display: block;
  width: 100%;
  height: auto;
}

/* Tablet & mobile (both orientations): artwork at 90% of the page width, centred */
@media (max-width: 1079px) {
  .hero-art {
    display: block;
    width: 90%;
    margin-inline: auto;
  }
}

/* Desktop: cap the artwork to the header's container so its edges align
   with the logo (left) and the Register interest button (right) */
@media (min-width: 1080px) {
  .hero-art {
    display: block;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }
}

/* Screen-reader-only mirror of the text baked into the hero artwork */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Form card
   -------------------------------------------------------------------------- */

.form-card {
  width: 100%;
  max-width: 470px;
  background: rgba(8, 26, 51, 0.88);
  border: 1px solid var(--cc-border);
  border-radius: var(--radius-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42), 0 0 50px rgba(8, 116, 232, 0.10);
  scroll-margin-top: 96px;
}
.form-card.pulse { animation: cardPulse 1.2s ease; }
@keyframes cardPulse {
  0% { box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42), 0 0 0 0 rgba(32, 213, 255, 0.45); }
  100% { box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42), 0 0 0 22px rgba(32, 213, 255, 0); }
}

.form-card-body { padding: clamp(24px, 4vw, 36px); }

.form-title {
  font-size: clamp(25px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}

.form-intro { color: var(--cc-text); font-size: 15.5px; margin-bottom: 26px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 440px) { .field-row { grid-template-columns: 1fr; gap: 0; } }

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #DCE7F5;
  margin-bottom: 7px;
}

.req { color: var(--cc-cyan); }

.opt {
  color: var(--cc-muted);
  font-weight: 400;
  font-size: 12px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field textarea {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  background: var(--cc-field);
  border: 1px solid var(--cc-border);
  border-radius: var(--radius-field);
  color: var(--cc-heading);
  font-family: var(--font-body);
  font-size: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea {
  min-height: 120px;
  padding-block: 13px;
  resize: vertical;
  line-height: 1.55;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--cc-muted); opacity: 0.75; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--cc-cyan-bright);
  box-shadow: 0 0 0 3px rgba(47, 224, 255, 0.22), 0 0 20px rgba(47, 224, 255, 0.10);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: var(--cc-error); }

.field-error {
  display: none;
  color: var(--cc-error);
  font-size: 13px;
  margin-top: 6px;
}
.field-error.show { display: block; }

/* Honeypot - off-screen, never display:none so lazy bots still fill it */
.hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

.consent-field { margin: 4px 0 20px; }

/* label.consent so this outranks the `.field label` block/weight defaults */
label.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--cc-text);
  margin-bottom: 0;
}
.consent input {
  flex: none;
  width: 19px;
  height: 19px;
  margin-top: 2px;
  accent-color: var(--cc-cyan);
  cursor: pointer;
}

#turnstile-slot:not(:empty) { margin-bottom: 18px; }

.btn-submit { width: 100%; }

.btn .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-error {
  display: none;
  margin-top: 14px;
  color: var(--cc-error);
  font-size: 14px;
  font-weight: 500;
}
.form-error.show { display: block; }

.form-note {
  margin-top: 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--cc-muted);
}

/* Success state */
.form-success { text-align: center; padding: 18px 0 8px; }

.success-ring {
  width: 74px;
  height: 74px;
  margin: 0 auto 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(50, 216, 158, 0.10);
  border: 1px solid rgba(50, 216, 158, 0.45);
  box-shadow: 0 0 34px rgba(50, 216, 158, 0.18);
}
.success-ring svg { width: 34px; height: 34px; stroke: var(--cc-success); }
.success-ring .tick {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: draw 0.55s ease 0.15s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.form-success h3 {
  font-size: 26px;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.form-success p { color: var(--cc-text); font-size: 15.5px; }
.form-success .success-email { color: var(--cc-cyan); font-weight: 600; }
.form-success .success-note { margin-top: 16px; font-size: 13px; color: var(--cc-muted); }

/* --------------------------------------------------------------------------
   Registration section - the page's destination, form centered
   -------------------------------------------------------------------------- */

.register-section {
  background:
    radial-gradient(640px 420px at 50% 30%, rgba(8, 116, 232, 0.10), transparent 70%),
    var(--cc-bg);
  padding-block: 50px;
}

.register-inner {
  display: flex;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Legal pages (privacy policy)
   -------------------------------------------------------------------------- */

.legal {
  /* Top padding clears the fixed header */
  padding: 140px 0 80px;
  background: var(--cc-bg);
}
.legal-inner { max-width: 760px; }
.legal h1 {
  font-size: clamp(34px, 5vw, 44px);
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}
.legal-meta {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cc-faint);
  margin-bottom: 36px;
}
.legal h2 {
  font-size: 21px;
  letter-spacing: -0.02em;
  margin: 38px 0 12px;
}
.legal p { color: var(--cc-text); margin-bottom: 14px; }
.legal ul { margin: 0 0 14px; padding-left: 22px; color: var(--cc-text); }
.legal li { margin-bottom: 8px; }
.legal a { text-decoration: underline; text-underline-offset: 2px; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding-block: 44px;
  background: var(--cc-bg);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.footer-logo { width: 120px; height: auto; margin-bottom: 14px; }
.footer-brand .brand-word { font-size: 21px; }
.footer-tag { margin-top: 8px; font-size: 14px; color: var(--cc-muted); }

.footer-meta { font-size: 13.5px; color: var(--cc-muted); max-width: 480px; }
.footer-meta a { text-decoration: underline; text-underline-offset: 2px; }
.footer-meta p { margin-bottom: 6px; }
.footer-meta strong { color: var(--cc-text); font-weight: 600; }
.footer-copy { margin-top: 14px; color: var(--cc-faint); }

/* --------------------------------------------------------------------------
   Animations: page-load + scroll reveals
   -------------------------------------------------------------------------- */


.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* No-JS and reduced-motion: everything visible, nothing moves */
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; animation: none; transition: none; }
  .form-card.pulse { animation: none; }
  .success-ring .tick { animation: none; stroke-dashoffset: 0; }
  .btn { transition: none; }
}

/* --------------------------------------------------------------------------
   Tablet ≥ 720px
   -------------------------------------------------------------------------- */

@media (min-width: 720px) {
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .footer-meta { text-align: right; }
}
