/* ================================================================
   WESTERNSTON HOLDINGS — framework.css
   Layer 1 · Base      — greyscale tokens, reset, fluid type & space
   Layer 2 · Components — nav, hero, section, card, btn, form, footer
   Layer 3 · Utilities  — single-purpose classes
   ================================================================ */

/* ── LAYER 1: BASE ─────────────────────────────────────────────── */
:root {
  /* Pure greyscale — no hue */
  --g0: #ffffff;
  --g1: #f5f5f5;
  --g2: #e8e8e8;
  --g3: #cccccc;
  --g4: #999999;
  --g5: #6b6b6b;
  --g6: #444444;
  --g7: #2a2a2a;
  --g8: #181818;
  --g9: #0a0a0a;

  /* Fluid spacing */
  --s-1: clamp(0.5rem,  1vw,  0.75rem);
  --s-2: clamp(0.75rem, 2vw,  1.25rem);
  --s-3: clamp(1.25rem, 3vw,  2rem);
  --s-4: clamp(2rem,    4vw,  3rem);
  --s-5: clamp(3rem,    6vw,  5rem);
  --s-6: clamp(4rem,    8vw,  8rem);

  /* Fluid type */
  --text-xs:   clamp(0.72rem,  1.1vw, 0.8rem);
  --text-sm:   clamp(0.85rem,  1.4vw, 0.95rem);
  --text-base: clamp(1rem,     1.8vw, 1.1rem);
  --text-lg:   clamp(1.15rem,  2.4vw, 1.4rem);
  --text-xl:   clamp(1.5rem,   3.5vw, 2.25rem);
  --text-2xl:  clamp(2rem,     5vw,   3.5rem);
  --text-hero: clamp(2.5rem,   7vw,   5.5rem);

  /* Border radius */
  --r-sm: 0.2rem;
  --r-md: 0.4rem;

  /* Shadows — grey only */
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
}

/* Semantic tokens — light default via :root, dark overrides after */
:root {
  --bg:         var(--g0);
  --bg-alt:     var(--g1);
  --bg-card:    var(--g0);
  --text:       var(--g8);
  --text-muted: var(--g5);
  --border-col: var(--g2);
}
/* Dark mode — MUST come after :root so it wins on equal specificity */
[data-theme="dark"] {
  --bg:         var(--g9);
  --bg-alt:     var(--g8);
  --bg-card:    var(--g8);
  --text:       var(--g1);
  --text-muted: var(--g4);
  --border-col: var(--g7);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
}

/* Theme toggle button */
.theme-toggle {
  background: none; border: 1.5px solid var(--border-col);
  border-radius: var(--r-md); padding: 0.35em 0.65em;
  cursor: pointer; color: var(--text-muted);
  font-size: var(--text-xs); line-height: 1;
  transition: border-color .15s, color .15s;
  display: flex; align-items: center; gap: 0.4em;
}
.theme-toggle:hover { border-color: var(--text); color: var(--text); }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: inline; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
img  { max-width: 100%; height: auto; display: block; }
a    { color: inherit; text-decoration: none; }
ul   { list-style: none; }
button, input, textarea, select { font: inherit; }
h1 { font-size: var(--text-hero); line-height: 1.08; font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: var(--text-2xl);  line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: var(--text-xl);   line-height: 1.2;  font-weight: 600; letter-spacing: -0.01em; }
h4 { font-size: var(--text-lg);   line-height: 1.3;  font-weight: 600; }
p  { font-size: var(--text-base); }
strong { font-weight: 600; }
hr { border: none; border-top: 1px solid var(--border-col); margin: var(--s-4) 0; }

/* ── LAYER 2: COMPONENTS ───────────────────────────────────────── */

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 1rem;
  padding: 0.5em 1em; background: var(--g9); color: var(--g0);
  font-size: var(--text-sm); font-weight: 600; z-index: 999;
}
.skip-link:focus { left: 1rem; }

/* Hero image */
.hero-img {
  width: 100%; aspect-ratio: 16/7; object-fit: cover;
  filter: grayscale(100%);
  margin-top: var(--s-4);
  border-radius: var(--r-md);
}
.section-img {
  width: 100%; border-radius: var(--r-md);
  object-fit: cover; filter: grayscale(100%);
  box-shadow: var(--shadow-md);
}

/* Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-col);
}
.nav__inner {
  max-width: 1140px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-2) var(--s-3);
}
.nav__logo {
  display: flex; align-items: center; gap: 0.6em;
  font-size: var(--text-sm); font-weight: 700;
  color: var(--g9); letter-spacing: 0.04em; text-transform: uppercase;
}
.nav__links {
  display: flex; align-items: center; gap: var(--s-1); flex-wrap: wrap;
}
.nav__link {
  font-size: var(--text-xs); font-weight: 500;
  color: var(--text-muted); padding: 0.4em 0.7em;
  border-radius: var(--r-sm);
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav__link:hover, .nav__link[aria-current="page"] {
  color: var(--text); background: var(--bg-alt);
}
.nav__link--cta {
  background: var(--g9); color: var(--g0) !important;
  padding: 0.45em 1em; border-radius: var(--r-md);
}
.nav__link--cta:hover { background: var(--g7); }

/* Mobile nav — CSS-only checkbox toggle */
.nav__toggle { display: none; }
.nav__burger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 4px; border-radius: var(--r-sm);
}
.nav__burger span {
  display: block; width: 22px; height: 2px;
  background: var(--g8); border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
@media (max-width: 768px) {
  .nav__burger { display: flex; }
  .nav__links {
    display: none; flex-direction: column; align-items: flex-start;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--g0); border-bottom: 1px solid var(--g2);
    padding: var(--s-2) var(--s-3); gap: var(--s-1);
    box-shadow: var(--shadow-md);
  }
  .nav__toggle:checked ~ .nav__inner .nav__links { display: flex; }
  .nav__toggle:checked ~ .nav__inner .nav__burger span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  .nav__toggle:checked ~ .nav__inner .nav__burger span:nth-child(2) { opacity: 0; }
  .nav__toggle:checked ~ .nav__inner .nav__burger span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
}

/* Hero */
.hero {
  padding: calc(var(--s-6) + 4rem) var(--s-3) var(--s-6);
  background: var(--bg);
  border-bottom: 1px solid var(--border-col);
}
.hero__inner {
  max-width: 1140px; margin: 0 auto;
}
.hero__label {
  font-size: var(--text-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--g4); margin-bottom: var(--s-2);
  display: flex; align-items: center; gap: 0.75em;
}
.hero__label::after {
  content: ''; display: block; width: 2rem;
  height: 1px; background: var(--g3);
}
.hero__ctas {
  display: flex; flex-wrap: wrap;
  gap: var(--s-2); margin-top: var(--s-4);
}

/* Section */
.section { padding: var(--s-5) var(--s-3); background: var(--bg); }
.section__inner { max-width: 1140px; margin: 0 auto; }
.section--alt { background: var(--bg-alt); }
.section--dark { background: var(--g9); color: var(--g0); }
.section__label {
  font-size: var(--text-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--g4); margin-bottom: var(--s-2);
}
.section--dark .section__label { color: var(--g4); }

/* Two-col feature layout */
.feature {
  display: grid; gap: var(--s-4); align-items: center;
}
@media (min-width: 680px) {
  .feature { grid-template-columns: 1fr 1fr; }
  .feature--wide { grid-template-columns: 3fr 2fr; }
  .feature--reverse { direction: rtl; }
  .feature--reverse > * { direction: ltr; }
}

/* Card */
.card {
  background: var(--bg-card); border: 1px solid var(--border-col);
  padding: var(--s-3); border-radius: var(--r-md);
}
.card--dark {
  background: var(--g8); border-color: var(--g7); color: var(--g0);
}

/* Stat / callout block */
.stat { border-left: 3px solid var(--g8); padding-left: var(--s-2); }
.stat--light { border-color: var(--g3); }
.stat__number { font-size: var(--text-2xl); font-weight: 700; line-height: 1; }
.stat__label  { font-size: var(--text-sm); color: var(--g5); margin-top: 0.25em; }

/* Divider rule with label */
.rule {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--text-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--g4);
  margin: var(--s-4) 0;
}
.rule::before, .rule::after {
  content: ''; flex: 1; height: 1px; background: var(--g2);
}

/* Badge */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.3em 0.8em; border-radius: var(--r-md);
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.badge--outline { border: 1px solid var(--g3); color: var(--g6); }
.badge--dark    { background: var(--g9); color: var(--g0); }
.badge--mid     { background: var(--g2); color: var(--g7); }

/* Button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.85em 2em; font-size: var(--text-sm); font-weight: 600;
  cursor: pointer; border: none; border-radius: var(--r-md);
  transition: background .15s, transform .15s, box-shadow .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn--dark    { background: var(--g9); color: var(--g0); }
.btn--dark:hover { background: var(--g7); }
.btn--outline { background: transparent; border: 1.5px solid var(--g8); color: var(--g8); }
.btn--outline:hover { background: var(--g9); color: var(--g0); }
.btn--ghost   { background: transparent; border: 1.5px solid var(--g3); color: var(--g6); }
.btn--ghost:hover { border-color: var(--g8); color: var(--g8); }
.btn--sm      { padding: 0.55em 1.25em; font-size: var(--text-xs); }

/* Grid */
.grid { display: grid; gap: var(--s-3); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }

/* Icon lists */
.check-list, .step-list, .lock-list {
  display: flex; flex-direction: column; gap: var(--s-1); list-style: none;
}
.check-list li, .step-list li, .lock-list li {
  display: flex; align-items: flex-start; gap: 0.75em;
  font-size: var(--text-base); line-height: 1.55;
}

/* Check circle — dark filled circle with white tick */
.check-list li::before {
  content: '✓';
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 20px; height: 20px; margin-top: 0.15em;
  background: var(--g9); color: var(--g0);
  border-radius: 50%;
  font-size: 11px; font-weight: 700; line-height: 1;
}
/* Arrow — bold right-arrow for process steps */
.step-list li::before {
  content: '→';
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 20px; height: 20px; margin-top: 0.1em;
  color: var(--g7);
  font-size: 15px; font-weight: 400; line-height: 1;
}
/* Shield tick — for trust/confidentiality items */
.lock-list li::before {
  content: '◆';
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 20px; height: 20px; margin-top: 0.1em;
  color: var(--g6);
  font-size: 10px; line-height: 1;
}

/* Dark sections — invert check circle */
.section--dark .check-list li::before,
.card--dark .check-list li::before {
  background: var(--g3); color: var(--g9);
}
.section--dark .step-list li::before,
.card--dark .step-list li::before { color: var(--g4); }

/* Dark theme */
[data-theme="dark"] .check-list li::before { background: var(--g3); color: var(--g9); }
[data-theme="dark"] .step-list li::before  { color: var(--g4); }
[data-theme="dark"] .lock-list li::before  { color: var(--g5); }
[data-theme="dark"] .section--dark .check-list li::before { background: var(--g5); color: var(--g9); }

/* Quote */
.blockquote {
  border-left: 3px solid var(--g8); padding-left: var(--s-3);
  font-size: var(--text-lg); font-style: italic; color: var(--g7);
  line-height: 1.5;
}
.blockquote cite {
  display: block; margin-top: var(--s-1);
  font-size: var(--text-sm); font-style: normal;
  font-weight: 600; color: var(--g5);
}

/* Form */
.form { display: flex; flex-direction: column; gap: var(--s-2); }
.form__row { display: grid; gap: var(--s-2); }
@media (min-width: 600px) { .form__row { grid-template-columns: 1fr 1fr; } }
.form__label {
  display: block; font-size: var(--text-sm); font-weight: 600;
  color: var(--text); margin-bottom: 0.4em;
}
.form__input, .form__textarea, .form__select {
  width: 100%; padding: 0.8em 1em;
  border: 1.5px solid var(--border-col);
  border-radius: var(--r-md);
  background: var(--bg-card); color: var(--text);
  font-size: var(--text-base);
  transition: border-color .15s, box-shadow .15s;
}
.form__input:focus, .form__textarea:focus, .form__select:focus {
  outline: none;
  border-color: var(--g8);
  box-shadow: 0 0 0 3px rgba(10,10,10,0.1);
}
.form__textarea { resize: vertical; min-height: 130px; }
.form__msg {
  padding: 0.8em 1em; border-radius: var(--r-md);
  font-size: var(--text-sm); font-weight: 500;
  display: none; margin-top: var(--s-1);
}

/* Page header (inner pages) */
.page-header {
  padding: calc(var(--s-5) + 4rem) var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border-col);
  background: var(--bg-alt);
}
.page-header__inner { max-width: 1140px; margin: 0 auto; }
.page-header__back {
  font-size: var(--text-sm); color: var(--g5); display: inline-flex;
  align-items: center; gap: 0.4em; margin-bottom: var(--s-2);
  transition: color .15s;
}
.page-header__back:hover { color: var(--g9); }

/* Footer */
.footer {
  background: var(--g9); color: var(--g4);
  padding: var(--s-5) var(--s-3) var(--s-4);
  font-size: var(--text-sm);
}
.footer__inner {
  max-width: 1140px; margin: 0 auto;
  display: grid; gap: var(--s-4);
}
@media (min-width: 640px) {
  .footer__inner { grid-template-columns: 2fr 1fr 1fr; }
}
.footer__logo { font-weight: 700; color: var(--g0); font-size: var(--text-base); letter-spacing: 0.04em; text-transform: uppercase; }
.footer__tagline { color: var(--g5); margin-top: var(--s-1); line-height: 1.5; }
.footer__heading { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--g5); margin-bottom: var(--s-2); }
.footer__links { display: flex; flex-direction: column; gap: 0.6em; }
.footer__link { color: var(--g4); transition: color .15s; }
.footer__link:hover { color: var(--g0); }
.footer__bottom {
  max-width: 1140px; margin: var(--s-4) auto 0;
  padding-top: var(--s-3); border-top: 1px solid var(--g7);
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  justify-content: space-between; align-items: center;
  font-size: var(--text-xs); color: var(--g6);
}

/* ── LAYER 3: UTILITIES ────────────────────────────────────────── */

/* Display */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end   { justify-content: flex-end; }

/* Gap */
.gap-1 { gap: var(--s-1); }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }

/* Padding */
.p-2  { padding: var(--s-2); }
.p-3  { padding: var(--s-3); }
.p-4  { padding: var(--s-4); }
.px-3 { padding-left: var(--s-3); padding-right: var(--s-3); }
.py-3 { padding-top: var(--s-3); padding-bottom: var(--s-3); }
.py-5 { padding-top: var(--s-5); padding-bottom: var(--s-5); }

/* Margin */
.mt-1 { margin-top: var(--s-1); }
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mb-1 { margin-bottom: var(--s-1); }
.mb-2 { margin-bottom: var(--s-2); }
.mb-3 { margin-bottom: var(--s-3); }
.mb-4 { margin-bottom: var(--s-4); }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Text */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.font-normal  { font-weight: 400; }
.font-medium  { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold    { font-weight: 700; }
.leading-tight   { line-height: 1.2; }
.leading-snug    { line-height: 1.4; }
.leading-relaxed { line-height: 1.8; }
.tracking-wide  { letter-spacing: 0.06em; }
.tracking-wider { letter-spacing: 0.12em; }
.uppercase { text-transform: uppercase; }
.italic    { font-style: italic; }

/* Colours — text */
.text-g0 { color: var(--g0); }
.text-g3 { color: var(--g3); }
.text-g4 { color: var(--g4); }
.text-g5 { color: var(--g5); }
.text-g6 { color: var(--g6); }
.text-g7 { color: var(--g7); }
.text-g8 { color: var(--g8); }
.text-g9 { color: var(--g9); }

/* Colours — background */
.bg-g0 { background: var(--g0); }
.bg-g1 { background: var(--g1); }
.bg-g2 { background: var(--g2); }
.bg-g8 { background: var(--g8); }
.bg-g9 { background: var(--g9); }

/* Sizing */
.w-full  { width: 100%; }
.max-w-prose { max-width: 68ch; }
.max-w-md { max-width: 640px; }
.max-w-lg { max-width: 800px; }

/* Borders */
.border-t { border-top: 1px solid var(--border-col); }
.border-b { border-bottom: 1px solid var(--border-col); }

/* Radius */
.rounded    { border-radius: var(--r-sm); }
.rounded-md { border-radius: var(--r-md); }

/* Misc */
.overflow-hidden { overflow: hidden; }
.relative  { position: relative; }
.shadow    { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

/* Focus */
:focus-visible {
  outline: 2px solid var(--g8);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ── DARK MODE — comprehensive overrides ───────────────────────── */
[data-theme="dark"] body        { color: var(--g2); }
[data-theme="dark"] .nav        { border-color: var(--g7); }
[data-theme="dark"] .nav__logo  { color: var(--g1); }
[data-theme="dark"] .nav__link--cta { background: var(--g1); color: var(--g9) !important; }
[data-theme="dark"] .nav__link--cta:hover { background: var(--g3); }
[data-theme="dark"] .hero       { border-color: var(--g7); }
[data-theme="dark"] .hero__label { color: var(--g5); }
[data-theme="dark"] .section--dark { background: var(--g9); }
[data-theme="dark"] .page-header__back { color: var(--g5); }
[data-theme="dark"] .section__label { color: var(--g5); }
[data-theme="dark"] .stat__label { color: var(--g4); }
[data-theme="dark"] .card--dark  { background: var(--g7); border-color: var(--g6); }
[data-theme="dark"] .badge--outline { border-color: var(--g6); color: var(--g4); }
[data-theme="dark"] .badge--mid  { background: var(--g7); color: var(--g3); }
[data-theme="dark"] .btn--dark   { background: var(--g1); color: var(--g9); }
[data-theme="dark"] .btn--dark:hover { background: var(--g3); }
[data-theme="dark"] .btn--outline { border-color: var(--g5); color: var(--g2); }
[data-theme="dark"] .btn--outline:hover { background: var(--g1); color: var(--g9); }
[data-theme="dark"] .btn--ghost  { border-color: var(--g6); color: var(--g4); }
[data-theme="dark"] .btn--ghost:hover { border-color: var(--g3); color: var(--g2); }
[data-theme="dark"] .rule::before,
[data-theme="dark"] .rule::after { background: var(--g7); }
[data-theme="dark"] .blockquote  { color: var(--g3); border-color: var(--g5); }
[data-theme="dark"] .blockquote cite { color: var(--g5); }
[data-theme="dark"] .check-list li::before { background: var(--g3); }
[data-theme="dark"] .footer      { background: var(--g9); }
[data-theme="dark"] .footer__bottom { border-color: var(--g8); }
[data-theme="dark"] hr           { border-color: var(--g7); }
/* Utility colour overrides in dark mode */
[data-theme="dark"] .text-g5 { color: var(--g4); }
[data-theme="dark"] .text-g6 { color: var(--g4); }
[data-theme="dark"] .text-g7 { color: var(--g3); }
[data-theme="dark"] .text-g8 { color: var(--g2); }
[data-theme="dark"] .bg-g0   { background: var(--g9); }
[data-theme="dark"] .bg-g1   { background: var(--g8); }
[data-theme="dark"] .bg-g2   { background: var(--g7); }
[data-theme="dark"] :focus-visible { outline-color: var(--g3); }
