/* Keeldragger Sailing — keeldragger.com
   Design tokens and layout transcribed from the design handoff prototype.
   Values are the prototype's; only the delivery changed (inline -> stylesheet). */

:root {
  --ink: #12303c;        /* primary dark: buttons, dark cards */
  --sky: #a9d6e5;        /* brand light blue: hero, support, accents */
  --slate: #4a7c92;      /* secondary: links, Substack card */
  --sail: #fafcfd;       /* page background, light text */
  --frame-bg: #dcebf1;   /* iframe fallback */
  --muted-dark: rgba(18, 48, 60, .75);   /* muted text on light */
  --muted-light: rgba(250, 252, 253, .8); /* muted text on dark */
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sail);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--slate); text-decoration: none; }
a:hover { color: var(--ink); }

img { max-width: 100%; }

h1, h2 { letter-spacing: -.01em; }

/* Keyboard focus: visible on both light and dark grounds. */
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--slate);
  outline-offset: 3px;
  border-radius: 4px;
}
.card-dark a:focus-visible, .ticker a:focus-visible, footer a:focus-visible {
  outline-color: var(--sky);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--sail);
  padding: 12px 20px;
  border-radius: 0 0 8px 0;
  font-weight: 700;
  z-index: 10;
}
.skip-link:focus { left: 0; color: var(--sail); }

.wrap { max-width: 1320px; margin: 0 auto; }

/* Anchored sections shouldn't land flush against the viewport top. */
[id] { scroll-margin-top: 24px; }

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 44px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 54px; height: 54px; }
.brand-name { font-weight: 800; font-size: 19px; }

.nav {
  display: flex;
  gap: 24px;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
}
.nav a { color: var(--ink); }
.nav a:hover { color: var(--slate); }
.nav .nav-cta {
  color: var(--sail);
  background: var(--ink);
  padding: 9px 18px;
  border-radius: 99px;
}
.nav .nav-cta:hover { background: var(--slate); color: var(--sail); }

/* ---------- Hero ---------- */

.hero {
  background: var(--sky);
  margin: 0 20px;
  border-radius: 14px;
  padding: 56px 52px 0;
  overflow: hidden;
}
.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 36px;
}
.hero-copy { max-width: 56ch; }

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  background: var(--ink);
  color: var(--sky);
  padding: 7px 14px;
  border-radius: 99px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 56px;
  line-height: 1.04;
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -.015em;
}
.hero p { font-size: 18px; line-height: 1.5; margin: 0; }
/* After .hero p so the tagline's margin wins at equal-or-higher specificity. */
.hero p.hero-tagline {
  font-size: 21px;
  font-weight: 700;
  margin: 0 0 14px;
  color: rgba(18, 48, 60, .85);
}

.hero-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: none;
  padding-bottom: 6px;
}
.btn {
  font-weight: 700;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: 99px;
  text-align: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(18, 48, 60, .22); }
.btn-ink { background: var(--ink); color: var(--sail); }
.btn-ink:hover { color: var(--sail); }
.btn-sail { background: var(--sail); color: var(--ink); }
.btn-sail:hover { color: var(--ink); }
.btn-sky { background: var(--sky); color: var(--ink); display: inline-block; }
.btn-sky:hover { color: var(--ink); }

/* Route map is the centrepiece — never cropped. */
.hero-map {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 20px 50px rgba(18, 48, 60, .35);
}

/* Full-bleed inside the hero card via negative margins matching its padding. */
.ticker {
  background: var(--ink);
  color: var(--sky);
  margin: 0 -52px;
  padding: 14px 52px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .08em;
  white-space: nowrap;
  overflow: hidden;
}

/* ---------- Generic section + headings ---------- */

.sec { padding: 56px 44px; }
.sec-route { padding: 56px 44px 48px; }

.sec-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 26px;
  gap: 20px;
}
.sec-head h2 { font-size: 28px; font-weight: 800; margin: 0; }
.sec-head .mono-link,
.sec-head .mono-note {
  font-family: var(--mono);
  font-size: 12px;
  flex: none;
}
.sec-head .mono-link { color: var(--slate); }
.sec-head .mono-note { color: rgba(18, 48, 60, .55); }

/* ---------- Route: five chapters ---------- */

.grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }

/* Each chapter card links to that leg's video. */
.chapter {
  display: block;
  color: var(--ink);
  border: 1.5px solid rgba(18, 48, 60, .15);
  border-radius: 12px;
  padding: 20px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.chapter:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(18, 48, 60, .10); }
/* Kicker and watch-link are scoped .chapter .x — a bare .chapter-kicker loses
   the color/size fight to .chapter p, which matches the same element. */
.chapter .chapter-kicker {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--slate);
  margin: 0 0 10px;
}
.chapter h3 { font-weight: 800; font-size: 18px; margin: 0 0 8px; }
.chapter p { font-size: 13.5px; line-height: 1.5; color: var(--muted-dark); margin: 0; }
.chapter .chapter-watch {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--slate);
  margin: 12px 0 0;
}
.chapter:hover .chapter-watch { color: var(--ink); }

/* The single-handed leg is the headline of the trip. */
.chapter-featured { border-color: var(--ink); background: var(--sky); }
.chapter-featured .chapter-kicker, .chapter-featured .chapter-watch { color: var(--ink); }
.chapter-featured p { color: rgba(18, 48, 60, .8); }

/* ---------- Dark cards (Boat, Toolkit) ---------- */

.card-dark {
  margin: 0 20px;
  background: var(--ink);
  border-radius: 14px;
  color: var(--sail);
  padding: 52px;
  display: grid;
  gap: 44px;
  align-items: center;
}
.card-boat { grid-template-columns: 1fr 1fr; }
.card-toolkit { grid-template-columns: 1fr 300px; gap: 40px; }

.kicker {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  background: var(--sky);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 99px;
  margin-bottom: 16px;
}
.card-dark h2 { font-size: 34px; font-weight: 800; margin: 0 0 12px; }
.card-dark p {
  font-size: 16px;
  line-height: 1.55;
  color: rgba(250, 252, 253, .85);
  margin: 0 0 18px;
}
.card-toolkit p { color: var(--muted-light); margin-bottom: 22px; max-width: 54ch; }

/* A personal aside, set apart from the feature description above it. */
.toolkit-note {
  font-size: 14px;
  font-style: italic;
  color: var(--sky) !important;
  opacity: .85;
  max-width: 50ch;
}

/* Mono link at the foot of a dark card (boat card -> refit story). */
.card-dark .card-link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--sky);
  margin-top: 18px;
}
.card-dark .card-link:hover { color: var(--sail); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: 11.5px; }
.chip-outline {
  border: 1px solid rgba(169, 214, 229, .5);
  color: var(--sky);
  padding: 6px 12px;
  border-radius: 99px;
}
.chip-solid { background: var(--sky); padding: 6px 12px; border-radius: 99px; }

.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Placeholder for owner photos not yet supplied. Swap the whole element for
   an <img class="photo"> when the real image lands. */
.photo-slot {
  border-radius: 10px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
  padding: 12px;
}
.photo-slot-dark {
  background: repeating-linear-gradient(45deg,
    rgba(169, 214, 229, .15), rgba(169, 214, 229, .15) 10px,
    rgba(169, 214, 229, .05) 10px, rgba(169, 214, 229, .05) 20px);
  border: 1px dashed rgba(169, 214, 229, .5);
  color: var(--sky);
}
.photo-slot-light {
  background: repeating-linear-gradient(45deg,
    rgba(74, 124, 146, .12), rgba(74, 124, 146, .12) 10px,
    rgba(74, 124, 146, .04) 10px, rgba(74, 124, 146, .04) 20px);
  border: 1px dashed rgba(74, 124, 146, .45);
  color: var(--slate);
  border-radius: 12px;
  font-size: 12px;
}
.photo { width: 100%; height: 240px; object-fit: cover; border-radius: 10px; display: block; }

/* The captain shot is a tight portrait. The design's 240px-tall band would
   have cropped it to a strip across his glasses, so it runs at its own 3:4
   instead — which happens to be the source aspect exactly, so nothing is cut. */
.captain-photo {
  display: block;
  width: 100%;
  max-width: 300px;
  /* height:auto is load-bearing — the img's height attribute is a presentational
     hint, and with both dimensions resolved aspect-ratio is ignored. */
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  margin: 0 auto;
}

.app-shot {
  display: block;
  margin: 0 auto;
  max-height: 260px;
  width: auto;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .35);
}

/* ---------- Follow along ---------- */

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.sec-follow .sec-head { grid-column: 1 / -1; margin-bottom: 0; }

.channel {
  display: block;
  border-radius: 12px;
  padding: 26px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.channel:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(18, 48, 60, .18); }
.channel svg { margin-bottom: 40px; }
.channel h3 { font-weight: 800; font-size: 20px; margin: 0 0 6px; }
.channel p { font-size: 14px; line-height: 1.45; margin: 0; }
.channel-link { font-family: var(--mono); font-size: 11px; margin-top: 16px; }

.channel-yt { background: var(--ink); color: var(--sail); }
.channel-yt:hover { color: var(--sail); }
.channel-yt p { color: rgba(250, 252, 253, .7); }
.channel-yt .channel-link { color: var(--sky); }

.channel-sub { background: var(--slate); color: var(--sail); }
.channel-sub:hover { color: var(--sail); }
.channel-sub p { color: var(--muted-light); }
.channel-sub .channel-link { color: #d6ecf3; }

.channel-ig { background: var(--sky); color: var(--ink); }
.channel-ig:hover { color: var(--ink); }
.channel-ig p { color: var(--muted-dark); }
.channel-ig .channel-link { color: var(--ink); }

/* ---------- Tracker ---------- */

.tracker {
  grid-column: 1 / -1;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(169, 214, 229, .35), transparent);
}
.tracker-head { display: flex; align-items: center; gap: 20px; padding: 22px 26px; }
.tracker-head svg { flex: none; }
.tracker-copy { flex: 1; }
.tracker-copy h3 { font-weight: 800; font-size: 19px; margin: 0 0 4px; }
.tracker-copy p { font-size: 14px; color: var(--muted-dark); margin: 0; }
.tracker-btn {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--ink);
  color: var(--sky);
  padding: 10px 18px;
  border-radius: 99px;
  flex: none;
}
.tracker-btn:hover { background: var(--slate); color: var(--sail); }
.tracker-frame {
  display: block;
  width: 100%;
  height: 480px;
  border: none;
  border-top: 1.5px solid var(--ink);
  background: var(--frame-bg);
}

/* ---------- Captain ---------- */

.sec-captain { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.sec-captain h2 { font-size: 30px; font-weight: 800; margin: 0 0 14px; }
.sec-captain p { font-size: 16px; line-height: 1.6; margin: 0 0 14px; }

/* Published writing — scoped .pubs .x so .sec-captain p can't restyle it. */
.pubs { margin-top: 20px; }
.pubs .pubs-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: rgba(18, 48, 60, .55);
  margin: 0 0 8px;
}
.pubs a {
  display: block;
  width: fit-content;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--slate);
  margin-bottom: 6px;
}

/* ---------- Support ---------- */

.support {
  margin: 0 20px 20px;
  background: var(--sky);
  border-radius: 14px;
  padding: 52px;
}
.support-intro { text-align: center; max-width: 64ch; margin: 0 auto 30px; }
.support-intro h2 { font-size: 30px; font-weight: 800; margin: 0 0 12px; }
.support-intro p { font-size: 16px; line-height: 1.55; margin: 0; color: rgba(18, 48, 60, .85); }

.support-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.support-card {
  display: block;
  background: var(--sail);
  border-radius: 12px;
  padding: 24px;
  color: var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
}
.support-card:hover {
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(18, 48, 60, .18);
}
.support-card h3 { font-weight: 800; font-size: 18px; margin: 0 0 6px; }
.support-card p { font-size: 14px; line-height: 1.5; color: var(--muted-dark); margin: 0; }
.support-card .channel-link { color: var(--slate); margin-top: 14px; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  padding: 32px 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { width: 40px; height: 40px; }
.footer-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(250, 252, 253, .7);
}
.footer-meta a { color: var(--sky); }
.footer-meta a:hover { color: var(--sail); }
.footer-links { display: flex; gap: 20px; font-weight: 700; font-size: 14px; flex-wrap: wrap; }
.footer-links a { color: var(--sky); }
.footer-links a:hover { color: var(--sail); }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .grid5 { grid-template-columns: repeat(2, 1fr); }
  .card-boat, .card-toolkit, .sec-captain { grid-template-columns: 1fr; }
  .grid3, .support-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 40px; }
}

@media (max-width: 680px) {
  .site-header { flex-direction: column; gap: 14px; padding: 16px 20px; }
  .nav { flex-wrap: wrap; justify-content: center; gap: 14px; }
  .hero { margin: 0 12px; padding: 32px 24px 0; }
  .hero-row { flex-direction: column; align-items: stretch; gap: 24px; }
  .hero-cta { flex-direction: row; flex-wrap: wrap; }
  .hero-cta .btn { flex: 1 1 auto; }
  .hero h1 { font-size: 33px; }
  .hero p.hero-tagline { font-size: 18px; }
  .badge { white-space: normal; line-height: 1.6; }
  .ticker { white-space: normal; margin: 0 -24px; padding: 12px 24px; font-size: 11px; }
  .sec, .sec-route { padding: 36px 20px; }
  /* Side-by-side heading and mono note collide once the heading wraps. */
  .sec-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .card-dark { margin: 0 12px; padding: 32px 24px; }
  .support { margin: 0 12px 12px; padding: 32px 24px; }
  .grid5 { grid-template-columns: 1fr; }
  .photos { grid-template-columns: 1fr; }
  /* Stacked full-width, a fixed 240px height would letterbox the masts off.
     Let the photos keep their own shape instead. */
  .photo { height: auto; aspect-ratio: 4 / 3; }
  .tracker-head { flex-wrap: wrap; }
  .tracker-head .tracker-btn { margin-left: 54px; }
  .tracker-frame { height: 340px; }
  .site-footer { flex-direction: column; gap: 16px; text-align: center; }
  .footer-brand { flex-direction: column; }
  .footer-links { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .btn:hover, .chapter:hover, .channel:hover, .support-card:hover { transform: none; }
}
