:root {
  --ink: #173b37;
  --ink-soft: #55706b;
  --paper: #f3f0e7;
  --paper-deep: #e9e5da;
  --coral: #ef6b4e;
  --coral-dark: #d95238;
  --line: rgba(23, 59, 55, 0.2);
  --white: #fffdf7;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 75% 15%, rgba(255,255,255,.9), transparent 28rem),
    var(--paper);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.site-header, main, footer { width: min(1240px, calc(100% - 64px)); margin-inline: auto; }

.site-header {
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--paper);
  background: var(--ink);
  border-radius: 50%;
}

.header-actions { display: flex; align-items: center; gap: 9px; }

.location-chip, .install-button {
  display: flex;
  align-items: center;
  max-width: 260px;
  gap: 9px;
  padding: 10px 15px;
  color: var(--ink);
  background: rgba(255,255,255,.42);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: .2s ease;
}

.location-chip:hover, .install-button:hover { background: var(--white); transform: translateY(-1px); }
.location-chip svg, .install-button svg { width: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.location-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.install-button { color: var(--paper); background: var(--ink); border-color: var(--ink); font-weight: 700; }
.install-button:hover { color: var(--ink); }
.install-button[hidden] { display: none; }

.hero {
  min-height: 660px;
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  align-items: center;
  gap: 54px;
  padding: 62px 0 52px;
}

.intro { position: relative; z-index: 2; }
.eyebrow {
  margin: 0 0 18px;
  color: var(--coral-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1, h2 { font-family: "Newsreader", serif; font-weight: 400; }
h1 {
  margin: 0;
  font-size: clamp(62px, 7.3vw, 106px);
  line-height: .82;
  letter-spacing: -.065em;
}
h1 em { color: var(--coral); font-size: .48em; font-style: normal; letter-spacing: -.02em; }

.wind-description {
  max-width: 430px;
  margin: 28px 0 32px;
  color: var(--ink-soft);
  font-family: "Newsreader", serif;
  font-size: 21px;
  line-height: 1.42;
}

.wind-reading { display: flex; align-items: stretch; gap: 22px; }
.wind-reading > div { display: flex; flex-direction: column; gap: 5px; }
.reading-value { white-space: nowrap; }
.reading-value strong { font-size: 25px; letter-spacing: -.04em; }
.reading-value small { font-size: 12px; font-weight: 600; }
.reading-label, .card-label { color: var(--ink-soft); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.divider { width: 1px; background: var(--line); }

.compass-wrap {
  position: relative;
  width: min(100%, 650px);
  aspect-ratio: 1;
  justify-self: end;
}

.compass-glow {
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  background: rgba(255,255,255,.7);
  box-shadow: 0 0 90px 80px rgba(255,255,255,.46);
}

.compass { position: relative; width: 100%; overflow: visible; filter: drop-shadow(0 20px 30px rgba(29, 55, 49, .06)); }
.outer-ring, .inner-ring { fill: none; stroke: var(--ink); }
.outer-ring { stroke-width: 1; opacity: .56; }
.inner-ring { stroke-width: .8; stroke-dasharray: 2 5; opacity: .25; }
.ticks path { fill: none; stroke: var(--ink); stroke-width: 1.2; opacity: .48; }
.petal { stroke: var(--ink); stroke-width: 1.2; stroke-linejoin: round; }
.petal.cardinal { fill: rgba(23,59,55,.08); }
.petal.ordinal { fill: rgba(23,59,55,.025); }
.petal.north { fill: var(--ink); }
.label { fill: var(--ink); font-family: "DM Sans", sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .09em; transition: fill .3s, font-size .3s; }
.label.active { fill: var(--coral-dark); font-size: 12px; }

.wind-arrow {
  transform-origin: 250px 250px;
  transform: rotate(0deg);
  transition: transform 1.1s cubic-bezier(.2,.85,.28,1);
}
.arrow-trail { fill: none; stroke: var(--coral); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 3 12; animation: flow 1.25s linear infinite; }
.arrow-head { fill: var(--coral); }
.wind-arrow circle { fill: var(--coral); stroke: var(--paper); stroke-width: 4; }
@keyframes flow { to { stroke-dashoffset: -30; } }

.compass-center {
  position: absolute;
  left: 50%; top: 50%;
  display: grid;
  width: 46px; height: 46px;
  place-items: center;
  transform: translate(-50%, -50%);
  color: var(--white);
  background: var(--ink);
  border: 5px solid var(--paper);
  border-radius: 50%;
  box-shadow: 0 5px 15px rgba(23,59,55,.22);
  font-size: 10px;
  font-weight: 700;
}

.details {
  display: grid;
  grid-template-columns: 1.3fr .8fr 1fr;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.weather-card {
  min-height: 134px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 34px;
}
.weather-card + .weather-card { border-left: 1px solid var(--line); }
.weather-card > div:not(.weather-icon), .temperature-card { display: flex; flex-direction: column; gap: 6px; }
.weather-card strong { font-family: "Newsreader", serif; font-size: 26px; font-weight: 500; }
.weather-icon { display: grid; width: 58px; height: 58px; place-items: center; color: var(--paper); background: var(--ink); border-radius: 50%; font-size: 27px; }
.temperature-card strong { font-size: 38px; line-height: 1; }
.temperature-card > span:last-child { color: var(--ink-soft); font-size: 12px; }
.update-card { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; }
.update-card strong { font-family: "DM Sans", sans-serif; font-size: 15px; }
.update-card button {
  grid-column: 2; grid-row: 1 / 3;
  align-self: center;
  padding: 11px 14px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.update-card button:hover { background: var(--white); }
.update-card button.loading span { display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.location-panel {
  margin: 36px 0 0;
  padding: 32px 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 3px;
}
.location-panel[hidden] { display: none; }
.location-panel .eyebrow { margin-bottom: 8px; color: #ff9a81; }
.location-panel h2 { margin: 0 0 5px; font-size: 34px; }
.location-panel p:last-child { margin: 0; color: rgba(255,255,255,.65); font-size: 13px; }
.panel-actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px; flex: 0 0 auto; }
.primary-button { padding: 13px 22px; color: var(--ink); background: var(--paper); border: 0; border-radius: 999px; cursor: pointer; font-weight: 700; }
.text-button { color: rgba(255,255,255,.7); background: none; border: 0; cursor: pointer; font-size: 12px; text-decoration: underline; }

footer {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 11px;
}
footer a { color: inherit; }

.status {
  position: fixed;
  left: 50%; bottom: 24px;
  z-index: 30;
  max-width: calc(100% - 32px);
  padding: 11px 18px;
  transform: translate(-50%, 100px);
  color: var(--white);
  background: var(--ink);
  border-radius: 999px;
  box-shadow: 0 8px 25px rgba(0,0,0,.18);
  font-size: 13px;
  opacity: 0;
  transition: .3s ease;
}
.status.visible { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 5px; padding-top: 50px; }
  .intro { text-align: center; }
  .wind-description { margin-inline: auto; }
  .wind-reading { justify-content: center; }
  .compass-wrap { width: min(100%, 600px); justify-self: center; }
  .details { grid-template-columns: 1fr 1fr; }
  .update-card { grid-column: 1 / -1; border-left: 0 !important; border-top: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .site-header, main, footer { width: min(100% - 32px, 1240px); }
  .site-header { height: 78px; }
  .brand-mark { width: 31px; height: 31px; }
  .location-chip { max-width: 150px; padding: 8px 11px; font-size: 12px; }
  .install-button { width: 35px; height: 35px; justify-content: center; padding: 0; }
  .install-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .hero { min-height: auto; padding: 42px 0 34px; }
  h1 { font-size: clamp(58px, 19vw, 82px); }
  .wind-description { margin: 22px auto 26px; font-size: 18px; }
  .wind-reading { gap: 14px; }
  .reading-value strong { font-size: 21px; }
  .compass-wrap { width: calc(100% + 12px); margin: 16px -6px 0; }
  .label { font-size: 9px; }
  .label.active { font-size: 10px; }
  .details { grid-template-columns: 1fr; }
  .weather-card { min-height: 110px; padding: 23px 20px; }
  .weather-card + .weather-card { border-left: 0; border-top: 1px solid var(--line); }
  .update-card { grid-column: auto; }
  .location-panel { padding: 28px 24px; flex-direction: column; align-items: stretch; }
  footer { padding: 30px 0; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; }
}

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