:root {
  --bg: #071016;
  --surface: #0e1921;
  --surface-soft: #111e27;
  --surface-tint: #171b1d;
  --line: rgba(178, 202, 201, 0.15);
  --line-gold: rgba(216, 173, 97, 0.22);
  --text: #f2eee7;
  --muted: #9ca8ad;
  --gold: #d8ad61;
  --teal: #59cbc6;
  --red: #d86a5a;
  --green: #8bc982;
  --radius: 16px;
  --control-radius: 10px;
  --font-ui: "Manrope", "Segoe UI Variable", "Segoe UI", sans-serif;
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  font-family: var(--font-ui);
  letter-spacing: -0.018em;
  background:
    radial-gradient(circle at 78% 5%, rgba(89, 203, 198, 0.065), transparent 27%),
    linear-gradient(145deg, #071016, #09141b 58%, #060d12);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.1;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

.op-shell {
  width: min(1500px, calc(100% - 64px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.op-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 4px 20px;
  border-bottom: 1px solid var(--line-gold);
}

.op-brand {
  display: grid;
  justify-items: start;
  gap: 8px;
}

.op-brand strong {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.035em;
  line-height: 0.72;
  text-transform: uppercase;
}

.op-brand strong span {
  display: block;
}

.op-brand strong span:last-child {
  margin-top: 8px;
  font-size: 27px;
}

.op-brand > span {
  color: rgba(242, 238, 231, 0.55);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.op-back {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: #dfc181;
  text-decoration: none;
  border: 1px solid rgba(216, 173, 97, 0.29);
  border-radius: var(--control-radius);
  background: rgba(216, 173, 97, 0.055);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.op-back:hover,
.op-back:focus-visible {
  border-color: rgba(216, 173, 97, 0.62);
  background: rgba(216, 173, 97, 0.11);
  outline: none;
  transform: translateX(-2px);
}

.op-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 56px;
  align-items: end;
  padding: 42px 4px 30px;
}

.op-kicker {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.op-hero h1 {
  max-width: 14ch;
  margin: 0;
  color: #f3eee6;
  font-family: var(--font-display);
  font-size: clamp(48px, 4.4vw, 68px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.94;
}

.op-hero-copy {
  max-width: 48ch;
  margin: 0;
  color: rgba(242, 238, 231, 0.66);
  font-size: 16px;
  line-height: 1.65;
}

.op-controlbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 0 2px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.window-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.window-tab {
  min-height: 34px;
  padding: 0 0 8px;
  cursor: pointer;
  color: rgba(242, 238, 231, 0.64);
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.window-tab:hover,
.window-tab:focus-visible {
  color: #f0d79e;
  border-bottom-color: rgba(216, 173, 97, 0.4);
  outline: none;
}

.window-tab[aria-pressed="true"] {
  color: #f3dcaa;
  border-color: transparent transparent var(--gold);
  background: transparent;
}

.window-tab:active,
.op-back:active,
.source-link:active {
  transform: translateY(1px);
}

.updated {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(242, 238, 231, 0.49);
  font-size: 12px;
  white-space: nowrap;
}

.updated::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(89, 203, 198, 0.09);
}

.status-message {
  display: none;
  margin: 0 0 16px;
  padding: 12px 14px;
  color: #e7c3bb;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid rgba(216, 106, 90, 0.24);
  border-radius: var(--control-radius);
  background: rgba(112, 38, 31, 0.18);
}

.status-message.is-visible {
  display: block;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr 0.9fr 1.3fr;
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  min-height: 132px;
  position: relative;
  overflow: hidden;
  padding: 20px 21px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(17, 30, 39, 0.94), rgba(10, 21, 28, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.metric::after {
  content: "";
  position: absolute;
  top: -42px;
  right: -38px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--metric-accent, var(--teal)) 6%, transparent);
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(242, 238, 231, 0.55);
  font-size: 12px;
  font-weight: 680;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.metric-label i {
  color: var(--metric-accent, var(--teal));
  font-size: 17px;
}

.metric-value {
  margin-top: 15px;
  color: #f3f0ea;
  font-size: clamp(27px, 2.6vw, 39px);
  font-weight: 660;
  letter-spacing: -0.045em;
  line-height: 1;
}

.metric-note {
  margin-top: 9px;
  color: rgba(242, 238, 231, 0.54);
  font-size: 13.5px;
  line-height: 1.4;
}

.metric-reading .metric-value {
  max-width: 18ch;
  color: #e6c982;
  font-family: var(--font-display);
  font-size: clamp(23px, 2vw, 31px);
  font-weight: 500;
  line-height: 1.08;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(390px, 0.75fr);
  gap: 18px;
}

.data-panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(14, 25, 33, 0.96), rgba(9, 18, 24, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin: 0;
  color: #f0ece5;
  font-size: 23px;
  font-weight: 590;
  letter-spacing: -0.025em;
}

.panel-head p {
  max-width: 42ch;
  margin: 5px 0 0;
  color: rgba(242, 238, 231, 0.48);
  font-size: 13px;
  line-height: 1.45;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  color: #d9bf87;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid rgba(216, 173, 97, 0.22);
  border-radius: 9px;
  transition: border-color 150ms ease, background 150ms ease;
}

.source-link:hover,
.source-link:focus-visible {
  border-color: rgba(216, 173, 97, 0.55);
  background: rgba(216, 173, 97, 0.07);
  outline: none;
}

.hourly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(98px, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(171, 197, 196, 0.13);
  border-radius: 14px;
  background: rgba(7, 15, 21, 0.26);
}

.hour-card {
  min-height: 156px;
  padding: 18px 14px;
  border: 0;
  border-right: 1px solid rgba(171, 197, 196, 0.11);
  border-radius: 0;
  background: transparent;
}

.hour-card:last-child {
  border-right: 0;
}

.hour-card:nth-child(even) {
  background: rgba(255, 255, 255, 0.018);
}

.hour-card.best {
  border-top: 2px solid rgba(216, 173, 97, 0.75);
  background: linear-gradient(180deg, rgba(216, 173, 97, 0.075), transparent 76%);
}

.hour-time {
  color: #e3c985;
  font-size: 13px;
  font-weight: 690;
}

.hour-main {
  margin: 13px 0 10px;
  color: #f1eee8;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.hour-facts {
  display: grid;
  gap: 5px;
  color: rgba(242, 238, 231, 0.55);
  font-size: 12px;
  line-height: 1.35;
}

.hour-facts span {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
}

.hour-facts strong {
  color: rgba(242, 238, 231, 0.8);
  font-size: 11.5px;
  font-weight: 570;
}

.radar-frame {
  min-height: 426px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(171, 197, 196, 0.13);
  border-radius: 16px;
  background: #071119;
}

.radar-map {
  width: 768px;
  height: 768px;
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-columns: repeat(3, 256px);
  grid-template-rows: repeat(3, 256px);
  transform: translate(-50%, -50%);
  filter: saturate(0.76) contrast(1.05) brightness(0.76);
}

.map-tile {
  width: 256px;
  height: 256px;
  position: relative;
}

.map-tile img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  display: block;
}

.map-tile img.radar-layer {
  z-index: 1;
  opacity: 0.72;
}

.map-marker {
  width: 16px;
  height: 16px;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  border: 3px solid #f2d68e;
  border-radius: 50%;
  background: #0c171d;
  box-shadow: 0 0 0 6px rgba(242, 214, 142, 0.16), 0 6px 22px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
}

.map-caption {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: rgba(242, 238, 231, 0.75);
  font-size: 11px;
  line-height: 1.35;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background: rgba(4, 10, 14, 0.79);
  backdrop-filter: blur(12px);
}

.legend {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-swatch {
  width: 52px;
  height: 5px;
  border-radius: 5px;
  background: linear-gradient(90deg, #57bde8, #4cc38b, #e5d04c, #db6c47, #c24172);
}

.surf-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
  gap: 18px;
}

.surf-reading {
  min-height: 238px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
}

.surf-reading h2 {
  max-width: 14ch;
  margin: 10px 0 12px;
  color: #e8cd8c;
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
}

.surf-reading p {
  max-width: 52ch;
  margin: 0;
  color: rgba(242, 238, 231, 0.61);
  font-size: 15px;
  line-height: 1.55;
}

.condition-ring {
  width: 142px;
  height: 142px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--teal) var(--score, 62%), rgba(255, 255, 255, 0.07) 0);
}

.condition-ring::before {
  content: "";
  width: 116px;
  height: 116px;
  position: absolute;
  border-radius: 50%;
  background: #0b151c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.condition-ring strong,
.condition-ring span {
  position: relative;
  z-index: 1;
}

.condition-ring strong {
  font-size: 34px;
  letter-spacing: -0.045em;
}

.condition-ring span {
  margin-top: -34px;
  color: rgba(242, 238, 231, 0.48);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tide-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(171, 197, 196, 0.12);
  border-radius: 14px;
  background: rgba(7, 15, 21, 0.26);
}

.tide-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 15px 14px;
  border: 0;
  border-bottom: 1px solid rgba(171, 197, 196, 0.11);
  border-radius: 0;
  background: transparent;
}

.tide-item i {
  color: var(--gold);
  font-size: 24px;
}

.tide-item strong {
  display: block;
  color: rgba(242, 238, 231, 0.88);
  font-size: 14px;
  font-weight: 610;
}

.tide-item span {
  color: rgba(242, 238, 231, 0.48);
  font-size: 12px;
}

.tide-item time {
  color: #dfc181;
  font-size: 13px;
}

.tide-item:nth-child(even) {
  background: rgba(255, 255, 255, 0.018);
}

.method-note {
  margin: 16px 0 0;
  padding-top: 14px;
  color: rgba(242, 238, 231, 0.44);
  font-size: 11.5px;
  line-height: 1.5;
  border-top: 1px solid rgba(171, 197, 196, 0.1);
}

.empty-state {
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
  color: rgba(242, 238, 231, 0.5);
}

.empty-state i {
  display: block;
  margin-bottom: 12px;
  color: var(--gold);
  font-size: 30px;
}

.op-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  padding: 18px 4px 0;
  color: rgba(242, 238, 231, 0.38);
  font-size: 11.5px;
  line-height: 1.5;
  border-top: 1px solid var(--line);
}

.op-footer p {
  max-width: 74ch;
  margin: 0;
}

.op-footer a {
  color: rgba(223, 193, 129, 0.72);
  text-underline-offset: 2px;
}

@media (max-width: 1100px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid,
  .surf-grid {
    grid-template-columns: 1fr;
  }

  .radar-frame {
    min-height: 480px;
  }
}

@media (max-width: 760px) {
  .op-shell {
    width: min(100% - 24px, 1480px);
    padding-top: 12px;
  }

  .op-header,
  .op-brand,
  .op-controlbar,
  .panel-head,
  .op-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .op-brand {
    gap: 5px;
  }

  .op-header {
    gap: 15px;
    padding-bottom: 15px;
  }

  .op-back {
    width: 100%;
    justify-content: center;
  }

  .op-hero {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 34px 2px 28px;
  }

  .op-hero h1 {
    font-size: clamp(42px, 14vw, 63px);
  }

  .op-controlbar { padding: 0 2px 12px; }

  .updated {
    padding-left: 4px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 130px;
  }

  .data-panel {
    padding: 15px;
  }

  .panel-head {
    gap: 12px;
  }

  .source-link {
    width: 100%;
    justify-content: center;
  }

  .hourly-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .hour-card { border-bottom: 1px solid rgba(171, 197, 196, 0.11); }

  .radar-frame {
    min-height: 400px;
  }

  .surf-reading {
    grid-template-columns: 1fr;
  }

  .condition-ring {
    width: 126px;
    height: 126px;
  }

  .condition-ring::before {
    width: 102px;
    height: 102px;
  }
}

@media (max-width: 440px) {
  .window-tabs { width: 100%; gap: 18px; }

  .hourly-grid {
    grid-template-columns: 1fr;
  }

  .map-caption {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .metric,
  .data-panel,
  .op-controlbar,
  .map-caption {
    background: #0b151c;
    backdrop-filter: none;
  }
}
