/* ==========================================================================
   Kangaroo Island Transfers — marketing site stylesheet
   KIT-119. Static site: no build step, no framework, no JS, no external fonts.

   Design notes (full rationale in docs/KIT-119-website.md):
   - Palette is COOL, deliberately not the warm-cream/terracotta default.
     Ground is a blue-green near-black; paper is a pale eucalypt grey; one
     chromatic signal (deep marine) reserved for CTAs, fares and links.
   - Zero border-radius site-wide. Square edges read editorial, and it is an
     explicit rejection of the rounded-card-with-accent-bar house style.
   - No cards with fills. Structure comes from hairline rules, tracked
     uppercase indices and whitespace.
   - System font stacks executed precisely; serif display, sans body,
     tabular figures on money.
   ========================================================================== */

/* ── 1. Tokens ─────────────────────────────────────────────────────────── */

:root {
  /* Ground / paper */
  --ink:        #12171a;  /* blue-green near-black — road at dusk, not pure #000 */
  --ink-2:      #1c2429;  /* raised surface on dark */
  --paper:      #e9eae5;  /* pale eucalypt grey — cool, NOT cream */
  --paper-2:    #dfe1da;  /* banded surface on light */

  /* The one colour */
  --marine:     #1d4e4b;  /* 7.6:1 on --paper */
  --marine-lift:#2a6b66;
  --marine-lite:#7fb3ac;  /* 7.5:1 on --ink — the accent when on dark */

  /* Text */
  --fg:         var(--ink);
  --fg-muted:   #4e5a58;  /* 5.8:1 on --paper */
  --fg-invert:  var(--paper);
  --fg-invert-muted: #9aa6a3; /* 7.1:1 on --ink */

  /* Lines */
  --rule:       rgba(18, 23, 26, .18);
  --rule-strong:rgba(18, 23, 26, .38);
  --rule-invert:rgba(233, 234, 229, .22);

  /* Type stacks — no webfonts, no CDN. Ordered best-available per platform. */
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino,
           "Book Antiqua", Constantia, Georgia, "Noto Serif", "Times New Roman", serif;
  --sans:  system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI",
           Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  /* Fluid scale */
  --t-display: clamp(2.3rem, 1.25rem + 4.1vw, 4.5rem);
  --t-h1:      clamp(1.95rem, 1.35rem + 2.4vw, 3.2rem);
  --t-h2:      clamp(1.45rem, 1.15rem + 1.3vw, 2.15rem);
  --t-h3:      clamp(1.08rem, 1rem + .35vw, 1.3rem);
  --t-body:    clamp(1rem, .955rem + .19vw, 1.115rem);
  --t-small:   .875rem;
  --t-micro:   .72rem;

  /* Space */
  --gutter:    clamp(1.35rem, .6rem + 3vw, 4rem);
  --band-y:    clamp(3.25rem, 2rem + 5.5vw, 7rem);
  --wrap:      1200px;
  --measure:   62ch;

  /* Nav / eyebrow tracking */
  --track-wide: .18em;
}

/* ── 2. Reset & base ───────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Offset for the sticky header when jumping to an anchor */
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--fg);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.62;
  font-synthesis-weight: none;   /* never fake a bold the stack does not have */
  font-synthesis-style: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;     /* long place-names must never force a scrollbar */
}

img, svg, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.13;
  letter-spacing: -.012em;
  margin: 0 0 .55em;
  text-wrap: balance;
}

p, ul, ol, dl, table { margin: 0 0 1.15em; }
p:last-child, ul:last-child { margin-bottom: 0; }

a { color: var(--marine); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--marine-lift); }

:focus-visible {
  outline: 2px solid var(--marine);
  outline-offset: 3px;
}

/* ── 3. Layout primitives ──────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.band { padding-block: var(--band-y); }
.band--tight { padding-block: clamp(2.25rem, 1.5rem + 3vw, 4rem); }
.band--rule  { border-top: 1px solid var(--rule); }

.band--dark {
  background: var(--ink);
  color: var(--fg-invert);
}
.band--dark h1, .band--dark h2, .band--dark h3 { color: var(--fg-invert); }
.band--dark a { color: var(--marine-lite); }
.band--dark .lede, .band--dark .muted { color: var(--fg-invert-muted); }

.band--alt { background: var(--paper-2); }

/* ── Dark contexts remap the TOKENS, not each selector ─────────────────────
   Every dark ground (hero, dark band, footer) rebinds the text/rule/accent
   tokens once, here. Any component built from those tokens is then correct on
   a dark ground automatically.

   This exists because the alternative — patching `.band--dark .thing` one
   selector at a time — silently fails for every component nobody remembered
   to patch. Two real WCAG failures were found that way during build: the hero
   eyebrow at 1.9:1 and the footer `.muted` at 2.5:1. Both were the same bug,
   and both are structurally impossible under this block.

   Note --marine → --marine-lite: the deep marine is 1.9:1 on ink and must
   never be used for text or a border there. The explicit `.band--dark .btn`
   rules below still win on specificity where a solid fill is wanted. */
.band--dark,
.site-foot,
.hero {
  --fg:          var(--fg-invert);
  --fg-muted:    var(--fg-invert-muted);
  --marine:      var(--marine-lite);
  --rule:        var(--rule-invert);
  --rule-strong: var(--rule-invert);
}

.measure { max-width: var(--measure); }

.eyebrow {
  font-family: var(--sans);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--marine);
  margin: 0 0 1.1rem;
}
.band--dark .eyebrow { color: var(--marine-lite); }
.eyebrow--spaced { margin-top: 2.75rem; }
.mt-l { margin-top: 2.5rem; }

.lede {
  font-size: clamp(1.08rem, 1rem + .55vw, 1.35rem);
  line-height: 1.5;
  color: var(--fg-muted);
  max-width: 54ch;
}

.muted { color: var(--fg-muted); }
.small { font-size: var(--t-small); line-height: 1.55; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--fg-invert);
  padding: .8rem 1.1rem;
  z-index: 100;
}
.skip:focus { left: 0; }

/* ── 4. Buttons ────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  text-decoration: none;
  padding: 1.05rem 1.9rem;
  border: 1px solid var(--marine);
  background: var(--marine);
  color: var(--paper);
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn:hover { background: var(--marine-lift); border-color: var(--marine-lift); color: var(--paper); }

.btn--ghost {
  background: transparent;
  border-color: var(--rule-strong);
  color: var(--fg);
}
.btn--ghost:hover { background: transparent; border-color: var(--ink); color: var(--ink); }

.band--dark .btn { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.band--dark .btn:hover { background: var(--marine-lite); border-color: var(--marine-lite); color: var(--ink); }
.band--dark .btn--ghost { background: transparent; border-color: var(--rule-invert); color: var(--fg-invert); }
.band--dark .btn--ghost:hover { border-color: var(--paper); color: var(--paper); background: transparent; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem 1rem;
  align-items: center;
  margin-top: 2rem;
}
/* At 390px both CTAs go full-width rather than clipping — the exact defect
   on the current Wix site that this rebuild exists to fix. */
@media (max-width: 27rem) {
  .actions { display: grid; gap: .7rem; }
  .actions .btn { display: block; text-align: center; padding-inline: 1rem; }
}

/* ── 5. Header ─────────────────────────────────────────────────────────── */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(9px);
  border-bottom: 1px solid var(--rule);
}
@supports not (backdrop-filter: blur(1px)) {
  .site-head { background: var(--paper); }
}

.head-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 2rem;
  padding-block: .95rem;
}

.brand {
  display: block;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
  line-height: 1.15;
}
.brand b {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.02rem, .95rem + .5vw, 1.32rem);
  letter-spacing: -.008em;
}
.brand span {
  display: block;
  font-size: var(--t-micro);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: .18rem;
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav a {
  display: inline-block;
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--fg-muted);
  text-decoration: none;
  padding-block: .35rem;
  border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--rule-strong); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--marine); }

.head-tel {
  font-family: var(--sans);
  font-size: clamp(.95rem, .9rem + .3vw, 1.06rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.head-tel:hover { color: var(--marine); }

.head-book { display: none; }

/* Order on small screens: brand + phone on row 1, nav wraps onto row 2.
   No hamburger, and therefore no JS: with five short labels a wrapping nav is
   always visible, needs no script, and cannot break with JS disabled. */
.nav { flex-basis: 100%; order: 3; }

/* Single-row header. The breakpoint is 68rem, not 62rem, because the full row
   (brand + 5 nav items + phone + button) measures ~1010px — at 62rem/992px it
   overflowed and wrapped the brand onto two lines. Measured, not guessed. */
@media (min-width: 68rem) {
  .head-in { flex-wrap: nowrap; gap: 1.75rem; }
  .brand { flex-shrink: 0; }
  .brand b { white-space: nowrap; }
  .nav { flex-basis: auto; order: 0; margin-left: auto; }
  .nav ul { flex-wrap: nowrap; gap: 1.4rem; }
  .nav a { white-space: nowrap; }
  .head-tel { flex-shrink: 0; }
  .head-book {
    display: inline-block;
    flex-shrink: 0;
    padding: .72rem 1.2rem;
    white-space: nowrap;
  }
}

/* ── 6. Hero ───────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  background: var(--ink);
  color: var(--fg-invert);
  isolation: isolate;
  overflow: hidden;
}

/* Photography slot. Drop a file in and set --hero-photo on .hero — nothing
   else needs to change. Until then the hero is typographic, on a field with
   a low horizon wash. It is NOT a placeholder look. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--hero-photo, none);
  background-size: cover;
  background-position: center 60%;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 85% at 15% 105%, rgba(29, 78, 75, .55) 0%, rgba(29, 78, 75, 0) 62%),
    linear-gradient(to bottom, rgba(18, 23, 26, .10) 0%, rgba(18, 23, 26, .72) 78%, var(--ink) 100%);
}
/* Note: with no photo set, the linear scrim above is ink-over-ink and therefore
   invisible; only the marine wash reads. The same rule works in both states, so
   there is no no-photo special case to keep in sync. */

.hero-in {
  padding-block: clamp(3.5rem, 2rem + 9vw, 8.5rem);
}

.hero h1 {
  font-size: var(--t-display);
  max-width: 17ch;
  margin-bottom: .5em;
}

.hero .lede { color: var(--fg-invert-muted); max-width: 52ch; }

.hero-rule {
  width: 4.5rem;
  height: 1px;
  background: var(--marine-lite);
  border: 0;
  margin: 0 0 1.6rem;
}

/* ── 7. Fares ──────────────────────────────────────────────────────────── */

.fares-scroll {
  /* Belt-and-braces: the table is built to fit 320px, but if a place-name
     ever grows, it scrolls inside its own box rather than the page. */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.fares {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25em;
}
table.fares caption {
  text-align: left;
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--fg-muted);
  padding-bottom: .9rem;
}
table.fares th, table.fares td {
  text-align: left;
  padding: 1.05rem .5rem 1.05rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
}
table.fares thead th {
  font-family: var(--sans);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--fg-muted);
  border-bottom-color: var(--rule-strong);
  padding-block: .6rem;
}
table.fares tbody th {
  font-family: var(--sans);
  font-size: var(--t-body);
  font-weight: 500;
  color: var(--ink);
  padding-right: 1rem;
}
table.fares .route-to { display: block; color: var(--fg-muted); }
table.fares td.fare,
table.fares th.fare {
  text-align: right;
  padding-right: 0;
  white-space: nowrap;
}
table.fares td.fare {
  font-family: var(--sans);
  font-size: clamp(1.1rem, 1rem + .6vw, 1.45rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--marine);
  letter-spacing: -.01em;
}
.band--dark table.fares td.fare { color: var(--marine-lite); }
.band--dark table.fares th, .band--dark table.fares td { border-bottom-color: var(--rule-invert); }
.band--dark table.fares thead th,
.band--dark table.fares caption { color: var(--fg-invert-muted); }
.band--dark table.fares tbody th { color: var(--fg-invert); }
.band--dark table.fares .route-to { color: var(--fg-invert-muted); }

.fare-note {
  font-size: var(--t-small);
  color: var(--fg-muted);
  max-width: 60ch;
  line-height: 1.55;
}
.band--dark .fare-note { color: var(--fg-invert-muted); }

/* ── 8. Editorial grid (replaces "cards") ──────────────────────────────── */

.grid {
  display: grid;
  gap: 0;
  grid-template-columns: 1fr;
}
.grid > * {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 2.1rem;
  min-width: 0;
}
.band--dark .grid > * { border-top-color: var(--rule-invert); }

@media (min-width: 48rem) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); column-gap: clamp(2rem, 5vw, 4.5rem); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); column-gap: clamp(1.75rem, 4vw, 3.75rem); }
}

.item-no {
  display: block;
  font-family: var(--sans);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: var(--track-wide);
  color: var(--marine);
  margin-bottom: .85rem;
}
.band--dark .item-no { color: var(--marine-lite); }

.grid h3 { font-size: var(--t-h3); margin-bottom: .5em; }
.grid p  { font-size: var(--t-small); color: var(--fg-muted); line-height: 1.6; }
.band--dark .grid p { color: var(--fg-invert-muted); }

/* Reason list — the structural claims. Hairline-separated, no bullets. */
.reasons { list-style: none; margin: 0; padding: 0; }
.reasons li {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0;
  display: grid;
  gap: .3rem .5rem;
}
.reasons li:last-child { border-bottom: 1px solid var(--rule); }
.reasons strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--t-h3);
  letter-spacing: -.01em;
}
.reasons span { color: var(--fg-muted); font-size: var(--t-small); line-height: 1.6; }
.band--dark .reasons li { border-top-color: var(--rule-invert); }
.band--dark .reasons li:last-child { border-bottom-color: var(--rule-invert); }
.band--dark .reasons span { color: var(--fg-invert-muted); }

@media (min-width: 52rem) {
      .reasons li { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 2.5rem; align-items: baseline; }
}

/* Two-column section head + body.
   minmax(0, 1fr) rather than a bare 1fr: grid tracks default to min-width:auto,
   so a single long unbreakable string (an email address, a URL) would otherwise
   push the whole track wider than the viewport. This was a real 17px overflow
   on /contact at 320px. Same reason for min-width:0 on .grid children. */
.split { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 56rem) {
  .split {
    grid-template-columns: minmax(0, 19rem) minmax(0, 1fr);
    gap: clamp(2rem, 6vw, 5.5rem);
    align-items: start;
  }
  .split > :first-child { position: sticky; top: 7rem; }
}

/* Definition-style detail lists (contact, spec) */
.deflist { margin: 0; }
.deflist div {
  border-top: 1px solid var(--rule);
  padding: 1.15rem 0;
  display: grid;
  gap: .2rem;
}
.deflist div:last-child { border-bottom: 1px solid var(--rule); }
.deflist dt {
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--fg-muted);
}
.deflist dd { margin: 0; font-size: var(--t-body); min-width: 0; overflow-wrap: anywhere; }
.deflist dd a { font-weight: 600; }
@media (min-width: 40rem) {
  .deflist div { grid-template-columns: 11rem minmax(0, 1fr); gap: 1.5rem; align-items: baseline; }
}

.big-contact {
  font-family: var(--sans);
  font-size: clamp(1.5rem, 1.1rem + 2.4vw, 2.6rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.015em;
  text-decoration: none;
  display: inline-block;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* ── 9. Footer ─────────────────────────────────────────────────────────── */

.site-foot {
  background: var(--ink);
  color: var(--fg-invert-muted);
  padding-block: clamp(2.75rem, 2rem + 3vw, 4.5rem);
  font-size: var(--t-small);
}
.foot-grid {
  display: grid;
  gap: 2.25rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--rule-invert);
}
@media (min-width: 48rem) {
  .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; }
}
.site-foot h2 {
  font-family: var(--sans);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--fg-invert-muted);
  margin-bottom: 1.1rem;
}
.site-foot a { color: var(--paper); text-decoration: none; }
.site-foot a:hover { color: var(--marine-lite); text-decoration: underline; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin-bottom: .55rem; }
.foot-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--paper);
  margin-bottom: .5rem;
}
.foot-base { padding-top: 1.6rem; display: grid; gap: .4rem; }
@media (min-width: 48rem) {
  .foot-base { grid-template-columns: 1fr auto; align-items: baseline; }
}

/* ── 10. Preferences & print ───────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .site-head, .hero::after, .actions, .skip { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .band { padding-block: 1rem; }
  .hero, .band--dark, .site-foot { background: #fff !important; color: #000 !important; }
  .band--dark h1, .band--dark h2, .band--dark h3, .site-foot a { color: #000 !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}
