/* Four sizes at each breakpoint: label, reading, lead, title. */
body {
  --type-label: 15px;
  --type-body: 18px;
  --type-lead: 24px;
  --type-title: 56px;
}

@media (max-width: 1100px) {
  body { --type-lead: 23px; --type-title: 48px; }
}
@media (max-width: 760px) {
  body { --type-body: 17px; --type-lead: 22px; --type-title: 42px; }
}

body .site-header .header-talk {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-block: 6px;
  font: 500 var(--type-body)/1.25 Jost, sans-serif;
}
body .site-header nav a:hover,
body .site-header nav a:focus-visible,
body .site-header .header-talk:hover,
body .site-header .header-talk:focus-visible {
  color: var(--pink);
  text-decoration: none;
}
body .piratas-footer a:hover,
body .piratas-footer a:focus-visible {
  color: var(--pink);
  text-decoration: none;
}
body .piratas-footer .pf-subscribe:hover,
body .piratas-footer .pf-subscribe:focus-visible { border-bottom-color: var(--pink); }

/* A destination has one visual role: action, reading link, or section jump. */
body main {
  --link-hover-bg: var(--pink);
  --link-hover-fg: var(--ink);
  --action-bg: var(--pink);
  --action-fg: var(--ink);
  --action-hover-bg: var(--ink);
  --action-hover-fg: var(--white);
}
body main :is(.home-universe, .home-invitation, .shore-talks, .sea-initiation, .sea-invitation, .canoe-voyage, .code-belonging, .owners-collaboration, .owners-invitation, .principle-picker, .log-routes, .shore-strip, #pattern, #voyages .pirate-offer:nth-child(odd)) {
  --link-hover-bg: var(--ink);
  --link-hover-fg: var(--white);
  --action-bg: var(--ink);
  --action-fg: var(--white);
  --action-hover-bg: var(--white);
  --action-hover-fg: var(--ink);
}
body main a.text-link:not([href^="contact.html"]),
body.home-page main a.hp-link:not(.pirate-cta):not([href^="contact.html"]) {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: inherit;
  font-size: var(--type-body);
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
}
body main a.text-link:not([href^="contact.html"]):hover,
body main a.text-link:not([href^="contact.html"]):focus-visible,
body.home-page main a.hp-link:not(.pirate-cta):not([href^="contact.html"]):hover,
body.home-page main a.hp-link:not(.pirate-cta):not([href^="contact.html"]):focus-visible {
  background: var(--link-hover-bg);
  border-bottom-color: transparent;
  color: var(--link-hover-fg);
  text-decoration: none;
  transform: none;
}
body main a.text-link[href^="contact.html"],
body main a.hp-link[href^="contact.html"],
body main a.quiet-link[href^="contact.html"] {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 48px;
  padding: 11px 16px;
  background: var(--action-bg);
  border: 1px solid var(--action-bg);
  color: var(--action-fg);
  font-size: var(--type-body);
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
}
body main :is(a.text-link, a.hp-link, a.quiet-link)[href^="contact.html"]:hover,
body main :is(a.text-link, a.hp-link, a.quiet-link)[href^="contact.html"]:focus-visible {
  background: var(--action-hover-bg);
  border-color: var(--action-hover-bg);
  color: var(--action-hover-fg);
}

body.code-page main .principle-index a:hover,
body.code-page main .principle-index a:focus-visible,
body.logbook-page main .log-routes a:hover,
body.logbook-page main .log-routes a:focus-visible {
  background: var(--ink);
  color: var(--white);
  border-bottom-color: transparent;
  text-decoration: none;
}
body.shore-page main .shore-routes a:hover,
body.shore-page main .shore-routes a:focus-visible,
body main .section-overview a:hover,
body main .section-overview a:focus-visible {
  background: var(--pink);
  color: var(--ink);
  border-bottom-color: transparent;
  text-decoration: none;
}

/* Keep the two signature voyage photographs level; this pair is an overview. */
body.sea-page main #voyages .voyage-pair figure { rotate: 0deg; }

/* Voyage destinations are text links, with one underline and no framed box. */
body.sea-page main #voyages .voyage-pair .voyage-actions > a.text-link {
  width: fit-content;
  min-height: 44px;
  padding: 8px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: inherit;
  font-size: var(--type-body);
  text-decoration: none;
}
body.sea-page main #voyages .voyage-pair .voyage-actions > a.text-link:hover,
body.sea-page main #voyages .voyage-pair .voyage-actions > a.text-link:focus-visible {
  background: var(--link-hover-bg);
  border-bottom-color: transparent;
  color: var(--link-hover-fg);
}
body.sea-page main #voyages .voyage-pair .voyage-actions > a.quiet-link[href^="contact.html"] {
  min-height: 44px;
  padding: 10px 15px;
  background: var(--action-bg);
  border: 1px solid var(--action-bg);
  color: var(--action-fg);
  text-decoration: none;
}
body.sea-page main #voyages .voyage-pair .voyage-actions > a.quiet-link[href^="contact.html"]:hover,
body.sea-page main #voyages .voyage-pair .voyage-actions > a.quiet-link[href^="contact.html"]:focus-visible {
  background: var(--action-hover-bg);
  border-color: var(--action-hover-bg);
  color: var(--action-hover-fg);
}
body.sea-page main #voyages .voyage-pair .voyage-actions > a.quiet-link[href^="#"] {
  min-height: 44px;
  padding: 8px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: inherit;
  text-decoration: none;
}
body.sea-page main #voyages .voyage-pair .voyage-actions > a.quiet-link[href^="#"]:hover,
body.sea-page main #voyages .voyage-pair .voyage-actions > a.quiet-link[href^="#"]:focus-visible {
  background: var(--link-hover-bg);
  border-bottom-color: transparent;
  color: var(--link-hover-fg);
}

/* Simple editorial links share the same contrast change. */
body main a:not(.text-link):not(.hp-link):not(.quiet-link):not(.brand-cta):not(.pirate-cta):not(.phone-offer-action):not(:has(h3, p, img)):hover,
body main a:not(.text-link):not(.hp-link):not(.quiet-link):not(.brand-cta):not(.pirate-cta):not(.phone-offer-action):not(:has(h3, p, img)):focus-visible {
  background: var(--link-hover-bg);
  color: var(--link-hover-fg);
  text-decoration: none;
}

/* The homepage opening keeps its single primary button. */
body.home-page main #top[data-screen-hero] .home-hero-actions > .brand-cta {
  min-height: 48px;
  padding: 11px 16px;
  font-size: 17px;
}

/* The teachers are credits beside the quotations, not exit links. */
.code-page .principle-voice .teacher-name { font-weight: 500; }
.code-page .principle-voice figcaption,
.code-page .principle-voice cite { font-size: var(--type-label); }

/* Code titles, leads, reading text and labels use the same four roles. */
body.code-page main { font-size: var(--type-body); line-height: 1.5; }
body.code-page main :is(.opening-reading, .principle-reading, .practice, .code-two-col) { font-size: var(--type-body); line-height: 1.5; }
body.code-page main :is(.opening-reading, .principle-reading, .practice, .code-two-col, .code-belonging, .code-next) p:not(.declaration):not(.principle-compass):not(.eyebrow),
body.code-page main :is(.journey-steps, .code-next) li,
body.code-page main .principle-voice blockquote p { font-size: var(--type-body); line-height: 1.5; }
body.code-page main :is(.principle h2, .code-aboard h2, .code-paths h2, .code-belonging h2, .code-next h2, .declaration) {
  font-size: var(--type-title);
  line-height: 1.08;
}
body.code-page main .principle-compass { font-size: var(--type-lead); line-height: 1.3; }
body.code-page main :is(.eyebrow, .practice > .eyebrow, .principle-name > .eyebrow, .principle-picker label, .principle-index-intro) {
  font: 400 var(--type-label)/1.5 'Space Mono', monospace;
}
body.code-page main .menu-hero[data-screen-hero] .menu-hero-note { font-size: var(--type-body); }
body.code-page main .menu-hero[data-screen-hero] > .menu-hero-copy > .text-link { font-size: var(--type-body); }
body main .menu-hero[data-screen-hero] .eyebrow { font-size: var(--type-label); line-height: 1.5; }
body main .menu-hero[data-screen-hero] p.menu-hero-lead,
body.home-page main #top[data-screen-hero] .brand-subtitle {
  font-size: clamp(21px, 2.2vw, 28px);
  line-height: 1.3;
}

body main [data-screen-hero] > [data-hero-strip] > p.banner-line {
  font-size: clamp(21px, 2vw, 28px);
  line-height: 1.2;
}

/* Numbered principle navigation. */
.code-page .principle-index-intro { font-size: var(--type-label); }
.code-page .principle-index,
.code-page .principle-index span { font-size: var(--type-body); }
.code-page .principle-index span { font-size: var(--type-label); }

@media (max-width: 760px) {
  body main a.text-link:not([href^="contact.html"]),
  body.home-page main a.hp-link:not(.pirate-cta):not([href^="contact.html"]) {
    min-height: 44px;
    padding: 7px 0;
    font-size: var(--type-body);
  }
  body main a.text-link[href^="contact.html"],
  body main a.hp-link[href^="contact.html"],
  body main a.quiet-link[href^="contact.html"] {
    min-height: 44px;
    padding: 9px 14px;
    font-size: var(--type-body);
  }
  body.home-page main #top[data-screen-hero] .home-hero-actions > .brand-cta {
    min-height: 44px;
    padding: 9px 13px;
    font-size: var(--type-body);
  }

  body main .menu-hero[data-screen-hero] .eyebrow { font-size: var(--type-label); }
  body main .menu-hero[data-screen-hero] h1 {
    font-size: var(--type-title);
    white-space: normal;
  }
  body main .menu-hero[data-screen-hero] p.menu-hero-lead,
  body.home-page main #top[data-screen-hero] .brand-subtitle {
    font-size: clamp(19px, 4.9vw, 23px);
    line-height: 1.3;
  }
  body.home-page main #top[data-screen-hero] .brand-heading { font-size: clamp(36px, 10.8vw, 42px); }
  body.home-page main #top[data-screen-hero] .brand-subtitle { font-size: clamp(20px, 5.4vw, 22px); }
  body main [data-screen-hero] > [data-hero-strip] > p.banner-line {
    font-size: clamp(18px, 4.6vw, 23px);
    line-height: 1.2;
  }
  body.code-page main .menu-hero-code[data-screen-hero] {
    --hero-strip-height: 68px;
  }

  body main .shore-routes a,
  body main .section-overview a,
  body.sea-page main .ways-grid > a > .text-link,
  body.logbook-page main .log-routes[data-hero-strip] > a {
    font-size: var(--type-body);
  }
}

/* On phones, uppercase guide labels stay secondary to the reading text. */
@media (max-width: 760px) {
  body { --type-label: 13px; }
  body main :is(.eyebrow, .hp-kicker, .status),
  body main .menu-hero[data-screen-hero] .eyebrow { font-size: 13px; }
  body.home-page #main-content :is(.eyebrow, .hp-label, .hp-label > span, .hp-kicker, .offer-kind) { font-size: 13px; }
  body.home-page #main-content .eyebrow { font-size: 13px !important; }
  body.code-page main .principle-name > .eyebrow { font-size: 15px !important; }
}

/* Match reading roles across pages, after the older page-specific rules. */
body.home-page main .why-copy .hp-lead,
body.home-page main .home-experiences .hp-heading > p,
body.about-page main .about-opening .opening-definition,
body.code-page main .code-opening .opening-reading p,
body.sea-page main .sea-ways .ways-summary > p,
body.shore-page main .shore-opening > div > p,
body.logbook-page main .log-opening > p,
body.art-page main .art-opening .art-large,
body.owners-page main .owners-intro-copy > p:not(.eyebrow),
body.legal-page main .contact-intro .contact-lead {
  font: 400 clamp(19px, 1.7vw, 24px)/1.4 Jost, sans-serif !important;
}

body.home-page main .home-opening .why-copy > h2,
body.about-page main .about-opening h2,
body.code-page main .code-opening .declaration,
body.sea-page main .sea-ways > h2,
body.shore-page main .shore-opening > h2,
body.logbook-page main .log-opening h2,
body.art-page main .art-opening > h2,
body.owners-page main .owners-intro-copy > h2,
body.legal-page main .contact-intro > h1 {
  font-size: var(--type-title);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.04em;
}

body.legal-page main .contact-intro > .eyebrow {
  color: var(--pink);
  font: 400 var(--type-label)/1.5 'Space Mono', monospace;
}
