/* ============================================
   Antonio Valério — Portfólio
   Design system: dark navy + electric blue neon
   ============================================ */

:root {
  /* Core palette — derived from LinkedIn banner */
  --bg-deep: #050d1f;
  --bg-panel: #0a1730;
  --bg-elev: #0f2040;
  --line: rgba(59, 130, 246, 0.18);
  --line-strong: rgba(59, 130, 246, 0.4);

  --blue: #3b82f6;
  --blue-bright: #5b9dff;
  --blue-glow: #2563eb;
  --cyan: #38bdf8;

  --text: #e8eefb;
  --text-soft: #aab8d4;
  --text-mute: #6b7a99;

  --neon-shadow: 0 0 18px rgba(59, 130, 246, 0.45);
  --neon-shadow-soft: 0 0 30px rgba(37, 99, 235, 0.25);

  --maxw: 1180px;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  /* Material Design 3 motion tokens */
  --m3-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --m3-emphasized-decel: cubic-bezier(0.05, 0.7, 0.1, 1);
  --m3-emphasized-accel: cubic-bezier(0.3, 0, 0.8, 0.15);
  --m3-standard: cubic-bezier(0.2, 0, 0, 1);
  --dur-long: 0.55s;
  --dur-med: 0.4s;
  --dur-short: 0.25s;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: 'Sora', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient background texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(37, 99, 235, 0.14) 0%, transparent 38%),
    radial-gradient(circle at 88% 75%, rgba(56, 189, 248, 0.08) 0%, transparent 42%);
  pointer-events: none;
  z-index: 0;
}

.dots {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(59, 130, 246, 0.09) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
  z-index: 0;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.6), transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.6), transparent 70%);
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Sora', sans-serif;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(5, 13, 31, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand .mark {
  width: 3px;
  height: 26px;
  background: var(--blue);
  border-radius: 2px;
  box-shadow: var(--neon-shadow);
}
.brand b { color: var(--blue-bright); font-weight: 600; }
.nav-links {
  display: flex;
  gap: 6px;
  align-items: center;
}
.nav-links a {
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-soft);
  border-radius: 9px;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
  position: relative;
}
.nav-links a:hover { color: var(--text); background: rgba(59, 130, 246, 0.08); }
.nav-links a.active { color: var(--blue-bright); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: 2px;
  height: 2px;
  background: var(--blue);
  border-radius: 2px;
  box-shadow: var(--neon-shadow);
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--text);
  width: 42px; height: 42px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 20px;
  align-items: center;
  justify-content: center;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.lang-switch {
  display: flex;
  gap: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 3px;
  flex-shrink: 0;
}
.lang-btn {
  background: none;
  border: none;
  color: var(--text-soft);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 6px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active {
  color: #fff;
  background: var(--blue);
  box-shadow: var(--neon-shadow);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.3s var(--ease), background 0.25s var(--ease);
  font-family: inherit;
}
.btn-primary {
  background: var(--blue-glow);
  color: #fff;
  box-shadow: var(--neon-shadow-soft);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(59, 130, 246, 0.6);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: var(--neon-shadow);
}

/* ============================================
   Section primitives
   ============================================ */
.section { padding: 96px 0; position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-bright);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--blue);
  box-shadow: var(--neon-shadow);
}
.section-title {
  font-size: clamp(28px, 4vw, 44px);
  margin-bottom: 16px;
}
.section-sub {
  color: var(--text-soft);
  max-width: 560px;
  font-size: 17px;
}

/* ============================================
   Scroll reveal
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 40px;
  position: relative;
  z-index: 1;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 30px;
}
.footer h4 { font-size: 20px; margin-bottom: 8px; }
.footer p { color: var(--text-mute); font-size: 14px; max-width: 320px; }
.footer-social { display: flex; gap: 12px; margin-top: 4px; }
.footer-social a {
  width: 42px; height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-soft);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.3s var(--ease), transform 0.25s var(--ease);
}
.footer-social a:hover {
  color: var(--blue-bright);
  border-color: var(--blue);
  box-shadow: var(--neon-shadow);
  transform: translateY(-2px);
}
.footer-bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-mute);
  font-size: 13px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav-right { gap: 8px; }
  .lang-btn { padding: 6px 9px; font-size: 11px; }
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(7, 17, 38, 0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    padding: 8px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s var(--ease);
  }
  .nav-links.open { max-height: 320px; }
  .nav-links a { padding: 14px 16px; }
  .nav-links a.active::after { display: none; }
  .section { padding: 68px 0; }
}

/* ============================================
   HERO (home)
   ============================================ */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
#netCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.9;
}
.hero-inner { position: relative; z-index: 2; max-width: 880px; }
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 28px;
  background: rgba(10, 23, 48, 0.6);
}
.hero-tag .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}
.hero h1 {
  font-size: clamp(38px, 7vw, 76px);
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}
.hero h1 .glow {
  color: var(--blue-bright);
  text-shadow: 0 0 26px rgba(59, 130, 246, 0.55);
}
.hero-lead {
  font-size: clamp(17px, 2.2vw, 21px);
  color: var(--text-soft);
  max-width: 620px;
  margin-bottom: 36px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-scroll {
  position: absolute;
  bottom: 34px; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: var(--text-mute);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.hero-scroll .line {
  width: 1px; height: 38px;
  background: linear-gradient(var(--blue), transparent);
  animation: scrolldown 2.2s infinite;
}
@keyframes scrolldown {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* Metrics strip */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.metric {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 24px;
  text-align: center;
}
.metric .num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 600;
  color: var(--blue-bright);
  text-shadow: 0 0 22px rgba(59, 130, 246, 0.4);
  line-height: 1;
}
.metric .lbl { color: var(--text-soft); font-size: 14px; margin-top: 10px; }

/* Two-track home pillars */
.tracks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.track {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  transition: border-color 0.3s var(--ease), box-shadow 0.4s var(--ease), transform 0.3s var(--ease);
}
.track.linked:hover {
  border-color: var(--line-strong);
  box-shadow: var(--neon-shadow-soft);
  transform: translateY(-4px);
}
.track .ico {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue-bright);
  margin-bottom: 22px;
}
.track h3 { font-size: 23px; margin-bottom: 12px; }
.track p { color: var(--text-soft); font-size: 15px; margin-bottom: 20px; }
.track .tlist { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.track .tlist li {
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-soft);
}
.track .more {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 22px;
  color: var(--blue-bright);
  font-size: 15px;
  font-weight: 500;
  transition: gap 0.25s var(--ease);
}
.track.linked:hover .more { gap: 14px; }

/* ============================================
   PROJECTS
   ============================================ */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 40px; }
.chip {
  padding: 9px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  background: transparent;
  color: var(--text-soft);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--blue); }
.chip.active {
  color: #fff;
  background: var(--blue-glow);
  border-color: var(--blue-glow);
  box-shadow: var(--neon-shadow-soft);
}
.proj-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}
.proj {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s var(--ease), box-shadow 0.4s var(--ease), transform 0.3s var(--ease);
}
.proj:hover {
  border-color: var(--line-strong);
  box-shadow: var(--neon-shadow-soft);
  transform: translateY(-5px);
}
/* media slot — for screen recordings / GIFs */
.proj-media {
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(135deg, var(--bg-elev), var(--bg-panel));
  border-bottom: 1px solid var(--line);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.proj-media img, .proj-media video {
  width: 100%; height: 100%; object-fit: cover;
}
.proj-media .placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-mute);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.proj-media .placeholder .pico {
  width: 56px; height: 56px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--blue);
  font-size: 24px;
}
.proj-media .scanline {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  opacity: 0.6;
  animation: scan 4s linear infinite;
}
@keyframes scan {
  0% { transform: translateY(0); }
  100% { transform: translateY(260px); }
}
.proj-body { padding: 26px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.proj-cat {
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--blue-bright);
}
.proj-body h3 { font-size: 21px; }
.proj-body p { color: var(--text-soft); font-size: 15px; flex: 1; }
.proj-stack { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.proj-stack span {
  font-size: 12px; padding: 5px 11px;
  border: 1px solid var(--line); border-radius: 7px; color: var(--text-mute);
}

/* ============================================
   ABOUT
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
  align-items: start;
}
.about-portrait {
  position: sticky;
  top: 100px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 8px;
  background: var(--bg-panel);
}
.about-portrait .frame {
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--bg-elev), var(--bg-deep));
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute);
  font-size: 13px;
  text-align: center;
  overflow: hidden;
}
.about-portrait .frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.about-lead {
  font-size: clamp(19px, 2.6vw, 26px);
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.4;
  margin-bottom: 24px;
}
.about-lead .glow { color: var(--blue-bright); }
.about-body p { color: var(--text-soft); margin-bottom: 18px; font-size: 16px; }

/* Timeline */
.timeline { margin-top: 12px; border-left: 1px solid var(--line-strong); padding-left: 28px; }
.tl-item { position: relative; padding-bottom: 34px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -34px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid var(--blue);
  box-shadow: var(--neon-shadow);
}
.tl-item .when { font-size: 13px; color: var(--blue-bright); letter-spacing: 0.06em; }
.tl-item h4 { font-size: 18px; margin: 4px 0 6px; }
.tl-item p { color: var(--text-soft); font-size: 14px; margin: 0; }

/* Skill clusters */
.cluster-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.cluster h4 {
  font-size: 15px; color: var(--blue-bright);
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 14px;
}
.cluster .tags { display: flex; flex-wrap: wrap; gap: 8px; }
.cluster .tags span {
  font-size: 13px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--text-soft);
}

/* ============================================
   CONTACT + FEEDBACK
   ============================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 14px; color: var(--text-soft); margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 13px 15px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.25s var(--ease), box-shadow 0.3s var(--ease);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: var(--neon-shadow);
}
.field textarea { resize: vertical; min-height: 130px; }
.contact-direct { display: flex; flex-direction: column; gap: 16px; }
.contact-row {
  display: flex; align-items: center; gap: 16px;
  padding: 18px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.contact-row .ci {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 10px;
  background: rgba(59,130,246,0.12);
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue-bright);
}
.contact-row .small { font-size: 13px; color: var(--text-mute); }
.contact-row .big { font-size: 15px; }
a.contact-row { transition: border-color 0.25s var(--ease), box-shadow 0.3s var(--ease), transform 0.25s var(--ease); }
a.contact-row:hover { border-color: var(--blue); box-shadow: var(--neon-shadow); transform: translateY(-2px); }

/* Feedback carousel */
.fb-track {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 16px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.fb-track::-webkit-scrollbar { display: none; }
.fb-card {
  scroll-snap-align: start;
  flex: 0 0 min(440px, 84%);
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
}
.fb-card .quote { font-size: 40px; color: var(--blue); line-height: 0.5; font-family: 'Space Grotesk'; }
.fb-card .text { color: var(--text); font-size: 16px; margin: 18px 0 22px; }
.fb-who { display: flex; align-items: center; gap: 14px; }
.fb-who .av {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(140deg, var(--blue-glow), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; color: #fff; font-size: 17px;
}
.fb-who .nm { font-size: 15px; font-weight: 500; }
.fb-who .rl { font-size: 13px; color: var(--text-mute); }
.fb-dots { display: flex; gap: 8px; justify-content: center; margin-top: 24px; }
.fb-dot {
  width: 9px; height: 9px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  transition: background 0.25s var(--ease), box-shadow 0.3s var(--ease);
}
.fb-dot.active { background: var(--blue); box-shadow: var(--neon-shadow); border-color: var(--blue); }

/* Page header (inner pages) */
.page-head { padding: 80px 0 20px; position: relative; z-index: 1; }
.page-head h1 { font-size: clamp(34px, 6vw, 60px); margin-bottom: 16px; }
.page-head p { color: var(--text-soft); font-size: 18px; max-width: 580px; }

/* ============================================
   Responsive (pages)
   ============================================ */
@media (max-width: 900px) {
  .tracks { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .about-portrait { position: static; max-width: 320px; }
  .contact-grid { grid-template-columns: 1fr; }
  .cluster-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   CASES — redesigned (M3-inspired)
   ============================================ */
.cases-stack { display: flex; flex-direction: column; gap: 28px; }

.case {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  transition: border-color var(--dur-med) var(--m3-standard), box-shadow var(--dur-long) var(--m3-emphasized);
}
.case.in { border-color: var(--line-strong); box-shadow: var(--neon-shadow-soft); }

/* top accent bar that draws in */
.case::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  height: 3px; width: 0;
  background: linear-gradient(90deg, var(--blue-glow), var(--cyan));
  box-shadow: var(--neon-shadow);
  transition: width var(--dur-long) var(--m3-emphasized-decel);
  z-index: 3;
}
.case.in::before { width: 100%; }

.case-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: stretch;
}
.case-grid.flip .case-copy { order: 2; }
.case-grid.flip .case-stage { order: 1; }

.case-copy { padding: 42px; display: flex; flex-direction: column; justify-content: center; }
.case-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--blue-bright); margin-bottom: 14px;
}
.case-kicker .idx {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px;
  background: rgba(59,130,246,0.12); border: 1px solid var(--line-strong);
  font-size: 12px;
}
.case-copy h3 { font-size: 26px; margin-bottom: 14px; line-height: 1.15; }
.case-copy .ctx { color: var(--text-soft); font-size: 15px; margin-bottom: 20px; }

.case-steps { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.case-steps li {
  display: flex; gap: 13px; align-items: flex-start;
  font-size: 14px; color: var(--text);
  opacity: 0; transform: translateX(-10px);
  transition: opacity var(--dur-med) var(--m3-standard), transform var(--dur-med) var(--m3-emphasized);
}
.case.in .case-steps li { opacity: 1; transform: none; }
.case.in .case-steps li:nth-child(1) { transition-delay: 0.25s; }
.case.in .case-steps li:nth-child(2) { transition-delay: 0.35s; }
.case.in .case-steps li:nth-child(3) { transition-delay: 0.45s; }
.case.in .case-steps li:nth-child(4) { transition-delay: 0.55s; }
.case-steps li .dot {
  flex-shrink: 0; margin-top: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue); box-shadow: var(--neon-shadow);
}
.case-result {
  margin-top: 22px; padding: 15px 18px;
  background: rgba(59,130,246,0.08);
  border-left: 3px solid var(--blue);
  border-radius: 0 10px 10px 0;
  font-size: 14px;
}
.case-result b { color: var(--blue-bright); }

/* Stage (visualization side) */
.case-stage {
  background:
    radial-gradient(circle at 70% 20%, rgba(37,99,235,0.12), transparent 60%),
    linear-gradient(150deg, var(--bg-elev), var(--bg-deep));
  border-left: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  padding: 36px; min-height: 360px;
}
.case-grid.flip .case-stage { border-left: none; border-right: 1px solid var(--line); }

/* line chart */
.viz-svg { width: 100%; height: auto; max-width: 440px; }
.draw-line {
  fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1200; stroke-dashoffset: 1200;
}
.case.in .draw-line { animation: draw 2.1s var(--m3-emphasized) forwards; }
.case.in .draw-line.delay { animation-delay: 0.5s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.viz-area { opacity: 0; transition: opacity 0.8s ease 1.6s; }
.case.in .viz-area { opacity: 1; }
.viz-pulse { opacity: 0; }
.case.in .viz-pulse { animation: pulseDot 2s ease-in-out 2.2s infinite; }
@keyframes pulseDot { 0%,100% { opacity: 0.4; r: 4; } 50% { opacity: 1; r: 6; } }

/* CASE 4 — animated resolution ticker */
.res-meter { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 26px; }
.res-clock { text-align: center; }
.res-clock .big {
  font-family: 'Space Grotesk'; font-size: 64px; font-weight: 700;
  color: var(--blue-bright); line-height: 1; text-shadow: 0 0 26px rgba(59,130,246,0.5);
}
.res-clock .unit { font-size: 24px; color: var(--text-soft); }
.res-clock .sub { font-size: 13px; color: var(--text-mute); margin-top: 8px; }
.res-track-wrap { display: flex; flex-direction: column; gap: 14px; }
.res-row { display: flex; align-items: center; gap: 14px; }
.res-row .tag { width: 54px; font-size: 13px; color: var(--text-soft); flex-shrink: 0; }
.res-bar-bg { flex: 1; height: 26px; background: var(--bg-panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; position: relative; }
.res-bar {
  height: 100%; width: 0; border-radius: 7px;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 10px; font-size: 12px; font-weight: 600; color: #fff;
  transition: width 1.6s var(--m3-emphasized-decel);
}
.res-bar.slow { background: linear-gradient(90deg, rgba(107,122,153,0.5), var(--text-mute)); }
.res-bar.fast { background: linear-gradient(90deg, var(--blue-glow), var(--cyan)); box-shadow: var(--neon-shadow); }
.res-delta {
  align-self: center; margin-top: 4px;
  font-size: 13px; color: var(--blue-bright);
  display: inline-flex; align-items: center; gap: 6px;
}

/* bar chart (kept, refined) */
.bar-row { display: flex; align-items: flex-end; gap: 24px; height: 230px; width: 100%; max-width: 320px; justify-content: center; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 12px; flex: 1; max-width: 96px; }
.bar { width: 100%; border-radius: 10px 10px 0 0; transition: height 1.4s var(--m3-emphasized-decel); height: 0; }
.bar.before { background: linear-gradient(var(--text-mute), rgba(107,122,153,0.35)); }
.bar.after { background: linear-gradient(var(--blue-bright), var(--blue-glow)); box-shadow: var(--neon-shadow); }
.bar-cap { font-family: 'Space Grotesk'; font-size: 20px; font-weight: 600; }
.bar-cap.muted { color: var(--text-mute); }
.bar-cap.hi { color: var(--blue-bright); }
.bar-lbl { font-size: 12px; color: var(--text-soft); }

/* KPI dashboard */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; max-width: 400px; }
.kpi-box {
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px;
  transition: transform var(--dur-med) var(--m3-emphasized), border-color var(--dur-med);
}
.case.in .kpi-box { animation: kpiPop var(--dur-long) var(--m3-emphasized-decel) backwards; }
.case.in .kpi-box:nth-child(1) { animation-delay: 0.3s; }
.case.in .kpi-box:nth-child(2) { animation-delay: 0.42s; }
.case.in .kpi-box:nth-child(3) { animation-delay: 0.54s; }
.case.in .kpi-box:nth-child(4) { animation-delay: 0.66s; }
@keyframes kpiPop { from { opacity: 0; transform: scale(0.9) translateY(10px); } to { opacity: 1; transform: none; } }
.kpi-box .k-num { font-family: 'Space Grotesk'; font-size: 30px; font-weight: 600; color: var(--blue-bright); line-height: 1; }
.kpi-box .k-lbl { font-size: 12px; color: var(--text-soft); margin-top: 6px; }
.kpi-box .k-bar { height: 4px; background: var(--bg-elev); border-radius: 2px; margin-top: 12px; overflow: hidden; }
.kpi-box .k-fill { height: 100%; width: 0; background: var(--blue); border-radius: 2px; box-shadow: var(--neon-shadow); transition: width 1.6s var(--m3-emphasized-decel) 0.6s; }

/* onboarding */
.onb { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 24px; }
.onb-block .onb-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.onb-block .onb-head .lbl { color: var(--text-soft); }
.onb-block .onb-head .val { font-family: 'Space Grotesk'; font-weight: 600; }
.onb-track { height: 14px; background: var(--bg-panel); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.onb-fill { height: 100%; width: 0; border-radius: 7px; transition: width 1.6s var(--m3-emphasized-decel) 0.3s; }
.onb-fill.slow { background: linear-gradient(90deg, var(--text-mute), rgba(107,122,153,0.5)); }
.onb-fill.fast { background: linear-gradient(90deg, var(--blue-glow), var(--cyan)); box-shadow: var(--neon-shadow); }

/* CASE 6 — approval flow (CSM gate) */
.flow { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 0; }
.flow-step { display: flex; gap: 14px; align-items: stretch; position: relative;
  opacity: 0; transform: translateY(12px);
  transition: opacity var(--dur-med) var(--m3-standard), transform var(--dur-med) var(--m3-emphasized);
}
.case.in .flow-step { opacity: 1; transform: none; }
.case.in .flow-step:nth-child(1){ transition-delay:.25s } .case.in .flow-step:nth-child(2){ transition-delay:.37s }
.case.in .flow-step:nth-child(3){ transition-delay:.49s } .case.in .flow-step:nth-child(4){ transition-delay:.61s }
.case.in .flow-step:nth-child(5){ transition-delay:.73s }
.flow-rail { display: flex; flex-direction: column; align-items: center; }
.flow-node {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.flow-node.gate {
  background: var(--blue-glow); color: #fff; box-shadow: var(--neon-shadow);
  border-radius: 50%;
}
.flow-node.task {
  background: var(--bg-elev); border: 1px solid var(--line-strong); color: var(--text-soft);
}
.flow-line { width: 2px; flex: 1; min-height: 16px; background: var(--line-strong); }
.flow-step:last-child .flow-line { display: none; }
.flow-body { padding-bottom: 14px; }
.flow-body .ft { font-size: 14px; font-weight: 500; }
.flow-body .fd { font-size: 12px; color: var(--text-mute); }
.flow-body .ft .me { color: var(--blue-bright); }
.flow-legend { display: flex; gap: 18px; margin-top: 8px; font-size: 12px; color: var(--text-mute); }
.flow-legend span { display: inline-flex; align-items: center; gap: 7px; }
.flow-legend .lg { width: 12px; height: 12px; border-radius: 50%; }
.flow-legend .lg.gate { background: var(--blue-glow); box-shadow: var(--neon-shadow); }
.flow-legend .lg.task { background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: 3px; }

@media (max-width: 860px) {
  .case-grid, .case-grid.flip { grid-template-columns: 1fr; }
  .case-grid.flip .case-copy { order: 2; }
  .case-grid.flip .case-stage { order: 1; border-right: none; }
  .case-stage { border-left: none; border-top: 1px solid var(--line); min-height: 300px; }
  .case-copy { padding: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .case::before { width: 100%; transition: none; }
  .case-steps li, .flow-step { opacity: 1; transform: none; }
  .draw-line { stroke-dashoffset: 0; animation: none; }
}
