/* ============================================================
   Ballito Air and Electrical — shared stylesheet
   Design language: "Cool + Current" — frost-white / deep ink / amber spark
   Headings: Archivo · Body: Source Sans 3
   ============================================================ */

/* ---------- Tokens (light = default) ---------- */
:root {
  --ground: #EEF3F6;
  --surface: #FFFFFF;
  --ink: #0E1A22;
  --muted: #475963;
  --brand: #16384A;        /* CTA fill — white text on it */
  --brand-text: #16384A;   /* brand colour as small text */
  --amber: #FFB81C;        /* spark fill — DARK ink text on it, never white */
  --ink-on-fill: #0E1A22;  /* text on amber fill — fixed both themes */
  --amber-text: #7A4A00;   /* amber as small text (light) */

  /* Fixed roles — same in both themes (text that sits on dark bands, NOT a
     swappable surface fill; these never flip dark). */
  --on-brand: #FFFFFF;        /* text on brand/dark bands */
  --accent-on-dark: #FFB81C;  /* amber on always-dark bands */
  --band: #0F232E;            /* always-dark header/hero/footer/CTA/job-sheet */
  --band-muted: #BFD0DA;      /* secondary text on dark bands (≥4.5:1 on --band) */
  --band-line: rgba(255,255,255,0.18); /* hairlines on dark bands */

  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1120px;
  --gap: clamp(1rem, 3vw, 2rem);
  --shadow: 0 1px 2px rgba(14,26,34,0.06), 0 6px 20px rgba(14,26,34,0.08);

  --font-head: "Archivo", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  --ground: #0D1418;
  --surface: #172128;
  --ink: #EAF1F5;
  --muted: #9FB1BC;
  --brand: #3C6A83;
  --brand-text: #A9D2E6;
  --amber: #FFB81C;
  --ink-on-fill: #0E1A22;  /* still dark ink on amber in dark mode */
  --amber-text: #FFB81C;

  /* Fixed roles unchanged in dark mode on purpose. */
  --on-brand: #FFFFFF;
  --accent-on-dark: #FFB81C;
  --band: #080D10;
  --band-muted: #AFC0CB;
  --band-line: rgba(255,255,255,0.16);
  --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 6px 20px rgba(0,0,0,0.5);
}

/* Disable transitions while measuring / before load to avoid flash of wrong theme */
.no-transitions * { transition: none !important; }

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 800; line-height: 1.15; color: var(--ink); margin: 0 0 0.5em; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.45rem, 3.5vw, 2.1rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.02rem; }
p { margin: 0 0 1rem; }
a { color: var(--brand-text); }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.2rem; }
li { margin: 0.25rem 0; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
/* NOTE: never use `padding: X 0` shorthand on a `.container` element — it would
   wipe the inline padding above. Sections set vertical padding on themselves. */
.section { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.section--tight { padding-top: clamp(1.75rem, 4vw, 2.5rem); padding-bottom: clamp(1.75rem, 4vw, 2.5rem); }
.stack > * + * { margin-top: 1rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.center { text-align: center; }
.muted { color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.grid { display: grid; gap: var(--gap); }
.grid > * { min-width: 0; } /* prevent overflow of grid children at 320px */
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--font-head); font-weight: 700; font-size: 1rem;
  padding: 0.75rem 1.25rem; border-radius: var(--radius-sm);
  border: 2px solid transparent; cursor: pointer; text-decoration: none;
  line-height: 1.2; max-width: 100%; word-break: break-word;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--brand); color: #FFFFFF; border-color: var(--brand); }
.btn--primary:hover { background: #0E2A38; }
:root[data-theme="dark"] .btn--primary:hover { background: #4C7E99; }
.btn--amber { background: var(--amber); color: var(--ink-on-fill); border-color: var(--amber); }
.btn--amber:hover { background: #E8A814; }
.btn--ghost { background: transparent; color: var(--brand-text); border-color: var(--brand); }
.btn--ghost:hover { background: rgba(22,56,74,0.08); }
.btn--block { display: flex; width: 100%; }
.btn--lg { font-size: 1.1rem; padding: 0.9rem 1.5rem; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; font-weight: 600;
  padding: 0.3rem 0.7rem; border-radius: 999px;
  background: rgba(22,56,74,0.08); color: var(--ink); border: 1px solid rgba(22,56,74,0.15);
}
.chip--amber { background: rgba(255,184,28,0.18); border-color: rgba(255,184,28,0.5); color: var(--amber-text); }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); color: var(--ink);
  border: 1px solid rgba(14,26,34,0.08);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
}
:root[data-theme="dark"] .card { border-color: rgba(255,255,255,0.08); }
.card h3 { margin-top: 0; }
.card__icon { font-size: 1.6rem; line-height: 1; margin-bottom: 0.5rem; }

/* image + caption */
.media { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.media img { width: 100%; object-fit: cover; }
.img-note { font-size: 0.8rem; color: var(--muted); margin: 0.5rem 0 0; font-style: italic; }

/* NEEDS CONTENT placeholder */
.placeholder {
  border: 2px dashed rgba(22,56,74,0.35); border-radius: var(--radius);
  padding: 2rem 1.25rem; text-align: center; color: var(--muted);
  background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(22,56,74,0.03) 10px, rgba(22,56,74,0.03) 20px);
}
:root[data-theme="dark"] .placeholder { border-color: rgba(255,255,255,0.25); }

/* notes */
.note {
  border-left: 4px solid var(--amber); background: rgba(255,184,28,0.1);
  padding: 0.85rem 1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink);
}
.note strong { color: var(--ink); }

/* ============================================================
   ALWAYS-DARK BANDS — .hero, .band, header, footer, job-sheet panel
   Everything inside must read against a dark ground in BOTH themes.
   Give every text role an explicit light colour here.
   ============================================================ */
.band, .hero, .site-header, .site-footer, .jobsheet-panel {
  background: var(--band);
  color: var(--on-brand);
}
.band h1, .band h2, .band h3, .band h4,
.hero h1, .hero h2, .hero h3, .hero h4,
.site-header h1, .site-header h2, .site-header h3, .site-header h4,
.site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4,
.jobsheet-panel h1, .jobsheet-panel h2, .jobsheet-panel h3, .jobsheet-panel h4 {
  color: var(--on-brand);
}
.band p, .band li, .band dt, .band dd,
.hero p, .hero li,
.site-header p, .site-header li,
.site-footer p, .site-footer li, .site-footer dt, .site-footer dd,
.jobsheet-panel p, .jobsheet-panel li, .jobsheet-panel dt, .jobsheet-panel dd {
  color: var(--on-brand);
}
.band .muted, .hero .muted, .site-header .muted,
.site-footer .muted, .jobsheet-panel .muted {
  color: var(--band-muted);
}
.band a, .hero a, .site-header a, .site-footer a, .jobsheet-panel a {
  color: var(--accent-on-dark);
}
/* link rules above must NOT bleed into buttons — buttons keep their own text colour */
.band a.btn, .hero a.btn, .site-header a.btn, .site-footer a.btn, .jobsheet-panel a.btn { color: inherit; }
.band a.btn--primary, .hero a.btn--primary, .site-footer a.btn--primary, .jobsheet-panel a.btn--primary,
.site-header a.btn--primary { color: #FFFFFF; }
.band a.btn--amber, .hero a.btn--amber, .site-footer a.btn--amber, .jobsheet-panel a.btn--amber,
.site-header a.btn--amber { color: var(--ink-on-fill); }

/* chips on dark bands */
.band .chip, .hero .chip, .site-header .chip, .site-footer .chip, .jobsheet-panel .chip {
  background: rgba(255,255,255,0.12); color: var(--on-brand); border-color: var(--band-line);
}
.band .chip--amber, .hero .chip--amber, .site-footer .chip--amber, .jobsheet-panel .chip--amber {
  background: rgba(255,184,28,0.2); color: var(--accent-on-dark); border-color: rgba(255,184,28,0.55);
}
/* ghost buttons on dark bands */
.band .btn--ghost, .hero .btn--ghost, .site-header .btn--ghost,
.site-footer .btn--ghost, .jobsheet-panel .btn--ghost {
  color: var(--on-brand); border-color: var(--band-line);
}
.band .btn--ghost:hover, .hero .btn--ghost:hover, .site-header .btn--ghost:hover,
.site-footer .btn--ghost:hover, .jobsheet-panel .btn--ghost:hover {
  background: rgba(255,255,255,0.1);
}
/* notes on dark bands — keep readable */
.band .note, .hero .note, .jobsheet-panel .note {
  background: rgba(255,184,28,0.14); color: var(--on-brand); border-left-color: var(--amber);
}
.band .note strong, .hero .note strong, .jobsheet-panel .note strong { color: var(--on-brand); }
/* image notes on dark bands */
.band .img-note, .hero .img-note, .jobsheet-panel .img-note { color: var(--band-muted); }

/* ---------- .demo-note strip — solid dark background (bug fix) ---------- */
.demo-note {
  background: var(--band);
  color: var(--on-brand);
  font-size: 0.85rem;
  text-align: center;
  padding: 0.5rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid var(--band-line);
}
.demo-note a { color: var(--accent-on-dark); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header { position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 var(--band-line); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: 0.75rem; padding-bottom: 0.75rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--on-brand); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--band) 100%);
  display: grid; place-items: center; border: 1px solid var(--band-line);
  position: relative;
}
.brand-mark::after { content: "\26A1"; font-size: 1.1rem; color: var(--amber); }
.brand-name {
  font-family: var(--font-head); font-weight: 800; font-size: 1.05rem;
  color: var(--on-brand); line-height: 1.1; white-space: normal; /* allow wrap at spaces on 320px */
}
.brand-sub { display: block; font-size: 0.72rem; font-weight: 600; color: var(--band-muted); font-family: var(--font-body); }

.site-nav { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--on-brand); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  padding: 0.5rem 0.7rem; border-radius: var(--radius-sm);
}
.site-nav a:hover { background: rgba(255,255,255,0.1); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--accent-on-dark); }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.theme-toggle {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.1); border: 1px solid var(--band-line);
  color: var(--on-brand); cursor: pointer; display: grid; place-items: center; font-size: 1.1rem;
}
.theme-toggle:hover { background: rgba(255,255,255,0.18); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* header CTA — hidden on small screens (bug rule) */
.header-cta { white-space: nowrap; }

/* Responsive header — nav on its own row ≤700px, hide CTA ≤480px */
@media (max-width: 700px) {
  .header-inner { flex-wrap: wrap; }
  .site-nav { order: 3; width: 100%; justify-content: flex-start; border-top: 1px solid var(--band-line); padding-top: 0.5rem; }
}
@media (max-width: 480px) {
  .header-cta { display: none; }
  .brand-sub { display: none; }
  .brand-name { font-size: 0.98rem; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; overflow: hidden; }
.hero-inner {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--gap); align-items: center;
  padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
.hero-inner > * { min-width: 0; }
@media (max-width: 820px) { .hero-inner { grid-template-columns: 1fr; } }
.hero h1 .spark { color: var(--amber); }
.hero .btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.hero-media { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hero-media img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }

/* ---------- Proof strip ---------- */
.proof { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.proof .chip { font-size: 0.9rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { margin-top: 2rem; }
.footer-inner {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--gap);
  padding-top: clamp(2.5rem, 5vw, 3.5rem); padding-bottom: 1.5rem;
}
.footer-inner > * { min-width: 0; }
@media (max-width: 720px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-nav { list-style: none; padding: 0; margin: 0; }
.footer-nav a { display: inline-block; padding: 0.2rem 0; }
dl.nap { margin: 0; }
dl.nap dt { font-weight: 700; margin-top: 0.75rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--band-muted); }
dl.nap dd { margin: 0.1rem 0 0; word-break: break-word; }
.footer-bottom {
  border-top: 1px solid var(--band-line); padding-top: 1rem; padding-bottom: 1.5rem;
  font-size: 0.85rem; color: var(--band-muted);
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: space-between;
}

/* ============================================================
   JOB SHEET (signature feature)
   ============================================================ */
.jobsheet { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
.step { margin-bottom: 2rem; }
.step__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.9rem; height: 1.9rem; border-radius: 999px;
  background: var(--amber); color: var(--ink-on-fill); font-family: var(--font-head);
  font-weight: 800; font-size: 0.95rem; margin-right: 0.5rem;
}
.step__title { display: flex; align-items: center; gap: 0.25rem; }
.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
.option-grid > * { min-width: 0; }

/* selectable option buttons */
.opt {
  text-align: left; font-family: var(--font-body); font-size: 1rem; font-weight: 600;
  background: var(--surface); color: var(--ink);
  border: 2px solid rgba(22,56,74,0.2); border-radius: var(--radius-sm);
  padding: 0.85rem 1rem; cursor: pointer; display: flex; align-items: center; gap: 0.5rem;
  transition: border-color .12s ease, background-color .12s ease;
}
:root[data-theme="dark"] .opt { border-color: rgba(255,255,255,0.18); }
.opt:hover { border-color: var(--brand); }
.opt[aria-pressed="true"], .opt[aria-checked="true"] {
  border-color: var(--amber); background: rgba(255,184,28,0.14); color: var(--ink);
}
.opt[aria-pressed="true"]::before, .opt[aria-checked="true"]::before {
  content: "\2713"; color: var(--ink-on-fill); background: var(--amber);
  width: 1.3rem; height: 1.3rem; border-radius: 999px; display: inline-grid; place-items: center;
  font-size: 0.85rem; font-weight: 800; flex: 0 0 auto;
}

/* field groups */
.field { margin-top: 1rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.field input[type="text"], .field input[type="date"] {
  width: 100%; max-width: 420px; font-family: var(--font-body); font-size: 1rem;
  padding: 0.7rem 0.85rem; border-radius: var(--radius-sm);
  border: 2px solid rgba(22,56,74,0.2); background: var(--surface); color: var(--ink);
}
:root[data-theme="dark"] .field input { border-color: rgba(255,255,255,0.18); }
.field input:focus-visible { border-color: var(--brand); }
.field__hint { font-size: 0.85rem; color: var(--muted); margin: 0.3rem 0 0; }
/* selected-option helper text must read in BOTH themes (not on a dark band here) */
.selected-hint { font-size: 0.9rem; color: var(--amber-text); font-weight: 600; margin-top: 0.4rem; }

.hidden { display: none !important; }

/* ---- the dark output panel ---- */
.jobsheet-panel { border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); box-shadow: var(--shadow); }
.jobsheet-panel .summary-line { font-size: 1.1rem; font-weight: 600; }
.jobsheet-panel .have-ready { list-style: none; padding: 0; margin: 0.75rem 0 0; }
.jobsheet-panel .have-ready li { padding-left: 1.5rem; position: relative; }
.jobsheet-panel .have-ready li::before { content: "\2022"; color: var(--accent-on-dark); position: absolute; left: 0.3rem; font-weight: 800; }
.jobsheet-panel .message-box {
  background: rgba(255,255,255,0.08); border: 1px solid var(--band-line);
  border-radius: var(--radius-sm); padding: 1rem; margin-top: 1rem;
  white-space: pre-wrap; font-size: 0.98rem;
}
.jobsheet-panel .send-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.copy-status { font-size: 0.9rem; color: var(--accent-on-dark); font-weight: 600; min-height: 1.2em; margin-top: 0.4rem; }

/* ---------- How it works ---------- */
.steps-3 { counter-reset: s; }
.steps-3 .card { position: relative; }
.steps-3 .card .step-n {
  font-family: var(--font-head); font-weight: 800; color: var(--amber-text); font-size: 0.9rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* ---------- Utility ---------- */
.flow > * + * { margin-top: 1.5rem; }
.tag { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--amber-text); }
.divider { height: 1px; background: rgba(22,56,74,0.1); border: 0; margin: 2rem 0; }
:root[data-theme="dark"] .divider { background: rgba(255,255,255,0.1); }
