/* ─────────────────────────────────────────────────────────────────────────
   Light theme — white / black / green, Poppins.
   Overrides the Nocturne token layer. Because every page styles against
   var(--*), remapping the tokens here re-themes the whole site.
   The ramps are INVERTED relative to the dark theme: steps 100–400 are the
   dark, readable greens (text, icons, numbers) and 700–900 are the pale
   tints (glows, fills) — so existing usage keeps its meaning on white.
   Remove this <link> from a page to return it to the dark Nocturne theme.
   ───────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700&display=swap');

:root {
  /* ground + ink */
  --color-bg: #ffffff;
  --color-surface: #f6f9f7;
  --color-text: #121212;
  --color-divider: #e3e8e6;

  /* green */
  --color-accent: #0b8457;
  --color-accent-2: #0b8457;

  --color-accent-100: #03231a;
  --color-accent-200: #05402c;
  --color-accent-300: #06573b;
  --color-accent-400: #0a7a52;
  --color-accent-500: #0b8457;
  --color-accent-600: #10a76d;
  --color-accent-700: #6fcba6;
  --color-accent-800: #c4ebd8;
  --color-accent-900: #e9f7f0;
  /* the accent brightened for use ON the black bands, where the deep
     emerald loses too much contrast */
  --color-accent-on-dark: #2fd694;

  --color-accent-2-100: #03231a;
  --color-accent-2-200: #05402c;
  --color-accent-2-300: #06573b;
  --color-accent-2-400: #0a7a52;
  --color-accent-2-500: #0b8457;
  --color-accent-2-600: #10a76d;
  --color-accent-2-700: #6fcba6;
  --color-accent-2-800: #c4ebd8;
  --color-accent-2-900: #e9f7f0;

  /* neutrals, inverted: 100 darkest ink → 900 lightest chrome */
  --color-neutral-100: #0e1412;
  --color-neutral-200: #1c2422;
  --color-neutral-300: #5a635f;
  --color-neutral-400: #78817d;
  --color-neutral-500: #98a19d;
  --color-neutral-600: #a6afab;
  --color-neutral-700: #cfd6d3;
  --color-neutral-800: #eff3f1;
  --color-neutral-900: #f1f5f3;

  /* full-bleed bands go black — the third colour, used as presence */
  --color-section: #0c1210;
  --color-section-glow: #11362a;
  --color-section-ghost: #1c4f3a;

  --font-heading: "Rubik", system-ui, sans-serif;
  --font-heading-weight: 600;
  --font-body: "Rubik", system-ui, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* elevation: soft ink on white, not ambient darkness */
  --shadow-sm: 0 0 0 1px #e8ecea;
  --shadow-md: 0 1px 2px rgba(18,18,18,.04), 0 8px 24px rgba(18,18,18,.06);
  --shadow-lg: 0 2px 4px rgba(18,18,18,.05), 0 18px 48px rgba(18,18,18,.10);
  /* the card shadow: soft, directional, no hairline — cards pop off the
     off-white ground without a drawn border */
  --shadow-card: 0 1px 3px rgba(18,18,18,.05), 0 10px 30px rgba(18,18,18,.07);
  --shadow-card-hover: 0 2px 6px rgba(18,18,18,.06), 0 20px 46px rgba(18,18,18,.12);
}

body { background: var(--color-bg); color: var(--color-text); }

/* Lighten-blend is a dark-ground technique: on white it erases the image. */
.lighten { mix-blend-mode: normal; }

/* Section rhythm — pages that don't set a band background explicitly get a
   white / off-white alternation, so every section reads as its own surface.
   Sections with an inline background (the black bands, the sticky filter
   bar, and every band on the homepage) keep it. */
section:nth-of-type(even):not([style*="background"]) { background: var(--color-surface); }

/* Full-bleed black bands carry light ink. Anything dropped into one inherits
   it, instead of the page's near-black --color-text. */
section[style*="--color-section"],
section[style*="--color-section"] h1,
section[style*="--color-section"] h2,
section[style*="--color-section"] h3,
section[style*="--color-section"] h4,
section[style*="--color-section"] h5,
section[style*="--color-section"] h6,
section[style*="--color-section"] p,
section[style*="--color-section"] div,
section[style*="--color-section"] span,
section[style*="--color-section"] li { color: #e9e9ed; }

/* The accent is a deep emerald tuned for white grounds; on the black bands it
   needs the brighter step to stay legible. */
section[style*="--color-section"] .btn-primary {
  background: var(--color-accent);
  border-color: var(--color-accent-on-dark);
  color: #ffffff;
}
section[style*="--color-section"] .btn-primary:hover {
  background: var(--color-accent-on-dark);
  border-color: var(--color-accent-on-dark);
  color: #06281c;
}
section[style*="--color-section"] .btn-secondary { border-color: rgba(255,255,255,.45); color: #ffffff; }
section[style*="--color-section"] .btn-secondary:hover { border-color: #ffffff; background: rgba(255,255,255,.10); }
section[style*="--color-section"] :focus-visible { outline-color: var(--color-accent-on-dark); }

/* Solid green primary on white grounds. Nocturne outlines its primary against
   a dark ground; on white an outline alone reads as secondary, so the CTA
   takes the fill and the outline drops to the secondary role. */
.btn-primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #ffffff;
  font-weight: 500;
  transition: background .25s ease, border-color .25s ease, box-shadow .3s ease, transform .2s ease;
}
.btn-primary:hover {
  background: var(--color-accent-400);
  border-color: var(--color-accent-400);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(11,132,87,.24);
  transform: translateY(-1px);
}
.btn-primary:active { background: var(--color-accent-300); border-color: var(--color-accent-300); transform: none; }

.btn-secondary {
  border-color: var(--color-divider);
  color: var(--color-text);
  font-weight: 500;
  transition: border-color .25s ease, background .25s ease, color .25s ease;
}
.btn-secondary:hover { border-color: var(--color-accent); color: var(--color-accent); background: var(--color-accent-900); }
.btn-ghost { color: var(--color-accent); font-weight: 500; }
.btn-ghost:hover { color: var(--color-accent-300); background: var(--color-accent-900); }

/* Tags: green tint on white, readable ink. */
.tag-accent, .tag-accent-2 { background: var(--color-accent-900); color: var(--color-accent-200); border-color: var(--color-accent-800); }
.tag-neutral { background: var(--color-surface); color: var(--color-neutral-300); border-color: var(--color-divider); }
.tag-outline { border-color: var(--color-accent); color: var(--color-accent); }

/* DS cards pick up the same soft-shadow treatment as the hand-built ones. */
.card { background: var(--color-bg); box-shadow: var(--shadow-card); border: 1px solid transparent; }
.elev-sm, .elev-md, .elev-lg { box-shadow: var(--shadow-card); }

/* Inputs on white. */
.input {
  background: var(--color-bg);
  border-color: var(--color-divider);
  color: var(--color-text);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-900); outline: none; }
.input::placeholder { color: var(--color-neutral-500); }

/* Nocturne fades its rules out at the ends against a dark ground; on white a
   plain hairline is correct. */
.hr { background: var(--color-divider); }

/* `styles.css` sets `.nav a { color: inherit }` (0,1,1), which outranks a bare
   `.btn-primary` — so the header CTA needs the same weight or it inherits the
   near-black page ink onto the green fill. */
.nav a.btn-primary { color: #ffffff; }
.nav a.btn-primary:hover { color: #ffffff; }
.nav a.btn-secondary { color: var(--color-text); }
.nav a.btn-secondary:hover { color: var(--color-accent); }

/* Keyboard focus stays the accent ring on the new ground. */
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: var(--color-accent-800); color: var(--color-accent-100); }

/* ─────────────────────────────────────────────────────────────────────────
   Responsive layer
   The pages are authored fluid (clamp padding, minmax(min(N,100%),1fr) grid
   tracks), so this layer handles what fluidity alone can't: the header
   collapsing, grids that must hold an exact column count on desktop, and
   touch-target sizing. Nothing here uses fixed widths.
   ───────────────────────────────────────────────────────────────────────── */

html { -webkit-text-size-adjust: 100%; }
img, svg, image-slot { max-width: 100%; }

/* Exactly three service cards per row on desktop; the grid is authored with
   a --cols custom property so the breakpoints below can step it down. */
[data-grid="services"] {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 18px);
  align-items: stretch;
}

/* ── Tablet ── */
@media (max-width: 1024px) {
  [data-grid="services"] { --cols: 2; }

  /* Header: let the nav wrap under the brand rather than squeezing. */
  .nav { flex-wrap: wrap; row-gap: 10px; }
  .nav nav { gap: 16px !important; font-size: 14px; }
}

/* ── Mobile ── */
@media (max-width: 720px) {
  [data-grid="services"] { --cols: 1; }

  /* Case-study label/value rows stack. */
  [data-kv-row] { grid-template-columns: 1fr !important; gap: 2px !important; }

  /* Sticky chrome eats too much of a short viewport; release it. */
  .nav { position: static !important; }
  [data-sticky-bar] { position: static !important; }
  [data-sticky-aside] { position: static !important; }

  /* Every control clears the 44px touch minimum. */
  .btn { min-height: 44px; padding-top: 12px; padding-bottom: 12px; }
  .btn-icon { min-width: 44px; }

  /* Tighten the display scale so headlines don't run to six lines. */
  h1 { font-size: clamp(28px, 8vw, 36px) !important; line-height: 1.18 !important; max-width: none !important; }
  h2 { font-size: clamp(23px, 6vw, 30px) !important; line-height: 1.16 !important; }
  h3 { font-size: clamp(18px, 5vw, 21px) !important; }

  /* Big metric numerals shrink with the viewport, never overflow their cell. */
  [data-metric] { font-size: clamp(26px, 7.5vw, 34px) !important; }

  /* Carousel captions: the pill becomes a full-width bar so the text fits. */
  [data-caption-pill] {
    left: 12px !important; right: 12px !important;
    transform: none !important; width: auto !important; max-width: none !important;
    border-radius: var(--radius-md) !important; padding: 12px 14px !important;
  }
  [aria-label="Previous award"], [aria-label="Next award"] { opacity: 1 !important; width: 40px !important; height: 40px !important; }
}

@media (max-width: 420px) {
  .nav nav { gap: 12px !important; font-size: 13.5px; }
  /* Skill chips stay readable rather than shrinking to fit. */
  .tag { font-size: 12px; }
}

/* ─────────────────────────────────────────────────────────────────────────
   Mobile first fold
   Phones get a purpose-built opening: identity card, availability pill,
   headline, one-line pitch, the headline metric, three trust chips, two
   full-width CTAs, and a sticky action bar. Desktop is untouched.
   ───────────────────────────────────────────────────────────────────────── */

[data-only="mobile"] { display: none; }

@media (max-width: 720px) {
  [data-only="mobile"] { display: revert; }
  [data-only="mobile"][data-flex] { display: flex; }
  [data-only="mobile"][data-grid] { display: grid; }
  [data-only="desktop"] { display: none !important; }

  /* The hero loses its side-by-side split and its decorative glow. */
  [data-hero-grid] { display: block !important; }
  [data-hero-copy] { animation: none !important; }

  /* Room for the sticky action bar, on the pages that have one. */
  body:has([data-action-bar]) { padding-bottom: 76px; }
  /* One set of contact affordances, not two — the action bar supersedes the
     floating stack where both exist. Pages without a bar keep the stack. */
  body:has([data-action-bar]) [data-floating-contact] { display: none !important; }
}

/* Where the floating stack survives, it shrinks and the WhatsApp pill stops
   expanding past the viewport edge on tap. */
@media (max-width: 720px) {
  [data-floating-contact] a[href*="wa.me"] { width: 52px !important; }
  [data-floating-contact] a[href*="wa.me"] span { display: none; }
  [data-floating-contact] .btn { width: 48px !important; height: 48px !important; min-height: 48px; }
}
