/* WorkSmarter — shared stylesheet.
   Consolidated from the per-page <style> blocks. One source of truth for the
   whole site: tokens, base, components, utilities. Per-page differences are
   limited to the content width (--cw, set via a body class) and genuinely
   data-driven inline values (chart bar/timeline dimensions). */

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #1c2129;
  --border: #30363d;
  --border-light: #3d444d;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --text-bright: #f0f6fc;
  --blue: #58a6ff;
  --green: #3fb950;
  --purple: #bc8cff;
  --cyan: #39d2c0;
  --red: #f85149;
  --orange: #d29922;
  --pink: #f778ba;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'SF Mono', 'Fira Code', Menlo, Consolas, monospace;
  --cw: 960px; /* default content width; overridden per page via body class */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--cw); margin: 0 auto; padding: 0 1.5rem; }
@media (max-width: 600px) { .container { padding: 0 1rem; } }

/* Per-page content width */
body.cw-narrow { --cw: 780px; }
body.cw-wide   { --cw: 1100px; }

/* ---- Base typography ---- */
h2 { color: var(--text-bright); font-size: clamp(1.15rem, 3vw, 1.35rem); margin: 3rem 0 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); scroll-margin-top: 70px; letter-spacing: -0.01em; }
h2 .num { color: var(--blue); font-weight: 400; margin-right: 0.4rem; font-family: var(--mono); font-size: 0.9em; }
h3 { color: var(--text-bright); font-size: 1rem; margin: 1.5rem 0 0.5rem; }
p { margin-bottom: 1rem; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: rgba(110,118,129,0.15); padding: 0.1rem 0.4rem; border-radius: 4px; font-family: var(--mono); font-size: 0.82em; }
pre { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.2rem; overflow-x: auto; margin: 1rem 0; font-size: 0.82rem; line-height: 1.6; }
pre code { background: none; padding: 0; }

/* ---- Home hero (index) ---- */
.hero-home { text-align: center; padding: 5.5rem 0 4rem; }
.hero-logo { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.25em; text-transform: uppercase; color: var(--blue); margin-bottom: 1.5rem; display: inline-block; padding: 0.3rem 0.9rem; border: 1px solid rgba(88,166,255,0.25); border-radius: 20px; background: rgba(88,166,255,0.06); }
.hero-home h1 { color: var(--text-bright); font-size: 2.2rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.hero-home .subtitle { color: var(--text-muted); font-size: 1rem; margin-top: 1rem; max-width: 540px; margin-left: auto; margin-right: auto; line-height: 1.6; }
@media (max-width: 600px) { .hero-home h1 { font-size: 1.6rem; } .hero-home { padding: 4rem 0 3rem; } }

.divider { height: 1px; background: var(--border); margin: 0 0 3rem; }
.section-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin-bottom: 1.5rem; }

/* Home article list */
.articles { display: flex; flex-direction: column; gap: 1rem; padding-bottom: 6rem; }
.article-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.6rem 1.8rem; text-decoration: none; transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; }
.article-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); text-decoration: none; }
.article-tag { display: inline-block; font-size: 0.62rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.8rem; margin-right: 0.4rem; }
.tag-security { background: rgba(248,81,73,0.1); color: #f85149; }
.tag-infra { background: rgba(88,166,255,0.1); color: var(--blue); }
.tag-tech { background: rgba(188,140,255,0.1); color: var(--purple); }
.tag-report { background: rgba(139,148,158,0.12); color: var(--text-muted); }
.article-card h2 { color: var(--text-bright); font-size: 1.15rem; font-weight: 600; line-height: 1.35; border: none; padding: 0; margin: 0; scroll-margin-top: 0; }
.article-card p { color: var(--text-muted); font-size: 0.88rem; margin-top: 0.5rem; line-height: 1.55; }
.article-meta { display: flex; align-items: center; gap: 0.8rem; margin-top: 1rem; font-size: 0.75rem; color: var(--text-muted); }
.article-meta span { display: flex; align-items: center; gap: 0.3rem; }

/* ---- Article hero ---- */
.hero { text-align: center; padding: 3.5rem 0 2.5rem; border-bottom: 1px solid var(--border); margin-bottom: 2.5rem; }
.hero-badge { display: inline-flex; align-items: center; gap: 0.4rem; background: rgba(63,185,80,0.08); border: 1px solid rgba(63,185,80,0.25); color: var(--green); font-size: 0.72rem; font-weight: 600; padding: 0.35rem 0.9rem; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1.2rem; }
.hero-badge::before { content: ''; width: 6px; height: 6px; background: var(--green); border-radius: 50%; }
.hero-badge.badge-red { background: rgba(248,81,73,0.08); border-color: rgba(248,81,73,0.25); color: var(--red); }
.hero-badge.badge-red::before { background: var(--red); }
.hero h1 { color: var(--text-bright); font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; margin-bottom: 0.6rem; line-height: 1.25; letter-spacing: -0.02em; }
.hero .subtitle { color: var(--text-muted); font-size: clamp(0.9rem, 2.5vw, 1.05rem); max-width: 680px; margin: 0 auto; line-height: 1.6; }
.hero-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.5rem; margin-top: 1.5rem; color: var(--text-muted); font-size: 0.8rem; }

/* ---- Exec summary ---- */
.exec-summary { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem 1.8rem; margin-bottom: 2.5rem; }
.exec-summary h3 { color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.8rem; }
.exec-summary ul { margin: 0 0 0 1.2rem; }
.exec-summary li { font-size: 0.9rem; margin-bottom: 0.4rem; }
.exec-summary li strong { color: var(--text-bright); }

/* ---- Cards & stats ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.3rem; margin: 1rem 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.8rem; margin: 1rem 0; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.2rem; text-align: center; }
.stat-card .value { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; font-family: var(--mono); letter-spacing: -0.03em; }
.stat-card .label { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .detail { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.4rem; font-style: italic; }
.stat-card .detail .basis-tag { display: block; width: fit-content; margin: 0.4rem auto 0; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.85rem; }
th { text-align: left; color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.05em; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); }
td { padding: 0.6rem 0.8rem; border-bottom: 1px solid rgba(48,54,61,0.5); }
tr:hover td { background: rgba(88,166,255,0.03); }
.overflow-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---- Tags ---- */
.tag { display: inline-block; font-size: 0.68rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.tag-red { background: rgba(248,81,73,0.12); color: var(--red); }
.tag-orange { background: rgba(210,153,34,0.12); color: var(--orange); }
.tag-green { background: rgba(63,185,80,0.12); color: var(--green); }
.tag-blue { background: rgba(88,166,255,0.12); color: var(--blue); }
.tag-purple { background: rgba(188,140,255,0.12); color: var(--purple); }
.basis-tag { display: inline-block; font-size: 0.62rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.04em; vertical-align: middle; margin-left: 0.3rem; }
.basis-confirmed { background: rgba(63,185,80,0.12); color: var(--green); }
.basis-heuristic { background: rgba(210,153,34,0.12); color: var(--orange); }
.verified { font-size: 0.68rem; color: var(--green); font-weight: 600; letter-spacing: 0.03em; }
.source { font-size: 0.68rem; color: var(--text-muted); font-style: italic; }

/* ---- Figures (screenshots) ---- */
.figure { margin: 1.5rem 0; }
.figure img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.figure figcaption { font-size: 0.72rem; color: var(--text-muted); font-style: italic; margin-top: 0.5rem; text-align: center; line-height: 1.5; }
.figure-phone { max-width: 300px; margin-left: auto; margin-right: auto; }

/* ---- Charts (dimensions are data-driven, set inline per element) ---- */
.bar-chart { margin: 1rem 0; }
.bar-row { display: flex; align-items: center; gap: 0.8rem; margin: 0.3rem 0; }
.bar-label { font-size: 0.8rem; min-width: 140px; color: var(--text-muted); text-align: right; }
.bar-track { flex: 1; height: 22px; background: var(--surface2); border-radius: 4px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: 8px; }
.bar-fill span { font-size: 0.7rem; font-weight: 600; color: var(--text-bright); white-space: nowrap; }
@media (max-width: 600px) { .bar-label { min-width: 90px; font-size: 0.72rem; } }

.timeline-bar { display: flex; gap: 1px; align-items: flex-end; height: 80px; margin: 1rem 0; }
.timeline-day { flex: 1; border-radius: 2px 2px 0 0; min-width: 3px; position: relative; }
.timeline-labels { display: flex; justify-content: space-between; font-size: 0.65rem; color: var(--text-muted); margin-top: 0.3rem; }

/* ---- Callouts ---- */
.callout { border-left: 3px solid var(--blue); padding: 1rem 1.2rem; margin: 1.2rem 0; background: rgba(88,166,255,0.04); border-radius: 0 8px 8px 0; font-size: 0.9rem; }
.callout-red { border-left-color: var(--red); background: rgba(248,81,73,0.04); }
.callout-green { border-left-color: var(--green); background: rgba(63,185,80,0.04); }
.callout-orange { border-left-color: var(--orange); background: rgba(210,153,34,0.04); }
.callout-purple { border-left-color: var(--purple); background: rgba(188,140,255,0.04); }
.callout strong { color: var(--text-bright); }
.callout code { background: rgba(110,118,129,0.15); padding: 0.1rem 0.4rem; border-radius: 4px; font-family: var(--mono); font-size: 0.82em; }

.section-intro { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 1.2rem; padding-bottom: 0.8rem; border-bottom: 1px dashed var(--border); }

.redacted-notice { background: rgba(88,166,255,0.06); border: 1px solid rgba(88,166,255,0.2); border-radius: 10px; padding: 1rem 1.3rem; margin-bottom: 2.5rem; font-size: 0.85rem; color: var(--text-muted); }
.redacted-notice strong { color: var(--blue); }

.limits-box { background: rgba(210,153,34,0.05); border: 1px solid rgba(210,153,34,0.2); border-radius: 10px; padding: 1.3rem; margin: 1rem 0; }
.limits-box h3 { color: var(--orange); margin-top: 0; }
.limits-box ul { margin: 0.5rem 0 0 1.5rem; font-size: 0.88rem; }
.limits-box li { margin-bottom: 0.4rem; }

/* ---- TOC ---- */
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem 1.8rem; margin-bottom: 2.5rem; }
.toc h3 { color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.8rem; }
.toc ol { list-style: none; counter-reset: toc; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.3rem 2rem; }
.toc li { counter-increment: toc; }
.toc li a { display: flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; padding: 0.4rem 0; font-size: 0.88rem; border-bottom: 1px solid rgba(48,54,61,0.3); transition: border-color 0.2s, color 0.2s; }
.toc li a:hover { color: var(--blue); border-bottom-color: var(--blue); }
.toc li a::before { content: "0" counter(toc); color: var(--blue); font-family: var(--mono); font-size: 0.78rem; font-weight: 600; min-width: 1.4rem; }
.toc li:nth-child(n+10) a::before { content: counter(toc); }

/* ---- Sticky nav + reading progress ---- */
.progress-bar { position: fixed; top: 0; left: 0; height: 3px; background: var(--blue); width: 0%; z-index: 1000; transition: width 0.1s linear; }
.sticky-nav { position: fixed; top: 3px; left: 0; right: 0; z-index: 999; background: rgba(13,17,23,0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); transform: translateY(-100%); transition: transform 0.3s ease; }
.sticky-nav.visible { transform: translateY(0); }
.sticky-nav-inner { max-width: var(--cw); margin: 0 auto; padding: 0.6rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sticky-nav-title { color: var(--text-bright); font-weight: 600; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky-nav-links { display: flex; gap: 0.3rem; flex-shrink: 0; }
.sticky-nav-links a { color: var(--text-muted); font-size: 0.72rem; padding: 0.25rem 0.5rem; border-radius: 6px; text-decoration: none; transition: color 0.2s, background 0.2s; white-space: nowrap; }
.sticky-nav-links a:hover, .sticky-nav-links a.active { color: var(--blue); background: rgba(88,166,255,0.1); }
@media (max-width: 768px) { .sticky-nav-links { display: none; } }

/* ---- Footer ---- */
footer, .footer { margin-top: 3rem; padding: 2rem 0; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.78rem; text-align: center; }
footer p { margin-bottom: 0.3rem; }

/* ---- 404 ---- */
.notfound { max-width: 480px; margin: 0 auto; padding: 8rem 1.5rem; text-align: center; }
.notfound h1 { color: var(--text-bright); font-size: 3rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.notfound p { color: var(--text-muted); }

/* ---- Cookie banner ---- */
.cookie-banner { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem 1.2rem; display: flex; align-items: center; gap: 1rem; font-size: 0.75rem; z-index: 1001; max-width: 90vw; }
.cookie-banner button { background: #238636; color: #fff; border: none; border-radius: 6px; padding: 0.35rem 0.8rem; font-size: 0.75rem; cursor: pointer; white-space: nowrap; }
.cookie-banner button.reject { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.cookie-banner.hidden { display: none; }

/* ---- Utilities (replace former inline styles) ---- */
/* Atomic utilities carry !important: they replace inline styles, which
   previously won over component descendant rules (e.g. .callout strong).
   This preserves that precedence faithfully. */
.mono { font-family: var(--mono) !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.ta-r { text-align: right !important; }
.ta-c { text-align: center !important; }
.c-green  { color: var(--green) !important; }
.c-red    { color: var(--red) !important; }
.c-blue   { color: var(--blue) !important; }
.c-orange { color: var(--orange) !important; }
.c-purple { color: var(--purple) !important; }
.c-cyan   { color: var(--cyan) !important; }
.c-bright { color: var(--text-bright) !important; }
.c-muted  { color: var(--text-muted) !important; }
.fs-sm  { font-size: 0.88rem !important; }
.fs-xs  { font-size: 0.85rem !important; }
.fs-2xs { font-size: 0.78rem !important; }
.fs-3xs { font-size: 0.72rem !important; }
.fs-82  { font-size: 0.82rem !important; }
.fs-90 { font-size: 0.9rem !important; }
.mt-sm { margin-top: 0.5rem !important; }
.mt-md { margin-top: 0.8rem !important; }
.mt-1  { margin-top: 1rem !important; }
.mt-0 { margin-top: 0 !important; }
.mb-0  { margin-bottom: 0 !important; }
.mb-sm { margin-bottom: 0.5rem !important; }
.mb-xs { margin-bottom: 0.4rem !important; }
.m-0 { margin: 0 !important; }
.ml-12 { margin: 0 0 0 1.2rem !important; }
.ml-15 { margin: 0 0 0 1.5rem !important; }
.list-indent { margin: 0.5rem 0 0 1.5rem !important; }
.list-indent-b { margin: 0.5rem 0 1rem 1.5rem !important; }
.italic { font-style: italic !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.code { background: rgba(110,118,129,0.15); padding: 0.1rem 0.4rem; border-radius: 4px; font-family: var(--mono); font-size: 0.82em; }
.bc-blue { border-color: rgba(88,166,255,0.4) !important; }
.bc-green { border-color: rgba(63,185,80,0.4) !important; }
.bc-orange { border-color: rgba(210,153,34,0.4) !important; }
.bl-purple { border-left-color: var(--purple) !important; }
.bl-green { border-left-color: var(--green) !important; }
.bl-orange { border-left-color: var(--orange) !important; }

/* Single-role components lifted out of inline styles */
.note-card { margin-top: 1.5rem; padding: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 0.85rem; }
.section-break { text-align: center; margin: 3.5rem 0 1.5rem; padding: 2rem 0; border-top: 2px solid var(--border); border-bottom: 2px solid var(--border); background: rgba(88,166,255,0.02); }
.subhead { color: var(--text-bright); font-size: 1.15rem; font-weight: 700; margin: 0.5rem 0 0.3rem; }
.eyebrow { margin-top: 0; font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.eyebrow-blue { color: var(--blue); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  .sticky-nav, .progress-bar, .article-card { transition: none; }
}
