:root {
  color-scheme: light;
  --paper: #f5f3ec;
  --paper-deep: #ebe8de;
  --ink: #17211d;
  --muted: #68716c;
  --line: #d9d7ce;
  --card: rgba(255, 255, 255, 0.66);
  --accent: #d95c3f;
  --accent-soft: #f7dfd6;
  --blue: #27748c;
  --sun: #f2b84b;
  --radius: 22px;
  --shadow: 0 16px 44px rgba(30, 39, 35, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% -5%, rgba(242, 184, 75, 0.22), transparent 30rem),
    radial-gradient(circle at -10% 40%, rgba(39, 116, 140, 0.10), transparent 34rem),
    var(--paper);
}

button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.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;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--ink);
  font-size: 21px;
}

.search-wrap { position: relative; width: min(480px, 55vw); z-index: 10; }

#search-form {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  transition: border-color 160ms, box-shadow 160ms, background 160ms;
}

#search-form:focus-within {
  border-color: var(--blue);
  background: white;
  box-shadow: 0 0 0 4px rgba(39, 116, 140, 0.12);
}

.search-icon { padding-left: 16px; color: var(--muted); font-size: 22px; }

#location-search {
  width: 100%;
  min-width: 0;
  padding: 11px 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

#search-form button {
  margin-right: 5px;
  padding: 8px 15px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: var(--ink);
  cursor: pointer;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  width: 100%;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.search-result {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 11px;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.search-result:hover, .search-result:focus-visible { background: var(--paper); outline: 0; }
.search-result span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result small { flex: none; color: var(--muted); }

main { max-width: 1240px; min-height: calc(100vh - 176px); margin: 0 auto; padding: 44px 28px 72px; }

.location-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
}

.eyebrow, .section-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 5vw, 4.3rem); font-weight: 400; line-height: 1; }

.date-nav { display: flex; align-items: center; gap: 8px; }

.date-nav button, .date-field {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
}

.date-nav button { cursor: pointer; }
.date-nav button:hover { border-color: #aaa9a2; background: white; }
.icon-button { width: 40px; padding: 0; }
.text-button { padding: 0 16px; }
.date-field { display: flex; align-items: center; padding: 0 12px; }
.date-field input { border: 0; outline: 0; background: transparent; color: var(--ink); }

.view-tabs {
  display: flex;
  gap: 28px;
  margin: 52px 0 24px;
  border-bottom: 1px solid var(--line);
}

.view-tabs button {
  position: relative;
  padding: 0 1px 13px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.view-tabs button[aria-selected="true"] { color: var(--ink); font-weight: 700; }
.view-tabs button[aria-selected="true"]::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
  content: "";
}

.status { min-height: 24px; color: var(--muted); font-size: 14px; }
.status.error { margin-bottom: 18px; color: #963a2a; }

.loading-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.loading-card span { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: pulse 900ms infinite alternate; }
.loading-card span:nth-child(2) { animation-delay: 180ms; }
.loading-card span:nth-child(3) { animation-delay: 360ms; }
@keyframes pulse { to { opacity: .25; transform: translateY(-5px); } }

.day-hero {
  display: grid;
  grid-template-columns: minmax(260px, 1.15fr) minmax(320px, .85fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .72);
  box-shadow: var(--shadow);
}

.day-primary {
  position: relative;
  min-height: 370px;
  padding: clamp(28px, 5vw, 58px);
  background: linear-gradient(145deg, #f9e6b9 0%, #f5d5a7 50%, #d9e6e4 100%);
}

.day-primary::after {
  position: absolute;
  top: 40px;
  right: 9%;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 0 60px rgba(255, 255, 255, .72);
  content: "";
}

.condition-icon { position: relative; z-index: 1; display: block; margin-bottom: 34px; font-size: 60px; filter: saturate(.85); }
.temperature { position: relative; z-index: 1; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(4.7rem, 11vw, 8rem); line-height: .82; letter-spacing: -.05em; }
.condition { position: relative; z-index: 1; margin: 24px 0 4px; font-size: 22px; }
.high-low { position: relative; z-index: 1; margin: 0; color: #4e5b55; }

.day-details { display: flex; flex-direction: column; padding: clamp(28px, 5vw, 58px); }
.day-details h2 { margin: 4px 0 6px; font: 400 clamp(1.7rem, 3vw, 2.8rem)/1.05 Georgia, serif; }
.source-note { margin: 0; color: var(--muted); font-size: 14px; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 18px; margin-top: auto; padding-top: 44px; }
.metric { border-top: 1px solid var(--line); padding-top: 12px; }
.metric span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.metric strong { font-size: 17px; font-weight: 600; }

.hourly-section { margin-top: 42px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 14px; }
.section-heading h2 { margin: 0; font: 400 1.8rem Georgia, serif; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.hourly-list { display: grid; grid-auto-columns: minmax(94px, 1fr); grid-auto-flow: column; overflow-x: auto; border-block: 1px solid var(--line); scrollbar-width: thin; }
.hour { padding: 20px 12px; border-right: 1px solid var(--line); text-align: center; }
.hour:last-child { border-right: 0; }
.hour time, .hour small { display: block; color: var(--muted); font-size: 12px; }
.hour .weather-glyph { display: block; margin: 12px 0; font-size: 25px; }
.hour strong { display: block; font-size: 20px; }
.hour small { margin-top: 8px; color: var(--blue); }

.empty-note { padding: 30px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); text-align: center; }

.week-list { border-top: 1px solid var(--line); }
.week-day {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) 54px minmax(120px, .75fr) minmax(180px, 1fr) 100px;
  align-items: center;
  gap: 20px;
  min-height: 92px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
.week-day.today { margin-inline: -8px; padding-inline: 26px; border-radius: 14px; background: rgba(255,255,255,.65); }
.week-date strong, .week-date span { display: block; }
.week-date span, .week-source { margin-top: 4px; color: var(--muted); font-size: 12px; }
.week-icon { font-size: 29px; }
.week-temp strong { font-size: 21px; }
.week-temp span { color: var(--muted); }
.temp-bar { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.temp-track { flex: 1; height: 5px; overflow: hidden; border-radius: 999px; background: #d9e2e1; }
.temp-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--sun), var(--accent)); }
.precip { color: var(--blue); text-align: right; }

.month-head { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 22px; }
.month-head h2 { margin: 0; font: 400 clamp(2rem, 4vw, 3.3rem) Georgia, serif; }
.legend { display: flex; flex-wrap: wrap; justify-content: end; gap: 14px; color: var(--muted); font-size: 12px; }
.legend span::before { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--ink); content: ""; }
.legend .forecast::before { background: var(--accent); }
.legend .projected::before { border: 1px solid var(--blue); background: transparent; }

.calendar { display: grid; grid-template-columns: repeat(7, 1fr); overflow: hidden; border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.35); }
.weekday { padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-align: center; text-transform: uppercase; }
.calendar-day { position: relative; min-height: 126px; padding: 12px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.calendar-day:hover { background: rgba(255,255,255,.72); }
.calendar-day.blank { cursor: default; background: rgba(226,224,216,.38); }
.calendar-day.selected { box-shadow: inset 0 0 0 2px var(--accent); }
.calendar-day .day-number { display: inline-grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; font-size: 13px; }
.calendar-day.today .day-number { color: white; background: var(--ink); }
.calendar-day .weather-glyph { display: block; margin: 8px 0 6px; font-size: 25px; }
.calendar-temp { font-weight: 650; }
.calendar-temp span { color: var(--muted); font-weight: 400; }
.data-dot { position: absolute; top: 15px; right: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.data-dot.forecast { background: var(--accent); }
.data-dot.projected { border: 1px solid var(--blue); background: transparent; }

footer { max-width: 1240px; margin: 0 auto; padding: 0 28px 30px; color: var(--muted); font-size: 12px; }

@media (max-width: 760px) {
  .site-header { flex-direction: column; align-items: stretch; gap: 18px; padding: 18px; }
  .search-wrap { width: 100%; }
  main { padding: 28px 18px 56px; }
  .location-bar { align-items: stretch; flex-direction: column; gap: 24px; }
  .date-nav { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; }
  .date-field { min-width: 0; justify-content: center; }
  .date-field input { min-width: 0; }
  .date-nav .text-button { grid-column: 1 / -1; width: 100%; }
  .view-tabs { margin-top: 36px; }
  .day-hero { grid-template-columns: 1fr; }
  .day-primary { min-height: 330px; }
  .day-details { min-height: 330px; }
  .week-day { grid-template-columns: 1fr 42px minmax(105px, auto); gap: 12px; padding-inline: 6px; }
  .week-condition, .temp-bar { display: none; }
  .precip { grid-column: 3; font-size: 12px; }
  .month-head { align-items: start; flex-direction: column; gap: 12px; }
  .legend { justify-content: start; }
  .calendar { grid-template-columns: repeat(7, minmax(40px, 1fr)); }
  .weekday { padding-inline: 2px; font-size: 9px; }
  .calendar-day { min-height: 98px; padding: 6px; }
  .calendar-day .weather-glyph { font-size: 18px; }
  .calendar-temp { font-size: 13px; }
  .data-dot { top: 11px; right: 8px; }
  footer { padding-inline: 18px; }
}

@media (max-width: 430px) {
  #search-form button { display: none; }
  #location-search { padding-right: 14px; }
  .day-primary::after { width: 90px; height: 90px; }
  .details-grid { gap: 24px 12px; }
}

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