/* ===================================================================
   Vincent Reinan Ramos — portfolio
   Palette carries meaning: teal = data flowing, coral = the error
   path, amber = retry. Nothing is accented for decoration alone.
=================================================================== */
:root {
  --void: #070a10;
  --canvas: #0b0f17;
  --surface: #121824;
  --surface-2: #172032;
  --edge: #1e2634;
  --edge-soft: #151c28;

  --ink: #eaeef5;
  --ink-2: #99a3b8;
  --ink-3: #5d6779;

  --teal: #5eead4;
  --teal-dim: rgba(94, 234, 212, 0.12);
  --coral: #f97362;
  --coral-dim: rgba(249, 115, 98, 0.12);
  --amber: #fbbf24;

  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --shell: 1140px;
  --gut: clamp(22px, 5vw, 64px);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
}

/* ------------------------------------------------------------------
   Reset
------------------------------------------------------------------ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

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

::selection { background: rgba(94, 234, 212, 0.22); color: #fff; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 200;
  background: var(--teal);
  color: #04211c;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  font-weight: 600;
}
.skip-link:focus { left: 16px; }

/* ------------------------------------------------------------------
   Canvas dot grid — the n8n editor surface, not a gradient wash
------------------------------------------------------------------ */
.canvas-dots {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(148, 170, 200, 0.16) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(ellipse 80% 55% at 50% 22%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 22%, #000 0%, transparent 78%);
}

/* ------------------------------------------------------------------
   Shell + section rhythm
------------------------------------------------------------------ */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-inline: var(--gut);
}

.section {
  position: relative;
  z-index: 1;
  padding-block: clamp(90px, 12vw, 150px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 26px;
}
.eyebrow .glyph {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--teal);
  flex-shrink: 0;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(1.9rem, 3.8vw, 2.9rem);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.lede {
  color: var(--ink-2);
  font-size: 1.06rem;
  max-width: 58ch;
}

.tint { color: var(--teal); }

/* ------------------------------------------------------------------
   Reveal
------------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------------
   Buttons
------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1;
  transition: transform 0.3s var(--ease), background 0.25s ease,
              border-color 0.25s ease, box-shadow 0.3s ease, color 0.25s ease;
}

.btn-primary {
  background: var(--teal);
  color: #04211c;
  font-weight: 600;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -10px rgba(94, 234, 212, 0.5);
}

.btn-ghost {
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: rgba(94, 234, 212, 0.55);
  color: var(--teal);
  transform: translateY(-2px);
}

.btn-sm { padding: 9px 17px; font-size: 0.85rem; }
.btn-lg { padding: 16px 30px; font-size: 1rem; }

/* ------------------------------------------------------------------
   Header
------------------------------------------------------------------ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px var(--gut);
  transition: background 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
  border-bottom: 1px solid transparent;
}
.site-header.stuck {
  background: rgba(7, 10, 16, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--edge-soft);
}

.logo {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.logo-bracket { color: var(--teal); }

.main-nav { display: flex; gap: 30px; font-size: 0.92rem; color: var(--ink-2); }
.main-nav a { position: relative; padding-block: 4px; transition: color 0.22s ease; }
.main-nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--teal);
  transition: width 0.3s var(--ease);
}
.main-nav a:hover { color: var(--ink); }
.main-nav a:hover::after { width: 100%; }

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  align-items: center;
}
.menu-toggle span {
  width: 20px; height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.32s var(--ease), opacity 0.2s ease;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(3.75px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { transform: translateY(-3.75px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: var(--void);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 500;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.5s var(--ease);
}
.mobile-nav.open { clip-path: inset(0 0 0 0); }

/* ------------------------------------------------------------------
   Trace nav
------------------------------------------------------------------ */
.trace-nav {
  position: fixed;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.trace-line {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 1px;
  background: var(--edge);
  transform: translateX(-50%);
}
.trace-fill {
  position: absolute;
  inset: 0 0 auto 0;
  height: 0;
  background: var(--teal);
  transition: height 0.18s linear;
}
.trace-dot {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--canvas);
  border: 1px solid var(--ink-3);
  transition: background 0.28s ease, border-color 0.28s ease, transform 0.28s ease;
}
.trace-dot span {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-2);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.trace-dot:hover span { opacity: 1; }
.trace-dot.active {
  background: var(--teal);
  border-color: var(--teal);
  transform: scale(1.35);
  box-shadow: 0 0 14px rgba(94, 234, 212, 0.55);
}

/* ------------------------------------------------------------------
   Status dot — shared "running" indicator
------------------------------------------------------------------ */
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
  animation: ping 2.4s ease-out infinite;
}
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(94, 234, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0); }
}

/* ------------------------------------------------------------------
   Hero
------------------------------------------------------------------ */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(28px, 4vw, 46px);
  padding-block: 104px 40px;
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-2);
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.02);
  padding: 7px 15px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--display);
  font-size: clamp(2.1rem, 4.9vw, 3.6rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.03em;
  max-width: 21ch;
  margin-bottom: 22px;
}
.hero-title-sub {
  display: block;
  color: var(--ink-3);
  margin-top: 0.12em;
}

.hero-lede {
  color: var(--ink-2);
  font-size: clamp(1.02rem, 1.5vw, 1.13rem);
  max-width: 56ch;
  margin-bottom: 30px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* --- The signature: live self-healing workflow --- */
.flow-stage {
  position: relative;
  width: 100%;
  border-block: 1px solid var(--edge-soft);
  background:
    linear-gradient(180deg, rgba(94, 234, 212, 0.03), transparent 60%),
    var(--canvas);
}
#flow-canvas {
  display: block;
  width: 100%;
  height: clamp(180px, 21vw, 250px);
}

.flow-caption {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gut) 18px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.flow-legend { display: inline-flex; align-items: center; gap: 7px; }
.key { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.key-data  { background: var(--teal); }
.key-error { background: var(--coral); }
.key-retry { background: var(--amber); }
.flow-note { margin-left: auto; color: var(--ink-3); }
.flow-note.alert { color: var(--coral); }
.flow-note.recover { color: var(--amber); }

/* ------------------------------------------------------------------
   About
------------------------------------------------------------------ */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: clamp(36px, 6vw, 76px);
  align-items: start;
  margin-bottom: clamp(56px, 8vw, 88px);
}
.about-lead p + p { margin-top: 15px; }
.about-lead p:not(.lede) { color: var(--ink-2); max-width: 58ch; }

.about-card {
  border: 1px solid var(--edge);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.portrait { position: relative; aspect-ratio: 4 / 5; background: var(--surface-2); }
.portrait img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(0.45) contrast(1.03) brightness(0.93);
}
.portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, rgba(94, 234, 212, 0.14), transparent 58%);
  mix-blend-mode: screen;
}
.portrait-meta { padding: 16px 18px 18px; border-top: 1px solid var(--edge-soft); }
.portrait-name { font-family: var(--mono); font-size: 0.85rem; line-height: 1.45; }
.portrait-loc { font-family: var(--mono); font-size: 0.76rem; color: var(--ink-3); margin-top: 3px; }

.skills {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px 36px;
  padding-block: clamp(34px, 5vw, 48px);
  border-top: 1px solid var(--edge-soft);
  border-bottom: 1px solid var(--edge-soft);
  margin-bottom: clamp(56px, 8vw, 88px);
}
.skill-col h3 {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 14px;
}
.skill-col li {
  font-size: 0.9rem;
  color: var(--ink-2);
  padding-block: 5px;
  border-bottom: 1px solid transparent;
  transition: color 0.22s ease;
}
.skill-col li:hover { color: var(--ink); }

/* Timeline — chronology is real information here, so it is ordered */
.timeline-head {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 30px;
}
.timeline-list { border-left: 1px solid var(--edge); padding-left: clamp(22px, 3vw, 34px); }

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 22px;
  padding-bottom: 36px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: '';
  position: absolute;
  left: calc(clamp(22px, 3vw, 34px) * -1 - 5.5px);
  top: 7px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--void);
  border: 2px solid var(--teal);
}
.tl-item-edu::before { border-color: var(--coral); }

.tl-year {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-3);
  padding-top: 3px;
}
.tl-body h4 { font-family: var(--display); font-size: 1.1rem; font-weight: 600; }
.tl-org { font-size: 0.86rem; color: var(--teal); margin: 3px 0 7px; }
.tl-body p:last-child { color: var(--ink-2); font-size: 0.93rem; max-width: 56ch; }

/* ------------------------------------------------------------------
   Work — capability lanes
------------------------------------------------------------------ */
.section-work { background: linear-gradient(180deg, transparent, rgba(11, 15, 23, 0.85), transparent); }

.lanes { margin-top: clamp(38px, 5vw, 56px); border-top: 1px solid var(--edge-soft); }

.lane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: clamp(26px, 4vw, 56px);
  align-items: center;
  padding-block: clamp(28px, 3.5vw, 40px);
  border-bottom: 1px solid var(--edge-soft);
  transition: background 0.4s ease;
}
.lane:hover { background: rgba(94, 234, 212, 0.022); }

.lane-main h3 {
  font-family: var(--display);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 9px;
}
.lane-main p { color: var(--ink-2); font-size: 0.95rem; max-width: 54ch; margin-bottom: 15px; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags li {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--coral);
  background: var(--coral-dim);
  padding: 4px 9px;
  border-radius: 5px;
}

/* Each lane shows its real pipeline shape */
.lane-pipe {
  justify-self: end;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 15px 17px;
  border: 1px solid var(--edge-soft);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.014);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-3);
  transition: border-color 0.4s ease, background 0.4s ease;
}
.pipe-node {
  display: flex;
  align-items: center;
  gap: 11px;
  position: relative;
  padding-block: 6px;
  transition: color 0.35s ease;
}
.pipe-node i {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(94, 234, 212, 0.35);
  background: var(--canvas);
  flex-shrink: 0;
  transition: border-color 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
}
.pipe-node:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 3.5px;
  top: 20px;
  width: 1px;
  height: 13px;
  background: rgba(94, 234, 212, 0.22);
  transition: background 0.35s ease;
}
.lane:hover .lane-pipe {
  border-color: rgba(94, 234, 212, 0.28);
  background: rgba(94, 234, 212, 0.04);
}
.lane:hover .pipe-node i {
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-dim);
}
.lane:hover .pipe-node:not(:last-child)::before { background: rgba(94, 234, 212, 0.5); }
.lane:hover .pipe-node { color: var(--ink-2); }

/* ------------------------------------------------------------------
   Contact
------------------------------------------------------------------ */
.contact-title { max-width: 14ch; }

.contact-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 36px;
}
#email-link { font-family: var(--mono); font-size: 0.95rem; }

.contact-assistant { margin-top: 30px; }
.assistant-open {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  max-width: 480px;
  text-align: left;
  padding: 17px 20px;
  border: 1px solid var(--edge);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color 0.28s ease, background 0.28s ease, transform 0.3s var(--ease);
}
.assistant-open:hover {
  border-color: rgba(94, 234, 212, 0.5);
  background: var(--surface-2);
  transform: translateY(-2px);
}
.assistant-open-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.assistant-open-text strong { font-size: 0.95rem; font-weight: 600; }
.assistant-open-text em {
  font-style: normal;
  font-size: 0.82rem;
  color: var(--ink-3);
}
.assistant-open-arrow {
  margin-left: auto;
  color: var(--teal);
  font-size: 1.05rem;
  transition: transform 0.3s var(--ease);
}
.assistant-open:hover .assistant-open-arrow { transform: translateX(4px); }

.contact-meta {
  margin-top: 34px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.9rem;
  color: var(--ink-2);
}
.contact-meta a { border-bottom: 1px solid transparent; transition: color 0.22s ease, border-color 0.22s ease; }
.contact-meta a:hover { color: var(--teal); border-bottom-color: var(--teal); }
.contact-loc { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); }

/* ------------------------------------------------------------------
   Footer
------------------------------------------------------------------ */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--edge-soft);
  padding-block: 26px 44px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-3);
}
.footer-status { display: inline-flex; align-items: center; gap: 9px; }

/* ------------------------------------------------------------------
   Vince's Assistant
------------------------------------------------------------------ */
.chat {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.chat-bubble {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--teal);
  color: #04211c;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 32px -10px rgba(94, 234, 212, 0.6);
  transition: transform 0.32s var(--ease);
}
.chat-bubble:hover { transform: translateY(-3px) scale(1.05); }
.chat-bubble svg { width: 24px; height: 24px; position: relative; z-index: 1; }

.bubble-ping {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid rgba(94, 234, 212, 0.55);
  animation: bubble-ping 2.6s ease-out infinite;
}
@keyframes bubble-ping {
  0%   { transform: scale(0.92); opacity: 0.75; }
  70%  { transform: scale(1.28); opacity: 0; }
  100% { opacity: 0; }
}

.chat-panel {
  width: min(370px, calc(100vw - 44px));
  height: min(500px, calc(100svh - 130px));
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--r-lg);
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transform: translateY(14px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.34s var(--ease), opacity 0.26s ease;
}
.chat-panel.open { transform: none; opacity: 1; pointer-events: auto; }

.chat-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--edge-soft);
  background: rgba(255, 255, 255, 0.015);
  flex-shrink: 0;
}
.chat-head-text { min-width: 0; }
.chat-head-text h4 { font-family: var(--display); font-size: 0.94rem; font-weight: 600; }
.chat-head-text p { font-size: 0.74rem; color: var(--ink-3); line-height: 1.4; }
.chat-close {
  margin-left: auto;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--ink-2);
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease;
}
.chat-close:hover { background: var(--surface-2); color: var(--ink); }

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  scrollbar-width: thin;
  scrollbar-color: var(--edge) transparent;
}
.chat-log::-webkit-scrollbar { width: 8px; }
.chat-log::-webkit-scrollbar-thumb { background: var(--edge); border-radius: 99px; }

.msg {
  font-size: 0.875rem;
  line-height: 1.55;
  padding: 10px 14px;
  border-radius: var(--r-md);
  max-width: 86%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg-bot {
  background: var(--surface-2);
  color: var(--ink);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.msg-user {
  background: var(--teal-dim);
  color: var(--teal);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.msg-error { background: var(--coral-dim); color: var(--coral); }

.msg-typing { display: flex; gap: 4px; padding: 13px 15px; align-items: center; }
.msg-typing span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: typing 1.25s ease-in-out infinite;
}
.msg-typing span:nth-child(2) { animation-delay: 0.16s; }
.msg-typing span:nth-child(3) { animation-delay: 0.32s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

.chat-form {
  display: flex;
  gap: 9px;
  padding: 13px;
  border-top: 1px solid var(--edge-soft);
  flex-shrink: 0;
}
.chat-form input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--edge);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 0.875rem;
}
.chat-form input:focus { outline: none; border-color: var(--teal); }

.chat-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--teal);
  color: #04211c;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: transform 0.25s var(--ease), opacity 0.2s ease;
}
.chat-send svg { width: 17px; height: 17px; }
.chat-send:hover { transform: scale(1.08); }
.chat-send:disabled { opacity: 0.45; transform: none; cursor: not-allowed; }

/* ------------------------------------------------------------------
   Responsive
------------------------------------------------------------------ */
@media (max-width: 1080px) {
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .main-nav, .nav-cta { display: none; }
  .menu-toggle { display: flex; }
  .trace-nav { display: none; }

  .about-grid { grid-template-columns: 1fr; }
  .about-card {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    align-items: center;
    max-width: 420px;
  }
  .portrait { aspect-ratio: 1; }
  .portrait-meta { border-top: none; border-left: 1px solid var(--edge-soft); }

  .lane { grid-template-columns: 1fr; gap: 22px; }
  .lane-pipe { flex-direction: row; gap: 0; flex-wrap: wrap; }
  .pipe-node { padding-block: 0; padding-right: 26px; }
  .pipe-node:not(:last-child)::before {
    left: auto; right: 9px;
    top: 50%; transform: translateY(-50%);
    width: 12px; height: 1px;
  }

  .tl-item { grid-template-columns: 1fr; gap: 5px; }
}

@media (max-width: 560px) {
  .skills { grid-template-columns: 1fr; gap: 26px; }
  .about-card { grid-template-columns: 108px minmax(0, 1fr); }
  .chat { right: 15px; bottom: 15px; }
  .chat-panel { width: calc(100vw - 30px); height: min(460px, calc(100svh - 120px)); }
  .contact-actions .btn { width: 100%; justify-content: center; }
  .flow-caption { font-size: 0.66rem; gap: 13px; }
  .flow-note { margin-left: 0; width: 100%; }
}

/* ------------------------------------------------------------------
   Reduced motion
------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .status-dot, .bubble-ping, .msg-typing span { animation: none; }
  .btn, .lane, .assistant-open, .chat-bubble { transition: none; }
  .btn:hover, .assistant-open:hover, .chat-bubble:hover { transform: none; }
}
