@import url("https://fonts.googleapis.com/css2?family=Archivo+Black&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --ink: #101c25;
  --ink-soft: #253641;
  --paper: #f6f4ed;
  --surface: #fffef9;
  --line: #cdd2ce;
  --muted: #67747c;
  --lime: #d8ff3e;
  --orange: #ff6a3d;
  --sky: #87d8f7;
  --good: #b8ee36;
  --caution: #ffc857;
  --poor: #ff775b;
  --shadow: 0 24px 65px rgba(16, 28, 37, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(16, 28, 37, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 28, 37, 0.045) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(16, 28, 37, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-family: "Archivo Black", sans-serif;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-mark { position: relative; width: 35px; height: 35px; border-radius: 50%; background: var(--ink); overflow: hidden; }
.brand-mark i { position: absolute; width: 26px; height: 7px; border-radius: 99px; background: var(--lime); transform: rotate(-31deg); left: 6px; }
.brand-mark i:first-child { top: 10px; }
.brand-mark i:last-child { top: 19px; left: 10px; }

.data-status { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.data-status span { width: 9px; height: 9px; border-radius: 50%; background: #2ea96f; box-shadow: 0 0 0 5px rgba(46, 169, 111, 0.13); }

.intro { padding: 72px 0 34px; max-width: 900px; }
.kicker { margin: 0 0 12px; color: #46555d; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.intro h1 { margin: 0; max-width: 820px; font-family: "Archivo Black", sans-serif; font-size: clamp(3rem, 7.7vw, 6.5rem); font-weight: 400; letter-spacing: -0.07em; line-height: 0.91; text-wrap: balance; }
.intro h1 em { color: var(--orange); font-style: normal; }
.intro-copy { max-width: 630px; margin: 26px 0 0; color: var(--ink-soft); font-size: clamp(1rem, 2vw, 1.15rem); }

.run-board {
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.planner { position: relative; padding: 30px; }
.section-label { display: flex; align-items: center; gap: 12px; margin-bottom: 27px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.section-label span { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid var(--ink); border-radius: 50%; font-size: 0.7rem; letter-spacing: 0; }
.field { position: relative; display: grid; gap: 8px; }
.field label, .run-type legend { font-weight: 700; font-size: 0.9rem; }
.location-field { z-index: 3; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap svg { position: absolute; left: 14px; width: 20px; fill: none; stroke: var(--muted); stroke-width: 1.8; pointer-events: none; }
input, select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
input { padding: 11px 14px; }
select { padding: 11px 38px 11px 14px; }
input:focus, select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(216, 255, 62, 0.62); }
.search-wrap input { padding-left: 44px; padding-right: 76px; }
.search-button { position: absolute; right: 5px; min-height: 40px; border: 0; border-radius: 7px; padding: 0 14px; background: var(--ink); color: white; font-weight: 700; }
.search-button:hover { background: #273943; }
.location-button { display: inline-flex; align-items: center; gap: 7px; width: fit-content; margin-top: 3px; padding: 3px 0; border: 0; background: transparent; color: var(--ink-soft); font-weight: 600; font-size: 0.85rem; }
.location-button:hover { text-decoration: underline; }
.location-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.search-results { position: absolute; top: 80px; left: 0; right: 0; padding: 7px; border: 1px solid var(--ink); border-radius: 10px; background: white; box-shadow: 0 16px 35px rgba(16,28,37,.16); }
.search-option { display: block; width: 100%; padding: 10px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); text-align: left; }
.search-option:hover, .search-option:focus { background: #eff4e4; outline: none; }
.search-option strong { display: block; }
.search-option small { color: var(--muted); }

.planner-row { display: grid; grid-template-columns: 1.45fr 0.75fr; gap: 12px; margin-top: 22px; }
.run-type { margin: 22px 0 0; padding: 0; border: 0; }
.run-type legend { margin-bottom: 8px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: #eef0ec; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: grid; place-items: center; min-height: 40px; border-radius: 8px; font-size: 0.88rem; font-weight: 700; transition: 150ms ease; }
.segmented input:checked + span { background: var(--ink); color: white; box-shadow: 0 4px 10px rgba(16,28,37,.18); }
.segmented input:focus-visible + span { outline: 3px solid var(--lime); outline-offset: 2px; }
.form-note { margin: 22px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.45; }

.verdict-card { position: relative; min-height: 520px; padding: 32px; background: var(--ink); color: white; overflow: hidden; }
.verdict-card::before { content: ""; position: absolute; width: 400px; height: 400px; right: -205px; bottom: -225px; border: 34px solid rgba(216,255,62,.12); border-radius: 50%; box-shadow: 0 0 0 34px rgba(216,255,62,.055), 0 0 0 68px rgba(216,255,62,.03); }
.verdict-card[data-level="great"] { --status: var(--lime); }
.verdict-card[data-level="good"] { --status: var(--sky); }
.verdict-card[data-level="caution"] { --status: var(--caution); }
.verdict-card[data-level="poor"] { --status: var(--poor); }
.loading-state, .error-state { position: relative; z-index: 1; min-height: 450px; display: grid; place-items: center; align-content: center; gap: 16px; text-align: center; }
.loading-state p { color: #c4cdd2; }
.loader { width: 46px; height: 46px; border: 4px solid rgba(255,255,255,.18); border-top-color: var(--lime); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.verdict-content { position: relative; z-index: 1; }
.verdict-topline { display: flex; justify-content: space-between; gap: 15px; align-items: center; }
.verdict-pill { padding: 6px 10px; border: 1px solid var(--status); border-radius: 99px; color: var(--status); font-size: 0.74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.forecast-place { max-width: 52%; color: #c4cdd2; font-size: .86rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.score-row { display: grid; grid-template-columns: 122px 1fr; gap: 25px; align-items: center; margin-top: 40px; }
.score-ring { --score: 0; width: 122px; aspect-ratio: 1; display: grid; place-content: center; text-align: center; border-radius: 50%; background: radial-gradient(circle closest-side, var(--ink) 78%, transparent 80% 99%), conic-gradient(var(--status) calc(var(--score) * 1%), rgba(255,255,255,.15) 0); transition: background 500ms ease; }
.score-ring strong { display: block; font-family: "Archivo Black", sans-serif; font-size: 2.65rem; font-weight: 400; line-height: .95; }
.score-ring span { color: #aeb9be; font-size: .72rem; }
.weather-label { margin: 0 0 5px; color: var(--status); font-size: .85rem; font-weight: 700; }
.score-row h2 { margin: 0; font-family: "Archivo Black", sans-serif; font-size: clamp(2.2rem, 4.2vw, 3.7rem); font-weight: 400; letter-spacing: -.055em; line-height: .96; }
.score-row p:last-child { margin: 10px 0 0; color: #bec8cd; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 37px; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.18); }
.metric { padding: 13px 11px; background: var(--ink); }
.metric small { display: block; color: #9caaaf; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
.metric strong { display: block; margin-top: 2px; font-size: 1.05rem; }
.coach-note { display: flex; gap: 13px; align-items: flex-start; margin-top: 22px; padding: 15px; border-radius: 12px; background: rgba(216,255,62,.11); }
.coach-note > span { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--lime); color: var(--ink); font-weight: 800; }
.coach-note small { color: var(--lime); font-size: .66rem; font-weight: 700; letter-spacing: .12em; }
.coach-note p { margin: 2px 0 0; color: #eef1e8; font-size: .88rem; }
.error-state > span { display: grid; place-items: center; width: 52px; height: 52px; border: 2px solid var(--poor); border-radius: 50%; color: var(--poor); font-family: "Archivo Black"; font-size: 1.4rem; }
.error-state h2 { margin: 3px 0 0; font-family: "Archivo Black"; font-weight: 400; }
.error-state p { max-width: 360px; margin: 0; color: #c4cdd2; }
.error-state button { margin-top: 6px; padding: 10px 18px; border: 0; border-radius: 8px; background: var(--lime); color: var(--ink); font-weight: 700; }

.forecast-panel, .detail-card { margin-top: 22px; border: 1px solid var(--ink); border-radius: 22px; background: var(--surface); }
.forecast-panel { padding: 27px 28px 28px; }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.panel-heading h2 { margin: 0; font-family: "Archivo Black", sans-serif; font-size: clamp(1.55rem, 3vw, 2.25rem); font-weight: 400; letter-spacing: -.045em; }
.panel-heading > p { color: var(--muted); font-size: .88rem; }
.hour-strip { display: grid; grid-auto-columns: minmax(105px, 1fr); grid-auto-flow: column; gap: 9px; margin-top: 22px; padding-bottom: 7px; overflow-x: auto; scroll-snap-type: x mandatory; }
.hour-card { scroll-snap-align: start; min-height: 135px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 13px 10px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); }
.hour-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.hour-card.is-selected { border-color: var(--ink); background: var(--ink); color: white; }
.hour-time { font-size: .78rem; font-weight: 700; }
.hour-temp { font-size: 1.4rem; font-weight: 700; }
.hour-score { min-width: 41px; padding: 4px 7px; border-radius: 99px; background: #e9f2d1; color: #315013; font-size: .75rem; font-weight: 700; }
.hour-card.is-selected .hour-score { background: var(--lime); color: var(--ink); }
.hour-condition { color: var(--muted); font-size: .7rem; }
.hour-card.is-selected .hour-condition { color: #b9c4c9; }

.details-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 22px; }
.detail-card { padding: 28px; }
.factor-list { display: grid; gap: 18px; }
.factor { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 15px; }
.factor-name { font-weight: 700; }
.factor-track { height: 7px; border-radius: 99px; background: #e2e5e1; overflow: hidden; }
.factor-track i { display: block; height: 100%; width: var(--value); border-radius: inherit; background: var(--factor-color, var(--lime)); }
.factor-value { min-width: 64px; color: var(--muted); font-size: .84rem; text-align: right; }
.week-list { display: grid; }
.week-day { display: grid; grid-template-columns: 75px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.week-day:first-child { border-top: 0; padding-top: 0; }
.week-day strong { font-size: .9rem; }
.week-day div span { display: block; font-weight: 700; }
.week-day div small { color: var(--muted); }
.week-score { display: grid; place-items: center; width: 45px; height: 45px; border: 1px solid var(--ink); border-radius: 50%; font-weight: 700; }

footer { display: grid; grid-template-columns: auto 1fr 1fr; gap: 30px; align-items: start; margin: 50px 0 32px; padding-top: 25px; border-top: 1px solid rgba(16,28,37,.18); color: var(--muted); font-size: .76rem; }
.footer-brand { color: var(--ink); font-family: "Archivo Black"; font-size: 1rem; }
footer p { margin: 0; }
footer a { color: var(--ink); font-weight: 600; }

[hidden] { display: none !important; }

@media (max-width: 900px) {
  .intro { padding-top: 55px; }
  .run-board { grid-template-columns: 1fr; }
  .verdict-card { min-height: 490px; }
  .details-grid { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .page-shell { width: min(100% - 24px, 1180px); }
  .topbar { min-height: 68px; }
  .intro { padding: 42px 2px 25px; }
  .intro h1 { font-size: clamp(2.75rem, 13vw, 3.55rem); }
  .intro-copy { margin-top: 19px; }
  .planner, .verdict-card { padding: 22px; }
  .verdict-card { order: -1; min-height: 0; }
  .loading-state, .error-state { min-height: 360px; }
  .planner-row { grid-template-columns: 1fr; }
  .score-row { grid-template-columns: 92px 1fr; gap: 16px; margin-top: 32px; }
  .score-ring { width: 92px; }
  .score-ring strong { font-size: 2rem; }
  .score-row h2 { font-size: 2.25rem; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .forecast-panel, .detail-card { padding: 21px; }
  .panel-heading { align-items: start; flex-direction: column; gap: 2px; }
  .factor { grid-template-columns: 92px 1fr; gap: 10px; }
  .factor-value { grid-column: 2; margin-top: -7px; text-align: left; }
  footer { grid-template-columns: 1fr; gap: 14px; }
  .footer-brand { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
