:root {
  --bg: #ffffff;
  --surface: #ffffff;

  --fg: #171717;
  --fg-2: #4d4d4d;
  --muted: #666666;
  --muted-2: #808080;

  --border: rgba(0, 0, 0, 0.08);
  --border-soft: rgba(0, 0, 0, 0.04);

  --accent: #0070f3;
  --accent-hover: color-mix(in oklab, var(--accent), black 8%);

  --green: #16a34a;
  --amber: #eab308;
  --red: #dc2626;

  --font-display: "Geist", "Geist Sans", -apple-system, "Segoe UI", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", "Roboto Mono", Menlo, Monaco, "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;

  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;

  --elev-raised:
    0 0 0 1px rgba(0, 0, 0, 0.08),
    0 2px 2px rgba(0, 0, 0, 0.04),
    0 8px 8px -8px rgba(0, 0, 0, 0.04),
    0 0 0 1px #fafafa;

  --motion-fast: 150ms;
  --motion-base: 200ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  padding: 2.5rem 1.25rem 1.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 0 var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--fg);
}

.topbar .muted {
  color: var(--muted);
  font-weight: 400;
}

.subtitle {
  font-family: var(--font-mono);
  color: var(--muted);
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.best-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.best-card {
  background: var(--surface);
  box-shadow: var(--elev-raised);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  transition: box-shadow var(--motion-base) var(--ease-standard);
}

.best-card:hover {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.12),
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

.best-card .icon {
  width: 28px;
  height: 28px;
  color: var(--fg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.best-card .icon svg {
  width: 100%;
  height: 100%;
}

.best-card .label {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.best-card .value {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-top: 0.2rem;
}

.panel {
  background: var(--surface);
  box-shadow: var(--elev-raised);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.panel h2 {
  margin-top: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-soft);
  color: var(--fg);
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

.day-card {
  background: var(--surface);
  box-shadow: var(--elev-raised);
  border-radius: var(--radius);
  padding: 0.9rem 0.85rem;
  transition: box-shadow var(--motion-fast) var(--ease-standard);
}

.day-card:hover {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.12),
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

.day-card.past {
  opacity: 0.55;
}

.day-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 0.4rem;
  margin-bottom: 0.4rem;
}

.day-icon, .row-icon {
  width: 22px;
  height: 22px;
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.weather-icon {
  width: 100%;
  height: 100%;
}

.wind-row {
  margin: 0.4rem 0 0.6rem;
}

.wind-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.wind-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.compass-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-2);
}

.compass-disc {
  width: 22px;
  height: 22px;
  background: var(--fg);
  color: #ffffff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s var(--ease-standard);
}

.compass-arrow-svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.day-card .day-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.day-card .day-date {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 0.5rem;
}

.day-card .metrics {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.4rem 0 0.7rem;
}

.badges {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  cursor: help;
  box-shadow: 0 0 0 1px var(--border);
}

.badge svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
}

.badge.score-good {
  background: #f0fdf4;
  color: var(--green);
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.25);
}

.badge.score-ok {
  background: #fefce8;
  color: #a16207;
  box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.25);
}

.badge.score-bad {
  background: #fef2f2;
  color: var(--red);
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.2);
}

.menu-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.menu-table th,
.menu-table td {
  text-align: left;
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

.menu-table th {
  font-family: var(--font-mono);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #fafafa;
}

.menu-table tbody tr:hover {
  background: #fbfbfb;
}

.day-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.day-tab {
  background: transparent;
  border: none;
  box-shadow: 0 0 0 1px var(--border);
  color: var(--fg-2);
  border-radius: var(--radius);
  padding: 0.4rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all var(--motion-fast) var(--ease-standard);
}

.day-tab:hover {
  color: var(--fg);
  box-shadow: 0 0 0 1px var(--fg);
}

.day-tab.active {
  background: var(--fg);
  color: #ffffff;
  box-shadow: 0 0 0 1px var(--fg);
  font-weight: 600;
}

.day-tab.past {
  opacity: 0.55;
}

.day-tab.past.active {
  opacity: 0.9;
}

.hourly-table {
  overflow-x: auto;
}

.hourly-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  white-space: nowrap;
}

.hourly-table th,
.hourly-table td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
}

.hourly-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  background: #fafafa;
}

.hourly-table tbody tr:hover {
  background: #fbfbfb;
}

.hourly-table tr.past {
  opacity: 0.45;
}

.hourly-table tr.current td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 600;
  color: var(--accent);
}

.hourly-table tr.score-good {
  background: #f0fdf4;
}

.hourly-table tr.score-ok {
  background: #fefce8;
}

.hourly-table tr.score-bad {
  background: #fef2f2;
}

.dir-arrow {
  display: inline-block;
  color: var(--fg);
  transition: transform 0.2s ease;
  cursor: help;
}

.menu-table a {
  color: var(--fg);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--motion-fast) var(--ease-standard);
}

.menu-table a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.loading {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 1.5rem 1.25rem 2rem;
  box-shadow: 0 -1px 0 0 var(--border);
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}
