/*
Theme Name: Heuristic Data
Theme URI: https://heuristicdata.gr/
Author: Heuristic Data
Author URI: https://heuristicdata.gr/
Description: Dark, technical/monospace-accented theme for Heuristic Data — data, AI & software engineering. Front page built from template parts; content driven by custom post types (Services, Core Practices, Clients) and a Theme Settings page. Vanilla CSS/JS, no page builders, no ACF.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: heuristicdata
*/

/* ====================================================================
   Heuristic Data — DARK THEME ONLY
   Technical/monospace-accented, precise grid.
   ==================================================================== */

:root {
  --bg: #0A0A0B;
  --bg-2: #0F0F11;
  --bg-3: #16161A;
  --fg: #EDEDED;
  --fg-dim: rgba(237, 237, 237, 0.62);
  --fg-faint: rgba(237, 237, 237, 0.58);
  --line: rgba(237, 237, 237, 0.10);
  --line-strong: rgba(237, 237, 237, 0.22);
  --accent: #0de4c4;
  --accent-ink: #0de4c4;
  --gutter: clamp(20px, 4vw, 56px);
  --max: 1440px;
  --font-display: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

/* Light theme — same tokens, overridden. --accent stays bright (used as a
   fill behind explicit dark text); --accent-ink is a darkened stand-in for
   places accent is used as plain text on the page background, so contrast
   against white holds up. */
:root[data-theme="light"] {
  --bg: #FAFAF9;
  --bg-2: #F1F1EF;
  --bg-3: #E7E7E4;
  --fg: #14141A;
  --fg-dim: rgba(20, 20, 26, 0.66);
  --fg-faint: rgba(20, 20, 26, 0.62);
  --line: rgba(20, 20, 26, 0.10);
  --line-strong: rgba(20, 20, 26, 0.22);
  --accent-ink: #067a68;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }
.mono { font-family: var(--font-mono); font-feature-settings: "zero", "ss01"; letter-spacing: 0.02em; }
.dim { color: var(--fg-dim); }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 8px; top: 8px; z-index: 100; background: var(--accent); color: #0A0A0B; padding: 8px 14px; border-radius: 6px; }

/* ──────────────── Top frame: ticker grid coordinates ──────────────── */
.frame-ticks {
  position: fixed; top: 0; left: 0; right: 0; height: 22px;
  z-index: 50; pointer-events: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--fg-faint);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
}
.frame-ticks span { display: inline-flex; align-items: center; gap: 8px; }
.frame-ticks .tick-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

/* ──────────────── Nav ──────────────── */
.nav {
  position: sticky; top: 22px; z-index: 40;
  display: flex; align-items: center; justify-content: flex-start; gap: 14px;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
}
/* Brand stays pinned left; everything else clusters together at the right
   edge via one auto margin on the first item of that cluster. On desktop
   that's nav-links; on mobile nav-links leaves the flex flow (position:
   fixed, for the fullscreen overlay) so the mobile media query moves the
   auto margin onto theme-toggle instead — otherwise both would apply and
   split the free space, pushing them apart instead of clustering them. */
.nav-links { margin-left: auto; }
.nav-brand { order: 1; display: flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: -0.01em; }
.nav-logo {
  width: 36px; height: auto; display: block;
  transition: transform 0.4s cubic-bezier(.22,.8,.2,1), filter 0.3s;
}
.nav-brand:hover .nav-logo { transform: rotate(-6deg) scale(1.05); filter: drop-shadow(0 0 12px var(--accent)); }
/* Light logo mark only has enough contrast on a dark background — swap in
   the gunmetal variant for light theme so the brand mark stays visible. */
.nav-brand .nav-logo--light { display: none; }
:root[data-theme="light"] .nav-brand .nav-logo--dark { display: none; }
:root[data-theme="light"] .nav-brand .nav-logo--light { display: block; }

/* Theme toggle — sits after nav-links (i.e. after Contact) on desktop via
   flex order; on mobile nav-links becomes a fixed overlay and drops out of
   the top bar's flex flow, so the toggle lands next to the burger instead. */
.theme-toggle {
  order: 3;
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0;
  background: transparent; border: 0; border-radius: 50%;
  cursor: pointer; color: var(--fg);
  transition: background 0.2s, box-shadow 0.2s;
}
.theme-toggle:hover { background: var(--bg-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.theme-toggle-icon { overflow: visible; }
.theme-toggle-rays line {
  stroke: var(--accent); stroke-width: 2; stroke-linecap: round;
  transform-origin: 12px 12px;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(.22,.8,.2,1);
}
.theme-toggle-disc {
  fill: var(--fg);
  r: 7px;
  transition: fill 0.35s ease, r 0.35s cubic-bezier(.22,.8,.2,1);
}
.theme-toggle-mask-circle {
  transform-origin: 17px 8.5px;
  transition: transform 0.45s cubic-bezier(.22,.8,.2,1);
}
/* Dark (default): moon — rays hidden, the mask circle carves a crescent
   out of the filled disc via the SVG <mask>. */
.theme-toggle-rays line { opacity: 0; transform: scale(0.5); }
/* Light: sun — mask circle slides off the disc so it renders full, rays
   fan out around it. */
.theme-toggle[aria-pressed="true"] .theme-toggle-mask-circle { transform: translate(9px, -9px); }
.theme-toggle[aria-pressed="true"] .theme-toggle-disc { fill: var(--accent); r: 5.2px; }
.theme-toggle[aria-pressed="true"] .theme-toggle-rays line { opacity: 1; transform: scale(1); }
.theme-toggle:hover .theme-toggle-disc { fill: var(--accent); }

.nav-links { order: 2; display: flex; align-items: center; gap: 4px; }
.nav-links > li {
  list-style: none;
}
.nav-link {
  padding: 8px 12px; font-size: 13px; color: var(--fg-dim);
  border-radius: 4px; transition: color 0.15s, background 0.15s;
  position: relative;
}
.nav-link:hover { color: var(--fg); background: var(--bg-2); }
.nav-link::before {
  content: "·"; color: var(--accent-ink); margin-right: 6px;
  opacity: 0; transition: opacity 0.15s;
}
.nav-link:hover::before { opacity: 1; }
.nav-cta {
  margin-left: 8px; padding: 8px 14px; font-size: 13px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: transparent; color: var(--fg);
  display: inline-flex; align-items: center; gap: 8px;
  transition: background 0.15s, border-color 0.15s;
}
.nav-cta:hover { background: var(--accent); border-color: var(--accent); color: #0A0A0B; }
.nav-cta i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.nav-cta:hover i { background: #0A0A0B; }

.nav-burger {
  order: 4;
  display: none;
  position: relative;
  flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px;
  width: 38px; height: 38px; padding: 0 0 0 9px;
  background: transparent; border: 1px solid var(--line-strong); border-radius: 6px;
  cursor: pointer; z-index: 61;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.nav-burger:hover { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.nav-burger span {
  display: block; height: 1.5px; margin: 0;
  background: var(--fg);
  transition: transform 0.3s cubic-bezier(.22,.8,.2,1), opacity 0.2s ease, width 0.25s ease, background 0.2s ease;
}
.nav-burger span:nth-child(1) { width: 17px; }
.nav-burger span:nth-child(2) { width: 11px; }
.nav-burger span:nth-child(3) { width: 17px; }
.nav-burger:hover span { background: var(--accent); }
body.nav-open .nav-burger span { background: var(--accent); }
body.nav-open .nav-burger span:nth-child(1) { width: 17px; transform: translateY(6.5px) rotate(45deg); }
body.nav-open .nav-burger span:nth-child(2) { opacity: 0; width: 0; }
body.nav-open .nav-burger span:nth-child(3) { width: 17px; transform: translateY(-6.5px) rotate(-45deg); }

body.nav-open { overflow: hidden; }

@media (max-width: 860px) {
  .nav-burger { display: flex; }
  .nav-links { margin-left: 0; }
  .theme-toggle { margin-left: auto; }

  /* .nav uses backdrop-filter, which creates a containing block for
     fixed-position descendants — drop it while open so nav-links can
     size against the viewport instead of the nav bar's own box. */
  body.nav-open .nav { backdrop-filter: none; z-index: 61; }

  .nav-links {
    position: fixed; inset: 0; z-index: 60;
    flex-direction: column; align-items: center; justify-content: center;
    gap: 8px;
    width: 100vw; height: 100dvh;
    background: var(--bg);
    visibility: hidden; opacity: 0;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }
  body.nav-open .nav-links { visibility: visible; opacity: 1; }

  .nav-links .nav-link { font-size: 20px; padding: 12px 20px; }
  .nav-links .nav-cta { margin-left: 0; margin-top: 12px; font-size: 15px; padding: 12px 22px; }
  .nav-links .nav-link::before { display: none; }
}

/* ──────────────── Buttons ──────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  border: 1px solid transparent; border-radius: 999px;
  font-family: var(--font-display); font-size: 14px; font-weight: 500;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #0A0A0B; border: 0; }
.btn-primary:hover { box-shadow: 0 6px 22px -8px var(--accent); }
.btn-ghost {
  background: transparent; color: var(--fg);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-2); border-color: var(--fg-faint); }
.btn-lg { padding: 16px 24px; font-size: 15px; }

/* ──────────────── Hero ──────────────── */
.hero {
  position: relative;
  min-height: calc(100vh - 22px);
  padding: clamp(80px, 12vh, 140px) var(--gutter) clamp(60px, 8vh, 100px);
  display: flex; align-items: center;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero-inner { width: 100%; max-width: var(--max); margin: 0 auto; position: relative; z-index: 2; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11.5px; color: var(--fg-dim);
  padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-2);
  margin-bottom: clamp(28px, 4vh, 44px);
}
.hero-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2.4s ease-in-out infinite; }

.hero-h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 9vw, 132px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 500;
  margin: 0 0 clamp(24px, 3.5vh, 36px);
  max-width: 16ch;
  opacity: 1;
  animation: heroIn 0.9s cubic-bezier(.22,.8,.2,1);
}
.hero-h1 .accent { color: var(--accent-ink); font-style: italic; font-family: "Newsreader", "Iowan Old Style", Georgia, serif; font-weight: 400; }
@keyframes heroIn { from { transform: translateY(14px); } to { transform: translateY(0); } }

.hero-sub {
  max-width: 56ch; font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.55; color: var(--fg-dim);
  margin: 0 0 clamp(28px, 4vh, 44px);
  text-wrap: pretty;
}
.hero-ctas {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-bottom: clamp(40px, 6vh, 72px);
}
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 24px;
  font-size: 11.5px; color: var(--fg-faint);
  padding-top: 20px; border-top: 1px solid var(--line);
  max-width: 640px;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.08em; }
.hero-meta i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.hero-corner {
  position: absolute; bottom: 24px; right: var(--gutter);
  display: flex; gap: 16px;
  font-size: 10.5px; color: var(--fg-faint);
  text-transform: uppercase; letter-spacing: 0.1em;
}

/* Ambient grid */
.hero-grid { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero-grid-lines {
  position: absolute; inset: -20px;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: translate(var(--gx, 0), var(--gy, 0));
  transition: transform 0.4s linear;
  mask-image: radial-gradient(ellipse 80% 70% at 30% 50%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 50%, #000 30%, transparent 75%);
}
.hero-grid-glow { position: absolute; inset: 0; background: radial-gradient(60% 50% at 30% 40%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%); }

/* ──────────────── 404 ──────────────── */
.error-404-hero {
  position: relative;
  min-height: calc(100vh - 22px);
  padding: clamp(80px, 12vh, 140px) var(--gutter) clamp(60px, 8vh, 100px);
  display: flex; align-items: center;
  overflow: hidden;
}
.error-404-inner { text-align: center; margin-left: auto; margin-right: auto; }
.error-404-inner .hero-eyebrow { margin-left: auto; margin-right: auto; }
.error-404-inner .hero-sub { margin-left: auto; margin-right: auto; }
.error-404-inner .hero-ctas { justify-content: center; }
.error-404-code {
  font-family: var(--font-mono);
  font-size: clamp(96px, 20vw, 260px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  font-weight: 500;
  color: var(--accent-ink);
  margin: 0 0 clamp(16px, 2.5vh, 28px);
  text-shadow: 0 0 60px color-mix(in srgb, var(--accent) 35%, transparent);
}
.error-404-lead {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 clamp(16px, 2vh, 24px);
}

/* ──────────────── Section heads ──────────────── */
.section { padding: clamp(80px, 12vh, 140px) var(--gutter); border-bottom: 1px solid var(--line); }
.section-head { max-width: var(--max); margin: 0 auto clamp(40px, 6vh, 72px); }
.section-label {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 11.5px; color: var(--fg-dim);
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 24px;
}
.section-num { color: var(--fg-faint); }
.section-title {
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1.02; letter-spacing: -0.025em; font-weight: 500;
  margin: 0 0 16px; max-width: 18ch;
  white-space: pre-line;
}
.section-sub {
  font-size: clamp(15px, 1.2vw, 17px); color: var(--fg-dim);
  max-width: 56ch; line-height: 1.55;
}

/* ──────────────── Reveal ──────────────── */
.reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.22,.8,.2,1);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ──────────────── Vision ──────────────── */
.vision { background: var(--bg-2); }
.vision-inner { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 200px 1fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
.vision-label { display: inline-flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.12em; }
.vision-label .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.vision-title { font-size: clamp(28px, 3.6vw, 48px); line-height: 1.1; letter-spacing: -0.02em; font-weight: 500; margin: 0 0 24px; max-width: 22ch; }
.vision-body { color: var(--fg-dim); font-size: clamp(15px, 1.2vw, 18px); line-height: 1.6; max-width: 60ch; }
@media (max-width: 760px) { .vision-inner { grid-template-columns: 1fr; gap: 16px; } }

/* ──────────────── Services ──────────────── */
.services-grid {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
@media (max-width: 1080px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .services-grid { grid-template-columns: 1fr; } }
.svc-card {
  background: var(--bg);
  padding: 32px 28px 28px;
  position: relative;
  display: flex; flex-direction: column;
  min-height: 320px;
  transition: background 0.25s ease;
}
.svc-card:hover { background: var(--bg-2); }
.svc-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 28px; font-size: 11px; }
.svc-n { color: var(--fg-faint); font-size: 13px; letter-spacing: 0.04em; }
.svc-tag { color: var(--fg-dim); letter-spacing: 0.12em; font-size: 10.5px; transition: color 0.2s; }
.svc-card:hover .svc-tag { color: var(--accent-ink); }
.svc-title { font-size: 22px; letter-spacing: -0.015em; margin: 0 0 12px; line-height: 1.18; font-weight: 500; }
.svc-body { font-size: 14px; line-height: 1.55; color: var(--fg-dim); margin: 0 0 22px; }
.svc-points { list-style: none; padding: 0; margin: auto 0 0; display: flex; flex-direction: column; gap: 8px; }
.svc-points li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--fg); }
.svc-bullet { width: 5px; height: 5px; border-radius: 50%; flex: none; opacity: 0.7; background: var(--accent); }
.svc-hover-line { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; transition: width 0.4s ease; background: var(--accent); }
.svc-card:hover .svc-hover-line { width: 100%; }

/* Featured service */
.svc-feature {
  max-width: var(--max); margin: 24px auto 0;
  display: grid; grid-template-columns: 1.2fr 1fr;
  gap: clamp(24px, 4vw, 56px); align-items: center;
  padding: clamp(32px, 5vw, 56px);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  position: relative;
}
@media (max-width: 880px) { .svc-feature { grid-template-columns: 1fr; } }
.svc-feature-tag { font-size: 11px; letter-spacing: 0.18em; color: var(--accent-ink); }
.svc-feature-title { font-size: clamp(22px, 2.6vw, 32px); margin: 12px 0 14px; line-height: 1.15; letter-spacing: -0.015em; font-weight: 500; }
.svc-feature-body { color: var(--fg-dim); margin: 0 0 22px; font-size: 15px; line-height: 1.55; max-width: 52ch; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; transition: gap 0.2s; color: var(--accent-ink); }
.link-arrow:hover { gap: 14px; }
.svc-feature-viz {
  display: grid; grid-template-columns: repeat(8, 1fr);
  gap: 4px; aspect-ratio: 1.6/1;
}
.svc-feature-viz span {
  display: block; aspect-ratio: 1; border-radius: 1px;
  transition: opacity 1.5s ease;
}

/* ──────────────── Clients ──────────────── */
.clients-marquee { max-width: 100%; margin: 0 auto; }
.marquee {
  overflow: hidden; padding: 12px 0 34px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: inline-flex; gap: 12px; white-space: nowrap;
  animation: marquee 60s linear infinite;
}
.marquee-rev .marquee-track { animation: marquee-rev 50s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes marquee-rev { from { transform: translateX(-50%); } to { transform: translateX(0); } }

.client-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 15px; color: var(--fg);
  background: var(--bg-2);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.client-chip:hover { border-color: var(--line-strong); }
a.client-chip:hover { border-color: var(--accent); cursor: pointer; }
.client-chip-n { font-size: 10.5px; color: var(--fg-faint); letter-spacing: 0.05em; }

/* Logo entries: no pill/border/background — just the mark itself. */
.client-logo {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 20px;
  text-decoration: none;
}
.client-logo img {
  height: 44px; max-height: 44px; width: auto; max-width: 200px;
  object-fit: contain; display: block;
  filter: grayscale(1); opacity: 0.75;
  transition: filter 0.25s ease, opacity 0.25s ease, transform 0.2s ease;
}
a.client-logo:hover { cursor: pointer; }
a.client-logo:hover img { filter: none; opacity: 1; transform: scale(1.12); }
/* Light theme: show partner logos in full color at rest, no grayscale dimming. */
:root[data-theme="light"] .client-logo img { filter: none; opacity: 1; }
:root[data-theme="light"] a.client-logo:hover img { transform: scale(1.12); }

.client-chip-cta {
  position: absolute; left: 0; right: 0; top: 100%;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  margin-top: 6px;
  font-size: 11px; letter-spacing: 0.04em; color: var(--accent-ink);
  opacity: 0; transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
a.client-chip:hover .client-chip-cta,
a.client-logo:hover .client-chip-cta { opacity: 1; transform: translateY(0); }

.client-chip-arrow {
  display: inline-flex; align-items: center; color: var(--accent-ink);
  opacity: 0; transition: opacity 0.2s ease;
}
a.client-chip:hover .client-chip-arrow { opacity: 1; }
.client-chip-arrow-icon { display: block; flex-shrink: 0; }

.clients-stat {
  max-width: var(--max); margin: clamp(48px, 7vh, 80px) auto 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 3vw, 48px);
  padding-top: 32px; border-top: 1px solid var(--line);
}
@media (max-width: 720px) { .clients-stat { grid-template-columns: repeat(2, 1fr); } }
.clients-stat > div { display: flex; flex-direction: column; gap: 8px; }
.clients-stat .mono { font-size: 10.5px; letter-spacing: 0.12em; }
.big-num { font-size: clamp(36px, 4vw, 56px); letter-spacing: -0.03em; line-height: 1; font-weight: 500; }
.big-num.accent { color: var(--accent-ink); }

/* ──────────────── Contact ──────────────── */
.contact-grid {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}
@media (max-width: 960px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 24px; }
.field { position: relative; grid-column: 1/-1; }
.field.half { grid-column: span 1; }
@media (max-width: 600px) { .field.half { grid-column: 1/-1; } }
.field label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-faint); margin-bottom: 10px;
  transition: color 0.2s;
}
.field-marker { color: var(--fg-faint); }
.field-required { color: var(--accent-ink); margin-left: 2px; }
.field-control { position: relative; }
.field input, .field textarea {
  width: 100%;
  background: transparent;
  border: 0; border-bottom: 1px solid var(--line-strong);
  color: var(--fg); font-family: inherit; font-size: 16px;
  padding: 8px 0 12px;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
}
.field textarea { min-height: 100px; }
.field input:focus, .field textarea:focus { border-bottom-color: transparent; }
.field:focus-within label, .field.filled label { color: var(--fg); }
.field-line {
  position: absolute; bottom: 0; left: 0; height: 1px; width: 0;
  transition: width 0.3s ease; background: var(--accent);
}
.field:focus-within .field-line { width: 100%; }
.field.filled .field-line { width: 100%; opacity: 0.5; }
.field-error { min-height: 16px; margin: 6px 0 0; font-size: 12px; color: #ff7a7a; text-decoration: none; }
.field.has-error input, .field.has-error textarea { border-bottom-color: #ff7a7a; }
.contact-form .btn { grid-column: 1/-1; justify-self: start; margin-top: 8px; }
.contact-form .btn[disabled] { opacity: 0.7; cursor: default; transform: none; }
.btn-spinner {
  display: none; width: 13px; height: 13px;
  border: 2px solid rgba(10, 10, 11, 0.3); border-top-color: #0A0A0B;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}
.btn.is-loading .btn-spinner { display: inline-block; }
.btn.is-loading [data-submit-icon] { display: none; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
.contact-note { grid-column: 1/-1; font-size: 13px; color: var(--fg-dim); margin: 4px 0 0; }
.contact-note.error { color: #ff7a7a; }
.contact-note.ok { color: var(--accent-ink); }

.contact-info { display: flex; flex-direction: column; gap: 28px; padding-left: clamp(0px, 3vw, 40px); border-left: 1px solid var(--line); padding-block: 4px; }
@media (max-width: 960px) { .contact-info { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: 32px; } }
.contact-info-block { display: flex; flex-direction: column; gap: 6px; }
.contact-info-block .mono { font-size: 10.5px; letter-spacing: 0.12em; }
.contact-link { font-size: 18px; color: var(--fg); border-bottom: 1px solid transparent; padding-bottom: 1px; transition: border-color 0.15s; align-self: flex-start; }
.contact-link:hover { border-bottom-color: var(--accent); }
.contact-addr { font-size: 15px; color: var(--fg-dim); }

.contact-map {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-2);
  position: relative;
  height: 260px;
  overflow: hidden;
}

/* ──────────────── Footer ──────────────── */
.footer { padding: clamp(60px, 8vh, 96px) var(--gutter) 24px; border-bottom: 0; background: var(--bg); }
.footer-inner {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  padding-bottom: 48px; border-bottom: 1px solid var(--line);
}
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-col { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.footer-col .mono { font-size: 10.5px; letter-spacing: 0.12em; margin-bottom: 4px; }
.footer-col a { color: var(--fg); border-bottom: 1px solid transparent; transition: border-color 0.15s; align-self: flex-start; }
.footer-col a:hover { border-bottom-color: var(--accent); }
.footer-brand { justify-content: center; }
.footer-brand .footer-logo { width: 120px; height: auto; display: block; margin-bottom: 4px; }
.footer-brand .footer-logo--light { display: none; }
:root[data-theme="light"] .footer-brand .footer-logo--dark { display: none; }
:root[data-theme="light"] .footer-brand .footer-logo--light { display: block; }
.footer-mission-title { margin-top: 16px; }
.footer-mission { color: var(--fg-dim); line-height: 1.6; max-width: 50ch; margin: 0; }

.footer-base {
  max-width: var(--max); margin: 0 auto;
  padding-top: 22px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px; color: var(--fg-faint);
}
.footer-ascii { color: var(--fg-faint); letter-spacing: 0.4em; }
.footer-base a { transition: color 0.15s; }
.footer-base a:hover { color: var(--fg); }

/* Custom selection */
::selection { background: var(--accent); color: #0A0A0B; }

/* Scrollbar (subtle) */
html { scrollbar-width: thin; scrollbar-color: var(--fg-faint) transparent; }

/* ──────────────── Cursor glow (ambient) ──────────────── */
.cursor-glow {
  position: fixed; top: 0; left: 0;
  width: 480px; height: 480px;
  margin: -240px 0 0 -240px;
  pointer-events: none; z-index: 1;
  opacity: 0.7;
  mix-blend-mode: screen;
  will-change: transform;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%);
}

/* ──────────────── Spotlight section (AI + Data Eng) ──────────────── */
.spotlight { background: var(--bg); position: relative; }
.spot-grid {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
@media (max-width: 980px) { .spot-grid { grid-template-columns: 1fr; } }

.spot-card {
  --mx: 0%; --my: 0%; --mxp: 50%; --myp: 50%;
  position: relative;
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.5s cubic-bezier(.22,.8,.2,1);
  isolation: isolate;
}
.spot-card:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }

.spot-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 320px at var(--mxp) var(--myp),
    color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
  opacity: 0; transition: opacity 0.3s;
  z-index: 0;
}
.spot-card:hover .spot-glow { opacity: 1; }

.spot-grid-bg {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.5;
  mask-image: radial-gradient(70% 60% at var(--mxp) var(--myp), #000, transparent 80%);
  -webkit-mask-image: radial-gradient(70% 60% at var(--mxp) var(--myp), #000, transparent 80%);
}

.spot-viz-wrap {
  position: relative;
  height: 240px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-3) 60%, transparent), transparent);
  z-index: 1;
}
.spot-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.spot-corner-tl, .spot-corner-br {
  position: absolute; font-size: 10px; letter-spacing: 0.18em;
  color: var(--fg-faint);
}
.spot-corner-tl { top: 12px; left: 14px; color: var(--accent-ink); }
.spot-corner-br { bottom: 12px; right: 14px; }

.spot-body { position: relative; padding: 28px 32px 32px; z-index: 1; }
.spot-title {
  font-size: clamp(22px, 2.2vw, 28px);
  letter-spacing: -0.018em; font-weight: 500;
  margin: 0 0 12px;
}
.spot-text {
  color: var(--fg-dim); font-size: 14.5px; line-height: 1.55;
  margin: 0 0 22px; max-width: 52ch;
}
.spot-caps {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 4px; overflow: hidden;
}
.spot-cap {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 14px;
  background: var(--bg-2);
  transition: background 0.2s, transform 0.4s;
}
.spot-cap:hover { background: var(--bg-3); }
.spot-cap-k { font-size: 12px; letter-spacing: 0.14em; color: var(--accent-ink); }
.spot-cap-v { font-size: 14px; color: var(--fg); }

/* ──────────────── WP-specific helpers ──────────────── */
.wp-empty-note { max-width: var(--max); margin: 0 auto; color: var(--fg-faint); font-family: var(--font-mono); font-size: 13px; }

/* ──────────────── Singular — pages & posts ──────────────────────────
   Matches front-page aesthetic: same gutter, same max-width, same
   type scale. No Gutenberg block classes, just clean the_content() HTML.
   ─────────────────────────────────────────────────────────────────── */

/* Scaffold */
.hd-singular { padding-top: 22px; }
.hd-article { margin: 0; padding: 0; }

/* ── Post header ─────────────────────────────────────────────────── */
.hd-post-header {
  padding: clamp(60px, 10vh, 120px) var(--gutter) clamp(36px, 5vh, 64px);
  border-bottom: 1px solid var(--line);
  max-width: var(--max);
  margin: 0 auto;
}

.hd-post-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.hd-post-cat {
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-ink);
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  transition: background 0.15s;
}
.hd-post-cat:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

.hd-post-title {
  font-size: clamp(28px, 3.5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 0 0 20px;
  color: var(--fg);
  max-width: 22ch;
  text-wrap: pretty;
}

.hd-post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0;
  font-size: 11.5px; color: var(--fg-faint);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.hd-meta-sep { margin: 0 10px; opacity: 0.4; }

/* ── Hero image ──────────────────────────────────────────────────── */
.hd-post-hero {
  margin: 0;
  max-height: 520px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hd-post-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Content ─────────────────────────────────────────────────────── */
.hd-post-content {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(48px, 8vh, 96px) var(--gutter);
}

/* Typography — matches the dark aesthetic of the front page */
.hd-post-content p {
  font-size: clamp(16px, 1.15vw, 18px);
  line-height: 1.65;
  color: var(--fg-dim);
  margin: 0 0 1.5em;
  text-wrap: pretty;
}
.hd-post-content h2,
.hd-post-content h3,
.hd-post-content h4,
.hd-post-content h5,
.hd-post-content h6 {
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 2em 0 0.6em;
  max-width: 28ch;
}
.hd-post-content h2 { font-size: clamp(24px, 2.8vw, 38px); }
.hd-post-content h3 { font-size: clamp(20px, 2vw, 28px); }
.hd-post-content h4 { font-size: clamp(17px, 1.4vw, 22px); }
.hd-post-content h5 { font-size: 16px; }
.hd-post-content h6 {
  font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--fg-faint);
}

.hd-post-content a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity 0.15s;
}
.hd-post-content a:hover { opacity: 0.72; }
.hd-post-content strong { color: var(--fg); font-weight: 600; }
.hd-post-content em { font-style: italic; }

/* Separator */
.hd-post-content hr {
  border: 0;
  height: 1px;
  background: var(--line-strong);
  margin: 3em 0;
}

/* Lists */
.hd-post-content ul,
.hd-post-content ol {
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.65;
  color: var(--fg-dim);
  padding-left: 0;
  margin: 0 0 1.5em;
  max-width: 66ch;
  list-style: none;
}
.hd-post-content ul li,
.hd-post-content ol li {
  position: relative;
  padding-left: 1.4em;
  margin-bottom: 0.5em;
}
.hd-post-content ul li::before {
  content: "";
  position: absolute; left: 0; top: 0.7em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}
.hd-post-content ol { counter-reset: hd-ol; }
.hd-post-content ol li::before {
  content: counter(hd-ol, decimal-leading-zero);
  counter-increment: hd-ol;
  position: absolute; left: 0;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.04em;
  color: var(--accent-ink); top: 0.28em;
}

/* Blockquote */
.hd-post-content blockquote {
  border: 0;
  border-left: 2px solid var(--accent);
  padding: 8px 0 8px 28px;
  margin: 2em 0;
}
.hd-post-content blockquote p {
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.45;
  font-style: italic;
  color: var(--fg);
  max-width: 60ch;
}
.hd-post-content blockquote cite {
  display: block;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
  margin-top: 10px;
}

/* Code */
.hd-post-content code,
.hd-post-content kbd {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--bg-3);
  color: var(--accent-ink);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.hd-post-content pre {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px 28px;
  overflow-x: auto;
  margin: 1.8em 0;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--fg);
}
.hd-post-content pre code { background: none; color: inherit; padding: 0; border: 0; font-size: inherit; }

/* Images */
.hd-post-content img {
  max-width: 100%; height: auto; display: block;
  border-radius: 4px; margin: 1.8em 0;
}
.hd-post-content figure { margin: 1.8em 0; }
.hd-post-content figcaption {
  font-family: var(--font-mono);
  font-size: 11.5px; color: var(--fg-faint);
  letter-spacing: 0.06em;
  margin-top: 10px;
  text-align: center;
}

/* Table */
.hd-post-content table {
  width: 100%; border-collapse: collapse;
  font-size: 14px; margin: 1.8em 0;
  color: var(--fg-dim);
}
.hd-post-content th {
  background: var(--bg-2); color: var(--fg);
  font-family: var(--font-mono); font-weight: 500;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 10px 14px; border: 1px solid var(--line);
  text-align: left;
}
.hd-post-content td { padding: 10px 14px; border: 1px solid var(--line); }
.hd-post-content tr:hover td { background: var(--bg-2); }

/* ── Post footer ─────────────────────────────────────────────────── */
.hd-post-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px var(--gutter) 80px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 32px;
}

.hd-post-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.hd-tag {
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--fg-faint);
  transition: border-color 0.15s, color 0.15s;
}
.hd-tag:hover { border-color: var(--line-strong); color: var(--fg); }

.hd-post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 600px) { .hd-post-nav { grid-template-columns: 1fr; } }
.hd-post-nav-item {
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg-2);
  transition: border-color 0.2s, background 0.2s;
}
.hd-post-nav-item:hover { border-color: var(--line-strong); background: var(--bg-3); }
.hd-post-nav-next { text-align: right; }
.hd-post-nav-dir { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-faint); }
.hd-post-nav-title { font-size: 15px; color: var(--fg); line-height: 1.3; }

.hd-back-link {
  font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-faint);
  transition: color 0.15s;
}
.hd-back-link:hover { color: var(--accent-ink); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
