/* ==========================================================================
   QUIKLE.CO.ZA — BASE / part 1: reset, typography, focus
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-synthesis-weight: none;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

h1 { font-size: var(--text-hero); font-weight: 800; letter-spacing: -0.032em; }
h2 { font-size: var(--text-heading); }
h3 { font-size: var(--text-subheading); font-weight: 600; letter-spacing: -0.014em; }

p { margin: 0; text-wrap: pretty; }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--coral); }

ul, ol { margin: 0; padding: 0; list-style: none; }

strong, b { font-weight: 700; color: var(--ink); }

button, input, textarea, select {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; background: none; border: 0; padding: 0; }

::selection { background: var(--coral); color: #fff; }

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; top: 0; left: 50%;
  transform: translate(-50%, -120%);
  z-index: 200;
  background: var(--ink); color: #fff;
  padding: 12px 24px; border-radius: 0 0 12px 12px;
  font-family: var(--font-display); font-weight: 600;
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus { transform: translate(-50%, 0); color: #fff; }
/* ==========================================================================
   BASE / part 2: layout, sections, surfaces
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow { max-width: 780px; }

.section {
  position: relative;
  padding-block: var(--section-pad);
}

.section--tight { padding-block: var(--space-16); }

/* Alternate band backgrounds so the page breathes between sections
   without resorting to hard rules. */
.section--raised { background: var(--surface-solid); }
.section--ink {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.82);
}
.section--ink h2, .section--ink h3 { color: #fff; }

.section-head { max-width: 720px; margin-bottom: var(--space-12); }
.section-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: var(--space-4);
}
.eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: currentColor;
  border-radius: 2px;
}
.section-head--center .eyebrow::before { display: none; }

.lede {
  font-size: clamp(1.0625rem, 0.5vw + 0.95rem, 1.25rem);
  line-height: 1.6;
  color: var(--ink-muted);
  margin-top: var(--space-4);
  max-width: 62ch;
}
.section-head--center .lede { margin-inline: auto; }

.prose p + p { margin-top: var(--space-4); }
.prose { color: var(--ink-muted); }

/* Glass surface used by cards, pills and the composer. */
.surface {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: var(--space-6);
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--ink-faint);
  box-shadow: 0 18px 40px -18px rgba(25, 25, 112, 0.28);
}

.grid { display: grid; gap: var(--space-6); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 960px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}
/* ==========================================================================
   BASE / part 3: navigation, buttons, forms
   ========================================================================== */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(245, 244, 240, 0.72);
  border-bottom: 1px solid transparent;
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  transition: background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.nav[data-scrolled="true"] {
  background: rgba(245, 244, 240, 0.9);
  border-bottom-color: var(--hairline);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.brand__mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand__word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  line-height: 1;
}
.brand__tag {
  display: block;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 3px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  font-family: var(--font-display);
  font-size: var(--text-label);
  font-weight: 600;
}
.nav__links a {
  text-decoration: none;
  color: var(--ink);
  opacity: 0.82;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.nav__links a:hover { opacity: 1; color: var(--coral); }

.nav__toggle {
  display: none;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--ink);
}

/* Buttons ---------------------------------------------------------------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
  will-change: transform;
}
.btn:hover {
  transform: translateY(-2px);
  color: var(--btn-fg);
  box-shadow: 0 14px 30px -12px rgba(25, 25, 112, 0.45);
}
.btn:active { transform: translateY(0); }

.btn--coral {
  --btn-bg: var(--coral); --btn-fg: #fff;
  box-shadow: 0 10px 26px -12px rgba(226, 125, 96, 0.7);
}
.btn--teal { --btn-bg: var(--teal); --btn-fg: #fff; }
.btn--ghost {
  --btn-bg: transparent; --btn-fg: var(--ink);
  border-color: var(--ink-faint);
}
.btn--ghost:hover { border-color: var(--ink); box-shadow: none; }
.btn--sm { padding: 10px 18px; font-size: var(--text-caption); }
.btn--block { width: 100%; }

/* Forms ------------------------------------------------------------------ */
.field { display: block; margin-bottom: var(--space-4); }
.field__label {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-label);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.field__input {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface-solid);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-input);
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--charcoal);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.field__input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(65, 179, 163, 0.16);
}
.field__input::placeholder { color: var(--ink-faint); }
textarea.field__input { resize: vertical; min-height: 120px; }

/* ---------- Mobile navigation ------------------------------------------- */
/* Below 900px the link row is replaced by the toggle. The panel drops below
   the fixed header and closes on link click / Escape (handled in main.js). */
@media (max-width: 900px) {
  .nav__toggle { display: inline-flex; }

  .nav__links { display: none; }

  .nav__links.is-open {
    display: flex;
    position: absolute;
    top: calc(100% + 10px);
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px;
    background: var(--surface, #ffffff);
    border: 1px solid var(--line, rgba(25, 25, 112, 0.12));
    border-radius: 18px;
    box-shadow: 0 22px 48px rgba(10, 10, 10, 0.14);
    z-index: 80;
  }

  .nav__links.is-open a {
    padding: 15px 18px;
    border-radius: 12px;
    opacity: 1;
    font-size: 1rem;
    line-height: 1.2;
  }

  .nav__links.is-open a:active { background: rgba(25, 25, 112, 0.05); }
}
