:root {
  --bg: #f1ede3;
  --bg-deep: #e8e3d6;
  --fg: #1d1b16;
  --fg-muted: #7a7468;
  --fg-faint: #a6a093;
  --card: #fbf9f3;
  --border: rgba(0,0,0,0.08);
  --green: #5a9a6e;
  --green-tint: #dfe9d8;
  --yellow: #c99b2d;
  --yellow-tint: #efe1b2;
  --orange: #d97b2f;
  --red: #c4432b;
  --black: #2a2a2a;
  --serif: 'Iowan Old Style', 'Georgia', 'Palatino', serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14120f;
    --bg-deep: #0c0b09;
    --fg: #ebe6d9;
    --fg-muted: #8a8478;
    --fg-faint: #5a554b;
    --card: #1d1b17;
    --border: rgba(255,255,255,0.07);
    --green: #5fb87d;
    --green-tint: rgba(95,184,125,0.13);
    --yellow: #e6b84d;
    --yellow-tint: rgba(230,184,77,0.15);
    --orange: #eb9450;
    --red: #e85d47;
    --black: #000;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  font-size: 15.5px;
}
.wrap { max-width: 920px; margin: 0 auto; padding: 0 1.25rem; }

header {
  padding: 2.4rem 0 0.9rem;
}
header h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.8rem;
  margin: 0;
  letter-spacing: 0.22em;
  color: var(--fg-muted);
}

main { padding: 0.5rem 0 3rem; }

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 0.95rem;
  margin: 2.2rem 0 0.6rem;
  color: var(--fg-muted);
  letter-spacing: 0.12em;
  text-transform: lowercase;
  font-style: italic;
}

/* HERO — the whole weather "sky" */
.hero-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2.8rem 1.5rem 2.2rem;
  text-align: center;
  box-shadow: 0 1px 14px rgba(0,0,0,0.035);
  transition: background 0.5s, color 0.5s;
  position: relative;
  overflow: hidden;
}
.hero-card.green  { background: linear-gradient(180deg, var(--green) 0%, var(--green) 70%, color-mix(in srgb, var(--green) 85%, black) 100%); color: #fff; }
.hero-card.yellow { background: linear-gradient(180deg, var(--yellow) 0%, var(--yellow) 70%, color-mix(in srgb, var(--yellow) 85%, black) 100%); color: #1a1a1a; }
.hero-card.orange { background: linear-gradient(180deg, var(--orange) 0%, var(--orange) 70%, color-mix(in srgb, var(--orange) 85%, black) 100%); color: #fff; }
.hero-card.red    { background: linear-gradient(180deg, var(--red) 0%, var(--red) 70%, color-mix(in srgb, var(--red) 82%, black) 100%); color: #fff; }
.hero-card.black  { background: linear-gradient(180deg, #2a2a2a 0%, #0a0a0a 100%); color: #fff; }

.hero-level {
  font-family: var(--serif);
  font-size: 1.4rem;
  letter-spacing: 0.32em;
  opacity: 0.8;
  margin-bottom: 0.4rem;
}
.hero-score {
  font-size: 5.2rem;
  font-weight: 200;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.hero-score .of { font-size: 1.6rem; opacity: 0.55; font-weight: 300; margin-left: 0.1rem; }
.hero-brief {
  margin-top: 1.1rem;
  font-size: 1.02rem;
  max-width: 46ch;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.95;
}
.hero-tagline {
  margin-top: 1.3rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.82rem;
  opacity: 0.55;
  letter-spacing: 0.02em;
}
.hero-spark {
  display: block;
  width: 100%;
  max-width: 480px;
  height: 28px;
  margin: 1.2rem auto 0;
  opacity: 0.4;
}
.hero-spark path { fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linejoin: round; }
.hero-stamp {
  margin-top: 0.8rem;
  font-size: 0.72rem;
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
  min-height: 1em;
}

/* STRIP — 6 segments, pattern at a glance */
.strip-section { margin-top: 1.3rem; }
.strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  height: 10px;
  border-radius: 2px;
  overflow: hidden;
}
.strip-seg {
  position: relative;
  cursor: help;
  transition: opacity 0.2s, filter 0.2s;
}
.strip-seg.green  { background: var(--green); }
.strip-seg.yellow { background: var(--yellow); }
.strip-seg.orange { background: var(--orange); }
.strip-seg.red    { background: var(--red); }
.strip-seg.black  { background: var(--black); }
.strip-seg:hover { filter: brightness(1.15); }
.strip-seg .tip {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--fg);
  color: var(--bg);
  padding: 0.35rem 0.65rem;
  border-radius: 3px;
  font-size: 0.78rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 2;
}
.strip-seg:hover .tip { opacity: 1; }
.strip-labels {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  margin-top: 0.45rem;
  font-size: 0.68rem;
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  text-align: center;
}

/* ELEVATED DOMAIN CARDS — only shown when something's actually elevated */
.domains {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
  margin-top: 0.6rem;
}
.domain-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--yellow);
  padding: 0.9rem 1.1rem;
  border-radius: 4px;
}
.domain-card.t-orange { border-left-color: var(--orange); }
.domain-card.t-red    { border-left-color: var(--red); }
.domain-card.t-black  { border-left-color: var(--black); }
.domain-card .name {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  margin-bottom: 0.3rem;
}
.domain-card .score {
  font-size: 1.9rem;
  font-weight: 300;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.domain-card .headline {
  margin-top: 0.5rem;
  font-size: 0.93rem;
}
.domain-card .detail {
  margin-top: 0.2rem;
  font-size: 0.76rem;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

/* LOCATIONS */
.locations { margin-top: 1.5rem; }
#locations { display: flex; flex-direction: column; gap: 0.5rem; }
.loc-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 0.85rem 1.1rem;
  border-radius: 4px;
}
.loc-card.interesting { border-left: 3px solid var(--yellow); }
.loc-card.routine { }
.loc-name {
  font-family: var(--serif);
  font-size: 1rem;
}
.loc-country {
  font-family: inherit;
  font-size: 0.68rem;
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-left: 0.35rem;
}
.loc-line {
  font-size: 0.9rem;
  padding: 0.1rem 0;
  color: var(--fg);
}
.loc-line .icon { margin-right: 0.35rem; opacity: 0.75; }
.loc-line code {
  background: var(--bg-deep);
  padding: 0.05rem 0.35rem;
  border-radius: 2px;
  font-size: 0.76rem;
  margin-right: 0.2rem;
  color: var(--fg-muted);
  font-family: ui-monospace, 'SF Mono', Monaco, monospace;
}
.loc-quiet-row {
  font-size: 0.82rem;
  color: var(--fg-muted);
  padding: 0.4rem 0.1rem;
}
.loc-quiet-label { margin-right: 0.5rem; font-style: italic; }
.loc-pill {
  display: inline-block;
  padding: 0.08rem 0.55rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.76rem;
  color: var(--fg);
  margin-right: 0.25rem;
}

/* EVENT LOG */
.event-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border);
}
.event-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
}
.event-list .ev-time {
  font-variant-numeric: tabular-nums;
  color: var(--fg-faint);
  font-size: 0.78rem;
  min-width: 42px;
  flex-shrink: 0;
}
.event-list .ev-dot {
  color: var(--fg-faint);
  flex-shrink: 0;
}
.event-list .ev-body { color: var(--fg); }
.event-list .ev-empty {
  padding: 0.9rem 0;
  color: var(--fg-muted);
  font-style: italic;
  font-size: 0.9rem;
}
.event-list .ev-body a { color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--border); }
.event-list .ev-body a:hover { border-bottom-color: var(--fg-muted); }
.event-list .ev-src {
  font-size: 0.72rem;
  color: var(--fg-faint);
  margin-left: 0.4rem;
  font-style: italic;
}

/* FOOTER */
footer {
  margin-top: 2.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.84rem;
}
footer .meta { margin-top: 0.4rem; font-size: 0.72rem; color: var(--fg-faint); }
footer a { color: var(--fg-muted); }
.footer-details {
  margin: 0.6rem 0 0.4rem;
  font-size: 0.82rem;
}
.footer-details > summary {
  cursor: pointer;
  list-style: none;
  color: var(--fg-muted);
  padding: 0.2rem 0;
}
.footer-details > summary::-webkit-details-marker { display: none; }
.footer-details > summary::before { content: '▸ '; }
.footer-details[open] > summary::before { content: '▾ '; }
.footer-details ul {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
}
.footer-details li { padding: 0.15rem 0; color: var(--fg-muted); }

@media (max-width: 600px) {
  .hero-score { font-size: 4.2rem; }
  .strip-labels { font-size: 0.62rem; letter-spacing: 0.06em; }
  header h1 { font-size: 1.5rem; }
}
