:root {
  --ink: #10232e;
  --ink-soft: #3d5563;
  --paper: #f7f5ef;
  --paper-alt: #eef1ec;
  --line: #dcdfd6;
  --brand: #1d6f5e;
  --brand-dark: #12483d;
  --accent: #d97a3f;
  --port: #cc3333;
  --starboard: #2e9a44;
  --radius: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.15;
  margin: 0 0 .5em;
  color: var(--ink);
}

h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; color: var(--ink-soft); }

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247,245,239,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.logo {
  font-family: Georgia, serif;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05rem;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo span {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 400;
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--brand);
}

.site-nav {
  display: flex;
  gap: 22px;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: .95rem;
  font-weight: 500;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 0 8px;
  background: var(--ink);
}

/* Hero */
.hero {
  padding: 84px 0 64px;
  text-align: center;
  background: linear-gradient(180deg, var(--paper-alt), var(--paper));
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .8rem;
  color: var(--brand);
  font-weight: 600;
  margin-bottom: .75em;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  max-width: 18ch;
  margin-left: auto;
  margin-right: auto;
}

.hero .lead {
  max-width: 56ch;
  margin: 1em auto 1.6em;
  font-size: 1.05rem;
}

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 600;
  transition: background .15s ease;
}

.btn:hover { background: var(--brand-dark); }

.hero-note {
  margin: 1.2em 0 0;
  font-size: .9rem;
}

/* Sections */
.section { padding: 64px 0; }
.section.alt { background: var(--paper-alt); }

.section-intro {
  max-width: 60ch;
  font-size: 1.02rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.card-grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }

.card h3 { margin-bottom: .35em; color: var(--brand-dark); }
.card p { margin: 0; font-size: .95rem; }

/* Boat diagram */
.diagram-heading {
  margin-top: 40px;
}

.boat-diagrams {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 18px;
  margin-top: 22px;
}

.boat-diagrams figure {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 20px;
  margin: 0;
}

.boat-diagrams figcaption {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 10px;
  font-size: 1rem;
}

.boat-diagrams figcaption span {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 400;
  font-size: .85rem;
  color: var(--ink-soft);
  margin-left: .5em;
}

.diagram-scroll { overflow-x: auto; }

.boat-diagrams svg {
  display: block;
  width: 100%;
  height: auto;
}

.diagram-legend {
  list-style: none;
  counter-reset: part;
  margin: 24px 0 0;
  padding: 0;
  columns: 3;
  column-gap: 32px;
}

.diagram-legend li {
  counter-increment: part;
  position: relative;
  break-inside: avoid;
  margin-bottom: 10px;
  padding-left: 34px;
  font-size: .93rem;
  color: var(--ink-soft);
}

.diagram-legend li::before {
  content: counter(part);
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
  font-family: Georgia, serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diagram-legend strong { color: var(--ink); }

@media (max-width: 960px) {
  .diagram-legend { columns: 2; }
}

.stroke-cycle {
  list-style: none;
  counter-reset: phase;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 18px;
}

.stroke-cycle li {
  counter-increment: phase;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 18px;
}

.stroke-cycle svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 12px;
}

.stroke-cycle h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  color: var(--brand-dark);
  margin-bottom: .3em;
}

.stroke-cycle h3::before {
  content: counter(phase);
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stroke-cycle p { margin: 0; font-size: .92rem; }

.side-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin-top: 22px;
}

.side-key p {
  margin: 0;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.side-key strong { color: var(--ink); }

.chip {
  flex: none;
  width: 22px;
  height: 10px;
  border-radius: 3px;
}

.chip-port { background: var(--port); }
.chip-starboard { background: var(--starboard); }

/* Table */
.table-wrap {
  margin-top: 28px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

th, td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
}

th {
  background: var(--paper-alt);
  font-weight: 600;
  color: var(--ink);
}

tr:last-child td { border-bottom: none; }

.note {
  margin-top: 18px;
  font-size: .9rem;
  padding: 14px 18px;
  background: #fff;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}

/* Steps */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.steps li {
  counter-increment: step;
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px 20px 66px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 18px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-family: Georgia, serif;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
}

.steps h3 { margin-bottom: .3em; }
.steps p { margin: 0; font-size: .95rem; }

/* CTA / contact */
.cta { text-align: left; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.contact-grid > div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.contact-grid h3 {
  font-size: 1rem;
  color: var(--brand-dark);
  margin-bottom: .3em;
}

.contact-grid p { margin: 0; font-size: .95rem; }

/* Footer */
.site-footer {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: .85rem;
  color: var(--ink-soft);
}

/* Responsive nav */
@media (max-width: 760px) {
  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 12px 24px 18px;
    gap: 14px;
    display: none;
  }

  .site-nav.open { display: flex; }

  .boat-diagrams svg { min-width: 560px; }

  .diagram-legend { columns: 1; }

  .hero { padding: 56px 0 44px; }
  .section { padding: 48px 0; }
}
