/* ==========================================================================
   Peregrino — peregrino.co v2
   Design system: Space Grotesk (display) · Inter (UI/body) · JetBrains Mono (data)
   Rules: no gradients · no italics · angular radii · apricot used sparingly
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap");

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/SpaceGrotesk-VariableFont_wght.ttf") format("truetype-variations"),
       url("../fonts/SpaceGrotesk-VariableFont_wght.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("../fonts/GeneralSans-Variable.woff2") format("woff2-variations"),
       url("../fonts/GeneralSans-Variable.woff2") format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ------------------------------------------------------- */
:root {
  --peregrino-blue: #2B3990;
  --blue-700: #222D74;
  --blue-800: #1A2359;
  --blue-500: #3B4AAE;
  --blue-400: #6472C9;
  --blue-200: #C8CCE6;
  --blue-100: #E5E7F2;
  --blue-050: #F4F5FA;

  --apricot-600: #C48A5E;
  --apricot-500: #D69E73;
  --apricot-400: #E3B693;
  --apricot-200: #F4E7D9;
  --apricot-100: #FBF3EA;

  --circuit-600: #5A67D8;
  --circuit-200: #D4D8F2;
  --circuit-100: #EBEDF9;

  --filament-600: #8DB347;
  --filament-500: #B8E06E;
  --filament-100: #EEF7DD;

  --ink: #0D1028;
  --ink-soft: #2A2E45;
  --paper: #FAFAF7;
  --paper-2: #F2F1EA;

  --fg-1: #0D1028;
  --fg-2: #4A4F6B;
  --fg-3: #7A7F96;
  --fg-inverse: #FFFFFF;

  --bg-3: #F1F2F7;
  --border-1: #E6E4DC;
  --border-2: #D4D2C9;

  --success: #1E8E5A; --success-bg: #E4F3EC;
  --danger:  #C13434; --danger-bg: #F8E3E3;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "General Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --tracking-widest: 0.2em;
  --tracking-tighter: -0.03em;

  --radius-1: 2px; --radius-2: 4px; --radius-3: 8px;

  --shadow-1: 0 1px 2px rgba(13,16,40,.06), 0 1px 1px rgba(13,16,40,.04);
  --shadow-2: 0 4px 12px rgba(13,16,40,.08);
  --shadow-3: 0 12px 32px rgba(13,16,40,.12);
  --shadow-brand: 0 12px 28px rgba(43,57,144,.22);

  --ease-std: cubic-bezier(.2,0,0,1);
  --ease-out: cubic-bezier(.2,.8,.2,1);

  --max-w: 1200px;
  --nav-h: 72px;
}

/* ---------- Reset / base -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--fg-1);
  background: var(--paper);
  margin: 0;
}
img { max-width: 100%; display: block; }
a { color: var(--peregrino-blue); text-decoration: none; transition: color 120ms var(--ease-std); }
a:hover { color: var(--blue-700); }
::selection { background: var(--peregrino-blue); color: #fff; }

:focus-visible { outline: 2px solid var(--peregrino-blue); outline-offset: 2px; border-radius: 2px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--peregrino-blue); color: #fff;
  padding: 10px 18px; border-radius: 0 0 var(--radius-2) 0; font-weight: 500;
}
.skip-link:focus { left: 0; color: #fff; }

@view-transition { navigation: auto; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 5vw + 1rem, 4.5rem); letter-spacing: var(--tracking-tighter); }
h2 { font-size: clamp(1.9rem, 3vw + .5rem, 3rem); }
h3 { font-size: 1.55rem; }
p { margin: 0 0 16px; }

.accent { color: var(--apricot-600); font-style: normal; font-weight: inherit; }

.eyebrow {
  font-size: .75rem; font-weight: 600;
  letter-spacing: var(--tracking-widest); text-transform: uppercase;
  color: var(--peregrino-blue); margin: 0 0 14px;
}
.marker {
  font-family: var(--font-mono); font-size: .75rem; font-weight: 500;
  letter-spacing: .04em; color: var(--apricot-600); text-transform: uppercase;
}
.marker::before { content: "§ "; }

.wrap { max-width: var(--max-w); margin-inline: auto; padding-inline: 24px; }
.ribbon {
  height: 6px;
  background: linear-gradient(90deg, var(--peregrino-blue) 0 70%, var(--apricot-600) 70% 100%);
}
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Nav ----------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-1);
}
@supports (animation-timeline: scroll()) {
  .nav { animation: nav-elevate linear both; animation-timeline: scroll(); animation-range: 0 140px; }
  @keyframes nav-elevate { to { box-shadow: var(--shadow-2); } }
}
.nav-inner {
  display: flex; align-items: center; gap: 8px;
  height: var(--nav-h);
  max-width: var(--max-w); margin-inline: auto; padding-inline: 24px;
}
.nav-logo img { height: 24px; width: auto; }
.nav-links {
  display: flex; gap: 30px; margin-left: 48px;
  font-size: .75rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
}
.nav-links a { color: var(--fg-2); padding: 4px 0; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.nav-right .btn { white-space: nowrap; flex: none; padding: 9px 18px; font-size: .9rem; }
.lang-switch {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em;
  color: var(--fg-2); border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); border-radius: var(--radius-2);
  padding: 6px 10px; text-transform: uppercase;
}
.lang-switch:hover { color: var(--ink); border-color: var(--ink); }
.nav-burger { display: none; }

@media (max-width: 880px) {
  .nav-links {
    display: none;
    position: absolute; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--border-1);
    padding: 8px 24px 16px; margin: 0;
  }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--border-1); }
  .nav-links a:last-child { border-bottom: 0; }
  .nav:has(#nav-toggle:checked) .nav-links { display: flex; }
  .nav-burger {
    display: grid; place-items: center;
    width: 40px; height: 40px; cursor: pointer;
    border: 1px solid var(--border-2); border-radius: var(--radius-2);
  }
  .nav-burger span, .nav-burger span::before, .nav-burger span::after {
    content: ""; display: block; width: 16px; height: 2px; background: var(--ink); position: relative;
  }
  .nav-burger span::before { position: absolute; top: -5px; }
  .nav-burger span::after { position: absolute; top: 5px; }
}
#nav-toggle { display: none; }
@media (max-width: 640px) {
  .nav-right .btn { display: none; }
  .hero-grid { gap: 32px; }
}

/* ---------- Buttons -------------------------------------------------------- */
.btn {
  font-family: var(--font-sans); font-weight: 500; font-size: .94rem;
  padding: 11px 22px; border-radius: var(--radius-2);
  border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background 160ms var(--ease-std), color 160ms var(--ease-std), border-color 160ms var(--ease-std), transform 160ms var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--peregrino-blue); color: #fff; box-shadow: var(--shadow-brand); position: relative; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -45%; width: 35%;
  background: rgba(255,255,255,.18); transform: skewX(-18deg);
  transition: left 480ms var(--ease-out);
}
.btn-primary:hover::after { left: 130%; }
.btn-primary:hover { background: var(--blue-700); color: #fff; }
/* Liquid glass — frosted surfaces that diffuse whatever sits behind them */
.btn-secondary, .btn-ghost, .lang-switch {
  background: color-mix(in srgb, #fff 35%, transparent);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -1px 0 rgba(13,16,40,.04), 0 1px 3px rgba(13,16,40,.05);
}
.btn-secondary { color: var(--peregrino-blue); border-color: color-mix(in srgb, var(--peregrino-blue) 55%, transparent); }
.btn-secondary:hover { background: color-mix(in srgb, #fff 60%, transparent); border-color: var(--peregrino-blue); }
.btn-ghost { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 18%, transparent); }
.btn-ghost:hover { background: color-mix(in srgb, #fff 60%, transparent); border-color: color-mix(in srgb, var(--ink) 45%, transparent); }
.btn-inverse { background: #fff; color: var(--ink); }
.btn-inverse:hover { background: var(--apricot-200); color: var(--ink); }
.btn-lg { font-size: 1.05rem; padding: 14px 28px; }

/* ---------- Pulse dot ------------------------------------------------------ */
.pulse-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 999px;
  background: var(--filament-500); position: relative; vertical-align: middle; flex: none;
}
.pulse-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 999px;
  border: 1.5px solid var(--filament-500); opacity: .5;
  animation: pg-pulse 1.8s ease-out infinite;
}
@keyframes pg-pulse {
  0% { transform: scale(.8); opacity: .7; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ---------- Hero ----------------------------------------------------------- */
.hero { position: relative; overflow: clip; padding: clamp(56px, 9vw, 110px) 0 clamp(48px, 7vw, 90px); }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .028;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="160" height="160"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2"/></filter><rect width="100%25" height="100%25" filter="url(%23n)"/></svg>');
}
@keyframes rise-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.hero-copy > * { animation: rise-in .7s var(--ease-out) backwards; }
.hero-copy > *:nth-child(1) { animation-delay: .05s; }
.hero-copy > *:nth-child(2) { animation-delay: .14s; }
.hero-copy > *:nth-child(3) { animation-delay: .23s; }
.hero-copy > *:nth-child(4) { animation-delay: .32s; }
.hero-copy > *:nth-child(5) { animation-delay: .41s; }
.hero-grid > div:last-child { animation: rise-in .8s var(--ease-out) .45s backwards; }
.hero-grid {
  display: grid; gap: 48px;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  align-items: center;
}
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-copy .lede { font-size: 1.16rem; color: var(--fg-2); max-width: 54ch; text-wrap: pretty; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-meta {
  display: flex; gap: 10px 22px; flex-wrap: wrap; margin-top: 34px;
  font-size: .88rem; color: var(--fg-3);
}
.hero-meta span { display: inline-flex; gap: 8px; align-items: center; }

/* flight-path arc */
.arc {
  position: absolute; inset: auto -4% -2% -4%; height: 46%;
  pointer-events: none; opacity: .12;
}
.arc path { stroke-dasharray: 1600; stroke-dashoffset: 1600; animation: arc-draw 2.4s var(--ease-out) .3s forwards; }
@keyframes arc-draw { to { stroke-dashoffset: 0; } }

/* scroll-scrubbed flight path (ink section) — draws as you scroll through */
.arc-scrub { display: block; width: 100%; height: 70px; margin-bottom: 8px; pointer-events: none; }
.arc-scrub path { stroke-dasharray: 1700; stroke-dashoffset: 1700; }
.arc-scrub circle { opacity: 0; }
@supports (animation-timeline: view()) {
  .arc-scrub path { animation: arc-draw linear both; animation-timeline: view(); animation-range: entry 0% cover 55%; }
  .arc-scrub circle { animation: dot-pop linear both; animation-timeline: view(); animation-range: cover 40% cover 55%; }
  @keyframes dot-pop { to { opacity: 1; } }
}
@supports not (animation-timeline: view()) {
  .arc-scrub path { animation: arc-draw 2.2s var(--ease-out) .2s forwards; }
  .arc-scrub circle { animation: dot-pop .4s 1.8s forwards; }
  @keyframes dot-pop { to { opacity: 1; } }
}

/* ---------- Agent demo panel ---------------------------------------------- */
.agent-panel {
  background: #fff; border: 1px solid var(--border-1); border-radius: var(--radius-3);
  box-shadow: var(--shadow-3);
  display: flex; flex-direction: column;
  min-height: 480px; max-height: 600px;
  overflow: hidden;
  transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
  will-change: transform;
}
.agent-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border-1);
  background: var(--paper);
}
.agent-avatar {
  width: 36px; height: 36px; border-radius: var(--radius-3);
  background: var(--peregrino-blue);
  display: grid; place-items: center;
  box-shadow: var(--shadow-1);
}
.agent-avatar img { width: 20px; height: 20px; object-fit: contain; }
.agent-title { font-family: var(--font-display); font-weight: 500; font-size: .98rem; color: var(--ink); }
.agent-sub { font-size: .78rem; color: var(--fg-3); }
.agent-status {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .64rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
  background: var(--filament-100); color: var(--filament-600);
}
.agent-status[data-state="local"] { background: var(--bg-3); color: var(--fg-3); }
.agent-scenarios {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--border-1); background: #fff;
}
.chip {
  font-size: .76rem; padding: 5px 12px;
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); border-radius: 999px;
  background: color-mix(in srgb, #fff 55%, transparent); color: var(--ink); cursor: pointer;
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
  transition: all 140ms var(--ease-std);
}
.chip:hover { border-color: var(--peregrino-blue); color: var(--peregrino-blue); }
.chip.active { background: var(--peregrino-blue); border-color: var(--peregrino-blue); color: #fff; }
.agent-log {
  flex: 1; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  background: #fff;
  scrollbar-width: thin;
}
.msg { max-width: 86%; padding: 10px 14px; border-radius: var(--radius-3); font-size: .92rem; line-height: 1.5; }
.msg.bot { background: var(--blue-050); color: var(--ink); border: 1px solid var(--blue-100); align-self: flex-start; border-bottom-left-radius: var(--radius-1); }
.msg.user { background: var(--peregrino-blue); color: #fff; align-self: flex-end; border-bottom-right-radius: var(--radius-1); }
.msg.typing { display: inline-flex; gap: 5px; align-items: center; padding: 14px; }
.agent-log .suggest { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 2px; }
.agent-log .suggest .chip { border-style: dashed; color: var(--peregrino-blue); }
.agent-log .suggest .chip:hover { border-style: solid; }
.msg.typing i {
  width: 6px; height: 6px; border-radius: 999px; background: var(--blue-400);
  animation: blink 1.2s infinite;
}
.msg.typing i:nth-child(2) { animation-delay: .2s; }
.msg.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.agent-input {
  display: flex; gap: 10px; padding: 12px 14px;
  border-top: 1px solid var(--border-1); background: var(--paper);
}
.agent-input input {
  flex: 1; font-family: var(--font-sans); font-size: .94rem;
  padding: 10px 12px; border: 1px solid var(--border-2); border-radius: var(--radius-2);
  background: #fff; color: var(--ink);
}
.agent-input input:focus { outline: none; border-color: var(--peregrino-blue); box-shadow: 0 0 0 3px rgba(43,57,144,.12); }
.agent-input button {
  background: var(--peregrino-blue); color: #fff; border: 0; border-radius: var(--radius-2);
  padding: 10px 16px; font-weight: 500; cursor: pointer; font-family: var(--font-sans);
}
.agent-input button:hover { background: var(--blue-700); }
/* Agentic definition block */
.define {
  border: 1px solid var(--border-1); border-left: 3px solid var(--apricot-600);
  background: #fff; border-radius: 0 var(--radius-3) var(--radius-3) 0;
  padding: clamp(28px, 4vw, 44px);
  display: grid; gap: 28px; grid-template-columns: minmax(0, .55fr) minmax(0, 1.45fr);
  box-shadow: var(--shadow-1);
}
@media (max-width: 760px) { .define { grid-template-columns: 1fr; } }
.define .term { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.6rem, 2.6vw, 2.2rem); color: var(--ink); line-height: 1.1; }
.define .term small { display: block; font-family: var(--font-sans); font-weight: 400; font-size: .88rem; color: var(--fg-3); margin-top: 8px; }
.define .body p { font-size: 1.06rem; line-height: 1.7; color: var(--fg-1); max-width: 62ch; }
.define .body p:last-child { margin-bottom: 0; }
.define .body b { color: var(--peregrino-blue); }

/* ---------- Logo wall (marquee) -------------------------------------------- */
.logo-wall { padding: 34px 0 44px; border-top: 1px solid var(--border-1); }
.logo-viewport {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.logo-viewport .logo-row {
  flex-wrap: nowrap; justify-content: flex-start; width: max-content;
  animation: marquee 36s linear infinite;
}
.logo-viewport:hover .logo-row { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .logo-viewport .logo-row { animation: none; width: auto; flex-wrap: wrap; justify-content: center; }
}
.logo-wall .label {
  text-align: center; font-size: .76rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 24px;
}
.logo-row {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: clamp(28px, 5vw, 56px);
}
.logo-row img {
  height: 70px; width: auto; max-width: 140px; object-fit: contain;
  filter: grayscale(1); opacity: .55;
  transition: filter 200ms var(--ease-std), opacity 200ms var(--ease-std);
}
.logo-row img:hover { filter: none; opacity: 1; }

/* ---------- Sections ------------------------------------------------------- */
.section { padding: clamp(64px, 9vw, 120px) 0; position: relative; }
.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head .sub { font-size: 1.08rem; color: var(--fg-2); text-wrap: pretty; }

.section-ink { background: var(--ink); color: #E8E9F2; }
.section-ink h2, .section-ink h3 { color: #fff; }
.section-ink .section-head .sub { color: #A9ADC1; }
.section-ink .eyebrow { color: var(--blue-400); }

.tick-grid { background-image: repeating-linear-gradient(90deg, rgba(13,16,40,.05) 0 1px, transparent 1px 40px); }
.section-ink.tick-grid { background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 40px); }

/* ---------- How-it-works flow ---------------------------------------------- */
.flow {
  display: grid; gap: 12px;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
}
@media (max-width: 880px) { .flow { grid-template-columns: 1fr; } .flow .arrow { transform: rotate(90deg); justify-self: center; } }
.flow-node {
  background: #fff; border: 1px solid var(--border-1); border-radius: var(--radius-3);
  padding: 22px; box-shadow: var(--shadow-1);
}
.section-ink .flow-node { background: var(--ink-soft); border-color: #3A3F5C; }
.flow-node .n {
  font-family: var(--font-mono); font-size: .72rem; color: var(--apricot-600);
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px; display: block;
}
.flow-node h3 { font-size: 1.25rem; margin-bottom: 8px; }
.flow-node p { font-size: .92rem; color: var(--fg-2); margin: 0; }
.section-ink .flow-node p { color: #A9ADC1; }
.flow .arrow {
  align-self: center; color: var(--apricot-600);
  font-family: var(--font-mono); font-size: 1.2rem;
}

/* ---------- Metrics band ---------------------------------------------------- */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border-1); border: 1px solid var(--border-1); border-radius: var(--radius-3); overflow: hidden; }
@media (max-width: 880px) { .metrics { grid-template-columns: repeat(2, 1fr); } }
.metric { background: #fff; padding: 28px 24px; }
.section-ink .metrics { background: #3A3F5C; border-color: #3A3F5C; }
.section-ink .metric { background: var(--ink); }
.metric .v {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2rem, 3.4vw, 3rem); letter-spacing: -0.02em;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.section-ink .metric .v { color: #fff; }
.metric .v em { color: var(--apricot-600); font-style: normal; }
.metric .l { font-size: .82rem; color: var(--fg-3); margin-top: 6px; }
.section-ink .metric .l { color: #A9ADC1; }

/* ---------- Case cards ------------------------------------------------------ */
.case-grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  container-type: inline-size;
}
.case-card {
  background: #fff; border: 1px solid var(--border-1); border-radius: var(--radius-3);
  overflow: hidden; box-shadow: var(--shadow-1);
  display: flex; flex-direction: column;
  transition: box-shadow 220ms var(--ease-std), translate 220ms var(--ease-out), border-color 220ms;
  color: inherit;
}
.case-card:hover { box-shadow: var(--shadow-3); translate: 0 -4px; border-color: var(--blue-200); color: inherit; }
.case-card .thumb { aspect-ratio: 16 / 9; overflow: hidden; position: relative; }
.case-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: scale 600ms var(--ease-out); }
.case-card:hover .thumb img { scale: 1.05; }
@supports (animation-timeline: view()) {
  .case-card .thumb img {
    animation: img-reveal both; animation-timeline: view();
    animation-range: entry 0% entry 80%;
  }
  @keyframes img-reveal { from { transform: scale(1.14); filter: saturate(.4); } to { transform: scale(1); filter: none; } }
}
.case-card .thumb .sector {
  position: absolute; left: 12px; top: 12px;
  font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  background: color-mix(in srgb, var(--ink) 78%, transparent); color: #fff;
  padding: 4px 10px; border-radius: var(--radius-2);
}
.case-card .body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.case-card .kpi {
  font-family: var(--font-display); font-weight: 500; font-size: 2rem;
  color: var(--peregrino-blue); letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums;
}
.case-card .kpi small { font-size: .8rem; color: var(--fg-3); font-family: var(--font-sans); font-weight: 400; letter-spacing: 0; display: block; margin-top: 6px; }
.case-card h3 { font-size: 1.16rem; line-height: 1.25; margin: 0; }
.case-card .more {
  margin-top: auto; font-size: .86rem; font-weight: 500; color: var(--peregrino-blue);
  display: inline-flex; gap: 6px; align-items: center;
}

/* ---------- Article -------------------------------------------------------- */
.article-hero { position: relative; }
.article-hero .img { aspect-ratio: 21 / 9; overflow: hidden; border-radius: var(--radius-3); }
.article-hero .img img { width: 100%; height: 100%; object-fit: cover; }
.article-head { max-width: 800px; margin: 0 auto; padding: clamp(40px, 6vw, 72px) 24px 8px; }
.article-head h1 { font-size: clamp(2rem, 3.6vw + .5rem, 3.4rem); }
.article-meta {
  display: flex; gap: 14px; flex-wrap: wrap; margin: 18px 0 0;
  font-size: .88rem; color: var(--fg-3);
}
.article-kpis { display: flex; gap: 14px; flex-wrap: wrap; margin: 28px 0 0; }
.article-kpis .k {
  border: 1px solid var(--border-1); border-radius: var(--radius-3);
  background: #fff; padding: 14px 20px; min-width: 150px;
}
.article-kpis .k b {
  display: block; font-family: var(--font-display); font-weight: 500;
  font-size: 1.7rem; color: var(--peregrino-blue); letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.article-kpis .k span { font-size: .8rem; color: var(--fg-2); }
.prose { max-width: 720px; margin: 0 auto; padding: clamp(32px, 5vw, 56px) 24px 72px; font-size: 1.04rem; line-height: 1.75; }
.prose h2 { font-size: 1.6rem; margin: 44px 0 14px; }
.prose h2 .num { font-family: var(--font-mono); font-size: .8rem; color: var(--apricot-600); display: block; letter-spacing: .06em; margin-bottom: 8px; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 10px; }
.prose li b { color: var(--ink); }
.prose blockquote {
  margin: 36px 0; padding: 22px 26px;
  border-left: 3px solid var(--apricot-600);
  background: var(--apricot-100); border-radius: 0 var(--radius-3) var(--radius-3) 0;
  font-family: var(--font-display); font-weight: 500; font-size: 1.12rem; line-height: 1.5; color: var(--ink);
}
.prose blockquote footer { font-family: var(--font-mono); font-size: .72rem; color: var(--fg-3); margin-top: 12px; font-weight: 400; }
.prose table { width: 100%; border-collapse: collapse; margin: 28px 0; font-size: .94rem; font-variant-numeric: tabular-nums; }
.prose th, .prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border-1); }
.prose th { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); font-weight: 500; }
.prose td b { color: var(--peregrino-blue); font-family: var(--font-display); font-size: 1.1rem; }
.article-cta {
  max-width: 720px; margin: 0 auto 80px; padding: 0 24px;
}
.article-cta .box {
  background: var(--peregrino-blue); color: #fff; border-radius: var(--radius-3);
  padding: clamp(28px, 4vw, 44px); box-shadow: var(--shadow-brand);
  position: relative; overflow: hidden;
}
.article-cta .box h2 { color: #fff; font-size: 1.5rem; margin-bottom: 8px; }
.article-cta .box p { color: var(--blue-200); margin-bottom: 20px; max-width: 48ch; }

/* ---------- Footer ---------------------------------------------------------- */
.footer { background: var(--ink); color: #A9ADC1; padding: 64px 0 40px; }
.footer-grid { display: grid; gap: 40px; grid-template-columns: 1.4fr 1fr 1fr 1fr; }
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer img.lockup { height: 30px; width: auto; margin-bottom: 16px; }
.footer h4 {
  font-size: .74rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: #7A7F96; margin: 0 0 14px;
}
.footer a { color: #C9CBDD; display: block; padding: 5px 0; font-size: .92rem; }
.footer a:hover { color: #fff; }
.footer .fine {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid #2A2E45;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: .8rem;
}

/* ---------- Scroll reveal ---------------------------------------------------- */
.reveal { opacity: 0; translate: 0 26px; transition: opacity 700ms var(--ease-out), translate 700ms var(--ease-out); }
.reveal.in { opacity: 1; translate: 0 0; }
@supports (animation-timeline: view()) {
  .reveal { transition: none; opacity: 1; translate: none; animation: rise both; animation-timeline: view(); animation-range: entry 0% entry 48%; }
  @keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .pulse-dot::after { display: none; }
  .reveal { opacity: 1 !important; translate: none !important; animation: none !important; }
}

/* ---------- Contact ---------------------------------------------------------- */
.contact-grid { display: grid; gap: 48px; grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: .73rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2); }
.field input, .field select, .field textarea {
  font-family: var(--font-sans); font-size: .96rem; padding: 11px 13px;
  border: 1px solid var(--border-2); border-radius: var(--radius-2);
  background: #fff; color: var(--ink); transition: border-color 120ms, box-shadow 120ms;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--peregrino-blue); box-shadow: 0 0 0 3px rgba(43,57,144,.12);
}
.contact-aside .row {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px 0; border-bottom: 1px solid var(--border-1);
}
.contact-aside .row .ico { color: var(--apricot-600); flex: none; margin-top: 2px; }
.contact-aside .row b { display: block; color: var(--ink); font-weight: 600; font-size: .95rem; }
.contact-aside .row span, .contact-aside .row a.val { font-size: .92rem; color: var(--fg-2); display: inline; padding: 0; }


/* ==========================================================================
   2026 layer — liquid + scrubbed + morphing (flat colors only, on-brand)
   ========================================================================== */

/* Liquid blob — flat circuit tint, slow organic morph behind the agent panel */
.blob {
  position: absolute; z-index: -1; width: min(540px, 90%); aspect-ratio: 1;
  right: -8%; top: -12%;
  background: var(--circuit-100);
  opacity: .6; filter: blur(28px);
  animation: blob-morph 16s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes blob-morph {
  0%   { border-radius: 58% 42% 60% 40% / 50% 55% 45% 50%; transform: rotate(0deg) scale(1); }
  50%  { border-radius: 40% 60% 45% 55% / 60% 40% 60% 40%; transform: rotate(12deg) scale(1.06); }
  100% { border-radius: 52% 48% 38% 62% / 44% 58% 42% 56%; transform: rotate(-8deg) scale(.96); }
}
.hero-grid > div:last-child { position: relative; }

/* Cross-document image morph: case card -> article hero (View Transitions) */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-group(*) { animation-duration: 420ms; animation-timing-function: cubic-bezier(.2,.8,.2,1); }
}

/* Mega outline text — scrubbed horizontally as you scroll the ink section */
.mega {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(72px, 13vw, 190px); line-height: 1;
  white-space: nowrap; pointer-events: none; user-select: none;
  color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.09);
  letter-spacing: -0.02em;
  margin: -10px 0 -28px; position: relative;
}
@supports (animation-timeline: view()) {
  .mega { animation: mega-slide linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
  @keyframes mega-slide { from { transform: translateX(4%); } to { transform: translateX(-14%); } }
}

/* Reading progress — apricot hairline scrubbed by document scroll */
.read-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 80;
  background: var(--apricot-600); transform-origin: 0 50%; transform: scaleX(0);
}
@supports (animation-timeline: scroll()) {
  .read-progress { animation: progress-grow linear both; animation-timeline: scroll(); }
  @keyframes progress-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* Chat messages pop in with @starting-style */
.msg { transition: opacity 360ms var(--ease-out), translate 360ms var(--ease-out); }
@starting-style { .msg { opacity: 0; translate: 0 8px; } }

/* Nav links — apricot liquid underline */
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 100%;
  background: var(--apricot-600);
  transform: scaleX(0); transform-origin: 100% 50%;
  transition: transform 320ms var(--ease-out);
}
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); transform-origin: 0 50%; }

@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
  .mega { animation: none; transform: none; }
}
