/* Heads-up Security · blog · Cockpit palette.
   External stylesheet only: no inline styles or scripts, so the blog works under the strict
   main-branch CSP (style-src 'self', no script-src). */

@font-face { font-family: "Instrument Sans"; font-weight: 700; font-display: swap; src: url(/fonts/instrument-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-display: swap; src: url(/fonts/instrument-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url(/fonts/jetbrains-mono-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url(/fonts/source-sans-3-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url(/fonts/source-sans-3-latin-600-normal.woff2) format("woff2"); }

:root {
  /* Light is the default. Variable names follow the Cockpit system; in light mode
     --cockpit is the page, --pale is the ink and --hud is the text green. */
  color-scheme: light;
  --cockpit: #F4F6F2;
  --cockpit-2: #FFFFFF;
  --pale: #1C2A3A;
  --prose: #2A3744;
  --soft: #3D4B58;
  --muted: #5B6975;
  --hud: #1F7A47;
  --hud-hover: #17663A;
  --line: #D9DED8;
  --line-2: #C3CBC4;
  --mode-line: #7D8A93;
  --caution: #C98A17;
  --display: "Instrument Sans", system-ui, "Segoe UI", sans-serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --wrap: 1200px;
  --measure: var(--wrap); /* body text runs the full frame, the same width as the title and intro */
  --gutter: clamp(16px, 4vw, 48px);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --cockpit: #1B222C;
  --cockpit-2: #232B36;
  --pale: #E6EFE9;
  --prose: #D3DDD7;
  --soft: #C0CBC4;
  --muted: #949F99;
  --hud: #4AAE77;
  --hud-hover: #62C28D;
  --line: #333D4A;
  --line-2: #3D4855;
  --mode-line: #4A5664;
  --caution: #E6B04A;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cockpit); color: var(--pale); font-family: var(--body); font-size: 18px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--hud); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--hud-hover); }
a:focus-visible { outline: 2px solid var(--hud); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--hud); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* top bar (matches the full site) */
.top { background: var(--cockpit); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 72px; }
.top nav { margin-left: auto; }
.top .logo { display: inline-flex; align-items: center; min-height: 44px; }
.top .logo img { height: 48px; width: auto; }
.top nav { display: flex; gap: 6px; flex-wrap: wrap; font-family: var(--mono); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; }
.top nav a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; border-radius: 4px; }
.top nav a:hover { color: var(--pale); }
.top nav a[aria-current] { color: var(--hud); }

/* article header */
.post-head { padding-block: clamp(40px, 7vw, 88px) clamp(32px, 5vw, 56px); position: relative; }
.post-head .inner { max-width: none; }
.post-head h1 { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 5.2vw, 56px); line-height: 1.08; letter-spacing: -.015em; margin: 14px 0 0; text-wrap: balance; }
.standfirst { margin: 22px 0 0; font-size: clamp(19px, 2.1vw, 22px); line-height: 1.5; color: var(--soft); text-wrap: pretty; }
.byline { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--mono); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.byline .by { color: var(--pale); }
.horizon { height: 1px; background: repeating-linear-gradient(90deg, var(--hud) 0 6px, transparent 6px 14px); opacity: .35; }

/* article body */
.post { padding-block: clamp(36px, 6vw, 72px) clamp(48px, 7vw, 96px); }
.prose { max-width: var(--measure); margin: 0 auto; }
.prose > * + * { margin-top: 1.1em; }
.prose p, .prose li { color: var(--prose); }
.prose h2 { font-family: var(--display); font-weight: 700; font-size: clamp(25px, 3vw, 32px); line-height: 1.15; letter-spacing: -.01em; margin: 2.1em 0 0; color: var(--pale); text-wrap: balance; }
.prose h2 + * { margin-top: .7em; }
.prose h3 { font-family: var(--display); font-weight: 600; font-size: 21px; line-height: 1.25; margin-top: 1.8em; color: var(--pale); }
.prose h3 + p { margin-top: .45em; }
.prose strong { color: var(--pale); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .5em; }
.prose li::marker { color: var(--hud); font-family: var(--mono); }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--caution); color: var(--soft); font-size: 19px; }
.prose blockquote p { color: var(--soft); }

/* steps: numbered with mono indices */
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 18px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; gap: 0 12px; }
.steps li::before { content: counter(step, decimal-leading-zero); font-family: var(--mono); font-size: 13px; letter-spacing: .08em; color: var(--hud); padding-top: 5px; }
.steps li + li { margin-top: 0; }

/* principles list */
.principles { list-style: none; padding: 0; display: grid; gap: 14px; }
.principles li { background: var(--cockpit-2); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.principles li + li { margin-top: 0; }
.principles strong { display: block; font-family: var(--display); font-size: 18px; margin-bottom: 2px; }

/* figures: allowed to run wider than the text column */
.prose figure { margin: 2.2em calc(min(0px, (var(--measure) - min(1100px, 100vw - 2 * var(--gutter))) / 2)); }
.prose figure img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.prose figcaption { margin-top: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: .05em; color: var(--muted); line-height: 1.5; }

/* call to action */
.cta { margin-top: 3em; background: var(--cockpit-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 24px; }
.cta .eyebrow { margin-bottom: 8px; }
.cta p { color: var(--soft); }
.cta .addr { display: inline-flex; align-items: center; min-height: 48px; margin-top: 14px; font-family: var(--mono); font-size: clamp(15px, 2.2vw, 18px); color: var(--pale); background: var(--cockpit); border: 1px solid var(--line-2); border-radius: 5px; padding: 10px 16px; text-decoration: none; overflow-wrap: anywhere; }
.cta .addr:hover, .cta .addr:focus-visible { border-color: var(--hud); color: var(--hud); }

/* series navigation */
.series { margin-top: 2.4em; border-top: 1px solid var(--line); padding-top: 22px; }
.series ol { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.series li { display: flex; gap: 12px; align-items: baseline; color: var(--muted); font-size: 16.5px; }
.series li + li { margin-top: 0; }
.series .n { font-family: var(--mono); font-size: 12px; color: var(--muted); flex: none; width: 2.2em; }
.series .here { color: var(--pale); }
.series .here .n { color: var(--hud); }
.series .soon { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-left: auto; padding-left: 12px; white-space: nowrap; }

/* blog index */
.index-head { padding-block: clamp(40px, 7vw, 88px) clamp(28px, 4vw, 48px); }
.index-head h1 { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 5vw, 52px); line-height: 1.1; letter-spacing: -.01em; margin: 14px 0 0; }
.index-head p { margin: 18px 0 0; color: var(--soft); font-size: clamp(18px, 2vw, 21px); }
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; padding-block: clamp(32px, 5vw, 56px) clamp(56px, 8vw, 104px); }
.card { background: var(--cockpit-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.card:hover { border-color: var(--line-2); }
.card .thumb { display: grid; align-content: center; background: var(--cockpit); }
.card .thumb img { width: 100%; height: auto; }
.card .body { padding: 22px 24px 24px; display: grid; gap: 10px; align-content: start; }
.card h2 { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
.card h2 a { color: var(--pale); text-decoration: none; }
.card h2 a:hover { color: var(--hud); }
.card p { margin: 0; color: var(--soft); font-size: 17px; }
.card .meta { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.card .more { font-family: var(--display); font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; min-height: 44px; }
.upcoming { background: transparent; border-style: dashed; grid-template-columns: 1fr; }
.upcoming h2 { color: var(--muted); font-size: 21px; }

/* footer */
footer { border-top: 1px solid var(--line); color: var(--muted); padding-block: 28px calc(32px + env(safe-area-inset-bottom, 0px)); font-size: 14px; }
footer .wrap { display: grid; grid-template-columns: auto 1fr; gap: 14px 28px; align-items: center; }
footer img { height: 48px; width: auto; }
footer .legal { display: grid; gap: 4px; }

@media (max-width: 760px) {
  .card { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 17.5px; }
  .top .wrap { display: grid; grid-template-columns: 1fr auto; padding-block: 8px 4px; row-gap: 0; }
  .top nav { grid-column: 1 / -1; grid-row: 2; margin-left: 0; }
  .top nav { flex-wrap: nowrap; overflow-x: auto; gap: 2px; margin-inline: -8px; padding-inline: 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav a { white-space: nowrap; font-size: 11.5px; }
  .prose figure { margin-inline: 0; }
  .steps li { grid-template-columns: 34px 1fr; }
  footer .wrap { grid-template-columns: 1fr; }
  .series .soon { display: none; }
}

/* theme button (shown by /theme.js; hidden when scripts are off) */
.mode { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: transparent; border: 1px solid var(--mode-line); border-radius: 999px; padding: 0 14px 0 12px; cursor: pointer; }
.mode[hidden] { display: none; }
.mode:hover { color: var(--pale); border-color: var(--pale); }
.mode:focus-visible { outline: 2px solid var(--hud); outline-offset: 3px; }
.mode .sw { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; position: relative; flex: none; }
.mode .sw::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: currentColor; clip-path: inset(0 0 0 50%); }
:root[data-theme="dark"] .mode .sw::after { clip-path: inset(0 50% 0 0); }

/* logo files: the light cut by default, the dark cut in dark mode */
.on-dark { display: none !important; }
:root[data-theme="dark"] .on-light { display: none !important; }
:root[data-theme="dark"] .on-dark { display: block !important; }

/* list resets win over the general .prose list padding */
.prose .principles, .prose .steps { padding-left: 0; }
.prose > :first-child { margin-top: 0; }
.prose figure a { display: block; border-radius: 10px; }
