:root {
  color-scheme: light;
  --bg: #f6f9fc;
  --surface: #ffffff;
  --ink: #1a2b3c;
  --muted: #51606e;
  --brand: #0b7285;
  --brand-dark: #09596a;
  --accent: #2fb3a0;
  --border: #dce5ec;
  --code-bg: #eef4f8;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 42, 60, 0.08), 0 6px 20px rgba(16, 42, 60, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--brand-dark);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

header.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.2px;
}

.brand:hover {
  color: var(--brand);
}

nav.active-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

nav.active-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.3rem 0.1rem;
}

nav.active-nav a:hover {
  color: var(--brand);
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  scroll-margin-top: 5rem;
}

section {
  scroll-margin-top: 5rem;
}

.hero {
  text-align: center;
  padding: 2rem 0 2.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  margin: 0 0 1rem;
  text-wrap: balance;
}

.hero p.lede {
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  max-width: 46rem;
  margin: 0 auto 1.5rem;
  color: var(--muted);
  text-wrap: pretty;
}

.btn-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--brand);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
}

.btn-primary:hover {
  background: var(--brand-dark);
  color: #fff;
}

.btn-outline {
  color: var(--brand);
  border: 1px solid var(--border);
  background: var(--surface);
}

.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: #eef8fa;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin: 1.75rem 0;
  box-shadow: var(--shadow);
}

h2 {
  font-size: clamp(1.45rem, 3vw, 1.75rem);
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

h3 {
  font-size: 1.1rem;
  margin: 1.4rem 0 0.4rem;
  color: var(--brand-dark);
  text-wrap: balance;
}

ul,
ol {
  margin: 0.5rem 0;
  padding-left: 1.4rem;
}

li {
  margin: 0.3rem 0;
}

figure {
  margin: 1.5rem 0 0.5rem;
  text-align: center;
}

figcaption {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

dl.grid-terms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem 1.75rem;
  margin: 0.75rem 0 0;
}

dl.grid-terms div {
  break-inside: avoid;
}

dt {
  font-weight: 700;
  color: var(--brand-dark);
}

dd {
  margin: 0.15rem 0 0.6rem;
  color: var(--muted);
  font-size: 0.95rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.95rem;
}

caption {
  text-align: left;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--code-bg);
  font-variant-numeric: tabular-nums;
}

td {
  font-variant-numeric: tabular-nums;
}

code,
.wind-term {
  background: var(--code-bg);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
  font-size: 0.95em;
}

.wind-diagram {
  max-width: 720px;
  margin: 1.5rem auto 0.5rem;
}

.wind-diagram svg {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #eaf6f8 0%, #fdfefe 60%);
}

.safety {
  background: #fff8ef;
  border-color: #f0d9b8;
}

.safety h2 {
  color: #8a5a00;
}

.safety strong {
  color: #6d4700;
}

footer.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
  align-items: center;
}

.footer-wrap a {
  color: var(--brand);
  text-decoration: none;
}

.footer-wrap a:hover {
  text-decoration: underline;
}

.footer-wrap p {
  margin: 0;
}

.course-arrow {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2.5;
}

.wind-tufts {
  stroke: #7f7f8f;
  stroke-width: 1.6;
  fill: none;
}

.wind-label {
  fill: #55606c;
  font-size: 13px;
  font-weight: 600;
}

.wing {
  stroke: #1a2b3c;
  stroke-width: 1.6;
  stroke-linejoin: round;
  fill: #eaf6f8;
}

.boat-txt {
  fill: #1a2b3c;
  font-size: 12.5px;
  font-weight: 700;
}

.pick-tip {
  border-left: 4px solid var(--accent);
  background: #eefaf7;
  padding: 0.9rem 1.1rem;
  border-radius: 0 10px 10px 0;
  margin: 1rem 0;
}

@media (max-width: 720px) {
  .nav-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  nav.active-nav {
    flex-direction: column;
    gap: 0.4rem;
  }

  main {
    padding-top: 1.25rem;
  }
}

@supports (text-wrap: balance) {
  h1, h2, h3 { text-wrap: balance; }
  .hero p.lede { text-wrap: pretty; }
}
