/* ==========================================================================
   cristianvillafane.com — "Obsidian Cyber-Operations" visual layer (see site-tools/docs/ARCHITECTURE.md)
   Post-build presentation layer. Loaded after the compiled Tailwind <style>.
   Scope: html.rd  (added to in-scope pages only; /vault is untouched)
   Sections:
     0. Font + tokens
     1. Palette remap of compiled Tailwind utilities  (:where() = no specificity bump)
     2. Base, typography, atmosphere (bg, progress bar, HUD)
     3. Components (nav, glass, hero, case studies, story, CTA, footer, terminal, inner pages)
     4. Motion — load entrances (time based)
     5. Motion — scroll-driven (native animation-timeline)
     6. Motion — IntersectionObserver fallback (html.rd-io, set by /js/scroll-fx.js)
     7. Reduced motion / forced colors
     8. PERF PATCH        — compositor-friendly overrides (no animated blur, one blur surface)
     9. REVIEW + QA FIXES — contrast, HUD click-through, focus-visible safety, reveal ranges
    10. v3  FLOW, SPACING & SCROLL DECOR — progress bar, hero fit, particles/orbits, story compact
    11. v3.1 / v3.2       — story docking, last-block reveal guarantee
   CASCADE RULE: later blocks intentionally override earlier ones. Add new changes as a new
   dated block at the END of the file (see site-tools/docs/HOW-TO.md), never edit a block's
   meaning in place without re-running tools/verify.py and a visual check.
   ========================================================================== */

/* 0. FONT + TOKENS ------------------------------------------------------- */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/fonts/space-grotesk-latin-wght-v2.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@property --rd-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

html.rd {
  /* canvas */
  --ob-0: #08080f;
  --ob-1: #0e0d15;
  --sf-1: #13131a;
  --sf-2: #1b1b23;
  /* energy */
  --blue: #0070f3;
  --sky: #00d2ff;
  --royal: #2563eb;
  --cyan: #00f5d4;
  --blue-txt: #4da3ff;        /* text-safe electric blue (AA on obsidian) */
  /* ink */
  --ink-1: #eef2fa;
  --ink-2: #c3cad8;
  --ink-3: #8f98ab;
  --ink-4: #697186;
  /* lines */
  --hair: rgba(0, 210, 255, .2);
  --hair-soft: rgba(0, 210, 255, .1);
  --hair-strong: rgba(0, 210, 255, .45);
  /* glass */
  --glass-a: rgba(27, 27, 35, .58);
  --glass-b: rgba(14, 13, 21, .38);
  --glass-strong: rgba(14, 13, 21, .74);
  --blur: 16px;
  /* motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-cine: cubic-bezier(.22, .9, .2, 1);
  --shift: clamp(48px, 12vw, 220px);   /* lateral travel distance */
  /* type */
  --font-display: "Space Grotesk", Inter, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;

  background-color: var(--ob-0);
  color-scheme: dark;
}

/* 1. PALETTE REMAP -------------------------------------------------------- */
/* Surfaces */
:where(.rd) .bg-\[\#070a12\] { background-color: var(--ob-0); }
:where(.rd) .bg-\[\#070a12\]\/60 { background-color: rgba(8, 8, 15, .6); }
:where(.rd) .bg-\[\#070a12\]\/80 { background-color: rgba(8, 8, 15, .6); }
:where(.rd) .bg-\[\#070a12\]\/95 { background-color: rgba(8, 8, 15, .86); }
:where(.rd) .bg-slate-950 { background-color: var(--ob-1); }
:where(.rd) .bg-slate-950\/50 { background-color: rgba(14, 13, 21, .5); }
:where(.rd) .bg-slate-950\/60 { background-color: rgba(14, 13, 21, .6); }
:where(.rd) .bg-slate-950\/80 { background-color: rgba(8, 8, 15, .8); }
:where(.rd) .bg-slate-900 { background-color: rgba(27, 27, 35, .9); }
:where(.rd) .bg-slate-900\/60 { background-color: rgba(27, 27, 35, .5); }
:where(.rd) .bg-slate-900\/80 { background-color: rgba(27, 27, 35, .7); }
:where(.rd) .bg-slate-800 { background-color: var(--sf-2); }
:where(.rd) .bg-\[\#0d1322\],
:where(.rd) .bg-brand-surface { background-color: rgba(19, 19, 26, .6); }
:where(.rd) .bg-\[\#0d1322\]\/60,
:where(.rd) .bg-brand-surface\/70 { background-color: rgba(19, 19, 26, .5); }
:where(.rd) .bg-\[\#0d1322\]\/80,
:where(.rd) .bg-brand-surface\/80 { background-color: rgba(19, 19, 26, .7); }
:where(.rd) .bg-sky-950\/20 { background-color: rgba(0, 112, 243, .07); }
:where(.rd) .bg-sky-950\/30 { background-color: rgba(0, 112, 243, .1); }
:where(.rd) .bg-sky-950\/40 { background-color: rgba(0, 112, 243, .13); }
:where(.rd) .bg-sky-950\/60 { background-color: rgba(0, 112, 243, .18); }
:where(.rd) .bg-emerald-950\/20 { background-color: rgba(0, 245, 212, .05); }
:where(.rd) .bg-emerald-950\/40 { background-color: rgba(0, 245, 212, .09); }
:where(.rd) .bg-emerald-950\/60 { background-color: rgba(0, 245, 212, .13); }
:where(.rd) .bg-sky-400,
:where(.rd) .bg-\[\#38bdf8\] { background-color: var(--sky); }
:where(.rd) .bg-violet-400 { background-color: var(--blue-txt); }
:where(.rd) .bg-sky-500,
:where(.rd) .bg-brand-primary { background-color: var(--blue); }

/* Hover surfaces */
:where(.rd) .hover\:bg-slate-800:hover { background-color: rgba(0, 112, 243, .14); }
:where(.rd) .hover\:bg-slate-800\/60:hover,
:where(.rd) .hover\:bg-slate-800\/80:hover { background-color: rgba(0, 210, 255, .08); }
:where(.rd) .hover\:bg-slate-700:hover { background-color: #262633; }
:where(.rd) .hover\:bg-sky-400:hover { background-color: var(--sky); }

/* Text */
:where(.rd) .text-slate-100 { color: var(--ink-1); }
:where(.rd) .text-slate-200 { color: #dde3ee; }
:where(.rd) .text-slate-300 { color: var(--ink-2); }
:where(.rd) .text-slate-400 { color: var(--ink-3); }
:where(.rd) .text-slate-500 { color: var(--ink-4); }
:where(.rd) .text-slate-600 { color: #4d5467; }
:where(.rd) .text-slate-950 { color: #03050b; }
:where(.rd) .text-sky-400,
:where(.rd) .text-\[\#38bdf8\],
:where(.rd) .text-brand-primary { color: var(--sky); }
:where(.rd) .text-sky-300 { color: #7fe6ff; }
:where(.rd) .text-violet-400,
:where(.rd) .text-brand-secondary { color: var(--blue-txt); }
:where(.rd) .text-emerald-400 { color: var(--cyan); }
:where(.rd) .hover\:text-white:hover { color: #fff; }
:where(.rd) .hover\:text-sky-400:hover,
:where(.rd) .hover\:text-brand-primary:hover,
:where(.rd) .group:hover .group-hover\:text-sky-400,
:where(.rd) .group:hover .group-hover\:text-\[\#38bdf8\],
:where(.rd) .group:hover .group-hover\:text-brand-primary { color: var(--sky); }
:where(.rd) .hover\:text-sky-300:hover { color: #7fe6ff; }
:where(.rd) .group:hover .group-hover\:text-violet-400 { color: var(--blue-txt); }
:where(.rd) .hover\:text-violet-300:hover { color: #8cc2ff; }
:where(.rd) .group:hover .group-hover\:text-emerald-400,
:where(.rd) .hover\:text-emerald-400:hover { color: var(--cyan); }
:where(.rd) .hover\:text-emerald-300:hover { color: #7dfbe9; }
:where(.rd) .fill-sky-400 { fill: var(--sky); }

/* Borders */
:where(.rd) .border-slate-800,
:where(.rd) .border-slate-800\/60,
:where(.rd) .border-slate-800\/80,
:where(.rd) .border-brand-border,
:where(.rd) .border-brand-border\/40,
:where(.rd) .border-brand-border\/50,
:where(.rd) .border-brand-border\/60,
:where(.rd) .border-brand-border\/80 { border-color: var(--hair-soft); }
:where(.rd) .border-slate-700,
:where(.rd) .border-slate-700\/80 { border-color: rgba(0, 210, 255, .16); }
:where(.rd) .border-sky-400,
:where(.rd) .border-sky-500\/40,
:where(.rd) .border-brand-primary\/40 { border-color: var(--hair-strong); }
:where(.rd) .border-sky-500\/30,
:where(.rd) .border-sky-800\/40,
:where(.rd) .border-brand-primary\/30 { border-color: var(--hair); }
:where(.rd) .border-emerald-500\/30,
:where(.rd) .border-emerald-800\/40 { border-color: rgba(0, 245, 212, .24); }
:where(.rd) .hover\:border-slate-500:hover,
:where(.rd) .hover\:border-slate-700:hover,
:where(.rd) .hover\:border-sky-400\/50:hover,
:where(.rd) .hover\:border-sky-500\/40:hover,
:where(.rd) .hover\:border-sky-500\/50:hover,
:where(.rd) .hover\:border-brand-primary\/80:hover,
:where(.rd) .group:hover .group-hover\:border-\[\#38bdf8\] { border-color: var(--hair-strong); }
:where(.rd) .hover\:border-violet-400\/50:hover,
:where(.rd) .hover\:border-violet-500\/40:hover { border-color: rgba(77, 163, 255, .5); }

/* Rings, shadows, selection */
:where(.rd) .focus\:ring-sky-300:focus,
:where(.rd) .focus\:ring-sky-400:focus,
:where(.rd) .focus\:ring-\[\#38bdf8\]:focus,
:where(.rd) .focus\:ring-violet-400:focus,
:where(.rd) .focus\:ring-emerald-400:focus,
:where(.rd) .focus\:ring-brand-primary:focus { --tw-ring-color: var(--sky); }
:where(.rd) .focus\:ring-offset-\[\#070a12\]:focus { --tw-ring-offset-color: var(--ob-0); }
:where(.rd) .shadow-\[0_0_20px_rgba\(56\,189\,248\,0\.30\)\] { --tw-shadow: 0 0 28px rgba(0, 210, 255, .32); }
:where(.rd) .hover\:shadow-\[0_0_26px_rgba\(56\,189\,248\,0\.48\)\]:hover { --tw-shadow: 0 0 40px rgba(0, 210, 255, .5); }
:where(.rd) .shadow-glow,
:where(.rd) .hover\:shadow-glow:hover { --tw-shadow: 0 0 40px rgba(0, 112, 243, .35); }
:where(.rd) .shadow-glow-sm { --tw-shadow: 0 0 18px rgba(0, 210, 255, .25); }
.rd ::selection { background: var(--blue); color: #fff; }

/* Inline SVG illustration strokes/fills (presentation attributes are overridable) */
.rd [stroke="#38bdf8"] { stroke: var(--sky); }
.rd [fill="#38bdf8"] { fill: var(--sky); }
.rd [stroke="#a78bfa"] { stroke: var(--blue-txt); }
.rd [fill="#a78bfa"] { fill: var(--blue-txt); }
.rd [stroke="#818cf8"] { stroke: var(--royal); }
.rd [fill="#818cf8"] { fill: var(--royal); }
.rd [stroke="#34d399"] { stroke: var(--cyan); }
.rd [fill="#34d399"] { fill: var(--cyan); }
.rd [stroke="#1e293b"] { stroke: #262634; }
.rd [fill="#1e293b"] { fill: #1f1f2b; }
.rd [fill="#0f172a"] { fill: var(--sf-1); }
.rd [stroke="#0f172a"] { stroke: var(--sf-1); }
.rd [fill="#0b1120"] { fill: var(--ob-1); }
.rd [fill="#070a12"] { fill: var(--ob-0); }
.rd [fill="#64748b"] { fill: var(--ink-3); }
.rd [stroke="#64748b"] { stroke: var(--ink-4); }

/* 2. BASE / TYPOGRAPHY / ATMOSPHERE -------------------------------------- */
.rd body { background-color: var(--ob-0); color: var(--ink-1); }
.rd h1, .rd h2, .rd h3, .rd h4 {
  font-family: var(--font-display);
  letter-spacing: -.025em;
  font-weight: 700;
}
.rd h1 { text-wrap: balance; }
.rd h2, .rd h3 { text-wrap: balance; }
.rd p { text-wrap: pretty; }
.rd .font-mono { font-family: var(--font-mono); }
.rd :focus-visible { outline-color: var(--sky); }

/* Atmosphere: fixed layered background */
.rd-bg { position: fixed; inset: 0; z-index: -20; pointer-events: none; overflow: hidden; background: var(--ob-0); }
.rd-bg__grid {
  position: absolute; inset: -2px;
  background-image:
    linear-gradient(to right, rgba(0, 210, 255, .045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 210, 255, .045) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 20%, transparent 75%);
}
.rd-bg__glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; will-change: translate; }
.rd-bg__glow--a { width: 58vmax; height: 58vmax; left: -18vmax; top: -22vmax;
  background: radial-gradient(circle, rgba(0, 112, 243, .55), rgba(37, 99, 235, .12) 55%, transparent 70%); }
.rd-bg__glow--b { width: 46vmax; height: 46vmax; right: -16vmax; top: 30vh;
  background: radial-gradient(circle, rgba(0, 210, 255, .35), rgba(0, 245, 212, .08) 55%, transparent 70%); }
.rd-bg__noise {
  position: absolute; inset: 0; opacity: .05; mix-blend-mode: overlay;
  /* v2.2.0: static 128px WebP tile (was an feTurbulence SVG: rasterising it delayed first paint ~1 s on slow CPUs) */
  background-image: url(/assets/rd/noise.webp); background-size: 128px 128px;
}

/* Global top reading bar (z 100, above sticky nav) */
.rd-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 100; pointer-events: none;
  background: linear-gradient(90deg, var(--blue), var(--sky) 60%, var(--cyan));
  box-shadow: 0 0 12px rgba(0, 210, 255, .7), 0 0 2px rgba(0, 245, 212, .9);
  transform-origin: 0 50%;
  scale: var(--rd-p, 0) 1;
}

/* Floating lateral HUD telemetry */
.rd-hud {
  position: fixed; right: 1.25rem; top: 50%; translate: 0 -50%; z-index: 40;
  width: 9.5rem; padding: .85rem .9rem;
  border: 1px solid var(--hair); border-radius: 14px;
  background: linear-gradient(160deg, rgba(27, 27, 35, .62), rgba(8, 8, 15, .5));
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%); backdrop-filter: blur(var(--blur)) saturate(150%);
  font: 500 10px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
  box-shadow: 0 20px 50px -25px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .04);
  display: none;
}
@media (min-width: 1440px) { .rd-hud { display: block; } }
.rd-hud__title { display: flex; align-items: center; gap: .5rem; color: var(--sky); margin-bottom: .7rem; }
.rd-hud__ping { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
  animation: rd-blink 2.4s ease-in-out infinite; }
.rd-hud__track { height: 2px; background: rgba(0, 210, 255, .12); border-radius: 2px; overflow: hidden; margin-bottom: .75rem; }
.rd-hud__fill { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan));
  transform-origin: 0 50%; scale: var(--rd-p, 0) 1; }
.rd-hud__list { display: grid; gap: .45rem; margin: 0; }
.rd-hud__list > div { display: flex; justify-content: space-between; gap: .5rem; }
.rd-hud__list dt { color: var(--ink-4); }
.rd-hud__list dd { margin: 0; color: var(--ink-1); font-variant-numeric: tabular-nums; max-width: 5.2rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 3. COMPONENTS ----------------------------------------------------------- */
/* Glass primitive */
.rd .rd-glass {
  position: relative;
  background:
    radial-gradient(420px circle at var(--mx, 20%) var(--my, 0%), rgba(0, 210, 255, .09), transparent 60%),
    linear-gradient(145deg, var(--glass-a), var(--glass-b));
  border: 1px solid var(--hair-soft);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
          backdrop-filter: blur(var(--blur)) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045), 0 24px 60px -34px rgba(0, 0, 0, .95);
  transition: border-color .3s ease, box-shadow .3s ease;
}
.rd .rd-glass:hover { border-color: var(--hair); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 0 1px rgba(0, 210, 255, .06), 0 30px 70px -30px rgba(0, 112, 243, .35); }

/* HUD corner brackets */
.rd-corners { position: absolute; inset: 10px; pointer-events: none; z-index: 2; }
.rd-corners i { position: absolute; width: 14px; height: 14px; border: 0 solid var(--hair-strong); }
.rd-corners i:nth-child(1) { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.rd-corners i:nth-child(2) { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.rd-corners i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.rd-corners i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

/* Navigation shell */
.rd .rd-nav {
  background: rgba(8, 8, 15, .55);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--hair-soft);
}
.rd .rd-nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(0, 210, 255, .55), transparent);
  opacity: 0; transition: opacity .4s ease;
}
.rd .rd-nav[data-scrolled="true"]::after { opacity: 1; }
.rd .rd-nav nav a { position: relative; }
.rd .rd-nav nav a::after {
  content: ""; position: absolute; left: .75rem; right: .75rem; bottom: 8px; height: 1px;
  background: linear-gradient(90deg, var(--blue), var(--sky)); scale: 0 1; transform-origin: 0 50%;
  transition: scale .35s var(--ease-out);
}
.rd .rd-nav nav a:hover::after { scale: 1 1; }
.rd .rd-logo > div:first-child {
  background: linear-gradient(145deg, rgba(0, 112, 243, .28), rgba(0, 210, 255, .08));
  border-color: var(--hair-strong); color: var(--sky);
  box-shadow: 0 0 22px -4px rgba(0, 210, 255, .45), inset 0 0 12px rgba(0, 210, 255, .15);
  font-family: var(--font-display);
}
.rd .rd-logo > div:last-child > span:first-child { font-family: var(--font-display); letter-spacing: -.01em; }
.rd .rd-nav a[href^="/contact"].bg-sky-500,
.rd .rd-nav a[href^="/es/contact"].bg-sky-500,
.rd #mobile-menu a.bg-sky-500 {
  background: linear-gradient(100deg, #1f7bff, var(--sky));
  color: #03050b;
  box-shadow: 0 0 24px -6px rgba(0, 210, 255, .6);
}
.rd .rd-nav a.bg-sky-500:hover { background: linear-gradient(100deg, #3b8bff, #5ce1ff); }
.rd #mobile-menu { background: rgba(8, 8, 15, .92); border-color: var(--hair-soft); }

/* Primary CTA gradient (hero + contact) */
.rd .bg-gradient-to-r.from-sky-400.to-cyan-300 {
  background-image: linear-gradient(100deg, #1f7bff 0%, var(--sky) 55%, var(--cyan) 100%);
  color: #03050b;
}
.rd .bg-gradient-to-r.from-sky-400.to-cyan-300:hover {
  background-image: linear-gradient(100deg, #3b8bff 0%, #4fe0ff 55%, #5cfbe4 100%);
}

/* HERO -------------------------------------------------------------------- */
.rd .rd-hero { min-height: min(100svh, 980px); display: flex; align-items: center; }
.rd .rd-hero > .max-w-7xl { width: 100%; }
.rd .rd-hero-deco svg { opacity: .7; }
.rd .rd-hero-title {
  font-size: clamp(2.5rem, 6.4vw, 5.6rem);
  line-height: .98; letter-spacing: -.04em; font-weight: 700;
}
.rd .rd-hero-title > span:first-child { display: block; color: var(--ink-1); }
.rd .rd-grad {
  display: block;
  background-image: linear-gradient(95deg, var(--blue-txt) 0%, var(--sky) 45%, var(--cyan) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 28px rgba(0, 210, 255, .25));
}
.rd .rd-hero-copy > div:first-child > span:first-child { color: var(--cyan); letter-spacing: .18em; }
.rd .rd-hero-copy > div:first-child::before {
  content: ""; width: 26px; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan));
}

/* Pillar metrics as HUD tiles */
.rd .rd-metrics { border-top: 0; padding-top: 0; gap: .75rem; }
.rd .rd-metric {
  position: relative; padding: 1rem 1rem .9rem; border-radius: 14px;
  border: 1px solid var(--hair-soft);
  background: linear-gradient(160deg, rgba(27, 27, 35, .55), rgba(14, 13, 21, .3));
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  overflow: hidden;
}
.rd .rd-metric::before {
  content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 100%;
  background: linear-gradient(90deg, var(--blue), var(--sky), transparent);
}
.rd .rd-metric > span:first-child {
  font-family: var(--font-display); font-size: clamp(1.5rem, 2.6vw, 2.1rem); letter-spacing: -.03em;
  background: linear-gradient(180deg, #fff, #9fdcff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rd .rd-metric > span:last-child { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }

/* Portrait: identity terminal card with radar scan */
.rd .rd-hero-visual .blur-2xl {
  background: radial-gradient(circle at 60% 40%, rgba(0, 112, 243, .45) 0%, rgba(0, 210, 255, .18) 45%, transparent 75%) !important;
}
.rd .rd-hero-visual .bg-gradient-to-tr { background-image: linear-gradient(35deg, rgba(0, 112, 243, .5), rgba(0, 210, 255, .12) 50%, rgba(0, 245, 212, .35)); }
.rd .rd-portrait {
  border-color: var(--hair);
  background: var(--sf-1);
  box-shadow: 0 40px 90px -40px rgba(0, 112, 243, .55), 0 0 0 1px rgba(0, 210, 255, .06);
  isolation: isolate;
}
.rd .rd-portrait img { filter: grayscale(1) contrast(1.05) brightness(.95); }
.rd .rd-portrait picture::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 112, 243, .18), transparent 40%, rgba(0, 210, 255, .12));
  mix-blend-mode: screen;
}
.rd .rd-portrait .from-\[\#070a12\] { background-image: linear-gradient(to top, var(--ob-0), rgba(8, 8, 15, .78) 55%, transparent); }
.rd-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 38%; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(0, 210, 255, .0) 40%, rgba(0, 210, 255, .16) 92%, rgba(0, 245, 212, .55) 100%);
  border-bottom: 1px solid rgba(0, 245, 212, .6);
  mix-blend-mode: screen; opacity: .8;
  animation: rd-scan 5.5s cubic-bezier(.45, 0, .55, 1) infinite;
}
.rd .rd-portrait .rd-corners { inset: 12px; }

/* CASE STUDIES ------------------------------------------------------------ */
.rd .rd-projects { position: relative; counter-reset: rd-case; }
.rd .rd-sec-head > div:first-child > span:first-child { box-shadow: 0 0 12px currentColor; }
.rd .rd-sec-head h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.02; }
.rd .rd-case { position: relative; counter-increment: rd-case; border-color: var(--hair-soft); }
.rd .rd-case::before {
  content: "0" counter(rd-case);
  position: absolute; z-index: -1; top: -2.5rem; right: 0;
  font: 700 clamp(6rem, 16vw, 15rem)/1 var(--font-display); letter-spacing: -.06em;
  color: transparent; -webkit-text-stroke: 1px rgba(0, 210, 255, .12);
  pointer-events: none; user-select: none;
}
.rd .rd-case--flip::before { right: auto; left: 0; }
@media (min-width: 1024px) {
  .rd .rd-case--flip .rd-case-visual { order: 2; }
  .rd .rd-case--flip .rd-case-copy { order: 1; }
}
.rd .rd-hud-box { overflow: hidden; border-radius: 20px; }
.rd .project-card-cyan, .rd .project-card-violet, .rd .project-card-emerald { border-color: var(--hair-soft); }
.rd .project-card-cyan:hover { border-color: rgba(0, 112, 243, .55); box-shadow: 0 0 50px -16px rgba(0, 112, 243, .55); }
.rd .project-card-violet:hover { border-color: rgba(0, 210, 255, .55); box-shadow: 0 0 50px -16px rgba(0, 210, 255, .45); }
.rd .project-card-emerald:hover { border-color: rgba(0, 245, 212, .55); box-shadow: 0 0 50px -16px rgba(0, 245, 212, .4); }
.rd .rd-case-copy h3 { font-size: clamp(1.6rem, 2.8vw, 2.4rem); line-height: 1.08; }
.rd .rd-case-copy .bg-slate-900.border {
  background: rgba(0, 112, 243, .08); border-color: var(--hair); color: #bfe9ff;
}

/* STORY (Operating philosophy) ------------------------------------------- */
.rd .rd-story { position: relative; }
.rd .rd-story-grid { position: relative; }
.rd .rd-story-card { border-color: var(--hair-soft); overflow: hidden; }
.rd .rd-story-card::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--sky), var(--cyan));
  transform-origin: 0 50%; scale: var(--rd-card-line, 1) 1;
}
.rd .rd-story-card > div > span:first-child {
  font: 700 2.4rem/1 var(--font-display); letter-spacing: -.04em;
  color: transparent; -webkit-text-stroke: 1px var(--sky);
}
.rd .rd-sc2 > div > span:first-child { -webkit-text-stroke-color: var(--blue-txt); }
.rd .rd-sc3 > div > span:first-child { -webkit-text-stroke-color: var(--cyan); }
.rd .rd-story-links > a { border-color: var(--hair-soft); }

/* CTA --------------------------------------------------------------------- */
.rd .rd-cta .cta-ambient-glow {
  background: radial-gradient(circle closest-side at 50% 55%, rgba(0, 112, 243, .22), rgba(0, 210, 255, .08) 55%, transparent 80%);
}
.rd .rd-cta-panel {
  position: relative; border-radius: 28px; padding-block: clamp(2.5rem, 6vw, 4.5rem);
  background: linear-gradient(160deg, rgba(27, 27, 35, .62), rgba(8, 8, 15, .55));
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 50px 120px -50px rgba(0, 112, 243, .5), inset 0 1px 0 rgba(255, 255, 255, .05);
  isolation: isolate;
}
.rd .rd-cta-panel::before {        /* rotating conic hairline */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: -1;
  background: conic-gradient(from var(--rd-angle), transparent 0 60%, var(--sky) 75%, var(--cyan) 82%, transparent 92%),
              linear-gradient(var(--hair-soft), var(--hair-soft));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: rd-spin 9s linear infinite;
}
.rd .rd-cta-panel h2 { font-size: clamp(2rem, 4.8vw, 3.8rem); line-height: 1.02; }
@media (min-width: 640px) { .rd .rd-cta > .rd-cta-panel { margin-inline: auto; } }

/* FOOTER diagnostics console --------------------------------------------- */
.rd .rd-footer {
  position: relative; background: rgba(8, 8, 15, .78);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--hair-soft);
}
.rd .rd-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue) 30%, var(--sky) 50%, var(--cyan) 70%, transparent);
  opacity: .7;
}
.rd .rd-footer .easter-egg-trigger + span { display: inline-flex; align-items: center; gap: .5rem; color: var(--cyan); }
.rd .rd-footer .easter-egg-trigger + span::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan); animation: rd-blink 2.4s ease-in-out infinite;
}
.rd .rd-footer .easter-egg-trigger { border-color: var(--hair); background: rgba(0, 112, 243, .08); color: var(--sky); }
.rd .rd-footer .easter-egg-trigger:hover { box-shadow: 0 0 20px -4px rgba(0, 210, 255, .6); }

/* Restricted terminal modal (visual only) --------------------------------- */
.rd #easter-egg-modal { background: rgba(4, 4, 9, .72); }
.rd .rd-terminal {
  background: linear-gradient(160deg, rgba(27, 27, 35, .85), rgba(8, 8, 15, .9));
  border-color: var(--hair-strong);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 0 0 1px rgba(0, 210, 255, .08), 0 40px 100px -30px rgba(0, 112, 243, .6);
}
.rd .rd-terminal .text-emerald-400 { color: var(--cyan); text-shadow: 0 0 12px rgba(0, 245, 212, .5); }
.rd .rd-terminal #easter-egg-launch-btn { background-image: linear-gradient(100deg, #1f7bff, var(--sky)); color: #03050b; }

/* INNER PAGES ------------------------------------------------------------- */
.rd .rd-page-head h1 {
  font-size: clamp(2.3rem, 5.4vw, 4.4rem); line-height: 1; letter-spacing: -.035em;
  background: linear-gradient(180deg, #fff 30%, #a9dcff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rd .rd-page-head::after {
  content: ""; display: block; width: 88px; height: 2px; margin-top: 1.75rem;
  background: linear-gradient(90deg, var(--blue), var(--sky), var(--cyan));
  box-shadow: 0 0 14px rgba(0, 210, 255, .6);
}
.rd .rd-crumb { font-family: var(--font-mono); }
.rd .rd-card { border-color: var(--hair-soft); }
.rd .rd-tile.border, .rd .rd-block.border { border-color: var(--hair-soft); }
.rd .rd-tl-item > div:first-child { background: var(--sky) !important; box-shadow: 0 0 0 4px rgba(0, 210, 255, .12), 0 0 16px rgba(0, 210, 255, .7); border-color: var(--ob-0) !important; }
.rd .prose-invert, .rd .prose {
  --tw-prose-body: var(--ink-2); --tw-prose-headings: var(--ink-1); --tw-prose-links: var(--sky);
  --tw-prose-bold: var(--ink-1); --tw-prose-bullets: var(--sky); --tw-prose-counters: var(--sky);
  --tw-prose-hr: var(--hair-soft); --tw-prose-quotes: var(--ink-1); --tw-prose-quote-borders: var(--blue);
  --tw-prose-code: #9fe8ff; --tw-prose-th-borders: var(--hair); --tw-prose-td-borders: var(--hair-soft);
  --tw-prose-invert-body: var(--ink-2); --tw-prose-invert-headings: var(--ink-1); --tw-prose-invert-links: var(--sky);
  --tw-prose-invert-bold: var(--ink-1); --tw-prose-invert-bullets: var(--sky); --tw-prose-invert-counters: var(--sky);
  --tw-prose-invert-hr: var(--hair-soft); --tw-prose-invert-code: #9fe8ff;
}
.rd .prose h2, .rd .prose-invert h2 { font-family: var(--font-display); }
.rd .rd-404 h1 {
  font: 700 clamp(6rem, 22vw, 14rem)/.9 var(--font-display); letter-spacing: -.06em;
  background: linear-gradient(180deg, #fff, var(--sky) 60%, var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 40px rgba(0, 112, 243, .45));
}

/* 4. LOAD ENTRANCES (time-based, equivalent to tailwindcss-motion presets) -- */
@keyframes rd-enter   { from { opacity: 0; translate: 0 28px; filter: blur(10px); } to { opacity: 1; translate: 0 0; filter: blur(0); } }
@keyframes rd-enter-r { from { translate: 90px 0; scale: .94; } to { translate: 0 0; scale: 1; } }
@keyframes rd-scan    { 0% { translate: 0 -100%; } 100% { translate: 0 300%; } }
@keyframes rd-blink   { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes rd-spin    { to { --rd-angle: 360deg; } }

.rd .rd-enter   { animation: rd-enter 1.05s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 110ms + 80ms); }
.rd .rd-enter-r { animation: rd-enter-r 1.4s var(--ease-cine) both; animation-delay: calc(var(--d, 0) * 110ms + 80ms); }
.rd .rd-d1 { --d: 1; } .rd .rd-d2 { --d: 2; } .rd .rd-d3 { --d: 3; }
.rd .rd-d4 { --d: 4; } .rd .rd-d5 { --d: 5; } .rd .rd-d6 { --d: 6; }

/* Neutralise the legacy reveal/parallax transforms so only one motion system runs */
.rd.motion-ready .reveal-on-scroll,
.rd.motion-ready .reveal-on-scroll.is-revealed { transform: none; transition: none; }
.rd .parallax-project-visual { animation: none; transform: none; }
.rd .rd-hero-deco { animation: none; }

/* 5. SCROLL-DRIVEN (native CSS animation-timeline) ------------------------- */
@keyframes rd-in-l  { from { opacity: 0; translate: calc(var(--shift) * -1) 0; filter: blur(8px); } 70% { filter: blur(0); } to { opacity: 1; translate: 0 0; filter: blur(0); } }
@keyframes rd-in-r  { from { opacity: 0; translate: var(--shift) 0; filter: blur(8px); } 70% { filter: blur(0); } to { opacity: 1; translate: 0 0; filter: blur(0); } }
@keyframes rd-in-up { from { opacity: 0; translate: 0 64px; scale: .97; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes rd-in-scale { from { opacity: 0; scale: .86; translate: 0 60px; filter: blur(10px); } to { opacity: 1; scale: 1; translate: 0 0; filter: blur(0); } }
@keyframes rd-wipe-l { from { clip-path: inset(0 100% 0 0 round 20px); } to { clip-path: inset(0 0 0 0 round 20px); } }
@keyframes rd-wipe-r { from { clip-path: inset(0 0 0 100% round 20px); } to { clip-path: inset(0 0 0 0 round 20px); } }
@keyframes rd-drift  { from { translate: 0 0; } to { translate: 0 -18%; } }
@keyframes rd-drift-b { from { translate: 0 0; } to { translate: -12vw 40vh; } }
@keyframes rd-grow   { from { scale: 0 1; } to { scale: 1 1; } }
@keyframes rd-num    { from { translate: 0 30%; opacity: 0; } to { translate: 0 -30%; opacity: 1; } }
@keyframes rd-hero-copy-out { to { translate: -7vw -4vh; opacity: .08; filter: blur(6px); } }
@keyframes rd-hero-vis-out  { to { translate: 6vw -10vh; scale: .86; rotate: 3deg; opacity: .1; } }
@keyframes rd-hero-deco-out { to { translate: 0 -22vh; rotate: 14deg; opacity: .2; } }
@keyframes rd-out-soft { to { opacity: .35; scale: .96; filter: blur(2px); } }
@keyframes rd-line { from { scale: 0 1; } to { scale: 1 1; } }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .rd .rd-progress,
    .rd .rd-hud__fill { animation: rd-grow linear both; animation-timeline: scroll(root block); }
    .rd .rd-bg__glow--a { animation: rd-drift linear both; animation-timeline: scroll(root block); }
    .rd .rd-bg__glow--b { animation: rd-drift-b linear both; animation-timeline: scroll(root block); }

    /* Lateral / rise reveals, tied to each element's own view progress */
    .rd .rd-rev-l  { animation: rd-in-l linear both;  animation-timeline: view(); animation-range: entry 0% cover 34%; }
    .rd .rd-rev-r  { animation: rd-in-r linear both;  animation-timeline: view(); animation-range: entry 0% cover 34%; }
    .rd .rd-rev-up { animation: rd-in-up linear both; animation-timeline: view(); animation-range: entry 0% cover 28%; }
    .rd .rd-from-r > * { animation: rd-in-r linear both; animation-timeline: view(); animation-range: entry 0% cover 30%; --shift: clamp(40px, 8vw, 140px); }
    .rd .rd-from-l > * { animation: rd-in-l linear both; animation-timeline: view(); animation-range: entry 0% cover 30%; --shift: clamp(40px, 8vw, 140px); }

    /* Case visual: slide + clip wipe + soft exit (cinematic) */
    .rd .rd-case-visual.rd-rev-l { animation: rd-in-l linear both, rd-out-soft linear forwards; animation-timeline: view(), view(); animation-range: entry 0% cover 38%, exit 10% exit 100%; }
    .rd .rd-case-visual.rd-rev-r { animation: rd-in-r linear both, rd-out-soft linear forwards; animation-timeline: view(), view(); animation-range: entry 0% cover 38%, exit 10% exit 100%; }
    .rd .rd-case-visual.rd-rev-l .rd-hud-box { animation: rd-wipe-l linear both; animation-timeline: view(); animation-range: entry 10% cover 42%; }
    .rd .rd-case-visual.rd-rev-r .rd-hud-box { animation: rd-wipe-r linear both; animation-timeline: view(); animation-range: entry 10% cover 42%; }
    .rd .rd-case::before { animation: rd-num linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }

    .rd .rd-cta-panel { animation: rd-in-scale linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; }

    /* Hero cinematic exit (desktop only: on mobile the portrait sits below the copy) */
    @media (min-width: 1024px) {
      .rd .rd-hero-copy   { animation: rd-hero-copy-out linear both; animation-timeline: scroll(root block); animation-range: 0 85vh; }
      .rd .rd-hero-visual { animation: rd-hero-vis-out linear both;  animation-timeline: scroll(root block); animation-range: 0 90vh; }
      .rd .rd-hero-deco   { animation: rd-hero-deco-out linear both; animation-timeline: scroll(root block); animation-range: 0 100vh; }
    }

    /* Pinned storytelling: Operating Philosophy (large, tall-enough viewports) */
    @media (min-width: 1024px) and (min-height: 760px) {
      .rd .rd-story { height: 320vh; padding: 0; view-timeline: --story block; }
      .rd .rd-story-inner {
        position: sticky; top: 0; height: 100vh; padding-top: 5.5rem; padding-bottom: 2rem;
        display: flex; flex-direction: column; justify-content: center;
      }
      .rd .rd-story .rd-story-head { margin-bottom: 2.5rem; animation: rd-in-up linear both; animation-timeline: --story; animation-range: contain 0% contain 10%; }
      .rd .rd-story .rd-story-grid { margin-bottom: 2.5rem; }
      .rd .rd-story .rd-story-grid::before {
        content: ""; position: absolute; left: 0; right: 0; top: -1.1rem; height: 1px;
        background: linear-gradient(90deg, var(--blue), var(--sky), var(--cyan));
        box-shadow: 0 0 10px rgba(0, 210, 255, .7); transform-origin: 0 50%;
        animation: rd-line linear both; animation-timeline: --story; animation-range: contain 8% contain 72%;
      }
      .rd .rd-story .rd-sc1 { animation: rd-in-l linear both;     animation-timeline: --story; animation-range: contain 8% contain 28%; }
      .rd .rd-story .rd-sc2 { animation: rd-in-scale linear both; animation-timeline: --story; animation-range: contain 28% contain 48%; }
      .rd .rd-story .rd-sc3 { animation: rd-in-r linear both;     animation-timeline: --story; animation-range: contain 48% contain 68%; }
      .rd .rd-story .rd-story-links { animation: rd-in-up linear both; animation-timeline: --story; animation-range: contain 70% contain 86%; }
    }
  }
}

/* 6. FALLBACK — IntersectionObserver (Firefox / older Safari) -------------- */
.rd.rd-io .rd-rev-l, .rd.rd-io .rd-rev-r, .rd.rd-io .rd-rev-up,
.rd.rd-io .rd-from-l > *, .rd.rd-io .rd-from-r > *, .rd.rd-io .rd-cta-panel {
  transition: opacity .9s var(--ease-out), translate 1.1s var(--ease-cine), scale 1.1s var(--ease-cine), filter .9s ease;
}
.rd.rd-io .rd-rev-l:not(.rd-in),  .rd.rd-io .rd-from-l > *:not(.rd-in) { opacity: 0; translate: calc(var(--shift) * -1) 0; filter: blur(6px); }
.rd.rd-io .rd-rev-r:not(.rd-in),  .rd.rd-io .rd-from-r > *:not(.rd-in) { opacity: 0; translate: var(--shift) 0; filter: blur(6px); }
.rd.rd-io .rd-rev-up:not(.rd-in)  { opacity: 0; translate: 0 56px; }
.rd.rd-io .rd-cta-panel:not(.rd-in) { opacity: 0; scale: .9; }
.rd.rd-io .rd-from-l > *:nth-child(2), .rd.rd-io .rd-from-r > *:nth-child(2) { transition-delay: 80ms; }
.rd.rd-io .rd-from-l > *:nth-child(3), .rd.rd-io .rd-from-r > *:nth-child(3) { transition-delay: 160ms; }
.rd.rd-io .rd-from-l > *:nth-child(4), .rd.rd-io .rd-from-r > *:nth-child(4) { transition-delay: 240ms; }
.rd.rd-io .rd-from-l > *:nth-child(5), .rd.rd-io .rd-from-r > *:nth-child(5) { transition-delay: 320ms; }
.rd.rd-io .rd-instant { transition: none !important; }

/* Mobile tuning */
@media (max-width: 639px) {
  html.rd { --shift: 56px; --blur: 12px; }
  .rd .rd-hero { min-height: 0; }
  .rd .rd-metrics { gap: .5rem; }
  .rd .rd-metric { padding: .75rem .7rem; }
  .rd .rd-case::before { top: -1.5rem; }
  .rd-bg__glow { filter: blur(60px); }
}

/* 7. ACCESSIBILITY -------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .rd .rd-enter, .rd .rd-enter-r, .rd .rd-rev-l, .rd .rd-rev-r, .rd .rd-rev-up,
  .rd .rd-from-l > *, .rd .rd-from-r > *, .rd .rd-cta-panel, .rd .rd-hud-box, .rd .rd-case::before,
  .rd .rd-hero-copy, .rd .rd-hero-visual, .rd .rd-hero-deco, .rd .rd-story-card, .rd .rd-bg__glow {
    animation: none !important; opacity: 1 !important; translate: none !important; scale: none !important;
    filter: none !important; clip-path: none !important; transition: none !important;
  }
  .rd-scan, .rd .rd-cta-panel::before { animation: none !important; }
  .rd-scan { display: none; }
}
@media (forced-colors: active) {
  .rd-bg, .rd-scan, .rd-corners, .rd-progress, .rd-hud { display: none !important; }
  .rd .rd-grad, .rd .rd-page-head h1, .rd .rd-404 h1, .rd .rd-metric > span:first-child { color: CanvasText; background: none; }
}

/* ===================== PERF PATCH (subagent audit) ===================== */
/* ==========================================================================
   redesign.css — performance patch (append to the end of redesign.css, or fold
   each block into the rule it overrides). Same selectors/specificity as the
   originals, so it wins by source order; no !important needed.
   ========================================================================== */

/* P1 — Backdrop-filter budget --------------------------------------------
   Real blur only where it reads as glass over moving content: nav + CTA panel.
   Cards / metrics / footer / HUD sit over a near-uniform dark field, so an
   opaque-ish gradient + inner highlight is visually equivalent. */
.rd .rd-glass,
.rd .rd-metric,
.rd .rd-footer,
.rd-hud { -webkit-backdrop-filter: none; backdrop-filter: none; }
.rd .rd-glass {
  background:
    radial-gradient(420px circle at var(--mx, 20%) var(--my, 0%), rgba(0, 210, 255, .09), transparent 60%),
    linear-gradient(145deg, rgba(27, 27, 35, .86), rgba(14, 13, 21, .78));
}
.rd .rd-metric { background: linear-gradient(160deg, rgba(27, 27, 35, .8), rgba(14, 13, 21, .66)); }
.rd .rd-footer { background: rgba(8, 8, 15, .94); }
.rd-hud { background: linear-gradient(160deg, rgba(27, 27, 35, .9), rgba(8, 8, 15, .86)); contain: layout paint style; }
.rd .rd-nav { -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }   /* was blur(18px) saturate(160%) */
/* CTA panel: the animated ring lives inside it, so a backdrop blur here is re-run every frame
   the ring moves. Keep the ring, drop the blur (the panel sits over a static ambient glow). */
.rd .rd-cta-panel {
  -webkit-backdrop-filter: none; backdrop-filter: none;                              /* was blur(20px) saturate(150%) */
  background: linear-gradient(160deg, rgba(27, 27, 35, .9), rgba(8, 8, 15, .86));
}
@media (prefers-reduced-transparency: reduce) {
  .rd .rd-nav { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(8, 8, 15, .94); }
}

/* P2 — No blur() inside animated keyframes --------------------------------
   Any keyframe that animates filter:blur() fails compositing
   (kFilterRelatedPropertyMayMovePixels) and runs on the main thread.
   Same names, so these replace the originals by source order. */
@keyframes rd-enter    { from { opacity: 0; translate: 0 28px; } to { opacity: 1; translate: 0 0; } }
@keyframes rd-in-l     { from { opacity: 0; translate: calc(var(--shift) * -1) 0; } to { opacity: 1; translate: 0 0; } }
@keyframes rd-in-r     { from { opacity: 0; translate: var(--shift) 0; } to { opacity: 1; translate: 0 0; } }
@keyframes rd-in-scale { from { opacity: 0; scale: .86; translate: 0 60px; } to { opacity: 1; scale: 1; translate: 0 0; } }
@keyframes rd-hero-copy-out { to { translate: -7vw -4vh; opacity: .08; } }
/* IO fallback (Firefox/older Safari): same idea, no filter transition */
.rd.rd-io .rd-rev-l, .rd.rd-io .rd-rev-r, .rd.rd-io .rd-rev-up,
.rd.rd-io .rd-from-l > *, .rd.rd-io .rd-from-r > *, .rd.rd-io .rd-cta-panel {
  transition: opacity .9s var(--ease-out), translate 1.1s var(--ease-cine), scale 1.1s var(--ease-cine);
}
.rd.rd-io .rd-rev-l:not(.rd-in), .rd.rd-io .rd-from-l > *:not(.rd-in),
.rd.rd-io .rd-rev-r:not(.rd-in), .rd.rd-io .rd-from-r > *:not(.rd-in) { filter: none; }

/* P2b — Hero headline visible on the first frame (LCP / perceived load):
   rise only, no fade/blur, no stagger delay. Kicker, copy, CTAs, metrics keep the staggered fade. */
@keyframes rd-title-in { from { translate: 0 .28em; } to { translate: 0 0; } }
.rd h1.rd-enter { animation-name: rd-title-in; animation-duration: .9s; animation-delay: 0ms; }

/* P3 — Atmosphere without per-frame filters/blending ----------------------- */
.rd-bg__glow { filter: none; }        /* blur(90px) on 58vmax layers -> bake the falloff into the gradient */
.rd-bg__glow--a { background: radial-gradient(circle closest-side, rgba(0, 112, 243, .42), rgba(37, 99, 235, .14) 45%, rgba(37, 99, 235, 0) 100%); }
.rd-bg__glow--b { background: radial-gradient(circle closest-side, rgba(0, 210, 255, .28), rgba(0, 245, 212, .08) 45%, rgba(0, 245, 212, 0) 100%); }
@media (max-width: 639px) { .rd-bg__glow { filter: none; } }
.rd-bg__noise { mix-blend-mode: normal; opacity: .035; }   /* overlay blend over a fixed full-viewport layer = full-screen blend every frame */
.rd-scan { mix-blend-mode: normal; }                       /* gradient already fades to transparent; plain alpha reads the same on the dark portrait */

/* P4 — Case visuals: one animation per element (was rd-in-* + rd-out-soft -> kTargetHasIncompatibleAnimations) */
@keyframes rd-case-l {
  entry 0%  { opacity: 0; translate: calc(var(--shift) * -1) 0; }
  cover 38% { opacity: 1; translate: 0 0; }
  exit 10%  { opacity: 1; scale: 1; }
  exit 100% { opacity: .35; scale: .96; }
}
@keyframes rd-case-r {
  entry 0%  { opacity: 0; translate: var(--shift) 0; }
  cover 38% { opacity: 1; translate: 0 0; }
  exit 10%  { opacity: 1; scale: 1; }
  exit 100% { opacity: .35; scale: .96; }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .rd .rd-case-visual.rd-rev-l { animation: rd-case-l linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
    .rd .rd-case-visual.rd-rev-r { animation: rd-case-r linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
  }
}

/* P5 — CTA: real scroll timeline + composited ring ------------------------
   overflow:hidden made #contact a scroll container, so view() on the panel and
   buttons bound to it (frozen progress, non-composited). overflow:clip clips
   without creating a scroller. */
.rd .rd-cta { overflow: clip; }
/* Ring: masked static frame + rotating child (rotate is compositor-only).
   Needs markup: <span class="rd-cta-ring" aria-hidden="true"><i></i></span> as first child of .rd-cta-panel
   (inject from tools/transform.py like .rd-scan). --rd-diag is set by scroll-fx.js (ResizeObserver). */
.rd .rd-cta-panel::before { content: none; animation: none; }
.rd .rd-cta-ring {
  position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1px; overflow: hidden; pointer-events: none;
  background: var(--hair-soft);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.rd .rd-cta-ring > i {
  position: absolute; left: 50%; top: 50%; width: var(--rd-diag, 100vmax); aspect-ratio: 1; translate: -50% -50%;
  background: conic-gradient(transparent 0 60%, var(--sky) 75%, var(--cyan) 82%, transparent 92%);
  animation: rd-rot 9s linear infinite;
}
@keyframes rd-rot { to { rotate: 1turn; } }

/* P6 — Let the renderer sleep: pause infinite loops while off-screen
   (class toggled by scroll-fx.js IntersectionObserver). Off-screen composited
   loops fall back to main-thread ticking (kAnimationHasNoVisibleChange). */
.rd-scan.rd-paused,
.rd .rd-cta-panel.rd-paused .rd-cta-ring > i,
.rd .rd-footer.rd-paused .easter-egg-trigger + span::before { animation-play-state: paused; }

/* P7 — Pointer glow: non-inherited custom props keep the recalc on the card only */
@property --mx { syntax: "<length-percentage>"; inherits: false; initial-value: 20%; }
@property --my { syntax: "<length-percentage>"; inherits: false; initial-value: 0%; }

/* P8 — Reduced motion: keep new pieces still */
@media (prefers-reduced-motion: reduce) {
  .rd .rd-cta-ring > i { animation: none; }
  .rd .rd-case-visual { animation: none !important; opacity: 1 !important; translate: none !important; scale: none !important; }
}

/* ===================== REVIEW + QA FIXES ===================== */
/* Atmosphere visible: body must not paint over the fixed .rd-bg layer */
.rd body { background-color: transparent; }
/* HUD: never intercept clicks; only where a gutter exists */
.rd-hud { pointer-events: none; display: none; }
@media (min-width: 1640px) { .rd-hud { display: block; } }
/* Top bar under the terminal modal */
.rd-progress { z-index: 45; }
/* AA contrast for solid primary buttons */
:where(.rd) .bg-sky-500, :where(.rd) .bg-brand-primary { background-color: #1f7bff; }
/* Nav: denser glass, scrolled state denser still */
.rd .rd-nav { background: rgba(8, 8, 15, .78); }
.rd .rd-nav[data-scrolled="true"] { background: rgba(8, 8, 15, .9); }
/* Hover states restored */
.rd .rd-logo:hover > div:first-child { border-color: var(--sky); }
.rd .rd-portrait { border-color: var(--hair); }
.rd .rd-portrait:hover { border-color: var(--hair-strong); }
.rd .rd-card { border-color: var(--hair-soft); }
.rd .rd-card:hover { border-color: var(--hair); }
.rd .rd-glass { transition: border-color .3s ease, box-shadow .3s ease, background-color .3s ease, transform .18s var(--ease-out); }
/* Contrast of the dimmest ink */
html.rd { --ink-4: #838ca0; }
/* Decorative counter: not announced, no "010" */
.rd .rd-case::before { content: counter(rd-case, decimal-leading-zero) / ""; }
/* Faint glass borders -> a touch stronger */
.rd .rd-glass { border-color: rgba(0, 210, 255, .14); }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* Reveals always complete: end when the element has fully entered (reachable even at page bottom) */
    .rd .rd-rev-l, .rd .rd-rev-r, .rd .rd-rev-up,
    .rd .rd-from-l > *, .rd .rd-from-r > * { animation-range: entry 0% entry 100%; }
    .rd .rd-cta-panel { animation-range: entry 0% entry 100%; }
    /* Single-column (<1024px): stacked tiles/cards rise instead of zig-zagging */
    @media (max-width: 1023px) {
      .rd .rd-tile.rd-rev-l, .rd .rd-tile.rd-rev-r,
      .rd .rd-card.rd-rev-l, .rd .rd-card.rd-rev-r,
      .rd .rd-story-card.rd-rev-l, .rd .rd-story-card.rd-rev-r { animation-name: rd-in-up; }
    }
    /* Pinned story only when the whole composition fits */
    @media (min-width: 1024px) and (min-height: 760px) and (max-height: 859px) {
      .rd .rd-story { height: auto; padding-block: 6rem; view-timeline: none; }
      .rd .rd-story-inner { position: static; height: auto; padding: 0 1rem; }
      .rd .rd-story .rd-story-head, .rd .rd-story .rd-story-links { animation: rd-in-up linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
      .rd .rd-story .rd-sc1 { animation: rd-in-l linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
      .rd .rd-story .rd-sc2 { animation: rd-in-scale linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
      .rd .rd-story .rd-sc3 { animation: rd-in-r linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
      .rd .rd-story .rd-story-grid::before { display: none; }
    }
    /* Keyboard focus always lands on a fully visible element (WCAG 2.4.7) */
    .rd :is(.rd-rev-l, .rd-rev-r, .rd-rev-up, .rd-cta-panel, .rd-story-card, .rd-story-links, .rd-story-head, .rd-case-visual):focus-within,
    .rd :is(.rd-from-l, .rd-from-r) > :focus-within,
    .rd .rd-story :is(.rd-sc1, .rd-sc2, .rd-sc3, .rd-story-links):focus-within {
      animation: none; opacity: 1; translate: none; scale: none; filter: none; clip-path: none;
    }
  }
}
@media (max-width: 1023px) {
  .rd.rd-io .rd-tile.rd-rev-l:not(.rd-in), .rd.rd-io .rd-tile.rd-rev-r:not(.rd-in),
  .rd.rd-io .rd-card.rd-rev-l:not(.rd-in), .rd.rd-io .rd-card.rd-rev-r:not(.rd-in) { translate: 0 56px; }
}
/* Story head is already in when the section pins (no blank frame on approach) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) and (min-width: 1024px) and (min-height: 860px) {
    .rd .rd-story .rd-story-head { animation-range: entry 15% entry 85%; }
  }
}

/* =====================================================================
   v3 — FLOW, SPACING & SCROLL DECOR (user review round 1)
   ===================================================================== */

/* --- Horizontal scroll-progress bar, docked under the sticky nav --- */
.rd-progress-track, .rd-progress {
  position: fixed; left: 0; right: 0; top: 4rem; height: 3px; pointer-events: none; z-index: 51;
}
@media (min-width: 640px) { .rd-progress-track, .rd-progress { top: 5rem; } }
.rd-progress-track { background: linear-gradient(90deg, rgba(0, 112, 243, .12), rgba(0, 210, 255, .08)); }
.rd-progress {
  background: linear-gradient(90deg, var(--blue) 0%, var(--sky) 70%, var(--cyan) 100%);
  box-shadow: 0 0 10px rgba(0, 210, 255, .75), 0 0 22px rgba(0, 112, 243, .45);
  border-radius: 0 3px 3px 0;
}
.rd .rd-nav::after { display: none; }                   /* the bar replaces the scrolled hairline */
.rd body:has(#easter-egg-modal:not(.hidden)) :is(.rd-progress, .rd-progress-track) { opacity: 0; }

/* --- Hero: starts right under the nav, fits one screen --- */
.rd .rd-hero {
  min-height: 0; display: block;
  padding-top: calc(5rem + clamp(1.5rem, 5vh, 3.25rem));
  padding-bottom: clamp(2rem, 5vh, 3.5rem);
}
@media (max-width: 639px) { .rd .rd-hero { padding-top: calc(4rem + 1.75rem); } }
.rd .rd-hero-title { font-size: clamp(2.4rem, min(5.2vw, 8.4vh), 4.6rem); margin-bottom: 1.25rem; }
.rd .rd-hero-copy > p { margin-bottom: 1.75rem; }
.rd .rd-hero-copy > .flex-wrap { margin-bottom: 1.75rem; }
@keyframes rd-hero-copy-out { to { translate: -4vw -3vh; opacity: .32; } }
@keyframes rd-hero-vis-out  { to { translate: 4vw -7vh; scale: .92; rotate: 2deg; opacity: .4; } }

/* --- Tighter section rhythm (home) --- */
.rd .rd-projects, .rd .rd-story { padding-block: clamp(3rem, 6vw, 5rem); }
.rd .rd-sec-head { margin-bottom: clamp(2.25rem, 4.5vw, 3.75rem); }
.rd .rd-projects .space-y-16 > :not([hidden]) ~ :not([hidden]) { margin-top: clamp(2.5rem, 5vw, 4rem); }
.rd .rd-case { padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.rd .rd-projects .mt-16 { margin-top: 2rem; }
.rd .rd-cta { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(2rem, 4vw, 3rem); }
.rd .rd-cta-panel { padding-block: clamp(2rem, 4.5vw, 3.25rem); }
.rd .rd-cta-panel h2 { font-size: clamp(1.9rem, 3.8vw, 3.1rem); margin-bottom: 1rem; }
.rd .rd-cta-panel > p { margin-bottom: 1.75rem; }
.rd .rd-cta-panel > .flex-wrap { margin-bottom: 1.75rem; }
.rd .rd-footer { padding-block: 1.5rem; }

/* --- Scroll decor: parallax particle field (fills empty scroll with motion) --- */
.rd-bg__dots { position: absolute; left: 0; right: 0; top: 0; height: 320vh; pointer-events: none; will-change: translate; }
.rd-bg__dots--a {
  background-image: radial-gradient(circle, rgba(0, 210, 255, .55) 0 1px, transparent 1.6px);
  background-size: 140px 140px; opacity: .35;
}
.rd-bg__dots--b {
  background-image: radial-gradient(circle, rgba(0, 245, 212, .7) 0 1.2px, transparent 2px),
                    radial-gradient(circle, rgba(77, 163, 255, .6) 0 1px, transparent 1.8px);
  background-size: 310px 310px, 230px 230px; background-position: 40px 90px, 170px 20px; opacity: .45;
}
@keyframes rd-dots-a { to { translate: 0 -120vh; } }
@keyframes rd-dots-b { to { translate: 0 -210vh; } }

/* Orbit rings (same language as the hero geometry) */
.rd .rd-projects, .rd .rd-story, .rd .rd-cta { position: relative; overflow-x: clip; }
.rd .rd-projects::before, .rd .rd-story::before, .rd .rd-cta::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none; aspect-ratio: 1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400' fill='none' stroke='%2300d2ff'%3E%3Ccircle cx='200' cy='200' r='196' stroke-opacity='.35' stroke-dasharray='3 9'/%3E%3Ccircle cx='200' cy='200' r='150' stroke-opacity='.18'/%3E%3Cpath d='M200 0v40M200 360v40M0 200h40M360 200h40' stroke-opacity='.5'/%3E%3Ccircle cx='200' cy='4' r='4' fill='%2300f5d4' stroke='none'/%3E%3Ccircle cx='50' cy='200' r='3' fill='%234da3ff' stroke='none'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .55;
}
.rd .rd-projects::before { width: min(46vw, 560px); right: -12vw; top: 1rem; }
.rd .rd-story::before    { width: min(40vw, 480px); left: -14vw; top: 10%; }
.rd .rd-cta::before      { width: min(60vw, 720px); left: 50%; top: 50%; margin: calc(min(60vw, 720px) / -2) 0 0 calc(min(60vw, 720px) / -2); opacity: .35; }
@keyframes rd-orbit { from { rotate: -40deg; translate: 0 8vh; } to { rotate: 80deg; translate: 0 -8vh; } }

/* Data-packet trace under each case study */
.rd .rd-case::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--sky), var(--cyan), transparent) no-repeat;
  background-size: 28% 100%; background-position: -30% 0;
  filter: drop-shadow(0 0 6px rgba(0, 210, 255, .9));
}
@keyframes rd-packet { from { background-position: -30% 0; } to { background-position: 130% 0; } }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .rd-bg__dots--a { animation: rd-dots-a linear both; animation-timeline: scroll(root block); }
    .rd-bg__dots--b { animation: rd-dots-b linear both; animation-timeline: scroll(root block); }
    .rd .rd-projects::before, .rd .rd-story::before, .rd .rd-cta::before {
      animation: rd-orbit linear both; animation-timeline: view(); animation-range: cover 0% cover 100%;
    }
    .rd .rd-case::after { animation: rd-packet linear both; animation-timeline: view(); animation-range: entry 50% exit 50%; }

    /* ONE consistent reveal rhythm: start as the element crosses the bottom edge,
       settle after a fixed scroll distance (never later than ~28vh / 240px). */
    .rd .rd-rev-l, .rd .rd-rev-r, .rd .rd-rev-up,
    .rd .rd-from-l > *, .rd .rd-from-r > *, .rd .rd-cta-panel { animation-range: entry 0% entry min(28vh, 240px); }

    /* Case visual: settle once it is fully in view (was cover 38% -> finished after the title had left) */
    @keyframes rd-case-l {
      entry 0%   { opacity: 0; translate: calc(var(--shift) * -1) 0; }
      entry 100% { opacity: 1; translate: 0 0; }
      exit 20%   { opacity: 1; scale: 1; }
      exit 100%  { opacity: .4; scale: .96; }
    }
    @keyframes rd-case-r {
      entry 0%   { opacity: 0; translate: var(--shift) 0; }
      entry 100% { opacity: 1; translate: 0 0; }
      exit 20%   { opacity: 1; scale: 1; }
      exit 100%  { opacity: .4; scale: .96; }
    }
    .rd .rd-case-visual.rd-rev-l .rd-hud-box,
    .rd .rd-case-visual.rd-rev-r .rd-hud-box { animation-range: entry 0% entry 90%; }

    /* Pinned story: compact composition that fits under the nav, cards start while it docks */
    @media (min-width: 1024px) and (min-height: 700px) {
      .rd .rd-story { height: 250vh; padding: 0; view-timeline: --story block; }
      .rd .rd-story-inner {
        position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center;
        padding-top: calc(5rem + 1.5rem); padding-bottom: 1.5rem;
      }
      .rd .rd-story .rd-story-head { max-width: 62rem; margin-bottom: 1.75rem; animation: rd-in-up linear both; animation-timeline: --story; animation-range: entry 20% entry 80%; }
      .rd .rd-story .rd-story-head h2 { font-size: clamp(2rem, 3.2vw, 2.9rem); margin-bottom: .9rem; }
      .rd .rd-story .rd-story-head p { font-size: 1rem; line-height: 1.6; }
      .rd .rd-story .rd-story-grid { gap: 1.25rem; margin-bottom: 1.5rem; }
      .rd .rd-story .rd-story-card { padding: 1.5rem 1.6rem; }
      .rd .rd-story .rd-story-card > div > span:first-child { font-size: 2rem; margin-bottom: .75rem; }
      .rd .rd-story .rd-story-card h3 { font-size: 1.2rem; margin-bottom: .5rem; }
      .rd .rd-story .rd-story-links { padding-top: 1.25rem; gap: 1rem; }
      .rd .rd-story .rd-story-links > a { padding: 1rem 1.25rem; }
      .rd .rd-story .rd-story-grid::before { animation: rd-line linear both; animation-timeline: --story; animation-range: entry 75% contain 52%; }
      .rd .rd-story .rd-sc1 { animation: rd-in-l linear both;     animation-timeline: --story; animation-range: entry 70% contain 18%; }
      .rd .rd-story .rd-sc2 { animation: rd-in-scale linear both; animation-timeline: --story; animation-range: contain 14% contain 34%; }
      .rd .rd-story .rd-sc3 { animation: rd-in-r linear both;     animation-timeline: --story; animation-range: contain 30% contain 50%; }
      .rd .rd-story .rd-story-links { animation: rd-in-up linear both; animation-timeline: --story; animation-range: contain 46% contain 62%; }
    }
    /* (undo the earlier 760–859px un-pinning: the compact layout fits from 700px) */
    @media (min-width: 1024px) and (min-height: 700px) and (max-height: 859px) {
      .rd .rd-story { height: 250vh; padding: 0; view-timeline: --story block; }
      .rd .rd-story-inner { position: sticky; top: 0; height: 100vh; padding: calc(5rem + 1.5rem) 1rem 1.5rem; }
      .rd .rd-story .rd-story-grid::before { display: block; }
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .rd-bg__dots, .rd .rd-projects::before, .rd .rd-story::before, .rd .rd-cta::before, .rd .rd-case::after { animation: none !important; }
}
@media (max-width: 639px) {
  .rd .rd-projects::before, .rd .rd-story::before { width: 70vw; opacity: .3; }
}
/* v3.1 — pinned story docks right under the nav (no empty band above the head) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) and (min-width: 1024px) and (min-height: 700px) {
    .rd .rd-story .rd-story-inner { justify-content: flex-start; padding-top: calc(5rem + 2.25rem); }
    .rd .rd-story .rd-story-head { animation-range: entry 10% entry 60%; }
  }
}
/* v3.2 — last block of a page always has enough scroll left to finish its reveal */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .rd .rd-page > .rd-rev-up:last-child, .rd .rd-page > :last-child .rd-rev-up,
    .rd .rd-page > :last-child > .rd-rev-l, .rd .rd-page > :last-child > .rd-rev-r { animation-range: entry 0% entry 100%; }
  }
}

/* ===================== v2.2.0 — SKILLS (About) ===================== */
/* Markup is generated by tools/content.py (skills_html) from layer/content/skills.json */
.rd .rd-skills { position: relative; overflow-x: clip; overflow-clip-margin: 24px; }  /* lateral reveals must not create horizontal scroll on phones */
.rd .rd-skills__eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; margin-bottom: .75rem;
  font: 600 .7rem/1 var(--font-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--cyan);
}
.rd .rd-skills__eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.rd .rd-skills h2 { font-family: var(--font-display); letter-spacing: -.02em; }
.rd .rd-skills__lead { max-width: 60ch; margin: 0 0 2rem; color: var(--ink-2); line-height: 1.65; }
.rd .rd-skills__grid { display: grid; gap: 1rem; }
.rd .rd-skills__group {
  display: grid; gap: 1rem 1.5rem; padding: 1.25rem; border-radius: 1.1rem;
  border: 1px solid var(--hair-soft);
}
@media (min-width: 768px) {
  .rd .rd-skills__group { grid-template-columns: 13.5rem 1fr; align-items: start; padding: 1.5rem 1.75rem; }
}
.rd .rd-skills__title {
  display: flex; align-items: baseline; gap: .75rem; margin: 0;
  font: 600 1.02rem/1.35 var(--font-display); color: var(--ink-1); letter-spacing: -.01em;
}
.rd .rd-skills__idx { font: 600 .72rem/1 var(--font-mono); color: var(--sky); letter-spacing: .08em; }
.rd .rd-skills__list { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.rd .rd-skill {
  --c: var(--sky);
  display: inline-flex; align-items: center; gap: .5rem; min-height: 2.25rem; padding: .4rem .75rem .4rem .5rem;
  border: 1px solid rgba(255, 255, 255, .07); border-radius: .7rem;
  background: rgba(19, 19, 26, .72); color: var(--ink-2);
  font: 500 .84rem/1 Inter, -apple-system, "Segoe UI", sans-serif;
  transition: border-color .25s ease, color .25s ease, translate .25s var(--ease-out), box-shadow .25s ease;
}
.rd .rd-skill__ico { flex: none; width: 1.15rem; height: 1.15rem; fill: currentColor; color: var(--ink-3); transition: color .25s ease; }
.rd .rd-skill__mono {
  display: inline-grid; place-items: center; border: 1px solid currentColor; border-radius: .35rem;
  font: 700 .5rem/1 var(--font-mono); letter-spacing: -.02em;
}
.rd .rd-skill:hover {
  color: var(--ink-1); translate: 0 -2px;
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
  box-shadow: 0 8px 24px -14px var(--c);
}
.rd .rd-skill:hover .rd-skill__ico { color: var(--c); }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes rd-chip { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
    .rd .rd-skills__list > li { animation: rd-chip linear both; animation-timeline: view(); animation-range: entry 0% entry min(22vh, 200px); }
    .rd .rd-skills__eyebrow::before { animation: rd-line linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; transform-origin: 0 50%; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .rd .rd-skills__list > li, .rd .rd-skill { animation: none !important; translate: none !important; transition: none !important; }
}
@media (forced-colors: active) { .rd .rd-skill { border-color: CanvasText; } .rd .rd-skill__ico { color: CanvasText; } }

/* ===================== v2.2.0 — PERF (mobile paint budget) ===================== */
@media (max-width: 639px) {
  .rd-bg__dots--b { display: none; }                 /* one particle layer is enough on phones */
}
@media (max-width: 639px) and (prefers-reduced-transparency: no-preference) {
  .rd .rd-nav { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
}

/* v2.2.0 — blocks already visible on the first screen skip their scroll reveal (see scroll-fx initFoldStatic) */
.rd .rd-static { animation: none !important; opacity: 1; translate: none; scale: none; filter: none; clip-path: none; }
/* v2.2.0 — mobile hero: keep the rise, drop the long fade (Speed Index / LCP on phones). Desktop unchanged. */
@media (max-width: 1023px) and (prefers-reduced-motion: no-preference) {
  .rd .rd-hero .rd-enter { animation-name: rd-title-in; animation-duration: .8s; animation-delay: calc(var(--d, 0) * 60ms); }
  .rd .rd-hero .rd-enter-r { animation-name: rd-enter-r-sm; animation-duration: .8s; animation-delay: 120ms; }
}
@keyframes rd-enter-r-sm { from { translate: 36px 0; scale: .97; } to { translate: 0 0; scale: 1; } }


/* ===================== 12. v2.3.0 — MODULAR IDENTITY & SAAS HUB ===================== */
/* Modern Web Guidance: defer-rendering-heavy-content (strictly below the fold), card container queries + stretched-link, opt-in reduced-motion */
.rd .rd-hub {
  position: relative;
  padding: clamp(4.5rem, 7vw, 6.5rem) 0;
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 780px;
}
.rd .rd-hub__head {
  display: flex; flex-direction: column; gap: 1.5rem;
  margin-bottom: 2.25rem;
}
@media (min-width: 1024px) {
  .rd .rd-hub__head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}
.rd .rd-hub__head-copy { max-width: 48rem; }
.rd .rd-hub__title {
  margin: 0 0 .85rem;
  font: 800 clamp(1.75rem, 3.2vw, 2.75rem)/1.12 var(--font-display);
  letter-spacing: -.025em; color: var(--ink-1);
}
.rd .rd-hub__lead { margin: 0; color: var(--ink-2); font-size: 1.03rem; line-height: 1.65; }
.rd .rd-studio-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 44px; padding: .8rem 1.4rem; border-radius: .8rem;
  background: linear-gradient(135deg, var(--sky), var(--cyan));
  color: #060911; font: 700 .88rem/1 var(--font-display); text-decoration: none;
  box-shadow: 0 0 24px rgba(0, 210, 255, .28);
  transition: box-shadow .2s ease, filter .2s ease;
}
.rd .rd-studio-btn:hover { filter: brightness(1.08); box-shadow: 0 0 32px rgba(0, 245, 212, .42); }
.rd .rd-studio-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* Billing mode toggle bar */
.rd .rd-billing-bar {
  display: flex; flex-direction: column; gap: .9rem;
  padding: 1rem 1.25rem; margin-bottom: 2rem; border-radius: 1rem;
  border: 1px solid var(--hair-soft);
}
@media (min-width: 900px) {
  .rd .rd-billing-bar { flex-direction: row; align-items: center; justify-content: space-between; }
}
.rd .rd-billing-bar__label { font: 600 .78rem/1.4 var(--font-mono); color: var(--ink-3); }
.rd .rd-billing-bar__group { display: flex; flex-wrap: wrap; gap: .5rem; }
.rd .rd-term-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: 44px; padding: .5rem .85rem; border-radius: .7rem;
  border: 1px solid var(--hair); background: rgba(14, 13, 21, .75);
  color: var(--ink-2); font: 600 .75rem/1 var(--font-mono); cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.rd .rd-term-btn:hover { border-color: var(--sky); color: var(--ink-1); }
.rd .rd-term-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.rd .rd-term-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, rgba(0, 112, 243, .28), rgba(0, 210, 255, .22));
  border-color: var(--cyan); color: var(--ink-1);
  box-shadow: 0 0 18px rgba(0, 210, 255, .22);
}
.rd .rd-term-badge {
  padding: .18rem .4rem; border-radius: .35rem;
  background: rgba(0, 245, 212, .14); color: var(--cyan); font-size: .65rem;
}

/* 4-Tier Identity Grid */
.rd .rd-plan-grid {
  display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-bottom: 2rem;
}
@media (min-width: 640px) { .rd .rd-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .rd .rd-plan-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.rd .rd-plan-card {
  container-type: inline-size;
  display: grid; grid-template-rows: auto auto 1fr auto; gap: 1rem;
  padding: 1.35rem; border-radius: 1.1rem; border: 1px solid var(--hair-soft);
}
.rd .rd-plan-card--popular {
  border-color: rgba(0, 210, 255, .52);
  box-shadow: 0 0 28px rgba(0, 112, 243, .16);
}
.rd .rd-plan-pill {
  display: inline-flex; align-items: center; padding: .28rem .65rem; margin-bottom: .75rem;
  border-radius: 999px; border: 1px solid var(--hair);
  background: rgba(0, 112, 243, .12); color: var(--sky); font: 600 .68rem/1 var(--font-mono);
}
.rd .rd-plan-card--popular .rd-plan-pill {
  background: rgba(0, 245, 212, .14); border-color: rgba(0, 245, 212, .4); color: var(--cyan);
}
.rd .rd-plan-card__title {
  margin: 0; font: 700 1.18rem/1.25 var(--font-display); color: var(--ink-1); letter-spacing: -.015em;
}
.rd .rd-plan-card__price-box {
  padding-bottom: .95rem; border-bottom: 1px solid var(--hair-soft);
}
.rd .rd-plan-card__price {
  font: 800 1.4rem/1.2 var(--font-mono); color: var(--cyan); font-variant-numeric: tabular-nums;
}
.rd .rd-plan-card__sub { margin: .3rem 0 0; font: 600 .75rem/1.35 var(--font-mono); color: var(--ink-2); }
.rd .rd-plan-card__ren { margin: .3rem 0 0; font: 500 .7rem/1.35 var(--font-mono); color: var(--ink-3); }
.rd .rd-plan-card__body { display: grid; align-content: start; gap: .85rem; }
.rd .rd-plan-card__aud { margin: 0; font-size: .86rem; line-height: 1.55; color: var(--ink-2); }
.rd .rd-plan-card__list { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; font-size: .8rem; color: var(--ink-2); }
.rd .rd-plan-card__list li { display: flex; align-items: flex-start; gap: .45rem; line-height: 1.45; }
.rd .rd-chk { color: var(--cyan); font-weight: 700; flex: none; }
.rd .rd-plan-card__foot {
  padding-top: .95rem; border-top: 1px solid var(--hair-soft); display: grid; gap: .75rem;
}
.rd .rd-plan-card__limit { margin: 0; font: 500 .7rem/1.4 var(--font-mono); color: var(--ink-3); }
.rd .rd-plan-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .6rem 1rem; border-radius: .75rem;
  border: 1px solid var(--hair); background: rgba(14, 13, 21, .8);
  color: var(--ink-1); font: 600 .76rem/1 var(--font-mono); text-decoration: none;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.rd .rd-plan-cta:hover { background: var(--sky); border-color: var(--sky); color: #060911; }
.rd .rd-plan-cta:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* 6 Zero-Cost Differentiators */
.rd .rd-diff-box {
  padding: 1.5rem; border-radius: 1.1rem; border: 1px solid var(--hair-soft);
}
.rd .rd-diff-box__head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem;
  margin-bottom: 1.15rem;
}
.rd .rd-diff-box__head h3 { margin: 0; font: 700 .82rem/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--sky); }
.rd .rd-diff-box__head span { font: 500 .74rem/1 var(--font-mono); color: var(--ink-3); }
.rd .rd-diff-grid { display: grid; grid-template-columns: 1fr; gap: .85rem; }
@media (min-width: 768px) { .rd .rd-diff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .rd .rd-diff-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rd .rd-diff-item {
  display: flex; align-items: flex-start; gap: .75rem; padding: .85rem; border-radius: .85rem;
  border: 1px solid rgba(255, 255, 255, .06); background: rgba(8, 8, 15, .65);
}
.rd .rd-diff-idx {
  display: inline-grid; place-items: center; width: 1.85rem; height: 1.85rem; border-radius: .5rem; flex: none;
  border: 1px solid var(--hair); background: rgba(0, 112, 243, .12); color: var(--sky);
  font: 700 .72rem/1 var(--font-mono); font-variant-numeric: tabular-nums;
}
.rd .rd-diff-title { margin: 0 0 .25rem; font: 600 .88rem/1.3 var(--font-display); color: var(--ink-1); }
.rd .rd-diff-desc { margin: 0; font-size: .78rem; line-height: 1.45; color: var(--ink-3); }

/* Modular SaaS Bento Grid (Modern Web Guidance: card container queries + stretched-link) */
.rd .rd-svc-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 768px) { .rd .rd-svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rd .rd-svc-card {
  container-type: inline-size; position: relative;
  display: grid; grid-template-rows: auto auto 1fr auto; gap: 1rem;
  padding: 1.5rem; border-radius: 1.1rem; border: 1px solid var(--hair-soft);
}
.rd .rd-svc-card:has(a.rd-card-link) a:not(.rd-card-link),
.rd .rd-svc-card:has(a.rd-card-link) button { position: relative; z-index: 1; }
.rd .rd-svc-card a.rd-card-link { color: inherit; text-decoration: none; }
.rd .rd-svc-card a.rd-card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.rd .rd-svc-card a.rd-card-link:focus-visible { outline: none; }
.rd .rd-svc-card:has(a.rd-card-link:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 2px; }

.rd .rd-svc-card__head { display: flex; flex-direction: column; gap: .75rem; }
@container (min-width: 26rem) {
  .rd .rd-svc-card__head { flex-direction: row; align-items: center; justify-content: space-between; }
  .rd .rd-svc-card__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.rd .rd-svc-card__badges { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.rd .rd-svc-cat {
  padding: .28rem .55rem; border-radius: .45rem; border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(14, 13, 21, .75); font: 600 .68rem/1 var(--font-mono); color: var(--ink-2);
}
.rd .rd-svc-status {
  display: inline-flex; align-items: center; gap: .38rem; padding: .28rem .6rem;
  border-radius: 999px; border: 1px solid var(--hair); font: 600 .68rem/1 var(--font-mono); color: var(--cyan);
}
.rd .rd-svc-status__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); }
.rd .rd-svc-card[data-status="beta"] .rd-svc-status { color: var(--sky); }
.rd .rd-svc-card[data-status="beta"] .rd-svc-status__dot { background: var(--sky); }
.rd .rd-svc-card[data-status="building"] .rd-svc-status { color: #fbbf24; border-color: rgba(251, 191, 36, .35); }
.rd .rd-svc-card[data-status="building"] .rd-svc-status__dot { background: #fbbf24; }
.rd .rd-svc-card__metric { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.rd .rd-svc-card__metric strong { display: block; font-size: .88rem; color: var(--sky); }
.rd .rd-svc-card__metric span { display: block; font-size: .68rem; color: var(--ink-3); }
.rd .rd-svc-card__title { margin: 0; font: 700 1.4rem/1.2 var(--font-display); color: var(--ink-1); }
.rd .rd-svc-card__sub { display: block; margin-top: .3rem; font: 500 .74rem/1.3 var(--font-mono); color: var(--ink-3); }
.rd .rd-svc-card__body p { margin: 0 0 .9rem; font-size: .92rem; line-height: 1.6; color: var(--ink-2); }
.rd .rd-svc-card__list { display: grid; gap: .45rem .85rem; margin: 0; padding: 0; list-style: none; font: 500 .76rem/1.4 var(--font-mono); color: var(--ink-3); }
.rd .rd-svc-card__list li { display: flex; align-items: center; gap: .45rem; }
.rd .rd-svc-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--sky); flex: none; }
.rd .rd-svc-card__foot {
  padding-top: .95rem; border-top: 1px solid var(--hair-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.rd .rd-svc-cta { font: 700 .78rem/1 var(--font-mono); color: var(--cyan); }
.rd .rd-svc-inquire {
  display: inline-flex; align-items: center; min-height: 36px; padding: .4rem .8rem;
  border-radius: .55rem; border: 1px solid var(--hair); background: rgba(14, 13, 21, .85);
  color: var(--ink-2); font: 600 .72rem/1 var(--font-mono); text-decoration: none;
  transition: border-color .2s ease, color .2s ease;
}
.rd .rd-svc-inquire:hover { border-color: var(--cyan); color: var(--ink-1); }

@media (prefers-reduced-motion: no-preference) {
  .rd .rd-plan-card, .rd .rd-svc-card {
    transition: transform .22s var(--ease-out), border-color .22s ease, box-shadow .22s ease;
  }
  .rd .rd-plan-card:hover, .rd .rd-svc-card:hover {
    transform: translateY(-3px);
    border-color: var(--hair-strong);
  }
}


/* ===================== 13. v2.4.0 — CURRENCY TOGGLE & CUSTOM ENGINES ===================== */
.rd .rd-billing-bar__left {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem;
}
.rd .rd-currency-group {
  display: inline-flex; align-items: center; gap: .25rem; padding: .25rem;
  border-radius: .65rem; border: 1px solid var(--hair-soft); background: rgba(8, 8, 15, .85);
}
.rd .rd-cur-btn {
  min-height: 36px; padding: .35rem .65rem; border-radius: .45rem;
  border: 1px solid transparent; background: transparent; color: var(--ink-3);
  font: 700 .72rem/1 var(--font-mono); cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.rd .rd-cur-btn:hover { color: var(--ink-1); }
.rd .rd-cur-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.rd .rd-cur-btn[aria-pressed="true"] {
  background: rgba(0, 210, 255, .16); border-color: rgba(0, 210, 255, .45); color: var(--cyan);
}

/* Anonymized Custom Software Engines Grid */
.rd .rd-engines-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 768px) { .rd .rd-engines-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rd .rd-engine-card {
  container-type: inline-size; position: relative;
  display: grid; grid-template-rows: auto auto 1fr auto; gap: 1rem;
  padding: 1.5rem; border-radius: 1.1rem; border: 1px solid var(--hair-soft);
}
.rd .rd-engine-card__head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem;
}
.rd .rd-eng-privacy {
  font: 600 .68rem/1 var(--font-mono); color: var(--cyan);
  padding: .28rem .55rem; border-radius: 999px; border: 1px solid rgba(0, 245, 212, .28);
  background: rgba(0, 245, 212, .08);
}
.rd .rd-engine-card__title {
  margin: 0; font: 700 1.32rem/1.22 var(--font-display); color: var(--ink-1); letter-spacing: -.015em;
}
.rd .rd-engine-card__body { display: grid; align-content: start; gap: .9rem; }
.rd .rd-engine-card__body p { margin: 0; font-size: .9rem; line-height: 1.6; color: var(--ink-2); }
.rd .rd-engine-card__foot {
  padding-top: .95rem; border-top: 1px solid var(--hair-soft);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
}
.rd .rd-eng-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.rd .rd-eng-chip {
  padding: .26rem .55rem; border-radius: .45rem; border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(8, 8, 15, .75); font: 600 .68rem/1 var(--font-mono); color: var(--ink-3);
}
@media (prefers-reduced-motion: no-preference) {
  .rd .rd-engine-card {
    transition: transform .22s var(--ease-out), border-color .22s ease, box-shadow .22s ease;
  }
  .rd .rd-engine-card:hover {
    transform: translateY(-3px);
    border-color: var(--hair-strong);
  }
}


/* ===================== 14. v2.5.0 — OPERATIONAL SOFTWARE & LIVE DEMO SHOWCASE ===================== */
.rd .rd-demo-frame {
  display: block; overflow: hidden; border-radius: .85rem;
  border: 1px solid rgba(0, 210, 255, .24); background: #070a12;
  box-shadow: 0 18px 42px -24px rgba(0, 112, 243, .45);
  transition: border-color .25s ease, transform .25s var(--ease-out), box-shadow .25s ease;
}
.rd .rd-demo-frame:hover {
  border-color: var(--cyan);
  box-shadow: 0 24px 52px -22px rgba(0, 245, 212, .38);
}
.rd .rd-demo-frame__bar {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .48rem .75rem; border-bottom: 1px solid rgba(255, 255, 255, .07);
  background: rgba(13, 17, 29, .95);
  font: 600 .66rem/1 var(--font-mono); color: var(--ink-3);
}
.rd .rd-demo-frame__dots { display: inline-flex; align-items: center; gap: .32rem; }
.rd .rd-demo-frame__dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(131, 140, 160, .45); }
.rd .rd-demo-frame__dots i:first-child { background: #f43f5e; }
.rd .rd-demo-frame__dots i:nth-child(2) { background: #f59e0b; }
.rd .rd-demo-frame__dots i:nth-child(3) { background: #00f5d4; }
.rd .rd-demo-frame__url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sky); }
.rd .rd-demo-frame__live {
  padding: .18rem .45rem; border-radius: 999px;
  border: 1px solid rgba(0, 245, 212, .35); background: rgba(0, 245, 212, .12);
  color: var(--cyan); font-size: .62rem; flex: none;
}
.rd .rd-demo-frame__img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover;
}
.rd .rd-demo-industries { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-bottom: 1rem; }
.rd .rd-demo-ind-label {
  font: 600 .68rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-right: .25rem;
}
.rd .rd-demo-ind-chip {
  padding: .28rem .58rem; border-radius: 999px;
  border: 1px solid rgba(0, 210, 255, .24); background: rgba(0, 112, 243, .1);
  color: var(--ink-2); font: 600 .72rem/1 var(--font-mono);
}
.rd .rd-demo-intel { display: grid; gap: .48rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.rd .rd-demo-intel li { display: flex; align-items: flex-start; gap: .55rem; font-size: .88rem; line-height: 1.5; color: var(--ink-2); }
.rd .rd-demo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.rd .rd-demo-btn-primary {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .65rem 1.15rem;
  border-radius: .75rem; background: linear-gradient(120deg, var(--blue), var(--sky) 60%, var(--cyan));
  color: #050811; font: 700 .84rem/1 var(--font-display); text-decoration: none;
  box-shadow: 0 0 24px rgba(0, 210, 255, .26); transition: filter .2s ease, transform .2s ease;
}
.rd .rd-demo-btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.rd .rd-projects-archive-grid {
  display: grid; grid-template-columns: 1fr; gap: 1.35rem; align-items: center;
}
@media (min-width: 768px) {
  .rd .rd-projects-archive-grid { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 1.75rem; }
}


/* ===================== 15. v2.6.3 - MOBILE DRAWER, REVEAL & SPOTLIGHT FIXES ===================== */
/* Opaque full-height mobile drawer so hero text never bleeds through */
.rd #mobile-menu {
  background: #08080f !important;
  min-height: calc(100dvh - 4rem);
  border-bottom: 1px solid var(--hair);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .95);
  z-index: 60;
  overscroll-behavior: contain;
}

/* Above-the-fold page-head and hero-copy elements start at opacity: 1 immediately */
@keyframes rd-enter-vis {
  from { opacity: 1; translate: 0 10px; }
  to { opacity: 1; translate: 0 0; }
}
.rd .rd-page-head .rd-enter,
.rd .rd-hero-copy .rd-enter {
  animation-name: rd-enter-vis;
  animation-duration: .45s;
  animation-delay: 0ms;
}

/* Reticle & Contrast polish */
.rd .rd-hero-deco svg { opacity: .42; }
html.rd { --ink-3: #a0aabf; }
.rd .rd-svc-card__sub,
.rd .rd-demo-ind-label { color: #a0aabf; }

/* Web Studio Spotlight card */
.rd .rd-hub--identity { contain-intrinsic-size: auto none auto 380px; }
.rd .rd-studio-spotlight {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem 2.5rem;
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  border-radius: 1.25rem;
  border: 1px solid var(--hair);
}
@media (min-width: 900px) {
  .rd .rd-studio-spotlight {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, .95fr);
    align-items: center;
  }
}
.rd .rd-studio-spotlight__main {
  display: grid;
  gap: 1rem;
  align-content: start;
}
.rd .rd-studio-spotlight__main .rd-skills__eyebrow { margin-bottom: 0; }
.rd .rd-studio-spotlight__main .rd-hub__title {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2.8vw, 2.3rem);
}
.rd .rd-studio-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: .35rem;
}
.rd .rd-studio-stat {
  display: inline-flex;
  align-items: baseline;
  gap: .45rem;
  padding: .5rem .8rem;
  border-radius: .65rem;
  border: 1px solid var(--hair-soft);
  background: rgba(8, 8, 15, .72);
}
.rd .rd-studio-stat strong {
  font: 700 .88rem/1 var(--font-mono);
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}
.rd .rd-studio-stat span {
  font: 500 .72rem/1 var(--font-mono);
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.rd .rd-studio-spotlight__aside {
  display: grid;
  gap: 1.25rem;
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid var(--hair-soft);
  background: rgba(8, 8, 15, .62);
}
.rd .rd-studio-list {
  display: grid;
  gap: .65rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .86rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.rd .rd-studio-list li {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
}
.rd .rd-studio-spotlight__cta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}
.rd .rd-studio-spotlight__cta .rd-studio-btn { width: 100%; }

/* Contact page email actions & Copy Email button */
.rd .rd-mail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  flex-shrink: 0;
}
.rd .rd-copy-mail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 44px;
  padding: .55rem .95rem;
  border-radius: .75rem;
  border: 1px solid var(--hair);
  background: rgba(14, 13, 21, .85);
  color: var(--ink-2);
  font: 600 .76rem/1 var(--font-mono);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.rd .rd-copy-mail-btn:hover { border-color: var(--cyan); color: var(--ink-1); }
.rd .rd-copy-mail-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.rd .rd-copy-mail-btn[data-copied="true"] {
  border-color: var(--cyan);
  background: rgba(0, 245, 212, .12);
  color: var(--cyan);
}
