:root {
  color-scheme: light;
  --ink: #1d1a16;
  --muted: #6d645b;
  --line: #e4dacb;
  --sheet: #f4efe6;
  --paper: #fffaf3;
  --accent: #9a4d2c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Manrope, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--sheet);
}
a { color: inherit; }
button, input { font: inherit; }
::selection { background: #e7b59a; color: #1d1a16; }
.sr, .skip {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip:focus {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0.5rem 0.8rem;
  clip: auto;
  background: white;
  border-radius: 999px;
}

.desk { min-height: 100dvh; }
.hero {
  --hero-ink: #172033;
  --hero-muted: rgba(23, 32, 51, 0.72);
  position: relative;
  display: flex;
  min-height: 34rem;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  overflow: hidden;
  padding: 1.35rem 1.25rem 4.5rem;
  color: var(--hero-ink);
  container-type: size;
}
.hero-top, .brand { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand {
  position: relative;
  z-index: 1;
  width: max-content;
  color: inherit;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.2rem;
  text-decoration: none;
}
.page-home .hero { justify-content: flex-start; gap: 1.4rem; padding-top: 0.85rem; }
.page-home .hero-foot { margin-top: auto; }
.page-home .brand { font-size: clamp(1.35rem, 2.4vw, 1.7rem); line-height: 1; }
.precip { position: absolute; inset: 0; pointer-events: none; }
.brand span { margin-left: 0.28rem; font-weight: 500; letter-spacing: 0; opacity: 0.8; }
.country { margin: 0; font-size: 0.95rem; color: var(--hero-muted); }
.hero-copy { position: relative; z-index: 1; max-width: 18em; }
.h1-prefix {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--hero-muted);
}
.city-name {
  display: block;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.98;
}
h1 { margin: 0; font-weight: inherit; }
.subtitle, .lead, .feels { color: var(--hero-muted); }
.subtitle { margin: 0.7rem 0 0; font-size: 1.05rem; }
.lead { margin: 1rem 0 0; font-size: 1.15rem; line-height: 1.45; max-width: 28rem; }
.hero-teaser { color: inherit; text-decoration: none; display: block; }
.teaser-kicker { display: block; margin-top: 1rem; color: var(--hero-muted); font-weight: 600; }
.hero-temp {
  display: flex;
  align-items: flex-start;
  gap: 0.12em;
  margin: 0.2rem 0 0;
  font-size: clamp(6.5rem, 24vw, 10rem);
  font-weight: 500;
  line-height: 0.86;
}
.hero-digits { letter-spacing: -0.04em; }
.hero-degree { margin-top: 0.06em; font-size: 0.38em; line-height: 1; letter-spacing: 0; }
@supports (font-size: 1cqh) {
  .hero-temp { font-size: clamp(6.75rem, 28cqh, 14rem); }
}
.condition {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.35rem 0 0;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 600;
}
.condition svg, .day-label svg, .hours svg { width: 1.45rem; height: 1.45rem; flex: none; }
.feels { margin: 0.35rem 0 0; font-size: 1.15rem; }
.sun-times {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 1.5rem;
}
.sun-times p { margin: 0; }
.sun-times span { display: block; color: var(--hero-muted); font-size: 0.85rem; }
.sun-times b { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 500; letter-spacing: -0.04em; }
.hero-foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}
.share { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.4rem; margin-left: auto; }
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #1d1a16;
  color: #f6f1e8;
  text-decoration: none;
  cursor: pointer;
}
.share-btn svg { width: 1.05rem; height: 1.05rem; display: block; }
.share-btn:hover, .share-btn.is-done { background: #fff; color: #1d1a16; }
.fav-add, .fav-remove {
  border: 0;
  border-radius: 999px;
  background: #1d1a16;
  color: #f6f1e8;
  padding: 0.48rem 0.85rem;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.fav-add:hover, .fav-remove:hover { background: #fff; color: #1d1a16; }
.fav-add { margin-top: 0.9rem; }
.fav-add.is-on { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; }
.favorites { margin-top: 1rem; }
.favorites h2 { margin-top: 0; }
.favorites ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.favorites li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1rem;
}
.favorites a {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  text-decoration: none;
}
.favorites a > span,
.favorites small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.favorites small { color: var(--muted); font-weight: 500; font-size: 0.82rem; }
.fav-now[hidden] { display: none; }
.fav-now {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.28rem;
  max-width: 46%;
  line-height: 1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fav-now svg { width: 1.05rem; height: 1.05rem; flex: 0 0 auto; display: block; }
.fav-now b { font-weight: 700; }
.fav-now .fav-cond {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.orb, .clouds, .stars, .precip span { position: absolute; }
.orb, .clouds, .stars { display: none; }
.orb {
  top: 6%;
  right: -6rem;
  width: 24rem;
  height: 24rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 248, 220, 0.95) 0%, rgba(255, 206, 110, 0.45) 32%, transparent 68%);
}
.hero[data-sky="clear-day"] .orb { display: block; }
.hero[data-sky="clear-night"] .orb {
  top: 12%;
  right: 8%;
  display: block;
  width: 8.5rem;
  height: 8.5rem;
  background: radial-gradient(circle at 38% 38%, #f8f4ea 0%, #d5e0f0 46%, transparent 72%);
  box-shadow: 0 0 48px rgba(214, 224, 245, 0.35);
}
.clouds {
  inset: 0;
  background:
    radial-gradient(ellipse 42% 24% at 18% 28%, rgba(255, 255, 255, 0.55), transparent 70%),
    radial-gradient(ellipse 50% 26% at 72% 20%, rgba(255, 255, 255, 0.38), transparent 72%),
    radial-gradient(ellipse 36% 20% at 46% 72%, rgba(255, 255, 255, 0.22), transparent 70%);
}
.hero[data-sky="cloudy-day"] .clouds, .hero[data-sky="fog"] .clouds { display: block; }
.hero[data-sky="cloudy-night"] .clouds { display: block; opacity: 0.35; }
.stars {
  top: 14%;
  left: 10%;
  width: 2px;
  height: 2px;
  border-radius: 999px;
  background: white;
  box-shadow: 18px 30px 0 white, 70px 8px 0 white, 120px 46px 0 white, 40px 90px 0 white, 160px 24px 0 white, 200px 70px 0 white, 90px 120px 0 white, 240px 16px 0 white, 280px 88px 0 white, 24px 160px 0 white;
  opacity: 0.85;
}
.hero[data-sky="clear-night"] .stars { display: block; }
.precip span {
  display: none;
  top: -12%;
  width: 1.5px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  animation: fall linear infinite;
}
.hero[data-sky="rain"] .precip span, .hero[data-sky="thunder"] .precip span, .hero[data-sky="snow"] .precip span { display: block; }
.hero[data-sky="snow"] .precip span { width: 5px; height: 5px; background: white; }
@keyframes fall { from { transform: translateY(0); } to { transform: translateY(120vh); } }
@media (prefers-reduced-motion: reduce) {
  .precip span { animation: none; opacity: 0.35; }
  html { scroll-behavior: auto; }
}

.hero[data-sky="clear-day"] { background: radial-gradient(46% 42% at 84% 16%, rgba(255, 236, 190, 0.95), transparent 68%), linear-gradient(168deg, #d7efff 0%, #7eb0dc 52%, #f0c98a 100%); }
.hero[data-sky="clear-night"] {
  --hero-ink: #f6f3ec;
  --hero-muted: rgba(246, 243, 236, 0.74);
  background: radial-gradient(28% 28% at 78% 18%, rgba(190, 208, 235, 0.28), transparent 70%), linear-gradient(180deg, #070b16 0%, #1b2950 62%, #10182e 100%);
}
.hero[data-sky="cloudy-day"] { background: radial-gradient(48% 32% at 18% 18%, rgba(255, 255, 255, 0.55), transparent 70%), linear-gradient(180deg, #d5e0ea 0%, #93a8ba 100%); }
.hero[data-sky="cloudy-night"] {
  --hero-ink: #f4f1ea;
  --hero-muted: rgba(244, 241, 234, 0.74);
  background: linear-gradient(185deg, #151c28 0%, #3c4a5c 100%);
}
.hero[data-sky="fog"] { background: linear-gradient(180deg, #eceff2 0%, #b7c1c9 100%); }
.hero[data-sky="rain"], .hero[data-sky="thunder"] {
  --hero-ink: #f6f3ec;
  --hero-muted: rgba(246, 243, 236, 0.75);
}
.hero[data-sky="rain"] { background: linear-gradient(180deg, #1b2836 0%, #3d5368 100%); }
.hero[data-sky="snow"] { background: radial-gradient(70% 42% at 72% 0%, rgba(255, 255, 255, 0.9), transparent 62%), linear-gradient(180deg, #eef3f8 0%, #a9bfd2 100%); }
.hero[data-sky="thunder"] { background: linear-gradient(180deg, #140f1e 0%, #3a2a52 58%, #22182f 100%); }

.sheet {
  position: relative;
  z-index: 2;
  margin-top: -1.5rem;
  border-radius: 1.5rem 1.5rem 0 0;
  background: var(--sheet);
  padding: 1.4rem 1.15rem 2.5rem;
}
.sheet h2, .catalog h2 { margin: 1.4rem 0 0.7rem; font-size: 1.15rem; letter-spacing: -0.03em; }
.search { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.search-field { position: relative; flex: 1 1 16rem; min-width: min(100%, 16rem); }
.search input {
  width: 100%;
  min-width: 0;
  border: 1px solid #ddd2c3;
  background: var(--paper);
  border-radius: 999px;
  padding: 0.85rem 1rem;
  color: var(--ink);
}
.suggest {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 16px 36px rgba(23, 18, 12, 0.14);
  max-height: 22rem;
  overflow: auto;
}
.suggest a, .suggest span {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.75rem;
  color: inherit;
  text-decoration: none;
}
.suggest a.is-on, .suggest a:hover { background: #f4ece3; }
.suggest small { color: var(--muted); font-size: 0.82rem; }
.suggest .is-empty { color: var(--muted); cursor: default; }
.search button, .pager a, .more a {
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1rem;
  background: #1d1a16;
  color: #f6f1e8;
  text-decoration: none;
  cursor: pointer;
}
.search button[data-locate] { background: transparent; color: var(--ink); border: 1px solid #d9cec0; }
.locate-error { min-height: 1.2em; margin: 0.4rem 0 0; color: var(--accent); font-size: 0.92rem; }
.lead-sheet { color: var(--muted); line-height: 1.5; }
.metrics, .days, .hours, .chips, .city-list { list-style: none; margin: 0; padding: 0; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.metrics li, .days li, .city-list a {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1rem;
}
.metrics li { padding: 0.8rem 0.9rem; }
.metrics span, .day-pop, .hour-pop, .credits, .meta-line, .updated, .crumbs { color: var(--muted); }
.metrics b { display: block; margin-top: 0.2rem; font-size: 1.05rem; }
.hours { display: flex; gap: 0.45rem; overflow-x: auto; padding-bottom: 0.4rem; scroll-snap-type: x mandatory; }
.hours li {
  flex: 0 0 4.6rem;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.7rem 0.3rem;
  background: var(--paper);
  border-radius: 1rem;
}
.hour-temp, .day-temps b { font-weight: 600; }
.days { display: flex; flex-direction: column; gap: 0.45rem; }
.days li {
  display: grid;
  grid-template-columns: 5.2rem 1fr auto auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
}
.day-name { text-transform: capitalize; }
.day-label { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.day-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-temps { display: flex; gap: 0.45rem; }
.prose { font-size: 1.05rem; line-height: 1.55; }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chips a, .letters a {
  display: inline-flex;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  text-decoration: none;
}
.chips a:hover, .letters a:hover, .city-list a:hover { border-color: #c9b8a4; }
.crumbs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.9rem; font-size: 0.92rem; }
.crumbs a { color: var(--accent); }
.credits, .meta-line, .updated { font-size: 0.9rem; }
.credits a { color: var(--accent); }
.ad-slot { margin: 0.9rem 0; overflow: hidden; }
.ad-slot--preview {
  border: 1px dashed currentColor;
  border-radius: 0.8rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.85rem;
}
.hero .ad-slot { position: relative; z-index: 1; }

.catalog { max-width: 52rem; margin: 0 auto; padding: 1.5rem 1.15rem 3rem; }
.catalog h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); letter-spacing: -0.04em; }
.brand-line { margin: 0 0 0.4rem; }
.brand-line a { font-weight: 700; text-decoration: none; letter-spacing: -0.04em; }
.letters { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 1rem 0; }
.letters a.is-on { background: #1d1a16; color: #f6f1e8; border-color: #1d1a16; }
.city-list { display: flex; flex-direction: column; gap: 0.45rem; }
.city-list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  text-decoration: none;
}
.city-list small { color: var(--muted); text-align: right; }
.empty { line-height: 1.5; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; margin-top: 1.2rem; }
.more { margin-top: 1.2rem; }

@media (min-width: 720px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .days li { grid-template-columns: 6rem 1fr 3rem auto; }
}
@media (min-width: 1024px) {
  .desk {
    display: grid;
    height: 100dvh;
    min-height: 0;
    grid-template-columns: minmax(0, 1.08fr) minmax(26rem, 0.92fr);
    overflow: hidden;
  }
  .hero { height: 100%; min-height: 0; padding: 1.35rem 2.5rem 2rem; }
  .page-home .brand { font-size: 1.85rem; }
  .page-home .hero-copy { max-width: 100%; }
  .page-home .city-name { font-size: clamp(3.4rem, 4.4vw, 5.2rem); max-width: 16em; }
  .sheet {
    height: 100%;
    margin: 0;
    overflow: auto;
    border-radius: 0;
    border-left: 1px solid var(--line);
    padding: 1.8rem 1.8rem 2.4rem;
  }
  .hero-temp { font-size: clamp(7.5rem, 24cqh, 13rem); }
}
@media (max-width: 640px) {
  .fav-now .fav-cond { display: none; }
  .days li { grid-template-columns: 4.4rem 1fr auto; }
  .day-pop { display: none; }
  .city-list a { flex-direction: column; gap: 0.15rem; }
  .city-list small { text-align: left; }
}
