/* Mars weather explorer — rust / amber / deep-space palette */
:root {
  --bg: #0d0a14;
  --bg2: #161020;
  --panel: #1c1326;
  --rust: #c1440e;
  --rust-bright: #e0531f;
  --amber: #f5a623;
  --amber-soft: #ffb347;
  --salmon: #ff8c5a;
  --violet: #7c5cff;
  --teal: #3dd6c3;
  --ink: #f6ede2;
  --ink-dim: #c9b8a8;
  --ink-faint: #94816f;
  --card-line: rgba(255, 170, 110, 0.16);
  --radius: 18px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .num {
  font-family: "Space Grotesk", "Inter", sans-serif;
  letter-spacing: -0.015em;
}

a { color: var(--amber-soft); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- nav ---------- */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 10, 20, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 170, 110, 0.1);
}
nav .wrap { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700; font-size: 1.12rem; text-decoration: none;
  background: linear-gradient(100deg, var(--amber) 10%, var(--rust-bright) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
nav a.link {
  color: var(--ink-dim); text-decoration: none; font-size: 0.92rem; font-weight: 500;
}
nav a.link:hover, nav a.link.active { color: var(--ink); }
nav .spacer { flex: 1; }

/* ---------- hero ---------- */
header.hero {
  background:
    radial-gradient(1100px 480px at 85% -10%, rgba(224, 83, 31, 0.38), transparent 65%),
    radial-gradient(900px 420px at 5% 0%, rgba(124, 92, 255, 0.22), transparent 60%),
    linear-gradient(175deg, #221024 0%, #2b1118 48%, var(--bg) 100%);
  padding: 72px 0 56px;
  position: relative;
  overflow: hidden;
}
header.hero::after { /* horizon arc */
  content: "";
  position: absolute; left: 50%; bottom: -340px; transform: translateX(-50%);
  width: 1600px; height: 400px; border-radius: 50%;
  background: linear-gradient(180deg, rgba(224, 83, 31, 0.28), transparent 70%);
  filter: blur(2px);
  pointer-events: none;
}
.hero .eyebrow {
  display: inline-block;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--amber-soft);
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid rgba(245, 166, 35, 0.3);
  padding: 5px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5.4vw, 3.6rem);
  font-weight: 700; line-height: 1.08; margin-bottom: 14px; max-width: 760px;
}
.hero h1 .grad {
  background: linear-gradient(95deg, var(--amber) 5%, var(--rust-bright) 60%, var(--salmon) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.sub { font-size: 1.12rem; color: var(--ink-dim); max-width: 640px; }

/* lag banner — honesty about data delay */
.lag-note {
  margin-top: 26px;
  display: inline-flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  background: rgba(124, 92, 255, 0.13);
  border: 1px solid rgba(124, 92, 255, 0.35);
  border-radius: 12px; padding: 10px 16px;
  font-size: 0.92rem; color: #cfc4ff;
}
.lag-note strong { color: #e6dfff; }

/* ---------- latest report ---------- */
section { padding: 56px 0; }
section.tight { padding-top: 24px; }
h2.sec {
  font-size: 1.7rem; font-weight: 700; margin-bottom: 8px;
}
p.sec-sub { color: var(--ink-dim); margin-bottom: 28px; max-width: 700px; }

.report-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.stat {
  border-radius: var(--radius);
  padding: 22px 20px 18px;
  border: 1px solid var(--card-line);
  position: relative; overflow: hidden;
}
.stat .label {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  opacity: 0.85; margin-bottom: 8px;
}
.stat .num { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.stat .unit { font-size: 1rem; font-weight: 500; opacity: 0.75; margin-left: 2px; }
.stat .small { font-size: 0.86rem; margin-top: 6px; opacity: 0.8; }

/* tinted card variants — colour ON the surface */
.t-rust   { background: linear-gradient(145deg, #3a1508, #2a0f08); border-color: rgba(224,83,31,.4); }
.t-rust .label { color: var(--salmon); }
.t-amber  { background: linear-gradient(145deg, #3a2a08, #2a1d06); border-color: rgba(245,166,35,.4); }
.t-amber .label { color: var(--amber-soft); }
.t-violet { background: linear-gradient(145deg, #231a45, #170f2e); border-color: rgba(124,92,255,.42); }
.t-violet .label { color: #b1a0ff; }
.t-teal   { background: linear-gradient(145deg, #0c3330, #082220); border-color: rgba(61,214,195,.38); }
.t-teal .label { color: var(--teal); }
.t-plum   { background: linear-gradient(145deg, #3a1030, #250a20); border-color: rgba(255,110,199,.35); }
.t-plum .label { color: #ff9ad5; }

.report-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 20px;
}
.report-head .sol-big {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2.4rem; font-weight: 700;
  background: linear-gradient(95deg, var(--amber), var(--rust-bright));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.report-head .date { color: var(--ink-dim); font-size: 1.05rem; }
.report-head .season-chip {
  background: rgba(224, 83, 31, 0.16); border: 1px solid rgba(224, 83, 31, 0.4);
  color: var(--salmon); font-size: 0.85rem; font-weight: 600;
  border-radius: 999px; padding: 4px 14px;
}

/* ---------- comparisons ---------- */
.compare-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.compare {
  border-radius: var(--radius); padding: 22px;
  border: 1px solid var(--card-line);
}
.compare .place { font-weight: 700; font-size: 1.05rem; margin-bottom: 2px; }
.compare .temp { font-family: "Space Grotesk", sans-serif; font-size: 1.7rem; font-weight: 700; }
.compare .note { font-size: 0.88rem; opacity: 0.85; margin-top: 8px; }
.compare.mars { outline: 2px solid rgba(224, 83, 31, 0.55); outline-offset: -2px; }

.verdict {
  margin-top: 22px; padding: 18px 22px; border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(224,83,31,.16), rgba(245,166,35,.1));
  border: 1px solid rgba(245, 166, 35, 0.28);
  font-size: 1.02rem;
}

/* ---------- charts ---------- */
.chart-card {
  background: linear-gradient(160deg, var(--panel), #130d1c);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  padding: 24px 24px 14px;
  margin-bottom: 26px;
}
.chart-card h3 { font-size: 1.18rem; margin-bottom: 4px; }
.chart-card p.desc { font-size: 0.92rem; color: var(--ink-dim); margin-bottom: 14px; max-width: 760px; }
.chart-card canvas { width: 100%; height: 320px; display: block; cursor: crosshair; }
.chart-card .legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 10px 2px 4px; font-size: 0.84rem; color: var(--ink-dim); }
.legend .key { display: inline-flex; align-items: center; gap: 7px; }
.legend .swatch { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.chart-tip {
  position: fixed; pointer-events: none; z-index: 100; display: none;
  background: rgba(20, 14, 28, 0.95); border: 1px solid rgba(255,170,110,.3);
  border-radius: 10px; padding: 9px 13px; font-size: 0.83rem; line-height: 1.5;
  box-shadow: 0 6px 24px rgba(0,0,0,.5); max-width: 240px;
}
.chart-tip b { color: var(--amber-soft); }

/* ---------- outlook table ---------- */
.outlook-table {
  width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 640px;
}
.outlook-table th {
  text-align: left; font-size: 0.76rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint);
  padding: 8px 14px 8px 0; border-bottom: 1px solid rgba(255,170,110,.18);
}
.outlook-table td {
  padding: 10px 14px 10px 0; border-bottom: 1px solid rgba(255,255,255,.05);
  color: var(--ink-dim); white-space: nowrap;
}
.outlook-table td .range { font-size: 0.8rem; color: var(--ink-faint); margin-left: 6px; }
.outlook-table td:first-child { font-family: "Space Grotesk", sans-serif; font-weight: 700; color: var(--ink); }
.outlook-table tr.today-row td { background: rgba(245,166,35,.07); color: var(--ink); }
.outlook-table tr.today-row td:first-child { color: var(--amber-soft); }
.outlook-table .hi { color: var(--amber-soft); font-weight: 600; }
.outlook-table .lo { color: #a797ff; font-weight: 600; }

/* ---------- forms (admin) ---------- */
.form-label {
  display: block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-faint); margin: 14px 0 6px;
}
.form-input {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.05); color: var(--ink);
  border: 1px solid rgba(255, 170, 110, 0.22);
  font-family: inherit; font-size: 0.95rem;
}
.form-input:focus { outline: none; border-color: var(--amber); }
.form-error {
  margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-size: 0.9rem;
  background: rgba(224, 83, 31, 0.14); border: 1px solid rgba(224, 83, 31, 0.45); color: #ffb9a0;
}
.btn {
  margin-top: 18px; padding: 10px 22px; border-radius: 10px; border: none; cursor: pointer;
  font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 0.95rem;
  background: linear-gradient(95deg, var(--amber), var(--rust-bright)); color: #1a0d06;
}
.btn:hover { filter: brightness(1.1); }
.btn-small { margin: 0; padding: 5px 12px; font-size: 0.8rem; }
.btn-danger { background: rgba(224, 83, 31, 0.18); color: var(--salmon); border: 1px solid rgba(224, 83, 31, 0.45); }

/* ---------- about page ---------- */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.5rem; margin: 40px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin-bottom: 14px; color: var(--ink-dim); }
.prose p strong { color: var(--ink); }
.prose ul { margin: 0 0 14px 22px; color: var(--ink-dim); }
.prose li { margin-bottom: 6px; }
.callout {
  border-radius: var(--radius); padding: 20px 24px; margin: 20px 0;
  border: 1px solid rgba(124,92,255,.35); background: rgba(124,92,255,.1);
  color: #d8d0ff; font-size: 0.97rem;
}
.callout.warm { border-color: rgba(245,166,35,.35); background: rgba(245,166,35,.08); color: #ffe9c4; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid rgba(255,170,110,.1);
  padding: 36px 0 48px; margin-top: 30px;
  color: var(--ink-faint); font-size: 0.88rem;
}
footer a { color: var(--ink-dim); }

@media (max-width: 640px) {
  .chart-card canvas { height: 240px; }
  header.hero { padding: 52px 0 40px; }
}
