/* ============================================================
   PLUS & MINUS — DESIGN SYSTEM
   A premium business-advisory design language.
   Tokens live on :root and are overridable by the Tweaks panel.
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  /* Brand — overridable */
  --brand: #0071E3;
  --radius: 16px;
  /* SF Pro where available (Apple devices), Inter as the web fallback everywhere else */
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", "Inter", system-ui, "Segoe UI", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Inter", system-ui, "Segoe UI", sans-serif;

  /* Derived brand ramp */
  --brand-700: color-mix(in oklab, var(--brand) 78%, #000);
  --brand-600: color-mix(in oklab, var(--brand) 90%, #000);
  --brand-300: color-mix(in oklab, var(--brand) 42%, #fff);
  --brand-100: color-mix(in oklab, var(--brand) 14%, #fff);
  --brand-50:  color-mix(in oklab, var(--brand) 7%, #fff);

  /* Cool neutral ink + surfaces */
  --ink:        #0A1020;   /* near-black navy, headings */
  --ink-2:      #2B3344;   /* strong body */
  --body:       #4A5365;   /* body copy */
  --muted:      #79839A;   /* captions, meta */
  --line:       #E7EAF0;   /* hairlines */
  --line-2:     #EEF0F5;
  --surface:    #FFFFFF;
  --soft:       #F6F7FA;   /* soft gray section */
  --soft-2:     #F0F2F7;

  /* Dark section palette */
  --dark:       #070B16;
  --dark-2:     #0C1426;
  --dark-soft:  #11182B;
  --dark-line:  rgba(255,255,255,.10);
  --on-dark:    #EAEEF6;
  --on-dark-mut:#93A0B8;

  /* Support */
  --green:      #1FA971;
  --green-100:  #E4F6EE;
  --amber:      #E6912B;

  /* Radii scale (derived from --radius) */
  --r-sm: calc(var(--radius) * .5);
  --r-md: var(--radius);
  --r-lg: calc(var(--radius) * 1.5);
  --r-xl: calc(var(--radius) * 2);
  --r-pill: 999px;

  /* Spacing scale (4px base) */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 80px; --s10: 96px;
  --s11: 120px; --s12: 160px;

  /* Shadows — soft, premium, never harsh */
  --sh-xs: 0 1px 2px rgba(10,16,32,.05);
  --sh-sm: 0 2px 8px rgba(10,16,32,.06), 0 1px 2px rgba(10,16,32,.04);
  --sh-md: 0 12px 32px -12px rgba(10,16,32,.16), 0 2px 8px rgba(10,16,32,.05);
  --sh-lg: 0 36px 80px -28px rgba(10,16,32,.30), 0 8px 24px -12px rgba(10,16,32,.12);
  --sh-brand: 0 14px 30px -10px color-mix(in oklab, var(--brand) 50%, transparent);

  /* Page content shares the navbar's grid line (.wrap-wide = 1320px) so the
     left edge of breadcrumbs, eyebrows, headings, copy and CTAs aligns with
     the logo/nav container — no inset gutter. */
  --maxw: 1320px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* Horizontal-overflow guard. `clip` (not `hidden`) so it never turns html/body
   into a scroll container — keeps the sticky header working. */
html, body { max-width: 100%; overflow-x: clip; }
body {
  font-family: var(--font-body);
  color: var(--body);
  background: var(--surface);
  line-height: 1.6;
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 17px;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
ul { list-style: none; padding: 0; }
::selection { background: var(--brand-100); color: var(--brand-700); }

/* ---------- TYPE ---------- */
h1,h2,h3,h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.08; letter-spacing: -.018em; font-weight: 600; text-wrap: balance; font-feature-settings: "ss01", "cv01"; }
.display { font-size: clamp(46px, 6.8vw, 88px); font-weight: 700; line-height: 1.0; letter-spacing: -.03em; }
.h1 { font-size: clamp(38px, 5vw, 64px); font-weight: 700; letter-spacing: -.026em; }
.h2 { font-size: clamp(32px, 3.8vw, 50px); font-weight: 600; letter-spacing: -.022em; }
.h3 { font-size: clamp(23px, 2.1vw, 30px); letter-spacing: -.016em; font-weight: 600; }
.h4 { font-size: 19px; font-weight: 600; letter-spacing: -.011em; }
.lead { font-size: clamp(18px, 1.5vw, 21px); color: var(--ink-2); line-height: 1.5; letter-spacing: -.011em; font-weight: 400; }
.body-lg { font-size: 18px; }
.small { font-size: 14px; }
.eyebrow {
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand); display: inline-flex; align-items: center; gap: 8px;
}
.muted { color: var(--muted); }
.text-pretty { text-wrap: pretty; }

/* ---------- LAYOUT ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
.wrap-wide { max-width: 1320px; margin-inline: auto; padding-inline: 24px; }
.section { padding-block: clamp(78px, 9.6vw, 144px); }
.section-sm { padding-block: clamp(58px, 6vw, 88px); }
.center { text-align: center; }
.stack-2 > * + * { margin-top: var(--s2); }
.stack-3 > * + * { margin-top: var(--s3); }
.stack-4 > * + * { margin-top: var(--s4); }
.stack-5 > * + * { margin-top: var(--s5); }
.section-head { max-width: 760px; }
.section-head.center { margin-inline: auto; }
.section-head .h2 { margin-top: 16px; }
.section-head p { margin-top: 18px; font-size: 20px; color: var(--body); }

/* ---------- BUTTONS ---------- */
.btn {
  --bh: color-mix(in oklab, var(--brand) 88%, #000);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-body); font-weight: 600; font-size: 16px; line-height: 1;
  padding: 15px 22px; border-radius: var(--r-pill);
  transition: transform .18s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
  white-space: nowrap; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn .ic, .btn [data-lucide] { width: 18px; height: 18px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--sh-brand); }
.btn-primary:hover { background: var(--bh); box-shadow: 0 18px 38px -10px color-mix(in oklab, var(--brand) 58%, transparent); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; transform: translateY(-1px); }
.btn-on-dark { background: #fff; color: var(--ink); }
.btn-on-dark:hover { transform: translateY(-1px); box-shadow: 0 16px 36px -14px rgba(0,0,0,.6); }
.btn-ghost-dark { color: var(--on-dark); box-shadow: inset 0 0 0 1.5px var(--dark-line); }
.btn-ghost-dark:hover { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); }
.btn-lg { padding: 17px 28px; font-size: 17px; }
.btn-sm { padding: 11px 16px; font-size: 14px; }
.link-arrow { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--brand); }
.link-arrow [data-lucide] { width: 17px; height: 17px; transition: transform .2s var(--ease); }
.link-arrow:hover [data-lucide] { transform: translateX(3px); }

/* ---------- CARDS (quieted toward editorial) ---------- */
.card {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 28px; transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.card-hover:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line), var(--sh-sm); }
.card-soft { background: var(--soft); box-shadow: none; }

/* Icon chip */
.chip {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center; flex: none;
  background: var(--brand-50); color: var(--brand);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--brand) 18%, transparent);
}
.chip [data-lucide] { width: 24px; height: 24px; stroke-width: 2; }
.chip-dark { background: rgba(255,255,255,.06); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }

/* Pills / badges */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px 7px 12px; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px color-mix(in oklab, var(--green) 18%, transparent); }
.pill-brand { background: var(--brand-50); color: var(--brand-700); box-shadow: inset 0 0 0 1px color-mix(in oklab,var(--brand) 20%, transparent); }
.tag { display:inline-block; padding: 5px 11px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; letter-spacing:.01em; background: var(--soft); color: var(--ink-2); }

/* ---------- PLACEHOLDER (for user imagery) ---------- */
.ph {
  position: relative; border-radius: var(--r-md); overflow: hidden;
  background:
    repeating-linear-gradient(135deg, var(--soft) 0 11px, var(--soft-2) 11px 22px);
  box-shadow: inset 0 0 0 1px var(--line);
  display: grid; place-items: center; color: var(--muted);
}
.ph.cover-img {
  background: #eaf3fe center / cover no-repeat;
  box-shadow: inset 0 0 0 1px var(--line);
}
.ph.cover-img::after { content: none; display: none; }
.ph::after {
  content: attr(data-label);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); background: var(--surface);
  padding: 5px 10px; border-radius: 6px; box-shadow: var(--sh-xs);
}

/* ---------- GRID HELPERS ---------- */
.grid { display: grid; gap: 26px; }
.cols-2 { grid-template-columns: repeat(2,1fr); }
.cols-3 { grid-template-columns: repeat(3,1fr); }
.cols-4 { grid-template-columns: repeat(4,1fr); }

/* ---------- DARK SURFACE ---------- */
.on-dark { background: var(--dark); color: var(--on-dark); }
.on-dark h1,.on-dark h2,.on-dark h3,.on-dark h4 { color: #fff; }
.on-dark .muted { color: var(--on-dark-mut); }
.on-dark .section-head p { color: var(--on-dark-mut); }

/* ---------- DIVIDER / MISC ---------- */
.hr { height: 1px; background: var(--line); border: 0; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){ .reveal { opacity:1; transform:none; transition:none; } html{scroll-behavior:auto;} }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 980px){
  .cols-4 { grid-template-columns: repeat(2,1fr); }
  .cols-3 { grid-template-columns: repeat(2,1fr); }
}
/* Force single-column stacking for structure/card grids on tablet & phone */
@media (max-width: 768px){
  .structs, .structure-grid, .cards-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px){
  body { font-size: 16px; }
  .wrap, .wrap-wide { padding-inline: 20px; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .btn.btn-auto { width: auto; }
}

/* ============================================================
   LAUNCH POLISH — site-wide refinements (additive only)
   Accessibility, depth, motion and touch ergonomics. Lives in
   the shared sheet so every page inherits it at once. No markup
   or layout changes; safe to ship.
   ============================================================ */

/* In-page anchors (#contact, #services, …) land clear of the
   72px sticky header instead of tucking underneath it. */
html { scroll-padding-top: 92px; }

/* Touch ergonomics: kill the grey tap flash; brand-tint native
   form controls (checkboxes, radios, range, the Tweaks sliders). */
body { -webkit-tap-highlight-color: transparent; }
:root { accent-color: var(--brand); }

/* Curb cumulative layout shift from images that ship intrinsic
   width/height attributes — keeps aspect ratio, prevents jumps. */
img { height: auto; }

/* Visible, on-brand keyboard focus — shows for keyboard users only,
   never on mouse click. A launch/a11y requirement that was missing.
   Form fields keep their own brand focus ring (contact.css). */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.form-chip:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2.5px solid color-mix(in oklab, var(--brand) 70%, transparent);
  outline-offset: 3px;
  border-radius: 10px;
}
/* Suppress the default UA outline on pointer focus only. */
:focus:not(:focus-visible) { outline: none; }

/* Premium crafted top-edge highlight on the primary CTA, preserved
   through hover so the button never loses its dimensional feel. */
.btn-primary {
  box-shadow: var(--sh-brand), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover {
  box-shadow: 0 18px 38px -10px color-mix(in oklab, var(--brand) 58%, transparent),
              inset 0 1px 0 rgba(255,255,255,.22);
}

/* Respect reduced-motion intent across smooth-scroll too. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
