:root {
  --bg: #070916;
  --bg-elev: #0e1228;
  --bg-card: rgba(14, 18, 40, 0.8);
  --text: #eef2ff;
  --muted: #9da8d0;
  --line: rgba(138, 154, 232, 0.2);
  --accent: #6ae0ff;
  --accent-2: #7b71ff;
  --accent-3: #35f2b5;
  --danger: #ff7f97;
  --ok: #56e6ae;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius-lg: 24px;
  --radius-md: 16px;
}

@property --border-spin-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@property --card-spin-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 10%, #121b44 0%, transparent 35%),
    radial-gradient(circle at 80% 30%, #15285e 0%, transparent 40%),
    radial-gradient(circle at 22% 72%, rgba(34, 57, 130, 0.6) 0%, transparent 42%),
    radial-gradient(circle at 78% 88%, rgba(40, 80, 170, 0.52) 0%, transparent 46%),
    var(--bg);
  overflow-x: hidden;
  opacity: 1;
  transition: opacity 0.22s ease;
}

body.fonts-loading {
  visibility: hidden;
  opacity: 0;
}

body.fonts-loaded {
  visibility: visible;
  opacity: 1;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: 0;
}

.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: radial-gradient(circle at 30% 20%, rgba(106, 224, 255, 0.14), transparent 28%),
    linear-gradient(135deg, rgba(9, 11, 32, 1), rgba(18, 27, 63, 0.98));
  color: #fff;
  text-align: center;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.intro-screen--fade {
  opacity: 0;
  transform: translateY(-18px);
  pointer-events: none;
}

.intro-screen__headline {
  font-family: "Syne", sans-serif;
  font-size: clamp(2.6rem, 6vw, 5.8rem);
  font-weight: 800;
  line-height: 1.05;
  max-width: 14ch;
  letter-spacing: -0.03em;
  text-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.intro-screen__progress {
  margin: 2rem auto 0;
  width: min(320px, 70vw);
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  box-shadow: 0 0 20px rgba(106, 224, 255, 0.08);
}

.intro-screen__progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(106, 224, 255, 0.95), rgba(123, 113, 255, 0.95));
  transition: width 1.6s ease;
}

.intro-screen.intro-screen--loading .intro-screen__progress-bar {
  width: 100%;
}

.intro-screen--fade .intro-screen__headline {
  opacity: 0;
  transform: translateY(-18px);
}

main {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100% - 6rem));
  margin: 0 auto;
  padding: 3.5rem 0 7rem;
}

.panel {
  --panel-glow-a: rgba(122, 147, 255, 0.14);
  --panel-glow-b: rgba(136, 125, 255, 0.12);
  --panel-glow-c: rgba(118, 173, 255, 0.11);
  position: relative;
  padding: 6rem 2.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 12% 18%, var(--panel-glow-a) 0%, transparent 42%),
    radial-gradient(circle at 88% 82%, var(--panel-glow-b) 0%, transparent 48%),
    radial-gradient(circle at 45% 100%, var(--panel-glow-c) 0%, transparent 54%),
    linear-gradient(150deg, rgba(23, 30, 64, 0.9), rgba(9, 13, 33, 0.95) 58%);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(3px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.03), transparent 36%),
    radial-gradient(circle at 74% 24%, rgba(155, 171, 255, 0.09), transparent 46%);
  mix-blend-mode: screen;
  opacity: 0.48;
  animation: panelGlowDrift 13s ease-in-out infinite alternate;
}

.panel::after {
  content: "";
  position: absolute;
  width: 260px;
  aspect-ratio: 1;
  right: -90px;
  top: -120px;
  background: radial-gradient(circle, rgba(106, 166, 255, 0.3), transparent 70%);
  filter: blur(14px);
}

.panel:nth-of-type(2n) {
  --panel-glow-a: rgba(134, 136, 255, 0.14);
  --panel-glow-b: rgba(118, 178, 255, 0.11);
  --panel-glow-c: rgba(156, 147, 255, 0.1);
}

.panel:nth-of-type(3n) {
  --panel-glow-a: rgba(106, 188, 255, 0.13);
  --panel-glow-b: rgba(149, 135, 255, 0.12);
  --panel-glow-c: rgba(129, 155, 255, 0.1);
}

.hero {
  min-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero__badge {
  width: fit-content;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(123, 113, 255, 0.2);
  border: 1px solid rgba(123, 113, 255, 0.55);
  color: #c7c3ff;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: "Syne", sans-serif;
  line-height: 1.05;
  margin: 0;
}

h1 {
  margin-top: 1.1rem;
  font-size: clamp(2.3rem, 6vw, 4.6rem);
  max-width: 14ch;
}

.hero > p {
  margin-top: 1.1rem;
  color: var(--muted);
  max-width: 54ch;
  line-height: 1.65;
}

.hero__actions {
  margin-top: 2rem;
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.85rem 1.15rem;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-3px);
}

.btn--primary {
  background: linear-gradient(120deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 12px 25px rgba(112, 125, 255, 0.35);
}

.btn--ghost {
  color: #d5ddff;
  border: 1px solid rgba(164, 176, 255, 0.35);
  background: rgba(164, 176, 255, 0.07);
}

.hero-stats {
  margin-top: 2.6rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.stat-card,
.glass-card,
.project-card {
  position: relative;
  border: 1px solid rgba(164, 176, 255, 0.18);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  backdrop-filter: blur(6px);
  isolation: isolate;
}

.stat-card::after,
.glass-card::after,
.project-card::after,
.timeline article::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--card-spin-angle, 0deg),
    #82f6ce,
    #71dfff,
    #9f96ff,
    #71dfff,
    #82f6ce
  );
  opacity: 0;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transition: opacity 0.24s ease;
}

.stat-card:hover::after,
.glass-card:hover::after,
.project-card:hover::after,
.timeline article:hover::after {
  opacity: 1;
  animation: cardBorderColorSpin 2.1s linear infinite;
}

.stat-card {
  padding: 1.15rem;
}

.stat-card__label {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.stat-card__value {
  margin: 0.45rem 0 0;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
}

.section-head > span {
  display: inline-flex;
  margin-bottom: 0.85rem;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c7ceff;
}

.section-head h2 {
  font-size: clamp(1.8rem, 4.2vw, 3rem);
  max-width: 18ch;
}

.grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.8rem;
}

.grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.glass-card {
  padding: 1.3rem 1.2rem;
}

.glass-card p {
  color: var(--muted);
  line-height: 1.65;
}

.check-list {
  margin: 0.9rem 0 0;
  padding-left: 1.2rem;
  color: #c8d2ff;
}

.check-list li {
  margin-bottom: 0.4rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.8rem;
}

.project-card {
  padding: 1.3rem;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

.project-card__tag {
  margin: 0;
  color: #80f6cb;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-card h3 {
  margin-top: 0.7rem;
  font-size: 1.38rem;
}

.project-card p {
  color: var(--muted);
  line-height: 1.6;
}

.project-open {
  margin-top: auto;
  width: fit-content;
  background: rgba(106, 224, 255, 0.12);
  border: 1px solid rgba(106, 224, 255, 0.45);
  color: #def6ff;
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

.timeline {
  margin-top: 1.8rem;
  display: grid;
  gap: 1rem;
}

.timeline article {
  position: relative;
  padding: 1.05rem 1.15rem;
  border-left: 3px solid rgba(106, 224, 255, 0.7);
  border-radius: 0 14px 14px 0;
  background: rgba(14, 18, 40, 0.65);
}

.timeline p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.skills-wrap {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.8rem;
}

.skills-wrap span {
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
  background: rgba(123, 113, 255, 0.18);
  border: 1px solid rgba(123, 113, 255, 0.45);
  font-size: 0.9rem;
}


.step-sidebar {
  position: fixed;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  padding: 0.95rem;
  border-radius: 18px;
  border: 1px solid rgba(164, 176, 255, 0.25);
  background: rgba(8, 12, 31, 0.82);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.step-sidebar__head {
  color: #d2daff;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
  text-align: center;
}

.step-sidebar nav {
  display: grid;
  gap: 0.44rem;
}

.step-sidebar__toggle {
  display: none;
}

.step-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  position: relative;
  width: 150px;
  color: #b8c5ff;
  text-decoration: none;
  padding: 0.42rem 0.54rem;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
  font-size: 0.88rem;
}

.step-label {
  display: inline-block;
}

.step-link::before {
  content: attr(data-step);
  font-size: 0.75rem;
  color: #7a89c7;
}

.step-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--border-spin-angle, 0deg),
    #82f6ce,
    #71dfff,
    #9f96ff,
    #71dfff,
    #82f6ce
  );
  opacity: 0;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transition: opacity 0.24s ease;
}

.step-link:hover,
.step-link.active {
  border-color: rgba(106, 224, 255, 0.6);
  background: rgba(106, 224, 255, 0.13);
  transform: translateX(-6px);
}

.step-link.active {
  border-color: transparent;
  color: transparent;
  background-image: linear-gradient(90deg, #82f6ce, #71dfff, #9f96ff, #82f6ce);
  background-size: 280% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: stepTextFlow 2.8s linear infinite;
  text-shadow: 0 0 14px rgba(106, 224, 255, 0.28);
}

.step-link.active::after {
  opacity: 1;
  animation: stepBorderColorSpin 2.1s linear infinite;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0%;
  z-index: 20;
  background: linear-gradient(90deg, var(--accent-3), var(--accent), var(--accent-2));
  box-shadow: 0 0 18px rgba(106, 224, 255, 0.8);
}

.cursor-glow {
  position: fixed;
  width: 360px;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(106, 224, 255, 0.35), transparent 62%);
  transition: left 0.1s linear, top 0.1s linear;
}

.noise {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  mix-blend-mode: soft-light;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.25) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
}

.project-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.project-modal[aria-hidden="false"] {
  pointer-events: auto;
}

.project-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 15, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.project-modal__card {
  position: relative;
  width: min(620px, calc(100% - 2rem));
  border-radius: 18px;
  border: 1px solid rgba(164, 176, 255, 0.3);
  background: linear-gradient(145deg, rgba(17, 24, 55, 0.95), rgba(8, 12, 31, 0.98));
  box-shadow: var(--shadow);
  padding: 1.3rem;
  transform: translateY(20px) scale(0.97);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.project-modal[aria-hidden="false"] .project-modal__backdrop {
  opacity: 1;
}

.project-modal[aria-hidden="false"] .project-modal__card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.project-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  color: #eff3ff;
  font-size: 1.3rem;
  background: rgba(139, 153, 255, 0.17);
}

.project-modal__tag {
  margin: 0;
  color: #80f6cb;
  font-size: 0.8rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.project-modal h3 {
  margin-top: 0.5rem;
  font-size: clamp(1.4rem, 4.2vw, 2rem);
}

.project-modal p {
  color: var(--muted);
  line-height: 1.65;
}

.project-modal ul {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: #d6deff;
  line-height: 1.6;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-card {
  opacity: 0;
  --depth-shift: 0px;
  transform: translateY(calc(22px + var(--depth-shift))) scale(0.985);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: transform;
}

.reveal-card.is-visible {
  opacity: 1;
  transform: translateY(var(--depth-shift)) scale(1);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(-50%) translateX(0);
  }

  50% {
    transform: translateY(-50%) translateX(-6px);
  }
}

@keyframes stepTextFlow {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 100% 50%;
  }
}

@keyframes stepBorderColorSpin {
  0% {
    --border-spin-angle: 0deg;
  }

  100% {
    --border-spin-angle: 360deg;
  }
}

@keyframes cardBorderColorSpin {
  0% {
    --card-spin-angle: 0deg;
  }

  100% {
    --card-spin-angle: 360deg;
  }
}

@keyframes panelGlowDrift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.45;
  }

  100% {
    transform: translate3d(-6px, 5px, 0) scale(1.02);
    opacity: 0.58;
  }
}

@media (max-width: 1050px) {
  main {
    width: min(100%, calc(100% - 3rem));
  }

  .step-sidebar {
    right: 0.6rem;
  }

  .project-grid,
  .hero-stats,
  .grid--two,
  .grid--three {
    grid-template-columns: 1fr 1fr;
  }

  .project-grid article:last-child,
  .hero-stats article:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  main {
    width: calc(100% - 1.5rem);
    padding-top: 1.2rem;
  }

  .panel {
    padding: 4rem 1rem;
    border-radius: 18px;
  }

  .step-sidebar {
    top: 50%;
    right: 1rem;
    bottom: auto;
    transform: translateY(-50%);
    animation: none;
    width: 58px;
    padding: 0.55rem 0.45rem;
    max-width: none;
    max-height: 82vh;
    overflow: auto;
    overflow-x: hidden;
    box-shadow: -14px 18px 42px rgba(0, 0, 0, 0.42);
    transition: width 0.26s ease, padding 0.26s ease;
  }

  .step-sidebar.is-open {
    width: 172px;
    padding: 0.65rem 0.55rem 0.55rem;
  }

  .step-sidebar__head {
    display: none;
  }

  .step-sidebar__toggle {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(164, 176, 255, 0.36);
    border-radius: 9px;
    background: rgba(106, 224, 255, 0.1);
    color: #dbe5ff;
    font: inherit;
    font-size: 0.72rem;
    padding: 0.42rem 0.3rem;
    margin-bottom: 0.45rem;
    cursor: pointer;
  }

  .step-sidebar__arrow {
    display: inline-block;
    font-size: 0.95rem;
    line-height: 1;
    transition: transform 0.22s ease;
  }

  .step-sidebar.is-open .step-sidebar__arrow {
    transform: rotate(180deg);
  }

  .step-sidebar nav {
    grid-template-columns: 1fr;
  }

  .step-link {
    width: 100%;
    justify-content: center;
    font-size: 0.8rem;
    padding: 0.45rem 0.2rem;
    gap: 0;
    transform: none;
  }

  .step-link::before {
    font-size: 0.74rem;
  }

  .step-link .step-label {
    display: none;
  }

  .step-sidebar.is-open .step-link {
    justify-content: space-between;
    gap: 0.55rem;
    padding: 0.45rem 0.45rem;
  }

  .step-sidebar.is-open .step-link .step-label {
    display: inline-block;
  }

  .step-link:hover,
  .step-link.active {
    transform: none;
  }

  .project-grid,
  .hero-stats,
  .grid--two,
  .grid--three {
    grid-template-columns: 1fr;
  }

  .cursor-glow {
    display: none;
  }
}

/* Language Switcher */
.language-switcher {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 50;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(164, 176, 255, 0.45);
  background: rgba(14, 18, 40, 0.85);
  color: #b8c5ff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all 0.3s ease;
}

.lang-toggle:hover {
  border-color: rgba(106, 224, 255, 0.8);
  background: rgba(106, 224, 255, 0.15);
  color: #def6ff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(106, 224, 255, 0.2);
}

.lang-toggle:active {
  transform: translateY(0);
}

.lang-current {
  font-weight: 700;
  color: #6ae0ff;
}

.lang-current .flag-icon {
  width: 24px;
  height: 16px;
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(106, 224, 255, 0.6));
}

.lang-sep {
  opacity: 0.5;
}

.lang-alt {
  opacity: 0.5;
}

.lang-alt .flag-icon {
  width: 16px;
  height: 11px;
  opacity: 0.5;
}

.lang-toggle:hover .lang-alt {
  opacity: 1;
}

.lang-toggle:hover .lang-alt .flag-icon {
  opacity: 1;
}

.flag-icon {
  width: 20px;
  height: 13px;
  display: inline-block;
  vertical-align: middle;
}

@media (max-width: 760px) {
  .language-switcher {
    top: 1rem;
    right: 1rem;
  }

  .lang-toggle {
    padding: 0.45rem 0.7rem;
    font-size: 0.75rem;
  }

  .flag-icon {
    width: 16px;
    height: 11px;
  }
}
