:root {
  --navy: #07182b;
  --navy-deep: #04111f;
  --panel: rgba(9, 24, 41, 0.86);
  --panel-strong: rgba(11, 31, 52, 0.98);
  --line: rgba(167, 197, 226, 0.18);
  --line-strong: rgba(124, 177, 230, 0.38);
  --text: #edf5fc;
  --muted: #adc0d3;
  --blue: #82b5e5;
  --blue-bright: #bfe1ff;
  --gold: #e7b65c;
  --red: #b53b45;
  --green: #73c58a;
  --shadow: 0 28px 72px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 0%, rgba(74, 143, 205, 0.24), transparent 30rem),
    radial-gradient(circle at 94% 14%, rgba(231, 182, 92, 0.12), transparent 30rem),
    linear-gradient(180deg, #0b223a 0%, var(--navy) 44%, var(--navy-deep) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 86%);
  mask-image: linear-gradient(180deg, #000, transparent 86%);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }
[hidden] { display: none !important; }

.shell {
  width: min(1120px, calc(100% - 1.5rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 17, 31, 0.76);
  backdrop-filter: blur(18px);
}

.nav-shell {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand { display: grid; gap: 0.12rem; }
.brand strong { font-family: "Fraunces", Georgia, serif; font-size: 1.2rem; }
.brand span { color: var(--muted); font-size: 0.82rem; }

.nav-actions { display: flex; align-items: center; gap: 0.8rem; color: var(--muted); }
.nav-actions a { padding: 0.7rem 0.85rem; border-radius: 999px; }
.nav-actions a:hover,
.nav-actions a:focus-visible { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.nav-actions .source-link {
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: rgba(130, 181, 229, 0.12);
}

.weather-page { padding: 1rem 0 2.5rem; }

.weather-hero {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(230px, 0.7fr) minmax(230px, 0.7fr);
  align-items: center;
  gap: clamp(1.2rem, 3vw, 2.4rem);
  padding: clamp(1.5rem, 5vw, 4rem);
  border: 1px solid var(--line-strong);
  border-radius: 30px;
  background:
    linear-gradient(120deg, rgba(5, 22, 39, 0.94), rgba(8, 35, 58, 0.82)),
    radial-gradient(circle at 80% 10%, rgba(231, 182, 92, 0.26), transparent 34%);
  box-shadow: var(--shadow);
}

.weather-hero::after {
  content: "";
  position: absolute;
  right: -6rem;
  bottom: -9rem;
  width: 34rem;
  height: 20rem;
  border-radius: 50% 50% 0 0;
  background: rgba(28, 72, 99, 0.28);
  transform: rotate(-8deg);
  pointer-events: none;
}

.sky-glow {
  position: absolute;
  top: -8rem;
  right: -4rem;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(231, 182, 92, 0.28), rgba(231, 182, 92, 0) 66%);
  pointer-events: none;
}

.hero-copy,
.hero-reading,
.wind-compass { position: relative; z-index: 1; }

.eyebrow,
.section-label,
.metric-label {
  color: var(--blue-bright);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 { font-family: "Fraunces", Georgia, serif; line-height: 1.05; }

h1 {
  max-width: 650px;
  margin: 0.75rem 0 1rem;
  font-size: clamp(3rem, 7vw, 6.2rem);
  letter-spacing: -0.035em;
}

.hero-copy > p {
  max-width: 620px;
  margin: 0;
  color: #c5d5e4;
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  line-height: 1.7;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.78rem;
  border: 1px solid rgba(115, 197, 138, 0.34);
  border-radius: 999px;
  color: #d8f5df;
  background: rgba(50, 122, 71, 0.18);
  font-size: 0.82rem;
}

.status-pill.is-offline {
  border-color: rgba(181, 59, 69, 0.38);
  color: #ffd9dd;
  background: rgba(181, 59, 69, 0.16);
}

.status-pill.is-loading {
  border-color: var(--line-strong);
  color: var(--blue-bright);
  background: rgba(130, 181, 229, 0.12);
}

.status-dot {
  width: 0.56rem;
  height: 0.56rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(115, 197, 138, 0.11);
}

.is-offline .status-dot { background: #dc6872; box-shadow: 0 0 0 5px rgba(181, 59, 69, 0.13); }
.is-loading .status-dot { background: var(--blue); animation: pulse 1.2s ease-in-out infinite; }
.observation-time { color: var(--muted); font-size: 0.82rem; }

.hero-reading {
  padding: 1.35rem;
  border-left: 1px solid var(--line);
}

.temperature-line {
  display: flex;
  align-items: flex-start;
  font-size: clamp(4.5rem, 9vw, 7.5rem);
  font-weight: 500;
  line-height: 0.86;
  letter-spacing: -0.07em;
}

.temperature-line sup {
  margin: 0.5rem 0 0 0.45rem;
  color: var(--gold);
  font-size: 1.1rem;
  letter-spacing: 0;
}

.hero-reading p,
.wind-compass p { margin: 1rem 0 0; color: var(--muted); }
.hero-reading strong,
.wind-compass strong { color: var(--text); }

.wind-compass { text-align: center; }
.compass-face {
  position: relative;
  width: 180px;
  aspect-ratio: 1;
  margin: 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background:
    repeating-conic-gradient(from -1deg, rgba(190, 218, 242, 0.18) 0 1deg, transparent 1deg 15deg),
    radial-gradient(circle, rgba(130, 181, 229, 0.12), rgba(255, 255, 255, 0.025) 64%);
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.25);
}

.compass-face > span:not(.wind-arrow):not(.compass-center) {
  position: absolute;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.compass-north { top: 0.55rem; left: 50%; transform: translateX(-50%); }
.compass-east { top: 50%; right: 0.6rem; transform: translateY(-50%); }
.compass-south { bottom: 0.55rem; left: 50%; transform: translateX(-50%); }
.compass-west { top: 50%; left: 0.6rem; transform: translateY(-50%); }

.wind-arrow {
  position: absolute;
  top: 30px;
  left: calc(50% - 7px);
  width: 14px;
  height: 60px;
  transform-origin: 50% 60px;
  transform: rotate(0deg);
  transition: transform 500ms ease;
}

.wind-arrow::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 20px solid var(--gold);
}

.wind-arrow::after {
  content: "";
  position: absolute;
  top: 18px;
  left: 5px;
  width: 4px;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(var(--gold), rgba(231, 182, 92, 0.18));
}

.compass-center {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--navy-deep);
  font-weight: 700;
}

.conditions-section,
.history-section,
.source-panel,
.weather-unavailable {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.conditions-section,
.history-section { padding: clamp(1.25rem, 4vw, 2.2rem); }

.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

h2 { margin: 0.35rem 0 0; font-size: clamp(1.7rem, 4vw, 2.55rem); }
h3 { margin: 0; font-size: 1.3rem; }

.refresh-button,
.primary-link,
.weather-unavailable a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.72rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  background: rgba(130, 181, 229, 0.12);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.refresh-button:hover,
.refresh-button:focus-visible,
.primary-link:hover,
.primary-link:focus-visible,
.weather-unavailable a:hover,
.weather-unavailable a:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(231, 182, 92, 0.56);
  background: rgba(231, 182, 92, 0.1);
}

.refresh-button:disabled { cursor: wait; opacity: 0.68; transform: none; }

.conditions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.metric-card {
  min-height: 178px;
  padding: 1.15rem;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -2rem;
  bottom: -3rem;
  width: 9rem;
  height: 9rem;
  border-radius: 50%;
  background: rgba(130, 181, 229, 0.08);
}

.rain-card::after { background: rgba(68, 150, 206, 0.13); }
.sunlight-card::after { background: rgba(231, 182, 92, 0.12); }

.metric-card strong {
  display: block;
  margin-top: 1.5rem;
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  line-height: 1;
}

.metric-card strong small { color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.metric-card p { position: relative; z-index: 1; margin: 1rem 0 0; color: var(--muted); font-size: 0.86rem; }

.history-note { color: var(--muted); font-size: 0.82rem; }

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.025);
}

.summary-strip > div { padding: 1rem; }
.summary-strip > div + div { border-left: 1px solid var(--line); }
.summary-strip span { display: block; color: var(--muted); font-size: 0.75rem; }
.summary-strip strong { display: block; margin-top: 0.35rem; font-size: 1.3rem; }

.chart-card {
  margin-top: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(130, 181, 229, 0.07), rgba(255, 255, 255, 0.02));
}

.chart-title-row { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.chart-title-row p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.82rem; }
.chart-title-row > span { color: var(--gold); font-weight: 700; }

.wind-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.wind-charts-grid .chart-card { min-width: 0; margin-top: 0; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  min-height: 1.2rem;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.chart-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }

.legend-line {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.legend-line-average { background: #82b5e5; }
.legend-line-gust { background: #e7b65c; }

.legend-dot {
  width: 8px;
  height: 8px;
  border: 2px solid #e7b65c;
  border-radius: 50%;
  background: #82b5e5;
}

.weather-chart {
  display: block;
  width: 100%;
  height: 260px;
  margin-top: 0.7rem;
}

.chart-axis-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.72rem; }

.source-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.25rem, 4vw, 2.2rem);
}

.source-panel p,
.weather-unavailable p { max-width: 720px; margin: 0.75rem 0 0; color: var(--muted); line-height: 1.65; }
.source-panel .primary-link { flex: 0 0 auto; }

.weather-unavailable { padding: clamp(1.25rem, 4vw, 2.2rem); border-color: rgba(181, 59, 69, 0.3); }
.weather-unavailable a { margin-top: 1rem; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0 1.8rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer a { color: var(--blue-bright); }

@keyframes pulse {
  0%, 100% { opacity: 0.48; }
  50% { opacity: 1; }
}

@media (max-width: 940px) {
  .weather-hero { grid-template-columns: 1fr 1fr; }
  .hero-copy { grid-column: 1 / -1; }
  .hero-reading { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .conditions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wind-charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .site-header { position: static; }
  .nav-shell,
  .nav-actions,
  .section-heading-row,
  .source-panel,
  .site-footer { align-items: flex-start; flex-direction: column; }
  .nav-shell { padding: 0.8rem 0; }
  .nav-actions { width: 100%; gap: 0.25rem; }
  .nav-actions a { padding-left: 0; }
  .nav-actions .source-link { padding-left: 0.8rem; }
  .weather-hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-copy { grid-column: auto; }
  .wind-compass { padding-top: 0.5rem; border-top: 1px solid var(--line); }
  .conditions-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 150px; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-strip > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .summary-strip > div:nth-child(4) { border-top: 1px solid var(--line); }
  .source-panel .primary-link { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
