/* Animated portfolio styles */
:root {
  /* Higher-contrast ink scale — every step is WCAG AA on the panel bg */
  --ink: #ffffff;             /* primary text — 21:1 */
  --ink-soft: #e6e3da;         /* secondary — was #c8c2b6, too dim */
  --ink-mute: #a8a294;         /* tertiary/meta — was #8d8678 */
  --ink-faint: #6f6a5e;        /* lowest — captions only */
  --bg: #06070c;
  /* Panels: opaque enough that text never fights the 3D bg.
     0.92 alpha + heavy blur gives a true frosted dark plate. */
  --panel: rgba(14, 16, 24, 0.92);
  --panel-strong: rgba(20, 22, 32, 0.96);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.24);
  --accent: #7fe6d2;            /* slightly brighter teal for AA on dark panel */
  --accent-warm: #ffc878;
  --accent-cool: #a8c5ff;
  --accent-pop: #ff9faf;
  --display: "Space Grotesk", "Helvetica Neue", system-ui, sans-serif;
  --body: "Inter", "Helvetica Neue", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Menlo", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11", "kern";
}

/* Global readability scrim — dims the busy 3D bg behind every section */
#app::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 50%, rgba(6,7,12,0) 0%, rgba(6,7,12,0.45) 60%, rgba(6,7,12,0.78) 100%);
  z-index: 1;
  pointer-events: none;
}

#bg-canvas {
  position: fixed; inset: 0; z-index: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
}

#app { position: relative; z-index: 2; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

/* ── Top nav ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 36px;
  background: linear-gradient(180deg, rgba(6,7,12,0.95) 0%, rgba(6,7,12,0.7) 70%, rgba(6,7,12,0.1));
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav__brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav__brand-mark {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent), #2c4d4a 70%, #0c1110);
  box-shadow: 0 0 24px rgba(105,215,195,0.45);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.12);
}
.nav__brand-mark::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18); opacity: 0.7;
  animation: pulseRing 3.6s ease-in-out infinite;
}
.nav__brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 24%;
  transform: scale(1.03);
}
.nav__brand-mark--photo {
  background: #0d1218;
  box-shadow: 0 0 0 1px rgba(127,230,210,0.18), 0 0 26px rgba(105,215,195,0.28);
}
.nav__brand-mark--photo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), transparent 38%, rgba(0,0,0,0.18));
  pointer-events: none;
  z-index: 1;
}
@keyframes pulseRing {
  0%,100% { transform: scale(1); opacity: 0.6; }
  50%     { transform: scale(1.15); opacity: 0.15; }
}
.nav__brand-text { font-size: 15px; color: var(--ink); }
.nav__brand-text span { color: var(--ink-soft); margin-left: 8px; font-weight: 400; font-size: 13px; }

.nav__links {
  display: flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}
.nav__link {
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--display);
  font-weight: 600;
  border: none;
  background: transparent;
}
.nav__link:hover { color: var(--ink); background: rgba(255,255,255,0.08); }
.nav__link--active {
  background: var(--ink); color: #0a0c12;
}

.nav__cta {
  font-size: 13px;
  font-family: var(--display);
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255,255,255,0.03);
}
.nav__cta:hover { background: var(--accent); color: #0a0c12; border-color: var(--accent); }

/* ── Section frame ── */
.section {
  min-height: 100vh;
  padding: 120px 48px 80px;
  position: relative;
}
.section__container { max-width: 1200px; margin: 0 auto; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
  text-shadow: 0 0 10px rgba(127,230,210,0.25);
}

.h-display {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(36px, 5.4vw, 76px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  text-wrap: balance;
  color: var(--ink);
  /* halo around big display type so it never fights the 3D bg */
  text-shadow: 0 2px 30px rgba(0,0,0,0.6), 0 0 1px rgba(0,0,0,0.5);
}
.h-section {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(30px, 3.6vw, 48px);
  letter-spacing: -0.015em;
  line-height: 1.08;
  margin: 0 0 18px;
  text-wrap: balance;
  color: var(--ink);
  text-shadow: 0 2px 20px rgba(0,0,0,0.55);
}
.h-card {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 8px;
  line-height: 1.28;
  letter-spacing: -0.005em;
  color: var(--ink);
}

/* ── Home hero ── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 56px;
  align-items: start;
  min-height: 80vh;
}
.hero__visuals {
  display: grid;
  gap: 24px;
  align-self: stretch;
  justify-items: end;
  padding-top: 32px;
}
.hero__lead {
  font-size: clamp(16px, 1.15vw, 19px);
  color: var(--ink-soft);
  max-width: 580px;
  margin: 0 0 28px;
  line-height: 1.65;
  text-shadow: 0 1px 12px rgba(0,0,0,0.5);
}
.hero__typer {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 18px;
  font-weight: 500;
}
.hero__typer b { color: var(--accent); font-weight: 600; }
.hero__typer .cursor {
  display: inline-block; width: 8px; height: 16px;
  background: var(--accent); margin-left: 4px; vertical-align: -2px;
  animation: blink 1s steps(2, end) infinite;
}
@keyframes blink { 0%, 50% { opacity: 1 } 51%, 100% { opacity: 0 } }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  background: rgba(20,22,32,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.18s ease;
}
.btn:hover { background: var(--ink); color: #0a0c12; border-color: var(--ink); }
.btn--primary { background: var(--accent); color: #06120f; border-color: var(--accent); }
.btn--primary:hover { background: #fff; color: #06120f; border-color: #fff; }

/* Hero visual orb */
.orb-stage {
  position: relative; aspect-ratio: 1 / 1; width: min(100%, 468px); max-width: 468px; margin-left: auto;
}
.orb {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.18), transparent 60%),
              radial-gradient(circle at 50% 50%, var(--col, var(--accent)), transparent 75%);
  filter: blur(0.5px);
  mix-blend-mode: screen;
  animation: float 14s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(8px,-12px) scale(1.04); }
}
.orb--core {
  inset: 28% 28% 28% 28%;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, var(--accent) 35%, #103832 70%, #061211 100%);
  box-shadow: 0 0 80px rgba(105,215,195,0.45), inset -20px -30px 80px rgba(0,0,0,0.6);
  filter: none;
  mix-blend-mode: normal;
}
.orb-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  animation: spin 24s linear infinite;
}
.orb-ring--2 { inset: 8%; animation-duration: 38s; animation-direction: reverse; border-color: rgba(255,255,255,0.08); }
.orb-ring--3 { inset: 18%; animation-duration: 18s; border-style: dashed; border-color: rgba(255,255,255,0.2); }
.orb-ring__node {
  position: absolute; top: -6px; left: 50%; width: 12px; height: 12px;
  background: var(--col, var(--accent)); border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 16px var(--col, var(--accent));
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Metric cards */
.metric-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-top: 36px;
}
.hero-connect {
  position: relative;
  z-index: 2;
  width: min(100%, 478px);
  min-height: 0;
  margin: -132px 0 0 auto;
  padding: 24px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(168,197,255,0.16), transparent 38%),
    linear-gradient(135deg, rgba(127,230,210,0.12), rgba(10,12,18,0.92) 58%);
  border-color: rgba(127,230,210,0.24);
}
.hero-connect__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.hero-connect__title {
  margin-bottom: 0;
  max-width: 286px;
  font-size: 28px;
  line-height: 1.06;
}
.hero-connect__jump {
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 13px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.hero-connect__jump:hover {
  border-color: rgba(127,230,210,0.4);
  background: rgba(127,230,210,0.08);
  transform: translateY(-1px);
}
.hero-connect__copy {
  margin: 10px 0 0;
  max-width: 350px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}
.hero-connect__map {
  position: relative;
  margin-top: 18px;
  min-height: 222px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.06);
  background:
    radial-gradient(circle at 82% 22%, rgba(127,230,210,0.1), transparent 26%),
    radial-gradient(circle at 30% 76%, rgba(168,197,255,0.08), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  overflow: hidden;
}
.hero-connect__map::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.8), transparent 100%);
  pointer-events: none;
}
.hero-connect__map::after {
  content: "";
  position: absolute;
  inset: 16px 18px auto auto;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(127,230,210,0.22), transparent 70%);
  pointer-events: none;
}
.hero-connect__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-connect__svg path {
  fill: none;
  stroke: url(#workflow-line);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-dasharray: 7 9;
  animation: workflowDash 13s linear infinite;
  opacity: 0.92;
}
.hero-connect__svg circle {
  fill: rgba(127,230,210,0.95);
  filter: drop-shadow(0 0 10px rgba(127,230,210,0.65));
}
@keyframes workflowDash {
  to { stroke-dashoffset: -180; }
}
.hero-connect__hub,
.hero-connect__node {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(12,14,20,0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.34);
}
.hero-connect__hub {
  left: 18px;
  top: 72px;
  width: 134px;
  min-height: 80px;
  border-color: rgba(127,230,210,0.3);
  background: linear-gradient(135deg, rgba(127,230,210,0.15), rgba(10,14,20,0.92));
}
.hero-connect__hub strong {
  font-family: var(--display);
  font-size: 21px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.hero-connect__hub-label,
.hero-connect__hub-meta,
.hero-connect__node-meta {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.hero-connect__node {
  width: 134px;
  color: var(--ink);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}
.hero-connect__node:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: rgba(127,230,210,0.42);
  box-shadow: 0 18px 32px rgba(0,0,0,0.42), 0 0 0 1px rgba(127,230,210,0.14);
  background: rgba(12,16,22,0.96);
}
.hero-connect__node--accent {
  border-color: rgba(127,230,210,0.38);
  background: linear-gradient(135deg, rgba(127,230,210,0.18), rgba(10,14,20,0.94));
}
.hero-connect__node-label {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.hero-connect__node--1 { top: 14px; right: 16px; }
.hero-connect__node--2 { top: 58px; right: 116px; }
.hero-connect__node--3 { top: 114px; right: 18px; }
.hero-connect__node--4 { top: 156px; right: 152px; }
.hero-connect__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 14px;
  color: var(--ink-mute);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 22px;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  transition: transform 0.25s ease, border-color 0.25s ease;
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
}
.metric:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.metric__v {
  font-family: var(--display);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.015em;
  color: var(--accent);
  display: block;
  line-height: 1;
  text-shadow: 0 0 20px rgba(127,230,210,0.25);
}
.metric__k {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

/* Generic cards */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 16px 50px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
}
.card__meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 10px;
  font-weight: 500;
}
.card__sub {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
}
.card__bullets {
  margin: 14px 0 0; padding: 0 0 0 18px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.65;
}
.card__bullets li { margin: 6px 0; }
.card__bullets li::marker { color: var(--accent); }
.card__circle {
  position: absolute; top: -40px; right: -40px;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--col, var(--accent)) 0%, transparent 70%);
  opacity: 0.14; pointer-events: none;
}

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  margin: 4px 4px 0 0;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.tag--accent {
  background: rgba(127,230,210,0.16);
  border-color: rgba(127,230,210,0.45);
  color: var(--accent);
  font-weight: 600;
}

/* skill bar */
.skill {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.skill__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.skill__tier {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.14em;
  font-weight: 500;
  text-transform: uppercase;
}
.skill__bar {
  height: 6px; border-radius: 999px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
  margin: 14px 0 14px;
}
.skill__fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-cool));
  border-radius: 999px;
  transform-origin: left;
  animation: fillBar 1.6s cubic-bezier(.16,.84,.44,1) both;
}
@keyframes fillBar { from { transform: scaleX(0); } to { transform: scaleX(var(--w, 1)); } }

/* Project cards */
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.project {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  position: relative; overflow: hidden;
  transition: all 0.3s cubic-bezier(.16,.84,.44,1);
  cursor: pointer;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.project:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 18px 50px rgba(0,0,0,0.55), 0 0 0 1px rgba(127,230,210,0.2);
}
.project__id {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.2em;
  font-weight: 500;
}
.project__circle {
  position: absolute; right: -50px; top: -50px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: conic-gradient(from var(--ang, 0deg), var(--col, var(--accent)), transparent 70%);
  opacity: 0.22;
  filter: blur(2px);
  animation: spin 30s linear infinite;
  pointer-events: none;
}

/* GitHub repo cards */
.repo {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  display: block;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.repo:hover {
  border-color: var(--accent);
  box-shadow: 0 14px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(127,230,210,0.2);
}
.repo__lang {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.08em;
  font-weight: 500;
}
.repo__name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  margin: 8px 0 8px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.repo__desc {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}
.repo__metric {
  display: inline-flex; align-items: baseline; gap: 8px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-mute);
}
.repo__metric b {
  font-family: var(--display);
  font-size: 20px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Footer / contact */
.contact-card {
  background:
    linear-gradient(135deg, rgba(127,230,210,0.18), rgba(168,197,255,0.12)),
    rgba(14,16,24,0.85);
  border: 1px solid rgba(127,230,210,0.38);
  border-radius: 22px;
  padding: 56px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.contact-card::after {
  content: ""; position: absolute; right: -120px; bottom: -120px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(105,215,195,0.4), transparent 70%);
  pointer-events: none;
}

/* Reveal on scroll-in */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.16,.84,.44,1); }
.reveal.in { opacity: 1; transform: none; }

/* Scrolling word ribbon */
.ribbon {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 32px 0;
  padding: 18px 0;
  background: rgba(0,0,0,0.25);
}
.ribbon__track {
  display: flex; gap: 36px;
  animation: marquee 40s linear infinite;
  white-space: nowrap;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.ribbon__track span { color: var(--accent); }
.ribbon__track .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  display: inline-block; align-self: center;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Section title row with HUGE stencil number */
.section-title-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 36px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}
.section-title-row__num {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(54px, 7.5vw, 120px);
  line-height: 0.85;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink-mute);
  letter-spacing: -0.025em;
  opacity: 0.7;
}

/* ── 3D scroll-progress rail ── */
#rail-3d {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  perspective: 600px;
}
.rail-3d__tube {
  position: relative;
  width: 6px;
  height: 60vh;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border-radius: 999px;
  transform-style: preserve-3d;
  transform: rotateY(15deg) rotateX(2deg);
  box-shadow: inset 1px 0 0 rgba(255,255,255,0.12), inset -1px 0 0 rgba(0,0,0,0.5);
  overflow: visible;
}
.rail-3d__fill {
  position: absolute; top: 0; left: 0; right: 0;
  height: 0%;
  background: linear-gradient(180deg, var(--accent), var(--accent-cool) 50%, var(--accent-pop));
  border-radius: 999px;
  box-shadow: 0 0 14px var(--accent), 0 0 30px rgba(105,215,195,0.5);
  transition: height 0.15s linear;
}
.rail-3d__cursor {
  position: absolute; left: 50%; top: 0;
  width: 14px; height: 14px;
  background: var(--ink);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotateY(-15deg);
  box-shadow: 0 0 14px var(--accent), 0 0 28px rgba(105,215,195,0.5), inset 0 0 8px rgba(0,0,0,0.3);
  transition: top 0.15s linear;
}
.rail-3d__dots {
  position: relative; height: 60vh; width: 18px;
  pointer-events: auto;
}
.rail-3d__dot {
  position: absolute; right: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(8,9,15,0.7);
  transform: translateY(-50%);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}
.rail-3d__dot:hover { border-color: var(--accent); transform: translateY(-50%) scale(1.3); }
.rail-3d__dot.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  transform: translateY(-50%) scale(1.4);
}
.rail-3d__pct {
  position: absolute;
  bottom: -22px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-mute);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* ── 3D section stamp (top-left floating) ── */
#section-stamp {
  position: fixed;
  left: 24px;
  bottom: 28px;
  z-index: 40;
  perspective: 700px;
  pointer-events: none;
  width: 110px;
  height: 110px;
}
.stamp__face {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(20,22,32,0.85), rgba(8,9,15,0.85));
  backdrop-filter: blur(10px);
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.04);
}
.stamp__face::before {
  content: "";
  position: absolute; inset: 4px;
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 10px;
  pointer-events: none;
}
.stamp__num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 38px;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
}
.stamp__label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  margin-top: 6px;
}

/* ── 3D reveal with rotateX swing ── */
.reveal-3d {
  transform: perspective(1200px) translateY(40px) rotateX(12deg) translateZ(-40px);
  transition: opacity 0.8s ease, transform 0.9s cubic-bezier(.16,.84,.44,1);
}
.reveal-3d.in {
  transform: perspective(1200px) translateY(0) rotateX(0deg) translateZ(0);
}

/* keep cards' 3D children layered above the conic-gradient blob */
.card > *, .project > *, .repo > *, .skill > * {
  position: relative;
  z-index: 1;
  transform: translateZ(20px);
}
.card__circle, .project__circle {
  transform: translateZ(-20px);
}

/* ── 3D hero orb upgrade — give the existing CSS orb stage real depth ── */
.orb-stage {
  transform-style: preserve-3d;
  perspective: 1000px;
}
.orb-stage::before {
  content: "";
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(105,215,195,0.18), transparent 60%);
  filter: blur(30px);
  z-index: -1;
  animation: pulseGlow 6s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%,100% { transform: scale(1); opacity: 0.8; }
  50%     { transform: scale(1.15); opacity: 1; }
}

/* Hide rail on small screens */
@media (max-width: 880px) {
  #rail-3d, #section-stamp { display: none; }
}

/* Mid-width: drop the brand subtitle so the nav stays one line */
@media (max-width: 1180px) {
  .nav__brand-text span { display: none; }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }
  .hero__visuals {
    width: min(100%, 640px);
    margin: 0 auto;
    padding-top: 0;
  }
  .orb-stage {
    margin: 0 auto;
  }
  .hero-connect {
    margin-top: -84px;
  }
}

/* Mobile */
@media (max-width: 880px) {
  .nav { padding: 14px 18px; }
  .nav__brand { gap: 10px; }
  .nav__brand-mark { width: 40px; height: 40px; }
  .nav__brand-text { font-size: 14px; }
  .nav__links { display: none; }
  .section { padding: 100px 22px 60px; }
  .hero { grid-template-columns: 1fr; }
  .hero__visuals { width: 100%; }
  .orb-stage { max-width: 320px; margin: 0 auto; }
  .hero-connect {
    padding: 20px;
    min-height: 0;
    width: 100%;
    margin-top: 0;
  }
  .hero-connect__header {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-connect__title,
  .hero-connect__copy {
    max-width: none;
  }
  .hero-connect__map {
    min-height: 0;
    display: grid;
    gap: 12px;
    padding: 18px;
  }
  .hero-connect__svg {
    display: none;
  }
  .hero-connect__hub,
  .hero-connect__node {
    position: static;
    width: auto;
  }
  .hero-connect__hub {
    min-height: 0;
  }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Tile creatures ──────────────────────────────────────────────────────────
 * Tiny pseudo-3D SVG figures that animate inside every content tile.
 * Position: absolute corner, mix-blend-mode: screen so they fuse with the
 * panel tint instead of fighting text. Hover lifts opacity + scale.
 * No per-tile WebGL — pure SVG + CSS keyframes for buttery smooth playback.
 * Reduced-motion users get static figures (animations cancelled below). */
.creature {
  position: absolute;
  pointer-events: none;
  width: clamp(78px, 19%, 112px);
  aspect-ratio: 90 / 70;
  color: var(--c, var(--accent));
  opacity: 0.34;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.45));
  mix-blend-mode: screen;
  transform-style: preserve-3d;
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(.16,.84,.44,1), filter 0.35s ease;
  will-change: transform, opacity;
}
.creature--br { right: 14px; bottom: 14px; }
.creature--bl { left: 14px;  bottom: 14px; }
.creature--tr { right: 14px; top: 60px; }
.creature__svg { width: 100%; height: 100%; display: block; overflow: visible; }
.creature__shadow { fill: rgba(0,0,0,0.35); filter: blur(1.4px); }

/* Push creatures behind text but above card background. The host
 * .card > * rule already sets z-index:1 + translateZ(20px) on every direct
 * child, so we explicitly override here with a -12px Z so the figure visually
 * recedes while the text stays forward. */
.card > .creature,
.project > .creature,
.repo > .creature,
.skill > .creature,
.contact-card > .creature {
  z-index: 0;
  transform: perspective(420px) rotateY(-14deg) rotateX(6deg) translateZ(-12px);
}
.card:hover > .creature,
.project:hover > .creature,
.repo:hover > .creature,
.skill:hover > .creature,
.contact-card:hover > .creature {
  opacity: 0.84;
  transform: perspective(420px) rotateY(-4deg) rotateX(2deg) translateZ(10px) scale(1.08);
  filter: drop-shadow(0 14px 22px rgba(0,0,0,0.55));
}
/* Lift content above the creature even though both share .card > * */
.card > *:not(.creature):not(.card__circle),
.project > *:not(.creature):not(.project__circle),
.repo > *:not(.creature):not(.card__circle):not(.project__circle),
.skill > *:not(.creature):not(.card__circle) {
  z-index: 2;
}

/* ── Keyframes ── */
@keyframes cr-bob          { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-1.4px); } }
@keyframes cr-flicker      { 0%,100% { opacity: 0.34; } 50% { opacity: 0.78; } }
@keyframes cr-arm-type-l   { 0%,100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(1.4px) rotate(5deg); } 75% { transform: translateY(-1px) rotate(-4deg); } }
@keyframes cr-arm-type-r   { 0%,100% { transform: translateY(0) rotate(0); } 20% { transform: translateY(-1px) rotate(-4deg); } 60% { transform: translateY(1.6px) rotate(6deg); } }
@keyframes cr-bar-pulse    { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(1.22); } }
@keyframes cr-arm-point    { 0%,100% { transform: translate(0,0) rotate(0); } 50% { transform: translate(2px,-2px) rotate(-7deg); } }
@keyframes cr-spin         { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes cr-page         { 0%,55% { transform: rotateY(0); opacity: 0.85; } 65% { transform: rotateY(-160deg); opacity: 0.35; } 100% { transform: rotateY(0); opacity: 0.85; } }
@keyframes cr-line-write   { 0% { stroke-dasharray: 0 100; opacity: 0.6; } 55% { stroke-dasharray: 100 0; opacity: 0.85; } 100% { stroke-dasharray: 100 0; opacity: 0.55; } }
@keyframes cr-hammer       { 0%,100% { transform: rotate(0deg); } 40% { transform: rotate(-34deg); } 65% { transform: rotate(10deg); } }
@keyframes cr-cube-spin    { 0%,100% { transform: rotate3d(1,1,0,0deg) translateY(0); } 50% { transform: rotate3d(1,1,0,22deg) translateY(-2px); } }
@keyframes cr-cursor       { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }
@keyframes cr-commit-dot   { 0% { transform: translateY(8px); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(-14px); opacity: 0; } }
@keyframes cr-pointer      { 0%,100% { transform: translate(0,0) rotate(0); } 50% { transform: translate(2px,1px) rotate(-5deg); } }
@keyframes cr-slide-cycle  { 0%,25% { opacity: 0.85; } 38%,58% { opacity: 0.2; } 72%,100% { opacity: 0.85; } }
@keyframes cr-chalk-draw   { 0% { stroke-dasharray: 0 60; opacity: 0.85; } 55% { stroke-dasharray: 60 0; opacity: 0.85; } 95%,100% { stroke-dasharray: 60 0; opacity: 0; } }
@keyframes cr-wave-arm     { 0%,100% { transform: rotate(0deg); } 25% { transform: rotate(-26deg); } 75% { transform: rotate(20deg); } }

/* ── Per-kind animation hooks (transform-box: fill-box keeps SVG transform-origin
 *    relative to the element's own bbox rather than the SVG canvas origin) ── */
.creature [class^="creature__"] { transform-box: fill-box; }

.creature__person--type        { animation: cr-bob 1.4s ease-in-out infinite; animation-delay: var(--d, 0s); }
.creature__person--type .creature__arm-l { transform-origin: 25px 38px; animation: cr-arm-type-l 0.55s ease-in-out infinite; animation-delay: var(--d, 0s); }
.creature__person--type .creature__arm-r { transform-origin: 31px 38px; animation: cr-arm-type-r 0.62s ease-in-out infinite; animation-delay: calc(var(--d, 0s) + 0.1s); }
.creature__screen              { animation: cr-flicker 1.6s ease-in-out infinite; animation-delay: var(--d, 0s); }

.creature__bar                 { transform-origin: bottom; animation: cr-bar-pulse 2.2s ease-in-out infinite; }
.creature__bar--1              { animation-delay: 0s; }
.creature__bar--2              { animation-delay: 0.25s; }
.creature__bar--3              { animation-delay: 0.5s; }
.creature__person--point       { animation: cr-bob 2s ease-in-out infinite; }
.creature__arm-point           { transform-origin: 29px 36px; animation: cr-arm-point 2s ease-in-out infinite; }

.creature__gear                { transform-origin: center; animation: cr-spin 8s linear infinite; }
.creature__person--turn        { animation: cr-bob 1.6s ease-in-out infinite; }

.creature__person--read        { animation: cr-bob 2.4s ease-in-out infinite; }
.creature__page                { transform-origin: left; animation: cr-page 4s ease-in-out infinite; }

.creature__line                { stroke-linecap: round; opacity: 0.55; }
.creature__line--1             { animation: cr-line-write 3.6s ease-in-out infinite; animation-delay: 0s; }
.creature__line--2             { animation: cr-line-write 3.6s ease-in-out infinite; animation-delay: 0.4s; }
.creature__line--3             { animation: cr-line-write 3.6s ease-in-out infinite; animation-delay: 0.8s; }
.creature__line--4             { animation: cr-line-write 3.6s ease-in-out infinite; animation-delay: 1.2s; }
.creature__person--review      { animation: cr-bob 2.2s ease-in-out infinite; }
.creature__arm-pen             { transform-origin: 31px 34px; animation: cr-arm-point 1.8s ease-in-out infinite; }

.creature__hammer-arm          { transform-origin: left center; animation: cr-hammer 1s cubic-bezier(.5,0,.5,1) infinite; }
.creature__cube                { transform-origin: center; animation: cr-cube-spin 4s ease-in-out infinite; }
.creature__person--hammer      { animation: cr-bob 1s ease-in-out infinite; }

.creature__cursor              { animation: cr-cursor 0.9s steps(2) infinite; font-weight: 700; }
.creature__commit-dot          { transform-origin: center; animation: cr-commit-dot 2.6s ease-out infinite; animation-delay: var(--d, 0s); }

.creature__person--present     { animation: cr-bob 2.4s ease-in-out infinite; }
.creature__arm-pointer         { transform-origin: 25px 40px; animation: cr-pointer 2.4s ease-in-out infinite; }
.creature__slide-line          { stroke-linecap: round; }
.creature__slide-line--1       { animation: cr-slide-cycle 5s ease-in-out infinite; }
.creature__slide-line--2       { animation: cr-slide-cycle 5s ease-in-out infinite; animation-delay: 0.3s; }
.creature__slide-line--3       { animation: cr-slide-cycle 5s ease-in-out infinite; animation-delay: 0.6s; }

.creature__chalk               { stroke-linecap: round; }
.creature__chalk--1            { animation: cr-chalk-draw 4.5s ease-in-out infinite; }
.creature__chalk--2            { animation: cr-chalk-draw 4.5s ease-in-out infinite; animation-delay: 1.5s; }
.creature__person--teach       { animation: cr-bob 1.8s ease-in-out infinite; }
.creature__arm-write           { transform-origin: 29px 38px; animation: cr-arm-point 1.4s ease-in-out infinite; }

.creature__wave-arm            { transform-origin: 52px 32px; animation: cr-wave-arm 1.4s ease-in-out infinite; }
.creature__person--wave        { animation: cr-bob 2.2s ease-in-out infinite; }

/* Smaller tile types get a slightly smaller creature so they don't crowd metrics */
.repo .creature   { width: clamp(58px, 22%, 84px); right: 10px; bottom: 10px; }
.skill .creature  { width: clamp(70px, 18%, 96px); }
.metric .creature { display: none; }

/* Reduced motion: freeze creatures but keep silhouette visible */
@media (prefers-reduced-motion: reduce) {
  .creature [class*="cr-"], .creature * { animation: none !important; }
  .creature, .card:hover > .creature, .project:hover > .creature,
  .repo:hover > .creature, .skill:hover > .creature, .contact-card:hover > .creature {
    transition: none;
  }
}

/* Mobile: shrink, dim, and snap into the corner so tile copy still breathes */
@media (max-width: 880px) {
  .card > .creature, .project > .creature, .repo > .creature,
  .skill > .creature, .contact-card > .creature {
    width: 56px;
    opacity: 0.26;
    right: 8px;
    bottom: 8px;
  }
  .card:hover > .creature, .project:hover > .creature, .repo:hover > .creature,
  .skill:hover > .creature, .contact-card:hover > .creature {
    opacity: 0.55;
    transform: perspective(420px) rotateY(0) translateZ(0) scale(1.04);
  }
}

.linkedin-card {
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at top right, rgba(127,230,210,0.12), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01));
}

.linkedin-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 14px 18px;
  height: 1px;
  background: linear-gradient(90deg, rgba(127,230,210,0), rgba(127,230,210,0.42), rgba(127,230,210,0));
  opacity: 0.58;
  pointer-events: none;
}

.linkedin-card--hero {
  background:
    radial-gradient(circle at top right, rgba(127,230,210,0.18), transparent 36%),
    linear-gradient(140deg, rgba(127,230,210,0.1), rgba(255,255,255,0.025) 58%, rgba(255,255,255,0.012));
}

.linkedin-card__eyebrow-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.linkedin-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(127,230,210,0.22);
  background: rgba(127,230,210,0.09);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.linkedin-card__badge--muted {
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.045);
  color: var(--ink-mute);
}

.linkedin-card__summary,
.linkedin-card__item p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.linkedin-card__summary {
  margin-top: 10px;
  color: var(--ink-soft);
  -webkit-line-clamp: 4;
}

.linkedin-card__source-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(127,230,210,0.14);
  background: rgba(127,230,210,0.06);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.58;
}

.linkedin-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.linkedin-card__meta-line,
.linkedin-card__item span,
.linkedin-card__open,
.linkedin-card__empty {
  color: var(--ink-mute);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}

.linkedin-card__meta-line {
  margin-top: 18px;
  text-transform: uppercase;
}

.linkedin-card__meta-line--secondary {
  margin-top: 8px;
  color: var(--accent);
}

.linkedin-card__stack {
  display: grid;
  gap: 14px;
  margin-top: 6px;
}

.linkedin-card__item {
  display: grid;
  gap: 8px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.035);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.linkedin-card__item strong {
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.linkedin-card__item p {
  margin: 0;
  color: var(--ink-soft);
  -webkit-line-clamp: 4;
}

.linkedin-card__item:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: rgba(255,255,255,0.05);
}

.linkedin-card__actions {
  margin-top: auto;
}

.linkedin-card__open {
  margin-top: 16px;
  color: var(--accent);
}

.linkedin-card__empty {
  margin-top: 12px;
  text-transform: none;
  letter-spacing: 0.02em;
}

/* ── AI Floating Buddy ────────────────────────────────────────────────────── *
 * Desktop: bottom-left next to the section stamp (left: 148px = 24+110+14).  *
 * Mobile (≤880px): bottom-right corner; panel goes full-width from bottom.   *
 * ─────────────────────────────────────────────────────────────────────────── */
.ai-buddy {
  position: fixed;
  left: 148px;
  bottom: 28px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: none;
}
.ai-buddy__orb {
  pointer-events: auto;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--accent) 0%, #1c3d3a 65%, #07100e 100%);
  border: 1.5px solid rgba(127,230,210,0.45);
  box-shadow: 0 0 22px rgba(127,230,210,0.32), 0 6px 24px rgba(0,0,0,0.55);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s cubic-bezier(.16,.84,.44,1), box-shadow 0.3s ease;
  position: relative;
}
.ai-buddy__orb::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 1px solid rgba(127,230,210,0.22);
  animation: pulseRing 3.2s ease-in-out infinite;
  pointer-events: none;
}
.ai-buddy__orb:hover {
  transform: scale(1.12) translateY(-2px);
  box-shadow: 0 0 36px rgba(127,230,210,0.55), 0 10px 32px rgba(0,0,0,0.6);
}
.ai-buddy__orb--open {
  background: radial-gradient(circle at 32% 28%, #ff9faf 0%, #3d1c1f 65%, #120709 100%);
  border-color: rgba(255,159,175,0.45);
  box-shadow: 0 0 22px rgba(255,159,175,0.32), 0 6px 24px rgba(0,0,0,0.55);
}
.ai-buddy__orb-icon {
  font-size: 21px; line-height: 1; user-select: none;
  text-shadow: 0 0 12px rgba(127,230,210,0.6);
}

/* Hover tooltip */
.ai-buddy__tooltip {
  pointer-events: none; position: absolute;
  bottom: 68px; left: 0; width: 276px;
  background: var(--panel-strong);
  border: 1px solid rgba(127,230,210,0.28); border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.6), 0 0 0 1px rgba(127,230,210,0.06);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  animation: buddyFadeUp 0.22s cubic-bezier(.16,.84,.44,1) both;
}
@keyframes buddyFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ai-buddy__tooltip-title {
  font-family: var(--display); font-size: 12.5px; font-weight: 700;
  color: var(--accent); margin-bottom: 6px; letter-spacing: 0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ai-buddy__tooltip-body {
  font-size: 12px; color: var(--ink-soft); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

/* Expanded panel */
.ai-buddy__panel {
  pointer-events: auto; position: fixed;
  left: 148px; bottom: 96px; width: 360px; max-height: 545px;
  display: flex; flex-direction: column;
  background: var(--panel-strong);
  border: 1px solid rgba(127,230,210,0.2); border-radius: 22px;
  box-shadow: 0 28px 72px rgba(0,0,0,0.68), 0 0 0 1px rgba(127,230,210,0.07);
  backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%);
  overflow: hidden; z-index: 46;
  animation: buddyPanelIn 0.28s cubic-bezier(.16,.84,.44,1) both;
}
@keyframes buddyPanelIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ai-buddy__panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 11px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.ai-buddy__panel-title {
  font-family: var(--display); font-size: 14.5px; font-weight: 700;
  color: var(--accent); letter-spacing: -0.01em;
}
.ai-buddy__ollama-status {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em;
  color: var(--ink-mute); margin-top: 3px; text-transform: uppercase;
}
.ai-buddy__ollama-status--ok { color: #7fe6a4; }
.ai-buddy__close {
  background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: var(--ink);
  border-radius: 50%; width: 28px; height: 28px; cursor: pointer; font-size: 12px;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; flex-shrink: 0; line-height: 1;
}
.ai-buddy__close:hover { background: rgba(255,255,255,0.12); }

/* Insight strips */
.ai-buddy__insight {
  margin: 10px 12px 0; padding: 9px 13px;
  background: rgba(127,230,210,0.07); border: 1px solid rgba(127,230,210,0.17);
  border-radius: 14px; cursor: pointer; transition: background 0.2s; flex-shrink: 0;
}
.ai-buddy__insight:hover { background: rgba(127,230,210,0.13); }
.ai-buddy__section-insight {
  margin: 6px 12px 0; padding: 9px 13px;
  background: rgba(168,197,255,0.06); border: 1px solid rgba(168,197,255,0.14);
  border-radius: 14px; display: flex; flex-direction: column; gap: 4px; flex-shrink: 0;
}
.ai-buddy__insight-label {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 4px; display: block;
}
.ai-buddy__insight-text { font-size: 11.5px; color: var(--ink-soft); line-height: 1.5; }

/* Chat messages */
.ai-buddy__messages {
  flex: 1; overflow-y: auto; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px; min-height: 0;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.ai-buddy__messages::-webkit-scrollbar { width: 4px; }
.ai-buddy__messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.ai-buddy__msg {
  padding: 9px 13px; border-radius: 14px; font-size: 12.5px;
  line-height: 1.56; max-width: 96%; word-wrap: break-word;
}
.ai-buddy__msg--assistant {
  background: rgba(127,230,210,0.07); border: 1px solid rgba(127,230,210,0.17);
  color: var(--ink-soft); align-self: flex-start; border-bottom-left-radius: 5px;
}
.ai-buddy__msg--user {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.11);
  color: var(--ink); align-self: flex-end; border-bottom-right-radius: 5px;
}
.ai-buddy__msg--thinking { opacity: 0.7; }
.ai-buddy__dots { display: inline-flex; gap: 3px; align-items: center; }
.ai-buddy__dots span {
  display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); animation: buddyDot 1.4s ease-in-out infinite;
}
.ai-buddy__dots span:nth-child(2) { animation-delay: 0.22s; }
.ai-buddy__dots span:nth-child(3) { animation-delay: 0.44s; }
@keyframes buddyDot {
  0%, 80%, 100% { transform: scale(0.55); opacity: 0.45; }
  40%           { transform: scale(1);    opacity: 1;    }
}

/* Input row */
.ai-buddy__input-row {
  display: flex; gap: 8px; padding: 10px 12px 13px;
  border-top: 1px solid var(--line); flex-shrink: 0;
}
.ai-buddy__input {
  flex: 1; min-width: 0; background: rgba(255,255,255,0.04);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px;
  color: var(--ink); font-size: 12.5px; font-family: var(--body);
  outline: none; transition: border-color 0.2s;
}
.ai-buddy__input:focus { border-color: rgba(127,230,210,0.38); }
.ai-buddy__input::placeholder { color: var(--ink-faint); }
.ai-buddy__send {
  background: var(--accent); border: none; color: #06120f; border-radius: 50%;
  width: 34px; height: 34px; cursor: pointer; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s; flex-shrink: 0;
}
.ai-buddy__send:hover:not(:disabled) { background: #fff; transform: scale(1.07); }
.ai-buddy__send:disabled { opacity: 0.4; cursor: not-allowed; }

/* Mobile */
@media (max-width: 880px) {
  .ai-buddy { left: auto; right: 16px; bottom: 16px; align-items: flex-end; }
  .ai-buddy__tooltip { left: auto; right: 0; width: min(276px, calc(100vw - 40px)); }
  .ai-buddy__panel {
    left: 0; right: 0; bottom: 0; width: 100%;
    max-height: 72dvh; border-radius: 20px 20px 0 0;
  }
}
