/* Forecast Cloud Technology — brand palette (from the BIMI / logo artwork) */
:root {
  --slate: #4a5e5c;   /* cloud, primary text */
  --grey:  #98a5a4;   /* rays, secondary text */
  --sage:  #c1d1ce;   /* light cloud */
  --blue:  #8cadb5;   /* light-mode rays */

  --bg: #f6f8f7;
  --surface: #ffffff;
  --text: var(--slate);
  --muted: #6f7f7d;
  --line: #dde5e3;
  --accent: var(--slate);
  --accent-text: #ffffff;
  --cloud: var(--slate);
  --rays: var(--grey);

  color-scheme: light;
}

/* Dark palette: follows the device unless the visitor picked light with the toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d2524;
    --surface: #26302f;
    --text: var(--sage);
    --muted: #93a3a1;
    --line: #34403f;
    --accent: var(--sage);
    --accent-text: #1d2524;
    --cloud: var(--sage);
    --rays: var(--blue);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1d2524;
  --surface: #26302f;
  --text: var(--sage);
  --muted: #93a3a1;
  --line: #34403f;
  --accent: var(--sage);
  --accent-text: #1d2524;
  --cloud: var(--sage);
  --rays: var(--blue);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Open Sans", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ---------- Header / theme toggle ---------- */
header {
  display: flex;
  justify-content: flex-end;
  padding: 16px;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover { border-color: var(--rays); transform: rotate(-15deg); }
.theme-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-active-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-active-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Main card ---------- */
main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px 16px 48px;
}

.card {
  width: 100%;
  max-width: 640px;
  text-align: center;
}

.logo {
  width: min(240px, 60vw);
  height: auto;
  display: block;
  margin: 0 auto 32px;
  overflow: visible;
}
.logo .c { fill: var(--cloud); transition: fill 0.3s ease; }
.logo .r { fill: var(--rays);  transition: fill 0.3s ease; }

.wordmark {
  font-weight: 300;
  letter-spacing: 0.04em;
  line-height: 1.15;
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  text-transform: uppercase;
}
.wordmark .top    { display: block; color: var(--grey); }
.wordmark .bottom { display: block; color: var(--text); }

.rule {
  width: 64px;
  height: 3px;
  border: 0;
  border-radius: 2px;
  background: var(--blue);
  margin: 28px auto;
}

.tagline {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 34ch;
  margin: 0 auto;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

/* ---------- Contact ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { opacity: 0.85; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--rays); }
.btn svg { width: 16px; height: 16px; }
.btn[hidden] { display: none; }

/* ---------- Footer ---------- */
footer {
  padding: 24px 16px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Motion ---------- */
.reveal { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  /* Fade-in on load (JS adds .is-loaded to <html>) */
  .js .reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: calc(var(--i, 0) * 90ms);
  }
  .js.is-loaded .reveal { opacity: 1; transform: none; }

  /* Sun rays pulse */
  .logo .ray { animation: pulse 3.2s ease-in-out infinite; }
  .logo .ray:nth-of-type(2) { animation-delay: 0.3s; }
  .logo .ray:nth-of-type(3) { animation-delay: 0.6s; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
