@font-face {
  font-family: "Libre Franklin";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/libre-franklin-600.ttf") format("truetype");
}

@font-face {
  font-family: "Wix Madefor Text";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/wix-madefor-text-400.ttf") format("truetype");
}

:root {
  color-scheme: dark;
  --background: #011634;
  --surface: #082442;
  --surface-hover: #0b2c4c;
  --text: #f6f8fb;
  --muted: #a8bfd0;
  --gold: #ecbf5b;
  --aqua: #9ae0d9;
  --sky: #72b8d0;
  --line: #28435b;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}
body {
  margin: 0;
  min-width: 280px;
  background: var(--background);
  color: var(--text);
  font-family: "Wix Madefor Text", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button,
select {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
select:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 5px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2 {
  font-family: "Libre Franklin", sans-serif;
  font-weight: 600;
}
[hidden] {
  display: none !important;
}
.dashboard {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: 44px 40px 24px;
}
.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}
.heading {
  min-width: 0;
  text-align: center;
}
.brand-logo {
  display: block;
  width: 100%;
  max-width: 200px;
  height: auto;
  object-fit: contain;
}
.brand-oceanica {
  justify-self: end;
  filter: invert(1) hue-rotate(180deg) contrast(1.25);
  mix-blend-mode: screen;
}
.eyebrow {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  color: var(--sky);
}
.eyebrow-line {
  width: 22px;
  height: 1px;
  background: var(--sky);
}
h1 {
  margin: 10px 0 6px;
  color: var(--gold);
  font-size: 30px;
  line-height: 1.25;
}
.subtitle {
  color: var(--muted);
  font-size: 14px;
}
.location-field {
  display: grid;
  gap: 7px;
  width: min(100%, 304px);
  min-width: 0;
}
.location-field label {
  font-size: 12px;
  color: var(--muted);
}
select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #56758c;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.location-code {
  font-size: 11px;
  color: var(--sky);
  overflow-wrap: anywhere;
}
.station-band {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-top: 30px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.station-identity {
  display: flex;
  justify-self: end;
  min-width: 0;
  align-items: center;
  gap: 16px;
  text-align: right;
}
.station-identity > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.buoy-image {
  object-fit: contain;
  width: 30px;
  height: 52px;
  flex-shrink: 0;
  image-rendering: auto;
}
.section-label {
  color: var(--sky);
  font-size: 10px;
}
.station-identity h2 {
  font-size: 19px;
  margin-top: 3px;
}
.tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}
.tabs button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  position: relative;
  min-width: 0;
  min-height: 58px;
  padding: 14px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}
.tabs button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: transparent;
}
.tabs button[aria-selected="true"] {
  color: var(--gold);
  background: linear-gradient(0deg, #ecbf5b0a, transparent);
}
.tabs button[aria-selected="true"]::after {
  background: var(--gold);
}
.tabs button:hover {
  color: var(--text);
}
.tabs svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}
.measurements-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 20px;
}
.measurements-heading h2 {
  font-size: 19px;
  margin-top: 4px;
}
.sample-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
}
.sample-label svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.readings-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.loading-track {
  height: 3px;
  margin-bottom: 16px;
  overflow: hidden;
}
.layout-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.layout-menu {
  position: relative;
  width: 280px;
  max-width: 100%;
  min-width: 0;
}
.layout-menu summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  list-style: none;
  font-size: 13px;
}
.layout-menu summary::-webkit-details-marker {
  display: none;
}
.layout-menu summary > span {
  flex: 1;
  min-width: 0;
}
.layout-menu summary svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--aqua);
}
.layout-choice {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.layout-menu summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.layout-menu[open] summary {
  border-color: var(--sky);
}
.layout-options {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 8px 24px #0006;
}
.layout-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px;
  font-size: 12px;
  cursor: pointer;
}
.layout-options label:hover,
.layout-options label:focus-within {
  background: var(--surface-hover);
}
.layout-options input {
  accent-color: var(--gold);
  flex-shrink: 0;
  margin: 0;
}
.sensor-grid.is-grouped {
  display: block;
}
.sensor-group + .sensor-group {
  margin-top: 28px;
}
.sensor-group-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--aqua);
  font-size: 16px;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.sensor-group-title span {
  font-size: 11px;
  color: var(--muted);
}
.loading-bar {
  height: 100%;
  background: var(--line);
  overflow: hidden;
}
.loading-bar::after {
  content: "";
  display: block;
  width: 35%;
  height: 100%;
  background: var(--aqua);
  animation: loading-travel 1.3s ease-in-out infinite;
}
@keyframes loading-travel {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(386%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .loading-bar::after {
    animation: none;
    width: 100%;
  }
}
.sensor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.sensor-card {
  min-width: 0;
  padding: 20px 22px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  animation: reveal 260ms ease-out both;
}
.sensor-card:nth-child(2),
.sensor-card:nth-child(5) {
  animation-delay: 35ms;
}
.sensor-card:nth-child(3),
.sensor-card:nth-child(6) {
  animation-delay: 70ms;
}
.sensor-card:hover {
  border-color: #4c7189;
  background: var(--surface-hover);
}
.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
}
.sensor-icon {
  display: flex;
  color: var(--aqua);
}
.sensor-icon svg {
  width: 23px;
  height: 23px;
  stroke-width: 1.5;
}
.sensor-context {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}
.sensor-name {
  margin-top: 16px;
  min-height: 24px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.reading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 68px;
  margin-top: 4px;
}
.sensor-value {
  font-size: 38px;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}
.sensor-unit {
  color: var(--sky);
  font-size: 16px;
}
.measurement-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  vertical-align: middle;
  border: 2px solid var(--line);
  border-top-color: var(--aqua);
  border-right-color: var(--aqua);
  border-radius: 50%;
  animation: measurement-spin 900ms linear infinite;
}
.sensor-card.is-loading .sensor-unit {
  visibility: hidden;
}
@keyframes measurement-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .measurement-spinner {
    animation: none;
  }
}
.reading.is-wind {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 104px;
}
.wind-rose {
  display: block;
  width: 88px;
  height: 88px;
}
.wind-rose text {
  fill: var(--muted);
  text-anchor: middle;
  font-size: 12px;
}
.wind-rose .wind-north {
  fill: var(--gold);
}
.wind-ring,
.wind-ticks {
  fill: none;
  stroke: var(--sky);
  stroke-width: 1;
}
.wind-shaft,
.wind-arrowhead {
  fill: none;
  stroke: var(--text);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wind-origin {
  fill: var(--aqua);
}
.wind-degrees {
  white-space: nowrap;
}
.wind-degrees .sensor-value {
  font-size: 28px;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-height: 42px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
}
.sensor-quality {
  color: var(--sky);
}
.sensor-card.is-stale .sensor-quality {
  color: var(--gold);
}
.reading-label {
  overflow-wrap: anywhere;
}
.sensor-card.is-missing .sensor-value {
  color: var(--muted);
  font-size: 28px;
}
.sensor-card.is-missing .sensor-quality {
  color: var(--gold);
}
.page-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}
.page-footer > span:first-child {
  color: var(--sky);
}
.footer-dot {
  padding: 0 5px;
}
.data-state {
  padding: 28px 0;
  color: var(--muted);
}
.data-state button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--sky);
  border-radius: 4px;
  color: var(--text);
}
.data-state button svg {
  width: 16px;
  height: 16px;
}
.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;
}
@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 900px) {
  .dashboard {
    padding: 30px 24px 20px;
  }
  .sensor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 620px) {
  .wind-card {
    grid-column: 1 / -1;
  }
  .dashboard {
    padding: 24px 18px 18px;
  }
  .page-header {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
    gap: 12px;
  }
  h1 {
    font-size: 22px;
  }
  .eyebrow {
    font-size: 8px;
    gap: 4px;
  }
  .eyebrow-line {
    display: none;
  }
  .subtitle {
    font-size: 11px;
  }
  .location-field {
    width: 100%;
  }
  .location-field label {
    font-size: 11px;
  }
  .location-field select {
    min-width: 0;
    font-size: 12px;
    padding: 10px 6px;
  }
  .station-identity {
    gap: 8px;
  }
  .station-identity h2 {
    font-size: 16px;
  }
  .buoy-image {
    width: 20px;
    height: 40px;
  }
  .station-band {
    margin-top: 22px;
    padding: 14px 0;
  }
  .tabs button {
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    padding: 12px 2px;
    min-height: 76px;
  }
  .measurements-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding-top: 24px;
  }
  .sensor-grid {
    gap: 12px;
  }
  .sensor-card {
    padding: 16px 14px 0;
  }
  .sensor-value {
    font-size: 32px;
  }
  .sensor-unit {
    font-size: 13px;
  }
  .sensor-name {
    min-height: 42px;
    font-size: 13px;
  }
  .sensor-context {
    font-size: 10px;
  }
  .reading {
    min-height: 60px;
  }
  .card-footer {
    min-height: 48px;
  }
  .page-footer {
    flex-direction: column;
    gap: 6px;
  }
}
@media (max-width: 359px) {
  .dashboard {
    padding-left: 14px;
    padding-right: 14px;
  }
  .sensor-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .sensor-name {
    min-height: 24px;
  }
  .tabs button {
    font-size: 11px;
  }
  .page-header {
    gap: 8px;
  }
  h1 {
    font-size: 20px;
  }
  .station-band {
    gap: 10px;
  }
  .station-identity .section-label {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
