@import url("https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400;1,6..72,500&family=DM+Sans:wght@400;500&family=JetBrains+Mono:wght@400;500&display=swap");

/* ============================================================
   KILOWOTT BRAND KIT v1.0 — kilowott.css (drop-in stylesheet)
   Link this ONE file to get on-brand pages:
     <link rel="stylesheet" href="https://brandkit.kilowott.com/project/kit/kilowott.css">
   Contains: Google Fonts import, every token from tokens.css, base
   reset, layout helpers, and the .btn / .chip / .card / .eyebrow /
   .display primitives, plus kit additions (links, focus, logo, nav,
   stat, sections, footer, Lucide icon sizing).
   Docs: https://brandkit.kilowott.com/AGENTS.md
   Generated by scripts/build-tokens.mjs from project/styles/tokens.css. Do not edit by hand: run `npm run build:tokens`.
   ============================================================ */

/* ============================================================
   KILOWOTT DESIGN SYSTEM — TOKENS
   Single source of truth. All components read from these.
   ============================================================ */

:root {
  /* ---------- BRAND COLORS ---------- */
  --k-ink:        #0B0F14;   /* near-black, primary text, hero backgrounds */
  --k-ink-2:      #1A2230;   /* secondary surface dark */
  --k-ink-3:      #2B3544;   /* tertiary, borders on dark */

  --k-paper:      #FFFFFF;   /* primary surface */
  --k-paper-2:    #F6F4F0;   /* warm off-white, section breaks */
  --k-paper-3:    #EDEAE3;   /* warmer still, cards on paper */

  --k-red:        #E4022D;   /* signature — use sparingly */
  --k-red-soft:   #FCE5EA;   /* tinted bg for red accents */
  --k-red-ink:    #8A021B;   /* darkened red for text on paper */

  --k-rule:       #1A2230;   /* rules/borders on paper */
  --k-rule-soft:  #E2DED6;   /* soft divider on paper */
  --k-muted:      #5B6573;   /* secondary text on paper */
  --k-muted-dark: #8A95A5;   /* secondary text on ink */
  --k-red-hover:  #B40224;   /* pressed / hover state for red fills */
  --k-navy:       #021032;   /* logo navy: the wordmark on paper, nothing else */

  /* ---------- STATE (product UI only — never marketing) ---------- */
  /* All four pass WCAG AA (≥4.5:1) as text on --k-paper and --k-paper-2. */
  --k-success:      #1A7F35;   /* 5.1:1 on paper */
  --k-success-soft: #E8F3EB;
  --k-warning:      #9A6200;   /* 5.1:1 on paper */
  --k-warning-soft: #FBF1E0;
  --k-info:         #1A4E8A;   /* 8.4:1 on paper */
  --k-info-soft:    #E6EDF5;

  /* ---------- SEMANTIC ---------- */
  --bg:           var(--k-paper);
  --bg-2:         var(--k-paper-2);
  --bg-3:         var(--k-paper-3);
  --fg:           var(--k-ink);
  --fg-2:         var(--k-muted);
  --accent:       var(--k-red);
  --accent-ink:   var(--k-red-ink);
  --rule:         var(--k-rule-soft);
  --rule-strong:  var(--k-rule);
  --accent-hover: var(--k-red-hover);
  --success:      var(--k-success);
  --success-soft: var(--k-success-soft);
  --warning:      var(--k-warning);
  --warning-soft: var(--k-warning-soft);
  --info:         var(--k-info);
  --info-soft:    var(--k-info-soft);
  --danger:       var(--accent);
  --danger-soft:  var(--k-red-soft);
  /* Text links and inline code use --accent-ink, not --accent:
     red-ink is 10:1 on paper; brand red is only 4.8:1 and fails on warm paper. */
  --link:         var(--accent-ink);
  /* The wordmark: navy on paper, white on ink. */
  --logo:         var(--k-navy);

  /* ---------- TYPE ---------- */
  --font-display: "Newsreader", ui-serif, Georgia, serif;
  --font-sans:    "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Display scale (editorial, large) */
  --fs-d1: clamp(3.5rem, 7vw, 6.25rem);   /* 56–100 */
  --fs-d2: clamp(2.75rem, 5.2vw, 4.5rem); /* 44–72 */
  --fs-d3: clamp(2rem, 3.6vw, 3rem);      /* 32–48 */

  /* UI scale */
  --fs-h1: 2.25rem;   /* 36 */
  --fs-h2: 1.5rem;    /* 24 */
  --fs-h3: 1.125rem;  /* 18 */
  --fs-body: 1rem;    /* 16 */
  --fs-sm: 0.875rem;  /* 14 */
  --fs-xs: 0.75rem;   /* 12 — eyebrows */

  --lh-tight: 1.04;
  --lh-snug:  1.2;
  --lh-body:  1.55;

  --tracking-eyebrow: 0.18em;
  --tracking-display: -0.02em;

  /* ---------- SPACING (8pt base) ---------- */
  --s-0:  0;
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  24px;
  --s-6:  32px;
  --s-7:  48px;
  --s-8:  64px;
  --s-9:  96px;
  --s-10: 128px;

  /* ---------- RADII ---------- */
  --r-0: 0;
  --r-1: 2px;
  --r-2: 4px;
  --r-3: 8px;
  --r-4: 12px;
  --r-pill: 999px;

  /* ---------- SHADOWS ---------- */
  --shadow-0: none;
  --shadow-1: 0 1px 0 rgba(11,15,20,0.06), 0 1px 2px rgba(11,15,20,0.04);
  --shadow-2: 0 2px 4px rgba(11,15,20,0.06), 0 8px 16px rgba(11,15,20,0.06);
  --shadow-3: 0 4px 8px rgba(11,15,20,0.08), 0 24px 48px rgba(11,15,20,0.10);

  /* ---------- MOTION ---------- */
  --ease-standard: cubic-bezier(.2, .8, .2, 1);
  --ease-in:       cubic-bezier(.4, 0, 1, 1);
  --ease-out:      cubic-bezier(0, 0, .2, 1);
  --dur-fast:      120ms;
  --dur-standard:  200ms;
  --dur-slow:      320ms;

  /* ---------- LAYOUT ---------- */
  --container: 1280px;
  --gutter: 32px;
}

/* Dark mode */
[data-theme="dark"] {
  --bg:          var(--k-ink);
  --bg-2:        var(--k-ink-2);
  --bg-3:        var(--k-ink-3);
  --fg:          var(--k-paper);
  --fg-2:        var(--k-muted-dark);
  --rule:        #2B3544;
  --rule-strong: #3B4656;
  --accent-ink:  var(--k-red-soft);   /* red-ink is unreadable on ink; soft red reads 16:1 */
  --logo:        var(--k-paper);
  --success:      #5BC27A;
  --success-soft: rgba(91,194,122,0.12);
  --warning:      #E0A43A;
  --warning-soft: rgba(224,164,58,0.12);
  --info:         #7FA8E0;
  --info-soft:    rgba(127,168,224,0.12);
  --shadow-1: 0 1px 0 rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-2: 0 2px 4px rgba(0,0,0,0.5), 0 8px 16px rgba(0,0,0,0.4);
  --shadow-3: 0 4px 8px rgba(0,0,0,0.6), 0 24px 48px rgba(0,0,0,0.5);
}

/* ---------- RESET + BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01","cv11";
}
h1,h2,h3,h4,h5 { margin: 0; font-weight: 500; letter-spacing: var(--tracking-display); line-height: var(--lh-snug); }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }

/* Display type — serif, tight */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
}
.display em {
  font-style: italic;
}

/* Eyebrow label */
.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 24px; height: 1px; background: currentColor;
  display: inline-block;
}
.eyebrow--accent { color: var(--accent); }

/* ---------- LAYOUT ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section {
  padding: var(--s-9) 0;
}
.section--tight { padding: var(--s-7) 0; }

.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr 1fr; }
}

/* ---------- PRIMITIVES ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-pill);
  background: transparent; color: var(--fg);
  font-size: var(--fs-sm); font-weight: 500;
  letter-spacing: 0.02em;
  transition: all .2s ease;
}
.btn:hover { background: var(--fg); color: var(--bg); }
.btn--primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--ghost { border-color: transparent; }
.btn__arrow { transition: transform .2s ease; }
.btn:hover .btn__arrow { transform: translateX(3px); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--rule); border-radius: var(--r-pill);
  font-size: var(--fs-xs); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-2);
}

.card {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--r-3);
  padding: var(--s-6);
}

.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }
.rule--strong { background: var(--rule-strong); }

/* Token row (label left, value right, rule between) */
.token-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  font-size: var(--fs-sm);
}
.token-row:last-child { border-bottom: 0; }
.token-row__label { color: var(--fg); }
.token-row__meta  { color: var(--fg-2); font-family: var(--font-mono); font-size: 13px; }

/* Page title block */
.page-header {
  padding-top: var(--s-9);
  padding-bottom: var(--s-7);
  border-bottom: 1px solid var(--rule);
}
.page-header__kicker { color: var(--accent); }
.page-header__title {
  font-family: var(--font-display);
  font-size: var(--fs-d2);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
  margin-top: var(--s-4);
  max-width: 18ch;
}
.page-header__lede {
  margin-top: var(--s-5);
  max-width: 58ch;
  color: var(--fg-2);
  font-size: 1.0625rem;
  line-height: 1.6;
}
.page-header__meta {
  display: flex; gap: var(--s-5); margin-top: var(--s-6);
  font-size: var(--fs-xs); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  color: var(--fg-2);
}
.page-header__meta > div b { display: block; color: var(--fg); font-weight: 500; margin-top: 4px; letter-spacing: 0.02em; text-transform: none; font-size: var(--fs-sm); }

/* Section heading (inside pages) */
.section-head {
  display: grid; grid-template-columns: 1fr 2fr; gap: var(--s-8);
  align-items: start;
  margin-bottom: var(--s-7);
}
.section-head__title {
  font-family: var(--font-display);
  font-size: var(--fs-d3);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
}
.section-head__body { color: var(--fg-2); font-size: 1.0625rem; line-height: 1.65; max-width: 58ch; }
@media (max-width: 900px) {
  .section-head { grid-template-columns: 1fr; gap: var(--s-4); }
}

/* Two-column editorial */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-8); }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* Do / Don't */
.dodont {
  border: 1px solid var(--rule);
  border-radius: var(--r-3);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.dodont__frame {
  aspect-ratio: 4/3;
  display: grid; place-items: center;
  background: var(--bg-2);
  padding: var(--s-6);
  position: relative;
}
.dodont__tag {
  position: absolute; top: 14px; left: 14px;
  font-size: var(--fs-xs); letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase; font-weight: 500;
  padding: 4px 10px; border-radius: var(--r-pill);
}
.dodont__tag--do    { background: #0B0F14; color: #fff; }
.dodont__tag--dont  { background: var(--accent); color: #fff; }
.dodont__caption {
  padding: var(--s-5);
  font-size: var(--fs-sm); color: var(--fg-2);
  border-top: 1px solid var(--rule);
  line-height: 1.5;
}
.dodont__caption b { color: var(--fg); font-weight: 500; }

/* Utility */
.mono { font-family: var(--font-mono); font-size: 13px; }
.muted { color: var(--fg-2); }
.accent-text { color: var(--accent); }
.num-lg { font-family: var(--font-display); font-size: var(--fs-d2); line-height: 1; letter-spacing: -0.03em; }

/* Scroll smooth */
html { scroll-behavior: smooth; }

/* Selection */
::selection { background: var(--accent); color: #fff; }

/* ============================================================
   KIT ADDITIONS — appended to tokens.css to make kilowott.css.
   Hand-written source: scripts/kit-extras.css. Use tokens only.
   ============================================================ */

/* ---------- Headline emphasis: the one red moment ---------- */
.display em,
.k-h em { font-style: italic; color: var(--accent); }
.display--d1 { font-size: var(--fs-d1); }
.display--d2 { font-size: var(--fs-d2); }
.display--d3 { font-size: var(--fs-d3); }
.k-h { font-family: var(--font-display); font-weight: 400; line-height: var(--lh-tight); letter-spacing: var(--tracking-display); }

.lede { color: var(--fg-2); font-size: 1.0625rem; line-height: 1.6; max-width: 58ch; }
.measure { max-width: 64ch; }

/* ---------- Links: red-ink, never brand red ---------- */
.prose a, a.link {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.prose a:hover, a.link:hover { text-decoration-thickness: 2px; }
.prose code, code.inline { font-family: var(--font-mono); font-size: 0.875em; color: var(--link); background: var(--bg-2); padding: 1px 6px; border-radius: var(--r-1); }

/* ---------- Focus: never removed ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Button additions ---------- */
.btn { text-decoration: none; cursor: pointer; }
.btn--accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn--sm { padding: 10px 16px; font-size: var(--fs-xs); }
.btn--lg { padding: 18px 28px; font-size: var(--fs-body); }

/* ---------- Sections: paper (default), warm, ink ---------- */
.section--warm { background: var(--bg-2); }
.section--ink,
.on-ink {
  --bg: var(--k-ink);
  --bg-2: var(--k-ink-2);
  --bg-3: var(--k-ink-3);
  --fg: var(--k-paper);
  --fg-2: var(--k-muted-dark);
  --rule: #2B3544;
  --rule-strong: #3B4656;
  --accent-ink: var(--k-red-soft);
  --link: var(--k-red-soft);
  background: var(--bg);
  color: var(--fg);
}
/* [data-theme="dark"] set on a child element (not <html>) also needs --link re-pointed */
[data-theme="dark"] { --link: var(--accent-ink); --danger: var(--accent); }
.section--ink .k-logo { color: var(--k-paper); }

/* ---------- Logo: one SVG, navy on paper and white on ink via --logo ---------- */
.k-logo {
  display: inline-block;
  color: var(--logo);
  width: 110px; height: 18px;
  aspect-ratio: 313 / 41;
  background: currentColor;
  -webkit-mask: url("../assets/kilowott-logo.svg") no-repeat center / contain;
          mask: url("../assets/kilowott-logo.svg") no-repeat center / contain;
}

/* ---------- Top navigation: max 5 links + 1 CTA ---------- */
.k-nav { border-bottom: 1px solid var(--rule); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.k-nav__inner { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); height: 64px; display: flex; align-items: center; gap: var(--s-6); }
.k-nav__links { display: flex; gap: var(--s-5); margin-left: auto; list-style: none; padding: 0; margin-top: 0; margin-bottom: 0; }
.k-nav__links a { text-decoration: none; font-size: var(--fs-sm); color: var(--fg-2); }
.k-nav__links a:hover, .k-nav__links a[aria-current="page"] { color: var(--fg); }
@media (max-width: 760px) { .k-nav__links { display: none; } .k-nav__inner { justify-content: space-between; } }

/* ---------- Hero ---------- */
.k-hero { padding: var(--s-9) 0 var(--s-8); border-bottom: 1px solid var(--rule); }
.k-hero .display { font-size: var(--fs-d1); margin-top: var(--s-5); max-width: 16ch; }
.k-hero .lede { margin-top: var(--s-5); }
.k-hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }

/* ---------- Stat: one serif number, one line, one source ---------- */
.stat__num { font-family: var(--font-display); font-size: var(--fs-d2); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat__num--accent { color: var(--accent); }
.stat__label { margin-top: var(--s-3); font-size: var(--fs-sm); color: var(--fg); max-width: 22ch; }
.stat__source { margin-top: var(--s-2); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--fg-2); }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Card additions ---------- */
.card--warm { background: var(--bg-2); border-color: transparent; }
.card--link { text-decoration: none; color: inherit; display: block; transition: border-color var(--dur-standard) var(--ease-standard), box-shadow var(--dur-standard) var(--ease-standard); }
.card--link:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-2); }
.card__title { font-family: var(--font-display); font-size: var(--fs-h2); line-height: var(--lh-snug); margin-top: var(--s-4); }
.card__body { margin-top: var(--s-3); color: var(--fg-2); font-size: var(--fs-sm); line-height: 1.6; }

/* ---------- Footer ---------- */
.k-footer { border-top: 1px solid var(--rule); padding: var(--s-8) 0 var(--s-6); font-size: var(--fs-sm); color: var(--fg-2); }
.k-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--s-6); }
.k-footer a { color: var(--fg); text-decoration: none; }
.k-footer a:hover { text-decoration: underline; }
.k-footer__legal { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--rule); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; }
@media (max-width: 760px) { .k-footer__grid { grid-template-columns: 1fr; } }

/* ---------- Icons: Lucide, 1.5 stroke, currentColor ---------- */
.lucide { width: 24px; height: 24px; stroke-width: 1.5; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; fill: none; flex: none; }
.btn .lucide { width: 18px; height: 18px; }

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  :root { --gutter: 20px; }
  .grid-2, .grid-3, .grid-4, .grid-6, .two-col { grid-template-columns: 1fr; }
  .section { padding: var(--s-8) 0; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
