:root {
  --bg: #101215;
  --bg-soft: #181c21;
  --surface: rgba(24, 28, 33, 0.88);
  --surface-strong: rgba(24, 28, 33, 0.98);
  --text: #e6e9ef;
  --muted: #a7afba;
  --accent: #8b95a3;
  --accent-2: #d9dee5;
  --line: rgba(217, 222, 229, 0.24);
  --shadow: 0 16px 40px rgba(2, 8, 18, 0.45);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Fira Code", "Cascadia Code", Consolas, "Courier New", monospace;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% -5%, rgba(217, 222, 229, 0.16) 0%, transparent 45%),
    radial-gradient(circle at 85% 8%, rgba(139, 149, 163, 0.2) 0%, transparent 38%),
    linear-gradient(140deg, rgba(9, 10, 12, 0.7), rgba(14, 16, 19, 0.8)),
    url("s.jpg") center/cover no-repeat;
  opacity: 0.95;
  pointer-events: none;
  z-index: -3;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(217, 222, 229, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(217, 222, 229, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
  pointer-events: none;
  z-index: -2;
}

.pipeline-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.pipeline-lane {
  position: absolute;
  left: 4%;
  width: 92%;
  display: grid;
  grid-template-columns: 1fr 0.55fr 1fr 0.55fr 1fr 0.55fr 1fr 0.55fr 1fr 0.55fr 1fr 0.55fr 1fr;
  align-items: center;
  gap: 0.38rem;
  opacity: 0.36;
}

.lane-a { top: 19%; }
.lane-b { top: 82%; transform: scale(0.96); opacity: 0.26; }

.stage {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border: 1px solid rgba(217, 222, 229, 0.34);
  background: rgba(20, 24, 29, 0.72);
  color: rgba(230, 233, 239, 0.88);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  animation: stagePulse 7.2s linear infinite;
}

.connector {
  position: relative;
  display: block;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    rgba(217, 222, 229, 0.5) 0 8px,
    transparent 8px 15px
  );
}

.connector::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -3px;
  width: 0;
  height: 0;
  border-left: 6px solid rgba(217, 222, 229, 0.42);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.runner {
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #eef2f7;
  box-shadow: 0 0 14px rgba(217, 222, 229, 0.85);
  transform: translateY(-50%);
  animation: runPipeline 7.2s linear infinite;
}

.runner::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 222, 229, 0.42) 0%, transparent 72%);
}

.runner.r2 {
  animation-delay: 2.6s;
}

.stage.s1 { animation-delay: 0s; }
.stage.s2 { animation-delay: 0.9s; }
.stage.s3 { animation-delay: 1.8s; }
.stage.s4 { animation-delay: 2.7s; }
.stage.s5 { animation-delay: 3.6s; }
.stage.s6 { animation-delay: 4.5s; }
.stage.s7 { animation-delay: 5.4s; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(15, 18, 22, 0.74);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 4.5rem);
}

.brand {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
}

.site-nav {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.86rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.3rem 0.62rem;
  transition: all 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  border-color: var(--line);
  color: var(--accent-2);
  background: rgba(30, 35, 41, 0.72);
}

main {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 2.5rem) 4rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  align-items: center;
  gap: clamp(1.2rem, 4vw, 3rem);
  min-height: min(78vh, 740px);
}

.kicker {
  color: var(--accent-2);
  letter-spacing: 0.07em;
  margin-bottom: 0.7rem;
  font-size: 0.86rem;
}

.hero h1 {
  font-size: clamp(1.8rem, 3.8vw, 3.05rem);
  line-height: 1.12;
  margin-bottom: 1rem;
  text-wrap: balance;
}

.hero p {
  color: var(--muted);
  line-height: 1.75;
  max-width: 62ch;
}

.hero-actions {
  margin-top: 1.6rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.btn {
  text-decoration: none;
  border-radius: 0;
  padding: 0.68rem 1.05rem;
  border: 1px solid var(--line);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: transparent;
  color: var(--accent-2);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent-2);
  color: #101010;
  background: var(--accent-2);
  box-shadow: none;
}

.btn-ghost {
  border-color: rgba(139, 149, 163, 0.45);
  background: transparent;
  color: var(--text);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: #101010;
  background: var(--accent);
}

.hero-links {
  list-style: none;
  margin-top: 1.25rem;
  display: grid;
  gap: 0.55rem;
}

.hero-links li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.hero-links a {
  color: inherit;
  text-decoration: none;
}

.hero-links a:hover,
.hero-links a:focus-visible {
  color: var(--accent-2);
}

.hero-visual {
  justify-self: center;
  width: min(100%, 300px);
  animation: rise 900ms ease 1;
}

.hero-visual img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  opacity: 0.96;
  transition: transform 260ms ease, filter 260ms ease, opacity 260ms ease;
}

.hero-visual img:hover,
.hero-visual img:focus-visible {
  transform: scale(1.04) translateY(-2px);
  filter: drop-shadow(0 14px 24px rgba(217, 222, 229, 0.22));
  opacity: 1;
}

.section {
  margin-top: 3rem;
  padding: 0.2rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 620ms ease forwards;
}

.section:nth-of-type(2) { animation-delay: 120ms; }
.section:nth-of-type(3) { animation-delay: 180ms; }
.section:nth-of-type(4) { animation-delay: 240ms; }
.section:nth-of-type(5) { animation-delay: 300ms; }
.section:nth-of-type(6) { animation-delay: 360ms; }

.section h2 {
  font-size: clamp(1.15rem, 2vw, 1.65rem);
  margin-bottom: 0.9rem;
  color: var(--accent-2);
}

.section > p {
  color: var(--muted);
  line-height: 1.72;
}

.grid {
  display: grid;
  gap: 0.95rem;
  margin-top: 1rem;
}

.cards-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.card {
  border: 0;
  border-left: 2px solid rgba(139, 149, 163, 0.6);
  border-radius: 0;
  background: transparent;
  padding: 0.7rem 0 0.7rem 0.9rem;
  clip-path: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(217, 222, 229, 0.52);
  box-shadow: none;
}

.grid .card:nth-child(odd) {
  transform: none;
}

.grid .card:nth-child(even) {
  transform: none;
}

.grid .card:nth-child(odd):hover,
.grid .card:nth-child(even):hover {
  transform: translateY(-2px);
}

.card h3 {
  font-size: 0.96rem;
  margin-bottom: 0.45rem;
}

.card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.62;
}

.cert-card h3 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cert-card h3 i {
  color: var(--accent-2);
  font-size: 1.08rem;
}

.cert-badges {
  margin-top: 0.72rem;
  display: flex;
  gap: 0.48rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.24rem 0.52rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(36, 42, 49, 0.72);
  color: var(--accent-2);
  font-size: 0.74rem;
  font-weight: 700;
}

.timeline {
  margin-top: 1rem;
  display: grid;
  gap: 0.95rem;
}

.timeline article {
  border-left: 3px solid rgba(139, 149, 163, 0.75);
  padding: 0.2rem 0 0.25rem 0.85rem;
}

.timeline h3 {
  font-size: 0.97rem;
}

.timeline p {
  margin-top: 0.3rem;
  color: var(--muted);
  line-height: 1.65;
}

.project-links {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.project-links a {
  text-decoration: none;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.33rem 0.55rem;
  background: transparent;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.project-links a:hover,
.project-links a:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent-2);
  background: var(--accent-2);
  color: #101010;
}

.contact {
  text-align: center;
}

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes runPipeline {
  0% {
    left: 0%;
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  96% {
    opacity: 1;
  }
  100% {
    left: calc(100% - 8px);
    opacity: 0;
  }
}

@keyframes stagePulse {
  0%, 13% {
    border-color: rgba(217, 222, 229, 0.34);
    background: rgba(20, 24, 29, 0.72);
    color: rgba(230, 233, 239, 0.8);
  }
  18%, 26% {
    border-color: rgba(232, 236, 242, 0.85);
    background: rgba(43, 50, 60, 0.92);
    color: rgba(245, 247, 250, 0.98);
  }
  31%, 100% {
    border-color: rgba(217, 222, 229, 0.34);
    background: rgba(20, 24, 29, 0.72);
    color: rgba(230, 233, 239, 0.8);
  }
}

@media (max-width: 980px) {
  .pipeline-lane {
    opacity: 0.16;
  }

  .stage {
    font-size: 0.5rem;
    min-height: 20px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-visual {
    max-width: 260px;
  }

  .cards-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .pipeline-bg {
    display: none;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cards-2,
  .cards-3 {
    grid-template-columns: 1fr;
  }

  .section {
    margin-top: 2.2rem;
    padding: 0.1rem 0;
  }
}
