:root {
  --ink: #17211c;
  --muted: #677169;
  --paper: #f4f0e8;
  --paper-deep: #e7dfd2;
  --card: rgba(255, 255, 255, .68);
  --line: rgba(23, 33, 28, .13);
  --accent: #e75f35;
  --green: #1f553e;
  --shadow: 0 24px 70px rgba(37, 48, 40, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 8%, rgba(247, 184, 101, .30), transparent 25rem),
    radial-gradient(circle at 8% 34%, rgba(121, 171, 164, .20), transparent 27rem),
    var(--paper);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

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

.sky-glow {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}
.sky-glow-one {
  width: 23rem; height: 23rem; right: -10rem; top: 30rem;
  border: 1px solid rgba(23, 33, 28, .08);
  box-shadow: 0 0 0 5rem rgba(255, 255, 255, .08), 0 0 0 10rem rgba(255, 255, 255, .05);
}
.sky-glow-two {
  width: 12rem; height: 12rem; left: -6rem; top: 8rem;
  background: rgba(255, 255, 255, .25);
}

.site-header {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .08em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 50%;
  font-size: 19px;
}
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--muted);
  font: 700 10px/1 system-ui, sans-serif;
  letter-spacing: .15em;
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #e75f35;
  box-shadow: 0 0 0 0 rgba(231, 95, 53, .45);
  animation: livePulse 2s infinite;
}
@keyframes livePulse { 50% { box-shadow: 0 0 0 6px rgba(231, 95, 53, 0); } }

main { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.globe-section {
  padding: 42px 0 72px;
  display: grid;
  grid-template-columns: minmax(250px, .72fr) minmax(420px, 1.28fr);
  align-items: center;
  gap: clamp(30px, 6vw, 85px);
  border-top: 1px solid var(--line);
}
.globe-copy h2 {
  margin: 0;
  font: 500 clamp(34px, 4.4vw, 58px)/1.22 "Yu Mincho", "Hiragino Mincho ProN", serif;
  letter-spacing: -.045em;
}
.globe-copy > p:not(.section-kicker):not(.globe-count) { margin: 22px 0; color: var(--muted); font-size: 13px; }
.globe-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.globe-controls button {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .48);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.globe-controls button:hover { background: #fff; }
.globe-count { margin: 14px 0 0; color: var(--muted); font-size: 10px; }
.globe-stage {
  position: relative;
  width: min(100%, 650px);
  justify-self: end;
  aspect-ratio: 1;
  touch-action: none;
  user-select: none;
}
#weatherGlobe { display: block; width: 100%; height: 100%; cursor: grab; }
#weatherGlobe:active { cursor: grabbing; }
.globe-tooltip {
  position: absolute;
  z-index: 3;
  max-width: 230px;
  padding: 9px 11px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 10px;
  background: rgba(23, 33, 28, .90);
  color: #fff;
  box-shadow: 0 10px 28px rgba(23,33,28,.18);
  pointer-events: none;
  font-size: 11px;
  line-height: 1.5;
}
.globe-tooltip strong { display: block; font-size: 12px; }
.globe-card-panel {
  position: absolute;
  z-index: 5;
  right: 14px;
  bottom: 14px;
  width: min(320px, calc(100% - 28px));
}
.globe-card-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 29px;
  height: 29px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(244, 240, 232, .92);
  color: var(--ink);
  cursor: pointer;
  font: 500 20px/1 system-ui, sans-serif;
}
.globe-card-close:hover { background: #fff; }
.globe-card-panel .globe-selected-card {
  min-height: 290px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 22px 55px rgba(23, 33, 28, .20);
  animation: globeCardIn .22s both;
}
.globe-card-panel .globe-selected-card:hover { transform: none; background: rgba(255, 255, 255, .96); }
.globe-card-panel .globe-selected-card .city-local-time { margin-right: 34px; }
@keyframes globeCardIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.hero { padding: 78px 0 90px; text-align: center; }
.eyebrow, .section-kicker {
  margin: 0 0 14px;
  color: var(--accent);
  font: 800 11px/1.3 system-ui, sans-serif;
  letter-spacing: .22em;
}
.hero h1 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(46px, 7vw, 88px);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -.055em;
}
.hero h1 em { color: var(--green); font-style: normal; }
.hero-copy { margin: 25px auto 35px; color: var(--muted); font-size: 15px; }

.weather-search {
  width: min(710px, 100%);
  margin: 0 auto;
  padding: 9px 9px 9px 23px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  border: 1px solid rgba(23, 33, 28, .18);
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(15px);
}
.search-icon { color: var(--green); font: 400 28px/1 serif; transform: rotate(-15deg); }
.weather-search input {
  min-width: 0;
  padding: 11px 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
}
.weather-search input::placeholder { color: #939990; }
.weather-search button, .empty-state button {
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  padding: 14px 22px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s, background .2s;
}
.weather-search button:hover, .empty-state button:hover { transform: translateY(-2px); background: var(--green); }
.search-message { min-height: 1.5em; margin: 12px 0 0; color: #a34428; font-size: 13px; }
.quick-filters { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.weather-chip {
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .38);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s ease;
}
.weather-chip:hover { border-color: rgba(23, 33, 28, .32); color: var(--ink); }
.weather-chip.is-active { color: #fff; background: var(--green); border-color: var(--green); }

.weather-overview, .city-results {
  padding: 55px 0 80px;
  border-top: 1px solid var(--line);
}
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.section-heading h2 { margin: 0; font: 500 clamp(28px, 4vw, 43px)/1.2 "Yu Mincho", "Hiragino Mincho ProN", serif; letter-spacing: -.035em; }
.updated-at, .result-count { margin: 0 0 5px; color: var(--muted); font-size: 12px; }
.update-status { max-width: 390px; text-align: right; }
.cache-note { margin: 3px 0 0; color: var(--muted); font-size: 10px; }

.overview-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.overview-card {
  position: relative;
  min-height: 236px;
  padding: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 18px;
  background: var(--weather-bg, #ddd);
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
}
.overview-card::after {
  content: "";
  position: absolute;
  width: 115px; height: 115px;
  right: -42px; top: -37px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35);
}
.overview-card:hover { transform: translateY(-6px); box-shadow: 0 17px 35px rgba(31, 42, 35, .16); }
.overview-top { display: flex; justify-content: space-between; align-items: center; }
.overview-symbol { font-size: 31px; line-height: 1; }
.overview-count { padding: 4px 8px; border-radius: 99px; background: rgba(255, 255, 255, .38); font: 800 10px/1 system-ui, sans-serif; }
.overview-label { margin-top: 43px; font: 700 23px/1.2 "Yu Mincho", serif; }
.overview-cities { margin-top: 8px; color: rgba(23, 33, 28, .70); font-size: 11px; line-height: 1.55; min-height: 3.1em; }
.overview-link { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(23, 33, 28, .13); display: flex; justify-content: space-between; font-size: 10px; font-weight: 800; }

.weather-sunny { --weather-bg: linear-gradient(145deg, #efc75d, #f6dd8e); }
.weather-heat { --weather-bg: linear-gradient(145deg, #ed754e, #f3a06d); }
.weather-cloudy { --weather-bg: linear-gradient(145deg, #b8c3bd, #d4d9d4); }
.weather-fog { --weather-bg: linear-gradient(145deg, #a8bdb9, #d1dcda); }
.weather-rain { --weather-bg: linear-gradient(145deg, #77a0a4, #abc3c1); }
.weather-heavy-rain { --weather-bg: linear-gradient(145deg, #53717a, #789298); color: #f8faf6; }
.weather-heavy-rain .overview-cities, .weather-thunder .overview-cities, .weather-blizzard .overview-cities { color: rgba(255, 255, 255, .75); }
.weather-heavy-rain .overview-link, .weather-thunder .overview-link, .weather-blizzard .overview-link { border-color: rgba(255, 255, 255, .25); }
.weather-thunder { --weather-bg: linear-gradient(145deg, #3e424d, #696d7a); color: #fff; }
.weather-hail { --weather-bg: linear-gradient(145deg, #8faeb9, #c5d9dd); }
.weather-snow { --weather-bg: linear-gradient(145deg, #d7e3e6, #f5f7f4); }
.weather-sleet { --weather-bg: linear-gradient(145deg, #91b2ba, #c3d7da); }
.weather-strong-wind { --weather-bg: linear-gradient(145deg, #77a28e, #b8d0c4); }
.weather-blizzard { --weather-bg: linear-gradient(145deg, #6e8790, #9fb4ba); color: #fff; }

.city-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.city-grid.is-grouped { display: block; }
.weather-city-group {
  padding: 34px 0 42px;
  border-top: 1px solid var(--line);
}
.weather-city-group:first-child { padding-top: 0; border-top: 0; }
.weather-city-group-heading {
  margin-bottom: 17px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}
.weather-city-group-heading h3 {
  margin: 0;
  font: 500 clamp(25px, 3vw, 34px)/1.3 "Yu Mincho", "Hiragino Mincho ProN", serif;
  letter-spacing: -.035em;
}
.weather-city-group-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.weather-city-group-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.weather-city-group-empty {
  margin: 0;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  font-size: 12px;
}
.city-card {
  --card-accent: #b2bdb5;
  min-height: 280px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 10px 30px rgba(37, 48, 40, .045);
  backdrop-filter: blur(10px);
  transition: transform .22s, background .22s;
  animation: cardIn .45s both;
}
.city-card:hover { transform: translateY(-4px); background: rgba(255, 255, 255, .90); }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } }
.city-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.city-weather-symbol {
  display: grid; place-items: center;
  width: 49px; height: 49px;
  border-radius: 15px;
  background: var(--card-accent);
  font-size: 25px;
}
.city-local-time { color: var(--muted); font: 700 11px/1.3 system-ui, sans-serif; letter-spacing: .06em; }
.city-card-body { margin-top: 30px; }
.city-country { margin: 0 0 3px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.city-name { margin: 0; font: 500 27px/1.25 "Yu Mincho", serif; }
.city-english-name {
  margin: 3px 0 0;
  color: var(--muted);
  font: 700 10px/1.4 system-ui, sans-serif;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.city-weather-row { margin-top: 16px; display: flex; align-items: baseline; gap: 9px; }
.city-temp { font: 500 34px/1 system-ui, sans-serif; letter-spacing: -.05em; }
.city-weather-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.city-meta { margin-top: auto; padding-top: 17px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.city-card[data-weather="sunny"] { --card-accent: #f1cb68; }
.city-card[data-weather="heat"] { --card-accent: #ee835d; }
.city-card[data-weather="cloudy"] { --card-accent: #c1cac5; }
.city-card[data-weather="fog"] { --card-accent: #b9cbc7; }
.city-card[data-weather="rain"] { --card-accent: #8dadaf; }
.city-card[data-weather="heavy-rain"] { --card-accent: #657e85; }
.city-card[data-weather="thunder"] { --card-accent: #686c78; }
.city-card[data-weather="hail"] { --card-accent: #aac4cc; }
.city-card[data-weather="snow"] { --card-accent: #dbe7e9; }
.city-card[data-weather="sleet"] { --card-accent: #aac7cd; }
.city-card[data-weather="strong-wind"] { --card-accent: #9dbdac; }
.city-card[data-weather="blizzard"] { --card-accent: #8fa8b0; }

.empty-state { padding: 65px 20px; text-align: center; border: 1px dashed rgba(23, 33, 28, .25); border-radius: 22px; }
.empty-state > span { font: 400 60px/1 serif; color: var(--muted); }
.empty-state h3 { margin: 16px 0 7px; font: 500 24px/1.4 "Yu Mincho", serif; }
.empty-state p { max-width: 520px; margin: 0 auto 24px; color: var(--muted); font-size: 13px; }
.empty-state button { padding: 11px 18px; }
.load-more-wrap { padding-top: 26px; text-align: center; }
.load-more-button {
  min-width: 220px;
  padding: 13px 23px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .56);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s, background .2s;
}
.load-more-button:hover { transform: translateY(-2px); background: #fff; }

footer {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 40px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 1040px) {
  .globe-section { grid-template-columns: minmax(220px, .8fr) minmax(380px, 1.2fr); gap: 28px; }
  .overview-grid { grid-template-columns: repeat(4, 1fr); }
  .overview-card { min-height: 210px; }
  .city-grid { grid-template-columns: repeat(3, 1fr); }
  .weather-city-group-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .site-header, main, footer { width: min(100% - 30px, 1180px); }
  .site-header { padding: 19px 0; }
  .globe-section { grid-template-columns: 1fr; padding: 36px 0 55px; }
  .globe-copy { text-align: center; }
  .globe-controls { justify-content: center; }
  .globe-stage { justify-self: center; width: min(100%, 560px); }
  .hero { padding: 48px 0 68px; }
  .hero h1 { font-size: clamp(40px, 13vw, 62px); }
  .hero-copy { font-size: 13px; }
  .desktop-only { display: none; }
  .weather-search { grid-template-columns: auto 1fr; padding: 9px 12px 9px 17px; }
  .weather-search button { grid-column: 1 / -1; width: 100%; }
  .quick-filters { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; margin-inline: -15px; padding: 0 15px 5px; scrollbar-width: none; }
  .weather-chip { flex: 0 0 auto; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .update-status { max-width: none; text-align: left; }
  .overview-grid { display: flex; overflow-x: auto; margin-inline: -15px; padding: 0 15px 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .overview-card { min-width: 180px; min-height: 220px; scroll-snap-align: start; }
  .city-grid { grid-template-columns: repeat(2, 1fr); }
  .city-card { min-height: 250px; }
  footer { flex-direction: column; gap: 4px; }
  footer p { margin: 0; }
}

@media (max-width: 470px) {
  .brand { font-size: 13px; }
  .live-badge { font-size: 8px; }
  .hero h1 { font-size: 43px; }
  .weather-overview, .city-results { padding: 43px 0 60px; }
  .city-grid { grid-template-columns: 1fr; }
  .weather-city-group-grid { grid-template-columns: 1fr; }
  .city-card { min-height: 244px; }
}

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