/* =============================================================
   GLOBAL STYLESHEET
   Loaded on every public + frontend page. Defines design tokens,
   typography, resets, and the light/dark theme system.
   ============================================================= */

/* -------------------------------------------------------------
   Font stack — San Francisco where available, with a faithful
   system fallback chain so non-Apple devices still get a
   matching grotesque sans.
   ------------------------------------------------------------- */
:root {
  --font-display: "IBM Plex Sans", -apple-system, BlinkMacSystemFont,
    "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont,
    "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono",
    Menlo, Consolas, monospace;

  /* Weight scale used consistently instead of arbitrary numbers */
  --w-regular: 400;
  --w-medium: 500;
  --w-semibold: 600;
  --w-bold: 700;
  --w-heavy: 800;

  /* Type scale */
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.25rem;
  --fs-3xl: 3rem;
  --fs-4xl: 3.75rem;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;

  /* Radius + shadow + motion */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur-base: 280ms;
  --dur-slow: 500ms;

  /* Brand gradient — dark orange, used on buttons & icon plates */
  --grad-brand: linear-gradient(135deg, #ff8a3d 0%, #e85d1f 45%, #b8390f 100%);
  --grad-brand-hover: linear-gradient(135deg, #ff9c5c 0%, #f06b2c 45%, #c64716 100%);
  --grad-brand-soft: linear-gradient(135deg, rgba(255,138,61,0.16) 0%, rgba(184,57,15,0.16) 100%);

  --container: 1180px;
  --header-h: 76px;
}

/* -------------------------------------------------------------
   Theme tokens — Light
   ------------------------------------------------------------- */
:root,
:root[data-theme="light"] {
  --bg: #faf8f5;
  --bg-elevated: #ffffff;
  --bg-sunken: #f1eee8;
  --surface: #ffffff;
  --surface-2: #f4f1ec;
  --border: #e7e2d9;
  --border-strong: #d8d1c4;

  --text-primary: #1c1712;
  --text-secondary: #5b5249;
  --text-tertiary: #8a8175;
  --text-on-brand: #fff7f0;

  --accent: #d9590f;
  --accent-strong: #b8390f;
  --accent-soft: #fff1e6;

  --success: #1e8a5b;
  --warning: #c98a12;
  --danger: #c4341f;

  --shadow-sm: 0 1px 2px rgba(28, 23, 18, 0.06);
  --shadow-md: 0 8px 24px rgba(28, 23, 18, 0.08);
  --shadow-lg: 0 24px 64px rgba(28, 23, 18, 0.14);

  --scrim: rgba(20, 14, 8, 0.5);
  color-scheme: light;
}

/* -------------------------------------------------------------
   Theme tokens — Dark (toggled via header switch)
   ------------------------------------------------------------- */
:root[data-theme="dark"] {
  --bg: #14110d;
  --bg-elevated: #1c1812;
  --bg-sunken: #0f0d0a;
  --surface: #1c1812;
  --surface-2: #241f17;
  --border: #322a20;
  --border-strong: #423728;

  --text-primary: #f6f1e9;
  --text-secondary: #c4baab;
  --text-tertiary: #8f8474;
  --text-on-brand: #fff7f0;

  --accent: #ff8a3d;
  --accent-strong: #ff6a1f;
  --accent-soft: #2c1f12;

  --success: #3fc384;
  --warning: #e3a93a;
  --danger: #e2604a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);

  --scrim: rgba(0, 0, 0, 0.65);
  color-scheme: dark;
}

/* -------------------------------------------------------------
   Reset
   ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img, picture, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }

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

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

body {
  font-family: var(--font-body);
  font-weight: var(--w-regular);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--w-bold);
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--text-primary);
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-md); }

p { color: var(--text-secondary); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* -------------------------------------------------------------
   Reusable primitives
   ------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: var(--w-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.section { padding: var(--sp-9) 0; }

.section-head { max-width: 640px; margin-bottom: var(--sp-7); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { margin-top: var(--sp-3); font-size: var(--fs-md); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  border: none;
  border-radius: var(--radius-pill);
  padding: 13px 26px;
  font-size: var(--fs-sm);
  font-weight: var(--w-semibold);
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease);
}

.btn-primary {
  background: var(--grad-brand);
  color: var(--text-on-brand);
  box-shadow: 0 10px 24px -8px rgba(184, 57, 15, 0.55);
}
.btn-primary:hover { background: var(--grad-brand-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); filter: saturate(0.95); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-strong); transform: translateY(-1px); }

.btn-sm { padding: 9px 18px; font-size: var(--fs-xs); }
.btn-block { width: 100%; }

.icon-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--grad-brand);
  flex-shrink: 0;
  box-shadow: 0 8px 20px -8px rgba(184, 57, 15, 0.5);
}
.icon-plate svg { width: 24px; height: 24px; }
.icon-plate.sm { width: 38px; height: 38px; border-radius: var(--radius-sm); }
.icon-plate.sm svg { width: 18px; height: 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: var(--w-semibold);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Shared CTA band (used across most inner pages) ---------- */
.cta-band {
  border-radius: var(--radius-lg);
  background: var(--grad-brand);
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
  color: var(--text-on-brand);
}
.cta-band h2 { color: var(--text-on-brand); margin-bottom: var(--sp-3); }
.cta-band p { color: rgba(255,247,240,0.85); max-width: 520px; margin: 0 auto var(--sp-6); }
.cta-band .btn-ghost { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.3); color: #fff; }

/* ---------- Shared "why us / values" grid (used across most inner pages) ---------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
}
.why-card { padding: var(--sp-6) var(--sp-5); }
.why-card .icon-plate { margin-bottom: var(--sp-4); }
.why-card h3 { margin-bottom: var(--sp-2); }
.why-card p { font-size: var(--fs-sm); }
@media (max-width: 900px) { .why-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .why-grid { grid-template-columns: 1fr; } }

@media (max-width: 720px) {
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }
  .section { padding: var(--sp-7) 0; }
  .container { padding: 0 var(--sp-4); }
}