/* ==========================================================================
   Indrico Jowensen — portfolio
   Theme: "Signal & Delivery" in blue. Dark by default, light via [data-theme].
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #060a13;
  --bg-2: #0a101d;
  --surface: #0d1424;
  --surface-2: #111a2d;
  --line: rgba(214, 226, 255, 0.08);
  --line-strong: rgba(214, 226, 255, 0.15);
  --text: #e8eefa;
  --text-2: #a5b3c9;
  --text-3: #72819a;

  --accent: #4c8dff;
  --accent-text: #7eb0ff;
  --accent-soft: rgba(76, 141, 255, 0.14);
  --cyan: #4fd1ff;
  --amber: #f5b84b;
  --amber-soft: rgba(245, 184, 75, 0.14);

  --btn-bg: #2563eb;
  --btn-bg-hover: #1d4fd6;
  --btn-text: #ffffff;
  --btn-glow: 0 10px 30px -10px rgba(37, 99, 235, 0.75);

  --glow-1: rgba(59, 130, 246, 0.22);
  --glow-2: rgba(79, 209, 255, 0.10);
  --grid: rgba(214, 226, 255, 0.045);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 30px 60px -30px rgba(0, 0, 0, 0.7);

  --radius: 18px;
  --radius-sm: 12px;
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f7fc;
  --bg-2: #eaf0f9;
  --surface: #ffffff;
  --surface-2: #f9fbff;
  --line: rgba(11, 18, 32, 0.08);
  --line-strong: rgba(11, 18, 32, 0.15);
  --text: #0b1220;
  --text-2: #43506a;
  --text-3: #5a6781;

  --accent: #2563eb;
  --accent-text: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.10);
  --cyan: #0891b2;
  --amber: #9a6412;
  --amber-soft: rgba(154, 100, 18, 0.10);

  --btn-glow: 0 10px 24px -12px rgba(37, 99, 235, 0.6);

  --glow-1: rgba(37, 99, 235, 0.13);
  --glow-2: rgba(8, 145, 178, 0.09);
  --grid: rgba(11, 18, 32, 0.05);
  --shadow: 0 1px 2px rgba(11, 18, 32, 0.04), 0 24px 48px -28px rgba(11, 18, 32, 0.22);

  color-scheme: light;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
strong { font-weight: 600; color: var(--text); }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* Stroke icons share one style */
svg[viewBox="0 0 24 24"] {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Backdrop (grid + glow behind the hero) ---------- */
.backdrop {
  position: absolute;
  inset: 0 0 auto 0;
  height: 1100px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 78% 18%, var(--glow-1), transparent 70%),
    radial-gradient(40% 40% at 12% 8%, var(--glow-2), transparent 70%);
}
.backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, #000 35%, transparent 80%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, #000 35%, transparent 80%);
}

/* ---------- Typography ---------- */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; text-wrap: balance; }

h1 em, h2 em {
  font-style: normal;
  color: var(--accent-text);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1.1rem;
}
.eyebrow span {
  color: var(--accent-text);
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  letter-spacing: 0.06em;
}

/* ---------- Buttons ---------- */
.btn {
  --h: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  height: var(--h);
  padding: 0 1.3rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 550;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.btn svg { width: 18px; height: 18px; transition: transform 0.2s var(--ease-out); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-text);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, var(--btn-glow);
}
.btn-primary:hover { background: var(--btn-bg-hover); transform: translateY(-1px); }

.btn-ghost {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-text); transform: translateY(-1px); }

.btn-sm { --h: 38px; padding: 0 1rem; font-size: 0.875rem; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; gap: 0.7rem; font-weight: 600; letter-spacing: -0.02em; }
.brand-mark { width: 32px; height: 32px; color: #e8eefa; }
.brand-mark .bm-bg { fill: #0b1220; stroke: color-mix(in srgb, var(--accent) 45%, transparent); stroke-width: 1.5; }
.brand-mark .bm-dot { fill: var(--accent); }
.brand-dim { color: var(--text-3); font-weight: 500; }

.nav { margin-left: auto; }
.nav ul { display: flex; gap: 0.25rem; }
.nav a {
  position: relative;
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-2);
  transition: color 0.2s ease, background-color 0.2s ease;
}
.nav a:hover { color: var(--text); background: var(--accent-soft); }
.nav a.is-active { color: var(--text); }
.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 1px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}

.header-actions { display: flex; align-items: center; gap: 0.6rem; }
.theme-toggle .i-moon { display: none; }
[data-theme="light"] .theme-toggle .i-sun { display: none; }
[data-theme="light"] .theme-toggle .i-moon { display: block; }

.nav-toggle { display: none; }
.nav-toggle .i-close { display: none; }
.site-header.nav-open .nav-toggle .i-menu { display: none; }
.site-header.nav-open .nav-toggle .i-close { display: block; }

@media (max-width: 920px) {
  .nav-toggle { display: inline-grid; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    margin: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 30px 40px -30px rgba(0, 0, 0, 0.5);
    display: none;
  }
  .site-header.nav-open .nav { display: block; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav a { padding: 0.85rem 0.25rem; font-size: 1.05rem; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav a:hover { background: transparent; }
  .nav a.is-active::after { left: auto; right: 0.25rem; top: 50%; bottom: auto; transform: translateY(-50%); width: 6px; height: 6px; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 520px) {
  .header-cta { display: none; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(40px, 7vw, 88px) clamp(56px, 8vw, 104px); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.85rem 0.35rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-2);
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); }
.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  opacity: 0;
  animation: pulse 2.2s var(--ease-out) infinite;
}
@keyframes pulse {
  0% { transform: scale(0.5); opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}

.hero-kicker {
  margin-top: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text-3);
}
.hero-kicker:first-child { margin-top: 0; }
.hero-kicker .k-sep { color: var(--accent-text); margin-inline: 0.35rem; }
@media (max-width: 520px) {
  .hero-kicker .k-sep { display: none; }
  .hero-kicker span:last-child { display: block; color: var(--text-2); }
}

.hero-title {
  margin-top: 0.7rem;
  font-size: clamp(2.5rem, 1.5rem + 3.7vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-lede {
  margin-top: 1.4rem;
  max-width: 36rem;
  font-size: clamp(1.02rem, 0.95rem + 0.3vw, 1.15rem);
  color: var(--text-2);
}

.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  margin-top: 2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-3);
}
.hero-meta li { display: inline-flex; align-items: center; gap: 0.45rem; }
.hero-meta svg { width: 15px; height: 15px; color: var(--accent-text); }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { max-width: 620px; }
}

/* ---------- Pipeline card (hero visual) ---------- */
.pipe-card {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
}
.pipe-card::before {
  content: "";
  position: absolute;
  inset: 0 12% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7;
}

.pipe-card-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-3);
}
.win-dots { display: inline-flex; gap: 6px; }
.win-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.pipe-card-title { color: var(--text-2); }
.sim-badge {
  margin-left: auto;
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

svg.pipe { width: 100%; height: auto; padding: 14px 12px 6px; overflow: visible; }
.pipe text { font-family: var(--font-mono); fill: var(--text-3); }
.pipe-cols text { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; fill: var(--text-3); }
.pipe .t-node { font-family: var(--font-sans); font-size: 14px; font-weight: 550; fill: var(--text); }
.pipe .t-sub { font-size: 11px; }
.pipe .t-mono { font-size: 13px; fill: var(--text-2); }
.pipe-fb-label { font-size: 10px; letter-spacing: 0.08em; fill: var(--amber) !important; opacity: 0.85; }

.pipe-wires path { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.pipe-wires .wire-fb { stroke: var(--amber); stroke-dasharray: 4 5; opacity: 0.6; }

.pipe .node rect:first-child {
  fill: var(--bg-2);
  stroke: var(--line-strong);
  stroke-width: 1;
  transition: stroke 0.35s ease, fill 0.35s ease;
}
.pipe .node.is-hit rect:first-child { stroke: var(--accent); fill: color-mix(in srgb, var(--accent) 14%, var(--bg-2)); transition-duration: 0.08s; }
.pipe .node.is-fail rect:first-child { stroke: var(--amber); fill: color-mix(in srgb, var(--amber) 14%, var(--bg-2)); transition-duration: 0.08s; }

.pipe .q-slot { fill: var(--line); transition: fill 0.25s ease; }
.pipe .q-slot.on { fill: color-mix(in srgb, var(--cyan) 70%, transparent); }

.pipe .led { fill: var(--line-strong); transition: fill 0.2s ease; }
.pipe .worker.is-busy .led { fill: var(--accent); }

.pipe .status { fill: none; stroke: var(--text-3); stroke-width: 1.5; transition: fill 0.3s ease, stroke 0.3s ease; }
.pipe .channel.is-hit .status { fill: var(--accent); stroke: var(--accent); }
.pipe .channel.is-fail .status { fill: var(--amber); stroke: var(--amber); }

.pipe .dot { fill: var(--accent); }
.pipe .dot-amber { fill: var(--amber); }
[data-theme="light"] .pipe .dot { fill: var(--accent); }

.pipe-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.pipe-stats > div { padding: 0.7rem 1rem; display: flex; flex-direction: column; gap: 0.1rem; }
.pipe-stats > div + div { border-left: 1px solid var(--line); }
.pipe-stats .k { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.pipe-stats .v { font-family: var(--font-mono); font-size: 1.05rem; font-variant-numeric: tabular-nums; color: var(--text); }

.pipe-log {
  height: 7.4rem;
  overflow: hidden;
  padding: 0.75rem 1rem 0.5rem;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 45%, transparent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.75;
  color: var(--text-3);
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
}
.pipe-log li {
  display: grid;
  grid-template-columns: 4.6rem 2.6rem 4.6rem minmax(0, 1fr);
  gap: 0.6rem;
  white-space: nowrap;
}
.pipe-log li.is-new { animation: log-in 0.35s var(--ease-out); }
.pipe-log .lg-c { color: var(--text-2); }
.pipe-log .lg-s { overflow: hidden; text-overflow: ellipsis; }
.pipe-log .ok { color: var(--accent-text); }
.pipe-log .warn { color: var(--amber); }
@keyframes log-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 520px) {
  .pipe-cols text { font-size: 14px; }
  .pipe .t-node { font-size: 15px; }
  .pipe .t-sub { font-size: 13px; }
  .pipe .t-mono { font-size: 15px; }
  .pipe-log li { grid-template-columns: 2.4rem 4.4rem minmax(0, 1fr); }
  .pipe-log .lg-t { display: none; }
  .pipe-stats > div { padding: 0.6rem 0.75rem; }
}

/* ---------- Metrics band ---------- */
.metrics {
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 45%, transparent);
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-inline: 1px solid var(--line);
  margin: 0;
}
.metric {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 0.35rem;
  padding: 1.75rem 1.25rem;
  background: var(--bg);
}
.metric dd {
  font-size: clamp(1.9rem, 1.3rem + 1.6vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.metric .unit { color: var(--accent-text); }
.metric dt { font-size: 0.86rem; color: var(--text-2); line-height: 1.45; max-width: 16rem; }

@media (max-width: 900px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:last-child { grid-column: 1 / -1; }
}

.industries {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding-block: 1.75rem;
}
.industries-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.industries ul { display: flex; flex-wrap: wrap; gap: 1rem clamp(1.25rem, 4vw, 3rem); }
.industries li { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 500; font-size: 1.05rem; color: var(--text-2); }
.industries svg { width: 22px; height: 22px; color: var(--accent-text); }
@media (max-width: 520px) {
  .industries ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; width: 100%; }
}

/* ---------- Sections ---------- */
.section { position: relative; padding-block: clamp(72px, 10vw, 128px); }
.section-alt {
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--surface) 55%, transparent) 18%, color-mix(in srgb, var(--surface) 55%, transparent) 82%, transparent);
}

.section-head { max-width: 46rem; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head h2 { font-size: clamp(2rem, 1.35rem + 2.3vw, 3.2rem); }
.section-sub { margin-top: 1rem; font-size: 1.075rem; color: var(--text-2); }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}
.about-grid .section-head { margin-bottom: 0; position: sticky; top: calc(var(--header-h) + 32px); }
.about-body { display: grid; gap: 1.25rem; }
.about-body p { font-size: 1.06rem; color: var(--text-2); }
.about-body .about-lead { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); line-height: 1.5; color: var(--text); letter-spacing: -0.01em; }
.about-lead em { font-style: normal; color: var(--accent-text); }

.nda-note {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  justify-self: start;
  margin-top: 0.5rem;
  padding: 0.6rem 0.9rem;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 0.76rem !important;
  color: var(--text-3) !important;
}
.nda-note svg { flex: none; width: 16px; height: 16px; color: var(--accent-text); }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .about-grid .section-head { position: static; }
}

/* ---------- Expertise cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card {
  --mx: 50%;
  --my: 0%;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  isolation: isolate;
  transition: border-color 0.3s ease, transform 0.3s var(--ease-out);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(420px circle at var(--mx) var(--my), var(--accent-soft), transparent 45%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.card:hover::before { opacity: 1; }

.card-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, var(--accent-soft), transparent);
  color: var(--accent-text);
}
.card-icon svg { width: 22px; height: 22px; }
.card h3 { margin-top: 1.25rem; font-size: 1.18rem; }
.card p { margin-top: 0.6rem; color: var(--text-2); font-size: 0.97rem; }
.card .tags { margin-top: auto; padding-top: 1.25rem; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-text);
}

@media (max-width: 980px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .cards { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Case studies ---------- */
.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.case {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.4rem, 2.5vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.3s ease;
}
.case:hover { border-color: var(--line-strong); }
.case-top { display: flex; align-items: center; gap: 0.8rem; font-family: var(--font-mono); font-size: 0.74rem; }
.case-num { color: var(--accent-text); }
.case-kicker { color: var(--text-3); letter-spacing: 0.08em; text-transform: uppercase; }
.case h3 { font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem); }

.case-dl { display: grid; gap: 1rem; margin: 0.25rem 0 0; }
.case-dl dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.3rem;
}
.case-dl dd { color: var(--text-2); font-size: 0.97rem; }
.case .tags { margin-top: auto; padding-top: 0.5rem; }

.case-featured {
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(70% 120% at 100% 0%, var(--accent-soft), transparent 60%),
    var(--surface);
  border-color: var(--line-strong);
}
.case-featured h3 { font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.1rem); max-width: 32ch; }
.case-featured .case-dl { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 2rem; }
.case-featured .case-dl > div { padding-top: 1rem; border-top: 1px solid var(--line-strong); }

@media (max-width: 860px) {
  .cases { grid-template-columns: minmax(0, 1fr); }
  .case-featured .case-dl { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Timeline ---------- */
.timeline { border-top: 1px solid var(--line-strong); }
.tl-item {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 2rem;
  padding-block: 2.25rem;
  border-bottom: 1px solid var(--line);
}
.tl-date { font-family: var(--font-mono); font-size: 0.84rem; color: var(--accent-text); padding-top: 0.35rem; }
.tl-body h3 { font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem); }
.tl-org {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.4rem;
  color: var(--text-2);
}
.pill-nda {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-3);
}
.pill-nda svg { width: 12px; height: 12px; }
.tl-points { display: grid; gap: 0.55rem; margin-top: 1.1rem; max-width: 50rem; }
.tl-points li { position: relative; padding-left: 1.3rem; color: var(--text-2); }
.tl-points li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.7em;
  width: 8px; height: 2px;
  background: var(--accent);
}
.tl-body .chips { margin-top: 1.25rem; }

@media (max-width: 720px) {
  .tl-item { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
}

/* ---------- Chips & stack ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 0.36rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.86rem;
  color: var(--text);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.chips li:hover { border-color: var(--accent); color: var(--accent-text); }
.chips-sm li { font-size: 0.78rem; padding: 0.25rem 0.65rem; color: var(--text-2); }

.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stack-group { padding: 1.5rem; background: var(--bg); }
.stack-group h3 {
  margin-bottom: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.stack-note {
  display: flex;
  align-items: flex-end;
  background:
    radial-gradient(90% 90% at 100% 100%, var(--accent-soft), transparent 70%),
    var(--bg);
}
.stack-note p {
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--text-2);
}

@media (max-width: 1040px) { .stack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 580px) { .stack-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Principles ---------- */
.principles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); }
.principle { padding-top: 1.25rem; border-top: 1px solid var(--line-strong); }
.p-num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-text); }
.principle h3 { margin-top: 0.9rem; font-size: 1.2rem; }
.principle p { margin-top: 0.55rem; color: var(--text-2); font-size: 0.97rem; }

@media (max-width: 1000px) { .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 580px) { .principles { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Contact ---------- */
.contact { overflow: hidden; }
.contact::before {
  content: "";
  position: absolute;
  inset: auto -10% -30% -10%;
  height: 80%;
  z-index: -1;
  background: radial-gradient(50% 60% at 30% 70%, var(--glow-1), transparent 70%);
  pointer-events: none;
}
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(36px, 6vw, 80px);
  align-items: start;
}
.contact-copy h2 { font-size: clamp(2.3rem, 1.5rem + 3vw, 3.8rem); }
.contact-lede { margin-top: 1.25rem; font-size: 1.08rem; color: var(--text-2); max-width: 32rem; }

.contact-facts { margin-top: 2rem; border-top: 1px solid var(--line); }
.contact-facts li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.contact-facts .k {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-top: 0.2rem;
}
.contact-facts li > span:last-child { text-align: right; }

.socials { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.social {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-2);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.social:hover { border-color: var(--accent); color: var(--text); }
.social svg { width: 16px; height: 16px; fill: currentColor; }

.contact-form {
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 1rem; }
.field label { font-size: 0.86rem; font-weight: 500; color: var(--text-2); }
.field .opt { font-weight: 400; color: var(--text-3); }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.field textarea { resize: vertical; min-height: 8.5rem; }
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.contact-form.was-validated :is(input, textarea):invalid { border-color: var(--amber); }

.select-wrap { position: relative; }
.select-wrap select { appearance: none; -webkit-appearance: none; padding-right: 2.5rem; cursor: pointer; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 1rem; top: 50%;
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--text-3);
  border-bottom: 1.5px solid var(--text-3);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.hp { display: none !important; }

.contact-form .btn-block { margin-top: 0.4rem; }
.contact-form button[disabled] { opacity: 0.7; cursor: progress; }
.contact-form.is-sending .btn svg { animation: nudge 0.8s ease-in-out infinite alternate; }
@keyframes nudge { to { transform: translateX(6px); } }

.form-status { min-height: 1.5rem; margin-top: 0.9rem; font-size: 0.92rem; }
.form-status.is-success { color: var(--accent-text); }
.form-status.is-error { color: var(--amber); }
.form-note { font-size: 0.8rem; color: var(--text-3); }

@media (max-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; } }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2rem calc(2rem + env(safe-area-inset-bottom, 0px));
  font-size: 0.86rem;
  color: var(--text-2);
}
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 2rem; }
.footer-dim { color: var(--text-3); font-family: var(--font-mono); font-size: 0.76rem; }
.to-top { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--text-2); transition: color 0.2s ease; }
.to-top:hover { color: var(--accent-text); }
.to-top svg { width: 15px; height: 15px; }

/* ---------- Reveal on scroll (only when JS is running) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .pulse::after { display: none; }
}
