:root {
  --bg: #040806;
  --bg-soft: #08110d;
  --panel: #0b1510;
  --panel-alt: #09100c;
  --text: #fffef1;
  --muted: #aaa691;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --accent: #2cff88;
  --accent-soft: #c9ffd9;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  font-family: "DM Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top center, rgba(44, 255, 136, 0.11), transparent 28%),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.03), transparent 18%),
    linear-gradient(180deg, #050906 0%, #040806 100%);
}

.bg-animation,
.bg-orbs,
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg-animation {
  z-index: 0;
  overflow: hidden;
}

.bg-orbs {
  background:
    radial-gradient(circle at 18% 22%, rgba(44, 255, 136, 0.14), transparent 0 18%),
    radial-gradient(circle at 78% 18%, rgba(44, 255, 136, 0.08), transparent 0 14%),
    radial-gradient(circle at 68% 72%, rgba(44, 255, 136, 0.11), transparent 0 18%),
    radial-gradient(circle at 30% 82%, rgba(255, 255, 255, 0.04), transparent 0 16%);
  filter: blur(28px);
  transform: scale(1.08);
  animation: ambient-drift 18s ease-in-out infinite alternate;
}

.bg-grid {
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black 42%, transparent 88%);
  animation: grid-drift 24s linear infinite;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: #fff;
  color: #000;
}

.page-shell {
  width: min(1120px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 4rem;
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: 0.25rem;
  backdrop-filter: blur(14px);
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 11, 16, 0.88);
  width: 100%;
  padding-left: max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  color: var(--muted);
}

.nav-links a:hover,
.contact-links a:hover,
.button:hover {
  color: var(--text);
}

.hero-section {
  padding: 5.5rem 0 4rem;
}

.eyebrow,
.section-label,
.project-index {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-main .eyebrow {
  font-size: clamp(1.9rem, 4.8vw, 4.4rem);
  letter-spacing: -0.04em;
  text-transform: none;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  font-weight: 800;
}

#about .section-label,
#experience .section-label,
#skills .section-label,
#projects .section-label,
#education .section-label,
#contact .section-label {
  font-size: clamp(1rem, 1.6vw, 1.45rem);
  letter-spacing: 0.08em;
}

.hero-title,
h2,
h3,
.brand,
.stat-card strong {
  font-family: "Manrope", sans-serif;
}

.hero-title {
  max-width: 100%;
  margin: 1rem 0 1.2rem;
  font-size: clamp(0.82rem, 2.8vw, 3.05rem);
  line-height: 1.16;
  letter-spacing: -0.04em;
}

.hero-title span {
  color: var(--accent-soft);
}

.hero-summary {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.75;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.hero-main,
.hero-side {
  display: flex;
  justify-content: center;
}

.hero-main {
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: min(100%, 860px);
  margin: 0 auto;
}

.hero-note {
  width: min(100%, 760px);
  padding: 1.2rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01));
}

.hero-side-label {
  margin: 0 0 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
}

.hero-note p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-title-typed {
  max-width: none;
  min-height: 1.5em;
  padding-bottom: 0.18em;
}

.typed-shell {
  position: relative;
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: visible;
  padding-bottom: 0.14em;
}

.typed-ghost {
  visibility: hidden;
}

.typed-text {
  position: absolute;
  inset: 0 auto 0 0;
  display: inline-block;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  color: var(--accent-soft);
  width: 0;
  animation: typing 3.8s steps(48, end) 0.2s forwards;
}

.typed-cursor {
  position: absolute;
  top: 0.08em;
  left: 0;
  display: inline-block;
  width: 0.08em;
  height: 0.9em;
  background: var(--accent-soft);
  vertical-align: -0.08em;
  animation:
    cursor-track 3.8s steps(48, end) 0.2s forwards,
    blink 900ms steps(1) infinite;
}

.typed-mobile {
  display: none;
}

.hero-actions,
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.hero-actions {
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.85rem 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: var(--text);
  color: #0a0d13;
}

.button.secondary {
  background: transparent;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 3.25rem;
}

.stat-card {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  box-shadow: var(--shadow);
}

.stat-card strong {
  display: block;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.06em;
}

.stat-card span {
  display: block;
  margin-top: 0.4rem;
  color: var(--muted);
}

.section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 2rem;
}

h2 {
  max-width: 14ch;
  margin: 0.5rem 0 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

h3 {
  margin: 0;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  letter-spacing: -0.04em;
}

.copy-block {
  max-width: 760px;
}

.copy-block p {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.8;
  font-size: 1.05rem;
}

.timeline-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.timeline-rail-column {
  position: relative;
  align-self: stretch;
  min-height: 100%;
}

.timeline-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 1.2rem;
  width: 2px;
  background: rgba(44, 255, 136, 0.14);
  border-radius: 999px;
}

.timeline-rail-progress {
  position: absolute;
  top: 0;
  left: 1.2rem;
  width: 2px;
  height: 0;
  background: linear-gradient(180deg, rgba(44, 255, 136, 0.22), #2cff88 42%, #c9ffd9 100%);
  border-radius: 999px;
  box-shadow: 0 0 28px rgba(44, 255, 136, 0.45);
}

.timeline-rail-glow {
  position: absolute;
  left: 1.2rem;
  top: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2cff88;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 8px rgba(44, 255, 136, 0.14),
    0 0 30px rgba(44, 255, 136, 0.72);
  animation: rail-pulse 1.6s ease-in-out infinite;
}

.timeline {
  display: grid;
  gap: 1.5rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 1.5rem 2rem;
  padding: 1.7rem 1.7rem 1.8rem;
  border: 1px solid rgba(44, 255, 136, 0.08);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(7, 15, 11, 0.96), rgba(5, 11, 8, 0.92));
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
  opacity: 0.35;
  transform: translateY(28px);
  transition:
    opacity 700ms ease,
    transform 700ms ease,
    border-color 700ms ease,
    box-shadow 700ms ease,
    background-color 700ms ease;
}

.timeline-item.visible {
  opacity: 0.82;
  transform: translateY(0);
}

.timeline-item.is-active {
  opacity: 1;
  border-color: rgba(44, 255, 136, 0.18);
  background: linear-gradient(180deg, rgba(10, 20, 14, 0.98), rgba(5, 11, 8, 0.94));
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(44, 255, 136, 0.06) inset,
    0 0 36px rgba(44, 255, 136, 0.12);
}

.role {
  margin: 0.35rem 0 0;
  color: var(--accent-soft);
  font-weight: 500;
}

.timeline-main ul {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.8;
}

.timeline-meta {
  text-align: right;
  color: var(--muted);
}

.timeline-meta p {
  margin: 0;
}

.skills-layout,
.education-grid {
  display: grid;
  gap: 1rem;
}

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

.skill-group,
.info-card,
.contact-panel {
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01));
  box-shadow: var(--shadow);
}

.skill-group h3,
.info-card h3 {
  margin-bottom: 1rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.chip-list span,
.contact-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.7rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.project-card-link {
  display: block;
  border-radius: 28px;
}

.project-card {
  height: 100%;
  padding: 1.5rem;
  border: 1px solid rgba(44, 255, 136, 0.08);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(8, 16, 11, 0.96), rgba(5, 11, 8, 0.92));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
  transition:
    transform 240ms ease,
    border-color 240ms ease,
    background-color 240ms ease,
    box-shadow 240ms ease;
}

.project-card-link:hover .project-card,
.project-card-link:focus-visible .project-card {
  transform: translateY(-6px);
  border-color: rgba(44, 255, 136, 0.2);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(44, 255, 136, 0.08) inset;
  background: linear-gradient(180deg, rgba(10, 20, 14, 0.98), rgba(5, 11, 8, 0.94));
}

.project-card-link:hover h3,
.project-card-link:focus-visible h3,
.project-card-link:hover .project-icon,
.project-card-link:focus-visible .project-icon {
  color: var(--accent-soft);
}

.project-card-link:focus-visible {
  outline: 2px solid rgba(44, 255, 136, 0.45);
  outline-offset: 4px;
}

.project-card p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.project-card h3 {
  margin-top: 0.25rem;
}

.project-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-top: 0.85rem;
  border: 1px solid rgba(44, 255, 136, 0.14);
  border-radius: 16px;
  color: var(--accent);
  background: rgba(44, 255, 136, 0.06);
  transition:
    color 240ms ease,
    border-color 240ms ease,
    background-color 240ms ease;
}

.project-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.project-stack {
  color: var(--accent-soft) !important;
  font-size: 0.95rem;
  margin-top: 1.2rem !important;
}

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

.education-list {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.education-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem 2rem;
  align-items: center;
  padding: 1.4rem 1.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.education-row h3 {
  margin: 0;
}

.education-row p,
.education-row span {
  color: var(--muted);
}

.education-row p {
  margin: 0.45rem 0 0;
}

.education-row span {
  white-space: nowrap;
}

.certifications-grid {
  margin-top: 1.25rem;
}

.cert-card-link {
  display: block;
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease,
    box-shadow 220ms ease;
}

.cert-card-link:hover,
.cert-card-link:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(44, 255, 136, 0.18);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(44, 255, 136, 0.08) inset;
}

.cert-card-link:hover h3,
.cert-card-link:focus-visible h3 {
  color: var(--accent-soft);
}

.cert-card-link:focus-visible {
  outline: 2px solid rgba(44, 255, 136, 0.45);
  outline-offset: 4px;
}

.info-card p,
.info-card span {
  color: var(--muted);
}

.info-card span {
  display: inline-block;
  margin-top: 0.6rem;
}

.contact-panel {
  display: grid;
  gap: 1.5rem;
}

.contact-links {
  margin-top: 0.5rem;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 700ms ease,
    transform 700ms ease;
}

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

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

@keyframes ambient-drift {
  0% {
    transform: translate3d(-2%, -1%, 0) scale(1.06);
  }

  50% {
    transform: translate3d(2%, 2%, 0) scale(1.1);
  }

  100% {
    transform: translate3d(-1%, 4%, 0) scale(1.08);
  }
}

@keyframes grid-drift {
  0% {
    transform: translate3d(0, 0, 0);
  }

  100% {
    transform: translate3d(44px, 22px, 0);
  }
}

@keyframes rail-pulse {
  0%,
  100% {
      box-shadow:
      0 0 0 8px rgba(44, 255, 136, 0.1),
      0 0 22px rgba(44, 255, 136, 0.56);
  }

  50% {
      box-shadow:
      0 0 0 14px rgba(44, 255, 136, 0.07),
      0 0 36px rgba(44, 255, 136, 0.82);
  }
}

@keyframes typing {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

@keyframes cursor-track {
  from {
    left: 0;
  }

  to {
    left: calc(100% - 0.08em);
  }
}

@media (max-width: 900px) {
  .stats-grid,
  .skills-layout,
  .education-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.9rem;
    padding: 1.1rem 1rem 1.15rem;
    border-radius: 22px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .education-row {
    grid-template-columns: 1fr;
  }

  .education-row span {
    white-space: normal;
  }

  .timeline-wrap {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 0.9rem;
  }

  .timeline-rail-column {
    display: block;
  }

  .timeline-rail,
  .timeline-rail-progress {
    left: 0.9rem;
  }

  .timeline-rail-glow {
    left: 0.9rem;
    width: 14px;
    height: 14px;
  }

  .timeline-meta,
  .project-stack {
    text-align: left;
    white-space: normal;
  }

  .timeline-main h3 {
    font-size: clamp(1.25rem, 4vw, 1.6rem);
  }

  .timeline-main .role {
    font-size: 0.92rem;
  }

  .timeline-main ul {
    margin-top: 0.8rem;
    padding-left: 0.95rem;
    font-size: 0.95rem;
    line-height: 1.65;
  }

  .timeline-meta {
    font-size: 0.92rem;
  }

  .typed-shell {
    display: block;
    width: 100%;
    white-space: normal;
    overflow: hidden;
    padding-bottom: 0;
  }

  .typed-ghost {
    display: none;
  }

  .typed-text {
    display: none;
  }

  .typed-cursor {
    display: none;
  }

  .typed-mobile {
    display: grid;
    justify-items: center;
    gap: 0.2rem;
    color: var(--accent-soft);
    line-height: 1.22;
  }

  .typed-mobile-line {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    width: 0;
  }

  .typed-mobile-line-1 {
    animation: typing-mobile-line-1 1.9s steps(28, end) 0.2s forwards;
  }

  .typed-mobile-line-2 {
    animation: typing-mobile-line-2 1.4s steps(17, end) 2.15s forwards;
  }

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

  .button {
    width: 100%;
    max-width: 18rem;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 1rem, 1120px);
  }

  .topbar {
    justify-content: center;
    padding: 0.65rem 0;
  }

  .nav-links {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, max-content);
    justify-content: space-between;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .hero-section {
    padding: 3.5rem 0 3rem;
  }

  .hero-main {
    width: 100%;
  }

  .timeline-wrap {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 0.75rem;
  }

  .timeline-rail,
  .timeline-rail-progress {
    left: 0.7rem;
  }

  .timeline-rail-glow {
    left: 0.7rem;
    width: 12px;
    height: 12px;
    box-shadow:
      0 0 0 6px rgba(44, 255, 136, 0.12),
      0 0 22px rgba(44, 255, 136, 0.56);
  }

  .hero-main .eyebrow {
    font-size: clamp(1.8rem, 9vw, 2.9rem);
    text-align: center;
  }

  .hero-title {
    font-size: clamp(0.9rem, 5.2vw, 1.35rem);
    line-height: 1.25;
    letter-spacing: -0.04em;
    margin-top: 0.7rem;
  }

  .hero-summary {
    font-size: 0.98rem;
  }

  .typed-text {
    font-size: inherit;
    text-align: center;
    white-space: normal;
    width: 100%;
  }

  .hero-title-typed {
    min-height: auto;
    padding-bottom: 0;
  }

  .typed-mobile {
    font-size: clamp(0.92rem, 4.9vw, 1.22rem);
  }

  .timeline-item {
    padding: 0.95rem 0.9rem 1rem;
  }

  .timeline-main h3 {
    font-size: 1.15rem;
  }

  .timeline-main .role,
  .timeline-meta,
  .timeline-main ul {
    font-size: 0.9rem;
  }
}

@keyframes typing-mobile-line-1 {
  from {
    width: 0;
  }

  to {
    width: 28ch;
  }
}

@keyframes typing-mobile-line-2 {
  from {
    width: 0;
  }

  to {
    width: 17ch;
  }
}
