@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

:root {
  --bg: #03050b;
  --bg-soft: #080d18;
  --card: rgba(8, 14, 28, 0.72);
  --border: rgba(96, 245, 255, 0.16);
  --text: #f4f7fb;
  --muted: #a7b0c0;
  --accent: #7c5cff;
  --accent-2: #00e5ff;
  --accent-3: #ff4fd8;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 14%, rgba(0, 229, 255, 0.16), transparent 24rem),
    radial-gradient(circle at 88% 8%, rgba(124, 92, 255, 0.14), transparent 25rem),
    radial-gradient(circle at 50% 92%, rgba(255, 79, 216, 0.09), transparent 28rem),
    linear-gradient(180deg, #03050b 0%, #060914 52%, #03050b 100%);
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

main,
.footer,
.boot-loader,
.network-flow,
.routing-layer,
.noise,
.cursor-glow {
  width: 100vw;
  max-width: 100vw;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.05) 1px, transparent 1px);
  background-size: 86px 86px;
  mask-image: radial-gradient(circle at 50% 25%, black, transparent 72%);
}

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

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cursor-glow {
  position: fixed;
  width: 26rem;
  height: 26rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.16), transparent 65%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
}

.header {
  position: fixed;
  top: 0;
  left: 50%;
  width: min(1180px, calc(100% - clamp(16px, 4vw, 32px)));
  transform: translateX(-50%);
  z-index: 20;
  margin-top: 16px;
  padding: 14px clamp(14px, 2vw, 18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(6, 7, 13, 0.72);
  border: 1px solid var(--border);
  border-radius: 22px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  min-width: 0;
  flex: 0 1 auto;
}

.brand span:last-child {
  min-width: 0;
  font-size: clamp(14px, 1vw, 16px);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  gap: clamp(12px, 1.8vw, 20px);
  color: var(--muted);
  font-size: 14px;
}

.nav a {
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  margin: 6px 0;
  background: var(--text);
}

.section {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - clamp(16px, 4vw, 32px)));
  margin: 0 auto;
  padding: clamp(72px, 9vw, 110px) 0;
}

.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 420px);
  align-items: center;
  gap: clamp(28px, 4vw, 48px);
  padding-top: 160px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(4px);
  animation: float 8s ease-in-out infinite;
}

.orb-1 {
  top: 18%;
  right: 18%;
  width: 140px;
  height: 140px;
  background: linear-gradient(135deg, var(--accent), transparent);
}

.orb-2 {
  bottom: 18%;
  left: 10%;
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, var(--accent-2), transparent);
  animation-delay: -2s;
}

.grid-lines {
  position: absolute;
  inset: 8%;
  border-radius: 40px;
  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: 42px 42px;
  mask-image: radial-gradient(circle, black, transparent 70%);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent-2);
  font-family: "Space Mono", monospace;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.12em;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  max-width: 850px;
  font-size: clamp(42px, 6vw, 86px);
  line-height: 0.96;
  letter-spacing: -0.065em;
}

h1 span {
  display: block;
  background: linear-gradient(135deg, #fff, var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  color: transparent;
}

h2 {
  font-size: clamp(32px, 4.2vw, 58px);
  line-height: 1;
  letter-spacing: -0.04em;
}

h3 {
  font-size: 22px;
}

.hero-text,
.content-card p,
.timeline-item p,
.project-card p,
.contact-section p {
  color: var(--muted);
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.8;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-3px);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.btn.secondary {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.hero-card {
  perspective: 1200px;
  min-width: 0;
  overflow: clip;
}

.terminal {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 28px;
  overflow: hidden;
  background: rgba(10, 14, 25, 0.86);
  box-shadow: var(--shadow);
  transform: rotateY(-7deg) rotateX(5deg);
  animation: cardTilt 6s ease-in-out infinite;
}

.terminal-top {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.terminal-top span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
}

.terminal-top span:nth-child(2) { background: var(--accent-2); }
.terminal-top span:nth-child(3) { background: var(--accent-3); }

pre {
  margin: 0;
  padding: 28px;
  overflow: auto;
  max-width: 100%;
}

code {
  color: #dce4ff;
  font-family: "Space Mono", monospace;
  font-size: clamp(12px, 1.5vw, 14px);
  line-height: 1.8;
}

.split {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(24px, 4vw, 40px);
}

.content-card,
.skill-card,
.project-card,
.contact-section {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 30px;
  padding: clamp(22px, 3vw, 30px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.quote-section {
  padding-top: 40px;
  padding-bottom: 40px;
}

blockquote {
  margin: 0;
  padding: clamp(24px, 4vw, 46px);
  border-radius: 36px;
  border: 1px solid rgba(0, 229, 255, 0.24);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(0, 229, 255, 0.08));
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1.15;
  letter-spacing: -0.045em;
}

.skills-grid,
.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.skill-card {
  position: relative;
  overflow: hidden;
  min-height: 310px;
}

.skill-card::before,
.project-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(circle at top left, rgba(0, 229, 255, 0.22), transparent 35%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.skill-card:hover::before,
.project-card:hover::before {
  opacity: 1;
}

.card-index {
  display: inline-flex;
  color: var(--accent-2);
  font-family: "Space Mono", monospace;
  margin-bottom: 38px;
}

.skill-card p {
  color: var(--muted);
  line-height: 1.7;
}

ul {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text);
}

li {
  margin: 10px 0;
  color: #d8deea;
}

li::before {
  content: "→";
  margin-right: 8px;
  color: var(--accent-2);
}

.timeline {
  position: relative;
  display: grid;
  gap: 14px;
  max-width: 980px;
  width: 100%;
}

.compact-timeline {
  padding-left: 26px;
}

.compact-timeline::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 7px;
  width: 1px;
  background: linear-gradient(
    to bottom,
    rgba(0, 229, 255, 0),
    rgba(0, 229, 255, 0.55),
    rgba(124, 92, 255, 0.28),
    rgba(0, 229, 255, 0)
  );
}

.timeline-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 22px;
  min-height: auto;
  padding: 22px 24px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(14px);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 28px;
  left: -25px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 0 6px rgba(0, 229, 255, 0.10), 0 0 22px rgba(0, 229, 255, 0.55);
}

.timeline-item::after {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(circle at top left, rgba(0, 229, 255, 0.18), transparent 34%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.timeline-item:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 229, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

.timeline-item:hover::after {
  opacity: 1;
}

.timeline-tag {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  max-width: 210px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.14);
  background: rgba(0, 229, 255, 0.075);
  color: var(--accent-2);
  font-family: "Space Mono", monospace;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.timeline-content {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}

.timeline-content h3 {
  margin: 0 0 8px;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.2;
}

.timeline-content p {
  margin: 0;
  max-width: 820px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.projects-grid {
  grid-template-columns: repeat(3, 1fr);
}

.project-card {
  position: relative;
  overflow: hidden;
}

.project-visual {
  height: clamp(160px, 24vw, 180px);
  border-radius: 22px;
  margin-bottom: 24px;
  background:
    linear-gradient(135deg, rgba(124,92,255,0.75), rgba(0,229,255,0.38)),
    linear-gradient(90deg, transparent 48%, rgba(255,255,255,0.18) 50%, transparent 52%);
  background-size: 100% 100%, 32px 32px;
  animation: scan 4s linear infinite;
}

.project-card a {
  color: var(--accent-2);
  font-weight: 800;
}

.contact-section {
  text-align: center;
  max-width: 860px;
}

.contact-section h2 {
  margin-bottom: 20px;
}

.contact-actions {
  justify-content: center;
}

.footer {
  position: relative;
  z-index: 2;
  padding: 34px 16px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.12s; }
.delay-2 { transition-delay: 0.22s; }
.delay-3 { transition-delay: 0.32s; }

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(22px, -26px, 0); }
}

@keyframes cardTilt {
  0%, 100% { transform: rotateY(-7deg) rotateX(5deg) translateY(0); }
  50% { transform: rotateY(-2deg) rotateX(2deg) translateY(-14px); }
}

@keyframes scan {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 0, 64px 0; }
}

@media (max-width: 980px) {
  .hero,
  .split {
    grid-template-columns: 1fr;
  }

  .skills-grid,
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    min-height: auto;
  }

  .terminal {
    transform: none;
  }
}

@media (max-width: 860px) {
  .header {
    width: calc(100% - 20px);
    border-radius: 20px;
  }

  .nav-toggle {
    display: block;
    flex: 0 0 auto;
  }

  .nav {
    position: fixed;
    top: 82px;
    left: 10px;
    right: 10px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: rgba(6, 7, 13, 0.94);
    box-shadow: var(--shadow);
  }

  .nav.open {
    display: flex;
  }

  .brand {
    max-width: calc(100% - 68px);
  }
}

@media (max-width: 720px) {
  .section {
    width: calc(100% - 12px);
    padding: 72px 0;
  }

  .hero,
  .split {
    display: flex;
    flex-direction: column;
    gap: 22px;
  }

  .skills-grid,
  .projects-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 14px;
  }

  .skill-card,
  .project-card {
    flex: 1 1 calc(50% - 7px);
    min-width: 0;
  }

  .content-card,
  .skill-card,
  .project-card,
  .contact-section,
  .timeline-item {
    padding: 18px;
  }

  .hero {
    padding-top: 130px;
  }

  .hero-network-card {
    inset: -20px;
  }

  .compact-timeline {
    padding-left: 18px;
  }

  .compact-timeline::before {
    left: 5px;
  }

  .timeline-item {
    flex-direction: column;
    gap: 14px;
    padding-left: 18px;
  }

  .timeline-item::before {
    left: -18px;
  }

  .timeline-tag {
    max-width: 100%;
  }

  blockquote {
    padding: 24px 18px;
  }

  h1 {
    font-size: clamp(44px, 12vw, 58px);
  }

  h2 {
    font-size: clamp(30px, 8vw, 42px);
  }

  .hero-text,
  .content-card p,
  .timeline-item p,
  .project-card p,
  .contact-section p,
  .skill-card p,
  .timeline-content p {
    font-size: 17px;
    line-height: 1.75;
  }

  h3,
  .timeline-content h3 {
    font-size: 22px;
    line-height: 1.25;
  }
}

@media (max-width: 640px) {
  .skills-grid,
  .projects-grid {
    gap: 12px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .brand span:last-child {
    font-size: 13px;
  }

  h1 {
    letter-spacing: -0.05em;
  }

  .skill-card {
    min-height: 0;
  }

  .skill-card,
  .project-card {
    flex-basis: 100%;
  }

  .timeline-item,
  .content-card,
  .skill-card,
  .project-card,
  .contact-section {
    border-radius: 24px;
  }
}

@media (max-width: 480px) {
  .header {
    margin-top: 10px;
    padding: 12px 14px;
  }

  .nav {
    top: 74px;
  }

  .section {
    width: calc(100% - 8px);
  }

  .hero {
    padding-top: 118px;
  }

  .content-card,
  .skill-card,
  .project-card,
  .contact-section,
  .timeline-item {
    padding: 16px;
  }

  h1 {
    font-size: clamp(42px, 12.5vw, 52px);
  }

  h2 {
    font-size: clamp(28px, 8.5vw, 38px);
  }

  .hero-text,
  .content-card p,
  .timeline-item p,
  .project-card p,
  .contact-section p,
  .skill-card p,
  .timeline-content p {
    font-size: 17px;
  }

  .terminal-top {
    padding: 14px;
  }

  pre {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}


/* ===== Network / motion design layer ===== */
.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(0,229,255,.12), transparent 22rem), #03050b;
  animation: bootOut .7s ease 1.7s forwards;
}

.boot-core {
  position: relative;
  display: grid;
  place-items: center;
  width: 110px;
  height: 110px;
  color: #fff;
  font-weight: 900;
  letter-spacing: -.04em;
}

.boot-ring,
.boot-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(0,229,255,.42);
}

.boot-ring {
  border-top-color: transparent;
  animation: spin 1.2s linear infinite;
}

.boot-pulse {
  inset: 18px;
  background: radial-gradient(circle, rgba(0,229,255,.20), transparent 65%);
  animation: pulse 1.4s ease-in-out infinite;
}

.boot-track {
  position: absolute;
  width: min(420px, calc(100% - 48px));
  height: 2px;
  margin-top: 190px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}

.boot-track span {
  display: block;
  height: 100%;
  width: 42%;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
  animation: dataBoot 1.1s ease-in-out infinite;
}

@media (max-width: 720px) {
  .boot-core {
    width: 148px;
    height: 148px;
    font-size: 30px;
  }

  .boot-pulse {
    inset: 24px;
  }

  .boot-track {
    width: min(520px, calc(100% - 28px));
    margin-top: 230px;
  }
}

.network-flow {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  opacity: .78;
}

.network-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,229,255,.22), transparent);
  overflow: hidden;
}

.network-line::after,
.network-section::after,
.timeline-item::after,
.skill-card::after,
.project-card::after,
.content-card::after,
.contact-section::after,
.quote-section blockquote::after {
  content: "";
  position: absolute;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.95), var(--accent-2), transparent);
  filter: drop-shadow(0 0 10px var(--accent-2));
}

.line-a { top: 18%; left: 8%; width: 38vw; transform: rotate(18deg); }
.line-b { top: 45%; right: 6%; width: 46vw; transform: rotate(-14deg); }
.line-c { bottom: 18%; left: 18%; width: 54vw; transform: rotate(8deg); }

.network-line::after {
  top: 0;
  left: -30%;
  width: 120px;
  height: 1px;
  animation: flowLine 4.6s linear infinite;
}

.line-b::after { animation-delay: 1.25s; }
.line-c::after { animation-delay: 2.1s; }

.network-node {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 18px var(--accent-2), 0 0 42px rgba(0,229,255,.35);
  animation: nodeBeat 2.4s ease-in-out infinite;
}

.node-a { top: 17%; left: 14%; }
.node-b { top: 31%; right: 17%; animation-delay: .5s; }
.node-c { bottom: 31%; left: 10%; animation-delay: 1s; }
.node-d { bottom: 18%; right: 24%; animation-delay: 1.5s; }

.header {
  background: rgba(3, 5, 11, 0.66);
  box-shadow: 0 18px 70px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.05);
}

.brand-mark,
.btn.primary {
  box-shadow: 0 0 22px rgba(0,229,255,.28);
}

.section {
  padding: 92px 0;
}

.network-section {
  isolation: isolate;
}

.network-section::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 96px;
  bottom: -74px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(0,229,255,.32), rgba(124,92,255,.18), transparent);
  z-index: -1;
}

.network-section::after {
  left: -88px;
  top: 96px;
  width: 108px;
  height: 1px;
  animation: sectionCurrent 3.2s ease-in-out infinite;
}

.hero {
  padding-top: 142px;
}

.hero-card {
  position: relative;
}

.hero-network-card {
  position: absolute;
  inset: -38px;
  border-radius: 40px;
  background:
    linear-gradient(90deg, transparent 49%, rgba(0,229,255,.25) 50%, transparent 51%),
    linear-gradient(transparent 49%, rgba(0,229,255,.16) 50%, transparent 51%);
  background-size: 80px 80px;
  opacity: .38;
  mask-image: radial-gradient(circle, black 35%, transparent 72%);
  animation: circuitDrift 12s linear infinite;
}

.chip {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--accent-2);
  box-shadow: 0 0 18px var(--accent-2);
}

.chip-1 { top: 22%; left: 12%; }
.chip-2 { top: 18%; right: 18%; }
.chip-3 { bottom: 20%; left: 22%; }
.chip-4 { bottom: 26%; right: 12%; }

.content-card,
.skill-card,
.timeline-item,
.project-card,
.contact-section,
blockquote {
  position: relative;
  overflow: hidden;
  box-shadow: 0 22px 72px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.04);
}

.content-card::after,
.skill-card::after,
.timeline-item::after,
.project-card::after,
.contact-section::after,
.quote-section blockquote::after {
  top: 0;
  left: -55%;
  width: 42%;
  height: 1px;
  animation: cardCurrent 4.2s ease-in-out infinite;
}

.skill-card:nth-child(2)::after,
.timeline-item:nth-child(2)::after,
.project-card:nth-child(2)::after { animation-delay: .65s; }
.skill-card:nth-child(3)::after,
.timeline-item:nth-child(3)::after,
.project-card:nth-child(3)::after { animation-delay: 1.25s; }
.skill-card:nth-child(4)::after,
.timeline-item:nth-child(4)::after { animation-delay: 1.85s; }

.terminal {
  background:
    radial-gradient(circle at 80% 10%, rgba(0,229,255,.14), transparent 38%),
    rgba(6, 12, 26, 0.88);
  box-shadow: 0 26px 90px rgba(0,0,0,.55), 0 0 40px rgba(0,229,255,.08);
}

.terminal::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(0,229,255,.06), transparent);
  transform: translateY(-100%);
  animation: terminalScan 4s ease-in-out infinite;
}

/* Compact premium timeline */
.timeline.compact-timeline {
  position: relative;
  display: grid;
  gap: 16px;
}

.timeline.compact-timeline::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 28px;
  bottom: 28px;
  width: 1px;
  background: linear-gradient(180deg, rgba(0,229,255,.08), rgba(0,229,255,.48), rgba(124,92,255,.18));
}

.timeline-item {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  min-height: auto;
  padding: 22px 26px 22px 58px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(8,14,28,.82), rgba(255,255,255,.035));
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: var(--accent-2);
  box-shadow: 0 0 16px var(--accent-2), 0 0 38px rgba(0,229,255,.28);
}

.timeline-tag {
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid rgba(0,229,255,.16);
  border-radius: 999px;
  background: rgba(0,229,255,.06);
  color: var(--accent-2);
  font-family: "Space Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.timeline-content h3 {
  margin: 0 0 8px;
  font-size: 21px;
}

.timeline-content p {
  margin: 0;
  max-width: 850px;
  font-size: 15.5px;
  line-height: 1.65;
}

@keyframes bootOut {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes pulse {
  0%,100% { transform: scale(.92); opacity: .52; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes dataBoot {
  from { transform: translateX(-110%); }
  to { transform: translateX(260%); }
}

@keyframes flowLine {
  from { transform: translateX(0); }
  to { transform: translateX(72vw); }
}

@keyframes nodeBeat {
  0%,100% { transform: scale(1); opacity: .55; }
  50% { transform: scale(1.65); opacity: 1; }
}

@keyframes sectionCurrent {
  0% { transform: translateY(0) translateX(-16px); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: translateY(290px) translateX(16px); opacity: 0; }
}

@keyframes cardCurrent {
  0% { transform: translateX(0); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateX(360%); opacity: 0; }
}

@keyframes circuitDrift {
  from { background-position: 0 0; }
  to { background-position: 80px 80px; }
}

@keyframes terminalScan {
  0%, 28% { transform: translateY(-100%); }
  55%, 100% { transform: translateY(100%); }
}

@media (max-width: 980px) {
  .network-section::before,
  .network-section::after {
    display: none;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 24px 24px 24px 54px;
  }
}

@media (max-width: 720px) {
  .network-flow {
    opacity: .38;
  }

  .boot-core {
    width: 92px;
    height: 92px;
  }

  .timeline.compact-timeline::before {
    left: 18px;
  }

  .timeline-item {
    padding-left: 46px;
  }

  .timeline-item::before {
    left: 13px;
  }
}

@media (hover: none), (pointer: coarse) {
  .cursor-glow {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot-loader { display: none; }
}

/* =========================================================
   ROUTING NETWORK SCROLL TRANSITION — câble visuel réel
   ========================================================= */

.routing-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.86;
}

.routing-svg {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.routing-cable,
.routing-energy {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.routing-cable-shadow {
  stroke: rgba(0, 0, 0, 0.58);
  stroke-width: 16;
  opacity: 0.42;
}

.routing-cable-main {
  stroke: url("#routingCableGradient");
  stroke-width: 4;
  opacity: 0.72;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.18));
}

.routing-cable-secondary {
  stroke: rgba(124, 92, 255, 0.16);
  stroke-width: 2;
  stroke-dasharray: 10 15;
  opacity: 0.58;
}

.routing-energy {
  stroke: rgba(0, 229, 255, 0.94);
  stroke-width: 5;
  opacity: 0.92;
  filter: url("#routingGlow");
  transition: stroke-width 0.18s ease;
}

.routing-energy-secondary {
  stroke: rgba(124, 92, 255, 0.64);
  stroke-width: 3;
  opacity: 0.55;
}

.routing-packet {
  opacity: 0;
  filter:
    drop-shadow(0 0 7px rgba(0, 229, 255, 1))
    drop-shadow(0 0 22px rgba(0, 229, 255, 0.62));
}

.routing-packet-main {
  fill: #f4feff;
  stroke: #00e5ff;
  stroke-width: 2;
}

.routing-packet-tail {
  fill: rgba(0, 229, 255, 0.48);
}

.routing-packet-secondary {
  fill: #7c5cff;
  filter:
    drop-shadow(0 0 7px rgba(124, 92, 255, 0.95))
    drop-shadow(0 0 18px rgba(124, 92, 255, 0.5));
}

/* On neutralise l'ancien effet qui créait surtout un point/flash par section */
.route-flash,
.network-section::before,
.network-section::after {
  display: none !important;
  content: none !important;
}

/* La section active reçoit seulement une légère réaction lumineuse, sans point parasite */
.network-section.route-active .section-title,
.network-section.route-active .content-card,
.network-section.route-active .skill-card,
.network-section.route-active .timeline-item,
.network-section.route-active .project-card,
.network-section.route-active .hero-content,
.network-section.route-active .hero-card,
.network-section.route-active blockquote {
  animation: routeCardPulse 0.75s ease both;
}

@keyframes routeCardPulse {
  0% {
    box-shadow: var(--shadow);
  }
  42% {
    box-shadow:
      0 24px 80px rgba(0, 0, 0, 0.45),
      0 0 0 1px rgba(0, 229, 255, 0.20),
      0 0 34px rgba(0, 229, 255, 0.11);
  }
  100% {
    box-shadow: var(--shadow);
  }
}

@media (max-width: 980px) {
  .routing-layer {
    opacity: 0.58;
  }

  .routing-cable-secondary,
  .routing-energy-secondary,
  .routing-packet-secondary {
    display: none;
  }

  .routing-cable-shadow {
    stroke-width: 11;
  }

  .routing-cable-main {
    stroke-width: 3;
  }

  .routing-energy-main {
    stroke-width: 4;
  }
}

@media (max-width: 720px) {
  .routing-layer {
    z-index: 3;
    opacity: 0.78;
  }

  .routing-cable-shadow {
    stroke-width: 7;
    opacity: 0.24;
  }

  .routing-cable-main {
    stroke-width: 2.4;
    opacity: 0.9;
  }

  .routing-energy-main {
    stroke-width: 3.4;
    opacity: 1;
  }

  .routing-packet-tail {
    opacity: 0.72;
  }
}

@media (prefers-reduced-motion: reduce) {
  .routing-layer {
    display: none !important;
  }
}
