/* Koda Safety shared stylesheet
   Palette taken from the actual Koda Safety logo.
   All pairings below target WCAG 2.2 AA. See ACCESSIBILITY.md
   before changing any color value. */

:root {
  /* Brand colors, straight from the logo */
  --brand-dark: #0f1721;        /* near-black wordmark, slightly lifted for surfaces */
  --brand-mid: #1c2a38;
  --brand-orange: #f86810;      /* safety orange, the hard hat */
  --brand-blue: #50a0d0;        /* sky blue, the arrow */

  /* Accessible text variants.
     #f86810 is 3.01:1 on white and FAILS AA for normal text.
     #50a0d0 is 2.88:1 on white and FAILS AA for normal text.
     These darkened variants are for orange/blue used AS TEXT on light grounds. */
  --brand-orange-text: #b84d08; /* 5.12:1 on white, 4.77:1 on --brand-light */
  --brand-blue-text: #256b98;   /* 5.78:1 on white */

  /* Legacy aliases so existing rules keep working */
  --brand-accent: var(--brand-orange);
  --brand-accent-dark: #a34406; /* 6.20:1 on white, safe for hover text too */

  --brand-light: #f5f7f9;

  --text: #1b2733;              /* 15.17:1 on white */
  --text-muted: #56636f;        /* 6.16:1 on white, 5.73:1 on --brand-light */
  --line: #dfe4e9;
  --white: #ffffff;

  --wrap: 1120px;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(20, 32, 46, .08), 0 8px 24px rgba(20, 32, 46, .06);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
}

img { max-width: 100%; height: auto; display: block; }

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

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 .5em;
  font-weight: 700;
  letter-spacing: -.015em;
}

h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.16rem; }

p { margin: 0 0 1.1em; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
  min-width: 0;
}

.section { padding-block: clamp(48px, 8vw, 84px); }
.section--light { background: var(--brand-light); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .76rem;
  font-weight: 700;
  color: var(--brand-orange-text); /* darkened: plain orange fails AA on light grounds */
  margin-bottom: .6em;
}

/* On dark grounds the full-strength orange is 6.58:1 and is correct */
.hero .eyebrow,
.cta-band .eyebrow { color: var(--brand-orange); }

.lede { font-size: 1.12rem; color: var(--text-muted); max-width: 62ch; }

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

.site-header {
  background: var(--brand-dark);
  color: var(--white);
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-block: 14px;
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--white);
  line-height: 1.15;
}

.brand strong { font-size: 1.3rem; letter-spacing: .01em; }

.brand span {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--brand-accent);
  font-weight: 600;
}

.nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.nav-toggle {
  display: none;
  min-height: 44px;
  padding: 9px 14px;
  border: 2px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius);
  background: transparent;
  color: var(--white);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.nav a {
  color: rgba(255, 255, 255, .86);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius);
}

.nav a:hover { background: rgba(255, 255, 255, .1); color: var(--white); }
.nav a[aria-current="page"] { color: var(--white); background: rgba(255, 255, 255, .12); }

/* The CTA inside the nav must keep near-black on orange (6.58:1).
   `.nav a` is more specific than `.btn--primary`, so it wins without this. */
.nav a.btn--primary,
.nav a.btn--primary:hover { color: #0a0a0a; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: var(--radius);
  font-weight: 650;
  font-size: .98rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

/* Near-black on safety orange = 6.58:1.
   White on this orange is only 3.01:1 and fails AA.
   Orange with black is also OSHA's own signage pairing. */
.btn--primary { background: var(--brand-orange); color: #0a0a0a; }
.btn--primary:hover { background: #ff7a26; color: #0a0a0a; }

.btn--ghost { border-color: rgba(255, 255, 255, .5); color: #fff; }
.btn--ghost:hover { background: rgba(255, 255, 255, .12); }

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

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

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

.hero {
  background:
    linear-gradient(140deg, rgba(20, 32, 46, .97) 0%, rgba(31, 51, 70, .93) 100%),
    var(--brand-dark);
  color: var(--white);
  padding-block: clamp(56px, 10vw, 110px);
}

.hero h1 { color: #fff; max-width: 22ch; }

.hero p {
  color: rgba(255, 255, 255, .84);
  font-size: 1.14rem;
  max-width: 56ch;
}

.hero .eyebrow { color: var(--brand-accent); }

/* ---------- Stat strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}

.stat { background: var(--white); padding: 26px 20px; text-align: center; }
.stat b { display: block; font-size: 1.5rem; color: var(--brand-dark); line-height: 1.1; }

.stat span {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  font-weight: 600;
}

/* ---------- Cards ---------- */

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}

.card h3 { margin-bottom: .4em; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }

.card ul { margin: 0; padding-left: 1.1em; color: var(--text-muted); font-size: .96rem; }
.card ul li { margin-bottom: .35em; }

.card--accent { border-top: 3px solid var(--brand-accent); }

/* ---------- Tier cards ---------- */

.tier { display: flex; flex-direction: column; }
.tier .price { font-size: 1.45rem; font-weight: 700; color: var(--brand-dark); margin: 0 0 .1em; }
.tier .price small { font-size: .8rem; font-weight: 500; color: var(--text-muted); }
.tier .fit { font-size: .88rem; color: var(--text-muted); margin-bottom: 1em; }

/* ---------- Steps ---------- */

.steps { counter-reset: step; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step { position: relative; padding-top: 44px; }

.step::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  top: 0;
  left: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-orange-text);
  letter-spacing: .04em;
}

.step h3 { font-size: 1.02rem; }
.step p { font-size: .95rem; color: var(--text-muted); margin: 0; }

/* ---------- CTA band ---------- */

.cta-band { background: var(--brand-dark); color: #fff; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255, 255, 255, .82); max-width: 54ch; margin-inline: auto; }
.cta-band .btn-row { justify-content: center; }

/* ---------- Contact ---------- */

.contact-grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }

.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { margin-bottom: 18px; }

.contact-list b {
  display: block;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.contact-list a { font-size: 1.12rem; font-weight: 600; text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }

/* ---------- Table ---------- */

/* WCAG 2.2 SC 1.4.10 exempts data tables from reflow, but only the table may
   scroll. The page itself must not. min-width:0 stops the scroller being
   stretched by its own content inside a grid/flex ancestor. */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
}

/* Keyboard users must be able to reach and scroll the table */
.table-scroll:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 2px; }

table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .95rem; }

th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }

th { background: var(--brand-light); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }

td:first-child { font-weight: 600; }

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

.site-footer {
  background: var(--brand-dark);
  color: rgba(255, 255, 255, .7);
  font-size: .9rem;
  padding-block: 36px;
  padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px));
}

.site-footer a { color: rgba(255, 255, 255, .84); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.footer-grid h2 {
  color: #fff;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin: 0 0 10px;
}

.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 6px; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .13);
  margin-top: 28px;
  padding-top: 18px;
  font-size: .82rem;
  color: rgba(255, 255, 255, .55);
}

.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--brand-accent);
  color: #0a0a0a;
  padding: 10px 16px;
  z-index: 100;
}

.skip-link:focus { left: 8px; top: 8px; }

/* Focus ring: orange is 3.01:1 on white, which meets the 3:1 minimum for
   non-text UI components. On dark grounds it is 6.58:1. */
:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 2px; }
.site-header :focus-visible,
.hero :focus-visible,
.cta-band :focus-visible,
.site-footer :focus-visible { outline-color: #ffffff; }

/* Respect a reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Honour Windows High Contrast / forced-colors mode */
@media (forced-colors: active) {
  .btn { border: 2px solid currentColor; }
  .card, .stat { border: 1px solid currentColor; }
}

/* Safety managers print pages for the file. Don't eat their toner. */
@media print {
  .site-header, .site-footer, .btn-row, .cta-band, .skip-link, .cookie-banner, .privacy-settings-button { display: none !important; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .hero { background: none !important; color: #000; padding-block: 0; }
  .hero h1, .hero p, .cta-band h2 { color: #000 !important; }
  .section { padding-block: 12pt; }
  .section--light, .stats, .card { background: #fff !important; }
  .card { border: 1px solid #999; break-inside: avoid; }
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #444; }
  a[href^="tel:"]::after, a[href^="mailto:"]::after { content: ""; }
  h2, h3 { break-after: avoid; }
  table { break-inside: auto; }
  tr { break-inside: avoid; }
}

/* ---------- Brand lockup ---------- */

.brand-logo { width: 190px; height: auto; }
.brand-tag {
  display: block;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--brand-orange);
  font-weight: 600;
  margin-top: 4px;
}

/* ---------- Contact actions ---------- */

.contact-actions { display: grid; gap: 12px; margin: 20px 0 8px; }
.btn--block { display: block; text-align: center; }
.note { font-size: .93rem; color: var(--text-muted); }

.callout {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-orange);
  border-radius: var(--radius);
  background: var(--brand-light);
  padding: 18px 20px;
  margin: 22px 0;
}
.callout h3 { font-size: 1rem; margin-bottom: .35em; }
.callout p { margin: 0; font-size: .95rem; color: var(--text-muted); }

/* Legal entity fine print, present for transparency and deliberately understated
   per the brand rule that Koda Safety is the only client-facing brand. */
.legal-entity { display: inline-block; margin-top: 6px; font-size: .78rem; color: rgba(255,255,255,.6); } /* 7.03:1 on #0f1721. The old .45 value was 4.48:1 and failed. */

/* ---------- Privacy controls ---------- */

.privacy-settings-button {
  appearance: none;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, .84);
  cursor: pointer;
  font: inherit;
  margin-top: 10px;
  min-height: 44px;
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
  background: var(--white);
  border: 2px solid var(--brand-dark);
  border-radius: var(--radius);
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  box-shadow: 0 10px 40px rgba(15, 23, 33, .24);
  color: var(--text);
  left: 50%;
  max-height: calc(100vh - 32px);
  max-width: min(720px, calc(100vw - 32px));
  overflow: auto;
  position: fixed;
  transform: translateX(-50%);
  width: 100%;
  z-index: 1000;
}

.cookie-banner__content { padding: 22px; }
.cookie-banner h2 { font-size: 1.25rem; margin-bottom: 8px; }
.cookie-banner p { font-size: .95rem; margin-bottom: 16px; }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.btn--privacy {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: var(--white);
  min-height: 48px;
}

.btn--privacy:hover { background: var(--brand-mid); color: var(--white); }

@media (max-width: 480px) {
  .cookie-banner__actions { display: grid; }
  .btn--privacy { width: 100%; }
}

@media (max-width: 760px) {
  .site-header .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .brand-logo { width: 150px; }
  .brand-tag { display: none; }
  .has-js .nav-toggle { display: inline-block; }

  .has-js .nav {
    display: none;
    grid-column: 1 / -1;
    width: 100%;
  }

  .has-js .nav.nav--open {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .has-js .nav a {
    display: block;
    min-height: 44px;
    padding: 10px 12px;
  }
}
