/* ══════════════════════════════════════════════════════════════
   Init1Security - Public Site

   COLOR is defined here and owned here. This file is the only source for the
   site palette, with no external stylesheet to keep in sync with.

   SURFACE TREATMENT: translucent borders and generous radii, which read better
   on a dark ground than fixed grey hairlines.

   Layout concept: "the matrix is the map". Structure borrows from an ATT&CK
   coverage matrix, the native artifact of this business.
   ══════════════════════════════════════════════════════════════ */

/* Self-hosted, latin subset, variable. No CDN and no third-party requests.
   Both faces are SIL Open Font License 1.1, see fonts/LICENSE.txt */
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/space-grotesk.woff2') format('woff2-variations'),
       url('../fonts/space-grotesk.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono.woff2') format('woff2-variations'),
       url('../fonts/jetbrains-mono.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Color. Defined here, owned here, no external file to keep in sync with. */
  --bg-primary:   #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary:  #1c2128;
  --accent:       #e63946;
  --accent-hover: #c22a36;
  --accent-glow:  rgba(230, 57, 70, 0.15);

  /* Accent ramp. The metallic gradient is the device that reads as premium,
     independent of hue, so it runs in our red rather than a borrowed gold. */
  --accent-lift:  #ff9aa2;
  --accent-deep:  #8f1a25;
  --accent-grad:  linear-gradient(135deg, #ff9aa2 0%, #e63946 48%, #8f1a25 100%);
  --text-primary: #e6edf3;
  --text-secondary: #c9d1d9;
  --text-muted:   #8b949e;
  --text-faint:   #484f58;
  --success:      #238636;
  --code-bg:      #1a1e24;

  /* Surface treatment, public site only. Translucent so borders pick up the
     surface beneath them instead of flattening into a fixed grey. */
  --border:       rgba(255, 255, 255, 0.10);
  --border-light: rgba(255, 255, 255, 0.17);

  --radius:    12px;
  --radius-sm:  8px;
  --radius-lg: 20px;

  --font-display: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --wrap: 1140px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

html { font-size: 15px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

:where(a, button, input, textarea, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* Present for screen readers and crawlers, absent visually. Used where a page
   needs an h1 for structure but the design does not call for a visible title. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ── Type ─────────────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.13;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); }
h3 { font-size: clamp(1.1rem, 1.8vw, 1.3rem); letter-spacing: -0.012em; }

/* Gradient text. Applied to one phrase per page at most, never to a block. */
.grad {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@supports not (background-clip: text) { .grad { color: var(--accent); } }
p { margin-bottom: 1.1em; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: ''; width: 22px; height: 2px; flex: none; border-radius: 2px;
  background: var(--accent-grad);
}

/* ── Header ───────────────────────────────────────────────── */

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 16px var(--gutter);
  border-bottom: 1px solid var(--border);
  background: rgba(22, 27, 34, 0.85);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 100;
}
.site-header .brand { display: flex; align-items: center; gap: 10px; }
.site-header .brand:hover { text-decoration: none; }
.brand-icon { width: 32px; height: auto; flex: none; }
.brand-mark {
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
  background: var(--accent-grad); -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.brand-text { font-size: 15px; color: var(--text-primary); font-weight: 600; letter-spacing: -0.01em; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  padding: 8px 12px; border-radius: var(--radius-sm);
}
.nav-links a:hover { color: var(--text-primary); background: var(--bg-tertiary); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--text-primary); }
.nav-training {
  color: var(--text-primary) !important;
  border: 1px solid var(--border-light);
  display: inline-flex; align-items: center; gap: 7px;
}
.nav-training:hover { border-color: var(--accent); background: var(--accent-glow) !important; }
.nav-training svg { opacity: .65; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s var(--ease); border: none;
  font-family: var(--font-sans); line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.14) inset; }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-light); }
.btn-secondary:hover { color: var(--text-primary); border-color: var(--text-faint); background: var(--bg-tertiary); }
.btn-large { padding: 14px 30px; font-size: 15px; border-radius: var(--radius); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── Hero ─────────────────────────────────────────────────── */

.hero {
  padding-block: clamp(56px, 9vw, 104px);
  border-bottom: 1px solid var(--border);
  position: relative;
  background:
    radial-gradient(1100px 520px at 86% 4%, rgba(230,57,70,.20), transparent 64%),
    radial-gradient(700px 400px at 8% 96%, rgba(230,57,70,.07), transparent 70%),
    var(--bg-primary);
}
.hero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .55;
}
/* The hero carries type only. It is a plain .wrap block, left aligned with every
   other section. The h1 has a hard <br>, and the lede caps its own measure, so
   nothing here needs a width constraint. */
.hero h1 { margin-bottom: 18px; }
.hero-lede { font-size: clamp(1rem, 1.35vw, 1.12rem); color: var(--text-muted); max-width: 46ch; margin-bottom: 28px; }

/* ── Signature: full ATT&CK matrix ────────────────────────── */

.mx-band {
  position: relative;
  background-size: cover; background-position: center;
  background-color: var(--bg-secondary);
  border-block: 1px solid var(--border);
  padding-block: clamp(48px, 7vw, 80px);
  overflow: hidden;
}
.mx-band::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(13,17,23,.93), rgba(13,17,23,.97));
}
.mx-band > * { position: relative; z-index: 1; }
.mx-band .section-head { margin-inline: auto; text-align: center; }
.mx-band .eyebrow { justify-content: center; }
.mx-scroll {
  overflow-x: auto; overflow-y: hidden;
  padding-bottom: 12px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
}
.mx-grid {
  display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 8px;
  width: max-content; margin-inline: auto;
  padding-inline: var(--gutter);
}
.mx-col { display: flex; flex-direction: column; gap: 6px; }
.mx-head {
  font-family: var(--font-mono); font-size: 10px; line-height: 1.35;
  letter-spacing: .05em; text-transform: uppercase; color: var(--text-secondary);
  padding-bottom: 10px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border-light); min-height: 3.4em;
}
.mx-n { display: block; color: var(--accent); margin-bottom: 4px; font-size: 9px; }

/* Every cell is lit. We test the whole framework. */
.mx-cell {
  display: block; text-decoration: none;
  font-family: var(--font-mono); font-size: 10px; line-height: 1.35;
  padding: 9px 8px; border-radius: 5px;
  color: var(--text-primary);
  border: 1px solid rgba(230, 57, 70, .38);
  background: linear-gradient(160deg, rgba(230,57,70,.20), rgba(230,57,70,.07));
  transition: all .18s var(--ease);
}
.mx-cell:hover { text-decoration: none; }
.mx-cell:hover {
  border-color: var(--accent);
  background: linear-gradient(160deg, rgba(230,57,70,.42), rgba(230,57,70,.18));
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: no-preference) {
  .mx-cell { animation: mxIn .55s var(--ease) both; }
}
@keyframes mxIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

.mx-id {
  display: block; margin-top: 5px; font-size: 9px;
  letter-spacing: .05em; color: var(--accent); opacity: .85;
}
.mx-note {
  margin-top: 22px; text-align: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-faint);
}
.mx-swatch {
  width: 12px; height: 12px; border-radius: 3px; flex: none;
  border: 1px solid rgba(230,57,70,.38);
  background: linear-gradient(160deg, rgba(230,57,70,.20), rgba(230,57,70,.07));
}
.mx-hint { color: var(--text-faint); }

/* ── Section background bands ─────────────────────────────── */

.section-band {
  position: relative;
  background-size: cover; background-position: center;
  border-block: 1px solid var(--border);
}
.section-band::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(13,17,23,.97) 0%, rgba(13,17,23,.86) 45%, rgba(13,17,23,.72) 100%);
}
.section-band > * { position: relative; z-index: 1; }

/* ── Stat strip ───────────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat { background: var(--bg-secondary); padding: 22px 20px; }
.stat b {
  display: block;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
}
.stat span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ── Sections ─────────────────────────────────────────────── */

.section { padding-block: clamp(52px, 8vw, 88px); }
.section-alt { background: var(--bg-secondary); border-block: 1px solid var(--border); }
.section-head { max-width: 60ch; margin-bottom: clamp(28px, 4vw, 44px); }
.section-head p { color: var(--text-muted); font-size: 1.02rem; }

/* ── Capabilities ─────────────────────────────────────────── */

.caps { display: grid; gap: 1px; background: var(--border); border-block: 1px solid var(--border); }
.cap {
  background: var(--bg-primary); padding: clamp(22px, 3vw, 32px) 0;
  display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: clamp(14px, 3vw, 36px); align-items: start;
}
.section-alt .cap { background: var(--bg-secondary); }
.cap-tag {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); padding-top: 6px;
}
.cap h3 { margin-bottom: 8px; }
.cap p { max-width: 68ch; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; margin-top: 14px; }
.tags li {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
  border: 1px solid var(--border-light); border-radius: 4px;
  padding: 4px 9px; background: var(--bg-tertiary);
}

/* ── Kill chain: a real sequence, so it is numbered ───────── */

.chain { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.chain-step { border-top: 2px solid var(--border-light); padding-top: 12px; }
.chain-n { font-family: var(--font-mono); font-size: 11px; color: var(--accent); display: block; margin-bottom: 6px; }
.chain-step b { color: var(--text-primary); font-weight: 600; font-size: 14px; }

/* ── Why ──────────────────────────────────────────────────── */

.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 1px; background: var(--border); }
.why-item { background: var(--bg-primary); padding: 24px 22px 26px; }
.section-alt .why-item { background: var(--bg-secondary); }
.why-item p { color: var(--text-primary); font-weight: 600; font-size: 1rem; line-height: 1.4; }

/* ── Post cards ───────────────────────────────────────────── */

.wrap-wide { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter); }

.posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: clamp(18px, 2.4vw, 26px); }

/* Featured post: image left, copy right, full width of the wide shell. */
.post-feature {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0; margin-bottom: clamp(22px, 3vw, 34px);
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; isolation: isolate;
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.post-feature:hover {
  text-decoration: none; transform: translateY(-4px);
  border-color: var(--border-light);
  box-shadow: 0 24px 54px -22px rgba(0,0,0,.8), 0 0 0 1px rgba(230,57,70,.15);
}
.post-feature .post-media { aspect-ratio: 16 / 11; border-bottom: none; border-right: 1px solid var(--border); }
.post-feature .post-media img { filter: saturate(.85); }
.post-feature:hover .post-media img { transform: scale(1.05); filter: saturate(1); }
.post-feature .post-body { padding: clamp(24px, 3vw, 40px); justify-content: center; }
.post-feature .post-meta { color: var(--text-faint); }
.post-feature h3 { color: var(--text-primary); }
.post-feature:hover h3 { color: var(--accent); }
.post-feature h3 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); letter-spacing: -.025em; margin-bottom: 12px; }
.post-feature p { font-size: 1rem; color: var(--text-muted); }
.feature-tag {
  align-self: flex-start; margin-bottom: 14px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: #fff; background: var(--accent-grad); border-radius: 999px; padding: 5px 12px;
}
@media (max-width: 860px) {
  .post-feature { grid-template-columns: 1fr; }
  .post-feature .post-media { border-right: none; border-bottom: 1px solid var(--border); aspect-ratio: 16 / 9; }
}

/* Card roots are anchors. Reset the inherited link colour here so children
   without their own colour do not come out red. */
.post-card, .post-feature { color: var(--text-secondary); }

.post-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.post-card:hover { text-decoration: none; }

/* Accent bar wipes in across the top edge on hover. */
.post-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; z-index: 3;
  background: var(--accent-grad);
  transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease);
}
.post-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-light);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .75), 0 0 0 1px rgba(230, 57, 70, .13);
}
.post-card:hover::before { transform: scaleX(1); }

.post-media {
  position: relative;
  aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}
.post-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s var(--ease), filter .4s var(--ease);
  filter: saturate(.82);
}
.post-card:hover .post-media img { transform: scale(1.06); filter: saturate(1); }

/* Scrim keeps the badge readable over any screenshot. */
.post-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13,17,23,.85) 0%, transparent 42%);
}
.post-badge {
  position: absolute; z-index: 2; left: 12px; bottom: 11px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-secondary);
  background: rgba(13, 17, 23, .72);
  border: 1px solid var(--border-light);
  border-radius: 999px; padding: 4px 10px;
  backdrop-filter: blur(6px);
}

.post-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.post-meta {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 9px;
}
.post-card h3 { margin-bottom: 9px; transition: color .25s var(--ease); }
.post-card:hover h3 { color: var(--accent); }
.post-card p { color: var(--text-muted); font-size: .92rem; margin-bottom: 16px; }

.post-more {
  margin-top: auto;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
  display: inline-flex; align-items: center; gap: 7px;
}
.post-more svg { transition: transform .3s var(--ease); }
.post-card:hover .post-more svg { transform: translateX(4px); }

/* Scroll reveal. Elements start hidden only once JS confirms it can observe
   them, so the content stays visible if the script never runs. */
@media (prefers-reduced-motion: no-preference) {
  .js-reveal .reveal { opacity: 0; transform: translateY(18px); }
  .js-reveal .reveal.in {
    opacity: 1; transform: none;
    transition: opacity .6s var(--ease), transform .6s var(--ease);
  }
}

/* ── Article ──────────────────────────────────────────────── */

.article { padding-block: clamp(40px, 6vw, 68px); }
.article-head { max-width: 52rem; margin: 0 auto clamp(28px, 4vw, 40px); }
.article-meta {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 14px;
}
.article-body { max-width: 52rem; margin-inline: auto; font-size: 1.06rem; }
.article-body h2 { font-size: clamp(1.4rem, 2.3vw, 1.75rem); margin-top: 2.3em; margin-bottom: 0.6em; }
.article-body h3 { margin-top: 1.9em; margin-bottom: 0.5em; }
.article-body img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); margin-block: 28px; }
.article-body ul, .article-body ol { padding-left: 22px; margin-bottom: 1.2em; }
.article-body li { margin-bottom: 0.4em; }
.article-body pre {
  background: var(--code-bg); border: 1px solid var(--border); color: var(--text-secondary);
  padding: 16px 18px; border-radius: var(--radius); overflow-x: auto;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; margin-block: 24px;
}
.article-body :not(pre) > code {
  font-family: var(--font-mono); font-size: 0.87em; background: var(--code-bg);
  border: 1px solid var(--border); padding: 2px 6px; border-radius: 4px; color: var(--text-primary);
}
.article-body blockquote {
  margin-block: 24px; padding: 14px 18px;
  border-left: 3px solid var(--accent); background: var(--bg-secondary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-body blockquote p { font-size: 0.95rem; color: var(--text-muted); }
.article-body video { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); margin-block: 28px; }
.article-figure { margin-block: 32px; }
@media (min-width: 1100px) {
  .article-figure { width: calc(100% + 140px); margin-inline: -70px; }
}
.article-figure img { margin-block: 0; }
.article-figure figcaption {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-faint);
  text-align: center; margin-top: 10px;
}

/* ── Page hero, shared by About and Services ──────────────── */

.page-hero {
  position: relative; padding-block: clamp(56px, 9vw, 96px);
  background-size: cover; background-position: center;
  border-bottom: 1px solid var(--border);
}
.page-hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(13,17,23,.96), rgba(13,17,23,.80) 55%, rgba(13,17,23,.62));
}
.page-hero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .5;
}
.page-hero > * { position: relative; z-index: 1; }
.page-hero h1 { max-width: 18ch; margin-bottom: 16px; }
.page-hero .hero-lede { margin-bottom: 0; }

/* ── Service cards ────────────────────────────────────────── */

.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: clamp(16px, 2vw, 22px); }
.svc {
  position: relative; display: flex; flex-direction: column;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: clamp(22px, 2.6vw, 30px);
  overflow: hidden; isolation: isolate;
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.svc::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--accent-grad); transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease);
}
.svc:hover {
  transform: translateY(-4px); border-color: var(--border-light);
  box-shadow: 0 20px 44px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(230,57,70,.13);
}
.svc:hover::before { transform: scaleX(1); }
.svc-n {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em;
  color: var(--accent); margin-bottom: 14px; display: block;
}
.svc h3 { margin-bottom: 10px; }
.svc p { color: var(--text-muted); font-size: .95rem; margin-bottom: 16px; }
.svc .tags { margin-top: auto; }

/* ── Service feature block ────────────────────────────────── */

.svc-feature {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-secondary); overflow: hidden;
}
.svc-feature-head {
  padding: clamp(24px, 3vw, 36px);
  border-bottom: 1px solid var(--border);
}
.svc-feature-head h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 12px; }
.svc-feature-head p { color: var(--text-muted); max-width: 68ch; }
.svc-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1px; background: var(--border); }
.svc-shot { background: var(--bg-secondary); }
.svc-shot img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 10; }
.svc-shot figcaption {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint);
  padding: 10px 14px; border-top: 1px solid var(--border);
}
.svc-slot {
  padding: 40px 24px; text-align: center;
  border: 1px dashed var(--border-light); border-radius: var(--radius); margin: clamp(20px,3vw,32px);
  font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); line-height: 1.7;
}

/* ── Tool block, ANIMO ────────────────────────────────────── */

.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.tool-name {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -.03em;
  font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1; margin-bottom: 6px;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tool-sub {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 18px;
}
.tool-shot {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--code-bg); box-shadow: 0 24px 60px -28px rgba(0,0,0,.9);
}
.tool-shot img { width: 100%; }
.tool-feats { list-style: none; display: grid; gap: 9px; margin: 18px 0 22px; }
.tool-feats li {
  position: relative; padding-left: 20px; font-size: .93rem; color: var(--text-muted);
}
.tool-feats li::before {
  content: ''; position: absolute; left: 0; top: .55em;
  width: 7px; height: 7px; border-radius: 2px; background: var(--accent-grad);
}
.tool-meta { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; margin-bottom: 20px; }
.tool-meta li {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
  border: 1px solid var(--border-light); border-radius: 4px; padding: 4px 9px; background: var(--bg-tertiary);
}
.tool-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: clamp(24px,3vw,36px); }
.tool-gallery figure { background: var(--bg-secondary); margin: 0; }
.tool-gallery img { width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: top left; cursor: zoom-in; }
.tool-gallery figcaption {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint);
  padding: 9px 13px; border-top: 1px solid var(--border);
}
@media (max-width: 900px) { .tool { grid-template-columns: 1fr; } }

/* ── About: approach steps and value rows ─────────────────── */

.approach { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.approach-step { background: var(--bg-secondary); padding: 26px 24px 28px; }
.approach-step b {
  display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 700;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; line-height: 1; margin-bottom: 12px; letter-spacing: -.03em;
}
.approach-step h3 { font-size: 1.05rem; margin-bottom: 8px; }
.approach-step p { color: var(--text-muted); font-size: .92rem; margin: 0; }

.split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 60px); align-items: center;
}
.split-media {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); aspect-ratio: 4 / 3;
}
.split-media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ── Article: hero, TOC, progress, code, lightbox ────────── */

.read-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 300;
  background: rgba(255,255,255,.05);
}
.read-progress span {
  display: block; height: 100%; transform: scaleX(0); transform-origin: left;
  background: var(--accent-grad);
}

.article-hero {
  position: relative; padding-block: clamp(56px, 9vw, 104px);
  background-size: cover; background-position: center;
  border-bottom: 1px solid var(--border);
}
.article-hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(13,17,23,.72), rgba(13,17,23,.95) 78%, var(--bg-primary));
}
.article-hero > * { position: relative; z-index: 1; }
.article-hero h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); max-width: 20ch; margin-bottom: 16px; }
.article-lede { font-size: clamp(1rem, 1.4vw, 1.15rem); color: var(--text-muted); max-width: 58ch; }

.article-layout {
  display: grid; grid-template-columns: 210px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px); align-items: start;
  padding-block: clamp(36px, 5vw, 56px);
}
.article-toc { position: sticky; top: 92px; }
.article-toc h4 {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px;
}
.article-toc ul { list-style: none; border-left: 1px solid var(--border); }
.article-toc a {
  display: block; padding: 6px 0 6px 14px; margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 12.5px; line-height: 1.4; color: var(--text-muted);
}
.article-toc a:hover { color: var(--text-primary); text-decoration: none; }
.article-toc a.active { color: var(--accent); border-left-color: var(--accent); }
.article-toc .lvl3 { padding-left: 26px; font-size: 12px; }

.article-body { max-width: 46rem; }
.article-body h2 { scroll-margin-top: 96px; }
.article-body h3 { scroll-margin-top: 96px; }

/* Code blocks get terminal chrome and a copy control, both added by JS. */
.code-block {
  margin-block: 26px; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; background: var(--code-bg);
}
.code-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: rgba(255,255,255,.035);
  border-bottom: 1px solid var(--border);
}
.code-dots { display: flex; gap: 6px; }
.code-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-light); }
.code-dots i:first-child { background: rgba(230,57,70,.55); }
.code-copy {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted);
  background: transparent; border: 1px solid var(--border);
  border-radius: 5px; padding: 4px 10px; cursor: pointer;
  transition: all .15s var(--ease);
}
.code-copy:hover { color: var(--text-primary); border-color: var(--border-light); }
.code-copy.ok { color: var(--success); border-color: var(--success); }
.code-block pre { margin: 0; border: none; border-radius: 0; }

.article-figure img { cursor: zoom-in; transition: transform .3s var(--ease); }
.article-figure img:hover { transform: scale(1.008); }

.lb {
  position: fixed; inset: 0; z-index: 400; display: none;
  background: rgba(5, 8, 13, 0);
  transition: background .32s var(--ease);
}
.lb.on { display: block; background: rgba(5, 8, 13, .93); backdrop-filter: blur(8px); }
.lb.closing { background: rgba(5, 8, 13, 0); }
.lb-stage { position: absolute; inset: 0; margin: 0; }
.lb img {
  position: absolute; display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.9);
  will-change: transform;
}
.lb figcaption {
  position: absolute; left: 0; right: 0; bottom: 22px;
  text-align: center; font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: .06em; color: var(--text-muted);
  opacity: 0; transition: opacity .3s var(--ease) .18s;
  pointer-events: none; padding-inline: 60px;
}
.lb.on figcaption { opacity: 1; }
.lb.closing figcaption { opacity: 0; transition-delay: 0s; }
.lb-close, .lb-nav {
  position: absolute; z-index: 2;
  background: rgba(255,255,255,.07); border: 1px solid var(--border-light);
  color: var(--text-primary); cursor: pointer; line-height: 1;
  transition: all .18s var(--ease);
}
.lb-close {
  top: 18px; right: 22px; width: 42px; height: 42px;
  border-radius: 50%; font-size: 23px;
}
.lb-nav {
  top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%; font-size: 26px;
}
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-close:hover, .lb-nav:hover { background: rgba(230,57,70,.28); border-color: var(--accent); }
.lb-nav[hidden] { display: none; }
@media (max-width: 640px) {
  .lb-nav { width: 38px; height: 38px; font-size: 21px; }
  .lb figcaption { padding-inline: 20px; bottom: 14px; }
}

/* Anything zoomable advertises it. */
.article-figure img, .tool-gallery img, .tool-shot img, .svc-shot img, .split-media img { cursor: zoom-in; }

.related { border-top: 1px solid var(--border); padding-block: clamp(36px, 5vw, 56px); }

@media (max-width: 980px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-toc { display: none; }
  .article-body { max-width: none; }
}

/* ── Contact ──────────────────────────────────────────────── */

.contact { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(28px, 5vw, 56px); align-items: start; }
.field { margin-bottom: 14px; }
.field label {
  display: block; font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px;
}
.field input, .field textarea {
  width: 100%; background: var(--bg-primary); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text-primary);
  font-family: var(--font-sans); font-size: 14px;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.field textarea { min-height: 120px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-note { font-size: 12px; color: var(--text-faint); margin-top: 10px; }
.form-note a { color: var(--text-muted); }
.form-note a:hover { color: var(--accent); }
.contact-direct {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border);
}
.contact-label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
}
.contact-direct a {
  font-family: var(--font-mono); font-size: 14px; color: var(--accent);
  word-break: break-all;
}
.contact-direct a:hover { text-decoration: underline; }

/* ── Footer ───────────────────────────────────────────────── */

.site-footer { background: var(--bg-secondary); border-top: 1px solid var(--border); padding-block: 32px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
.footer-links { display: flex; gap: 20px; font-size: 13px; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text-primary); text-decoration: none; }
.site-footer small { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 900px) {
  .contact { grid-template-columns: 1fr; }
  .matrix { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .matrix-col:nth-child(n + 4) { display: none; }
  .chain { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .nav-links .nav-hide { display: none; }
  .cap { grid-template-columns: 1fr; gap: 6px; }
  .cap-tag { padding-top: 0; }
  .matrix { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .matrix-col:nth-child(n + 3) { display: none; }
  .field-row, .chain { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
}
