:root {
  color-scheme: dark;
  --page-bg: #0a0e27;
  --text: #f5f7ff;
  --muted: rgba(245, 247, 255, 0.76);
  --panel-bg: rgba(8, 18, 32, 0.56);
  --card-bg: rgba(10, 21, 37, 0.44);
  --panel-border: rgba(255, 255, 255, 0.14);
  --accent: #2ed47a;
  --accent-strong: #0f8f53;
  --accent-soft: rgba(46, 212, 122, 0.16);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --max-width: 1160px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--page-bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(3, 8, 16, 0.04), rgba(3, 8, 16, 0.3));
}

body.has-custom-cursor,
body.has-custom-cursor a,
body.has-custom-cursor button {
  cursor: none;
}

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

button {
  font: inherit;
  color: inherit;
}

ul {
  list-style: none;
}

#webGLApp {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.page-shell {
  position: relative;
  z-index: 5;
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 80px;
}

.glass-panel,
.glass-card {
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.glass-panel {
  background: var(--panel-bg);
  border-radius: var(--radius-xl);
}

.glass-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
}

.topbar {
  position: sticky;
  top: 24px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 22px;
}

.brand {
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.nav a {
  color: var(--muted);
  transition: color 0.25s ease;
}

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

.card-label,
.project-type,
.step-number {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding-top: 112px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy,
.status-card,
.summary-card,
.metric-card,
.skill-card,
.project-card,
.process-card,
.contact-card,
.about-grid article {
  padding: clamp(22px, 3vw, 36px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-title,
.section-title,
.status-card h2 {
  font-family: "Manrope", "Segoe UI", sans-serif;
  letter-spacing: -0.05em;
}

.hero-title {
  margin-top: 20px;
  max-width: 12ch;
  font-size: clamp(2.4rem, 5.2vw, 4.8rem);
  line-height: 0.96;
}

.hero-text {
  margin-top: 20px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.72;
}

.hero-actions,
.contact-links,
.hero-tags,
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions,
.hero-tags {
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

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

.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #05110b;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.button-secondary {
  border-color: var(--panel-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.hero-tags span,
.project-tags span {
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-side {
  display: grid;
  gap: 24px;
}

.status-card h2 {
  margin-top: 14px;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1;
}

.status-card p,
.summary-list li,
.metric-card p,
.skill-card p,
.project-card p,
.process-card p,
.about-grid p {
  color: var(--muted);
  line-height: 1.72;
}

.status-card p,
.about-grid p {
  margin-top: 16px;
}

.summary-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.summary-list li {
  position: relative;
  padding-left: 20px;
}

.summary-list li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
}

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

.metric-title,
.skill-card h3,
.project-card h3,
.process-card h3,
.about-grid h3 {
  font-family: "Manrope", "Segoe UI", sans-serif;
  letter-spacing: -0.03em;
}

.metric-title {
  display: block;
  margin-bottom: 12px;
  font-size: 1.06rem;
}

.section {
  margin-top: 96px;
}

.section-head {
  max-width: 820px;
  margin-bottom: 28px;
}

.section-title {
  margin-top: 18px;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.05;
}

.section-text {
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.74;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.about-grid h3,
.skill-card h3,
.project-card h3,
.process-card h3 {
  margin-bottom: 14px;
  font-size: 1.32rem;
}

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

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

.project-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.project-type {
  color: var(--text);
}

.project-impact {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.project-tags {
  margin-top: auto;
}

.knowledge-card {
  position: relative;
  min-height: 620px;
  border: 1px solid var(--panel-border);
  border-radius: calc(var(--radius-lg) + 4px);
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(46, 212, 122, 0.12), transparent 28%),
    radial-gradient(circle at 82% 30%, rgba(46, 212, 122, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.028)),
    var(--panel-bg);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.knowledge-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(46, 212, 122, 0.058) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 212, 122, 0.058) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.95), transparent 92%);
}

.knowledge-graph {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 620px;
  cursor: none;
  touch-action: none;
}

.knowledge-graph.is-panning {
  cursor: none;
}

.knowledge-graph * {
  cursor: none;
}

.knowledge-link {
  fill: none;
  stroke: rgba(46, 212, 122, 0.42);
  stroke-width: 1.22;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.86;
  transition: opacity 0.18s ease, stroke 0.18s ease, stroke-width 0.18s ease;
}

.knowledge-link.is-active {
  stroke: rgba(127, 255, 183, 0.94);
  stroke-width: 1.6;
  opacity: 1;
}

.knowledge-link.is-dimmed {
  opacity: 0.09;
}

.knowledge-node-group {
  transition: opacity 0.18s ease;
}

.knowledge-node-group.is-dimmed {
  opacity: 0.36;
}

.knowledge-node {
  fill: rgba(152, 255, 203, 0.96);
  stroke: rgba(238, 255, 245, 0.44);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
  transition: fill 0.18s ease, stroke 0.18s ease, r 0.18s ease;
}

.knowledge-node.is-primary {
  fill: rgba(188, 255, 222, 0.98);
}

.knowledge-node-group.is-related .knowledge-node {
  fill: rgba(201, 255, 229, 0.98);
}

.knowledge-node-group.is-active .knowledge-node {
  fill: rgba(228, 255, 240, 1);
  stroke: rgba(255, 255, 255, 0.72);
}

.knowledge-node-label {
  fill: rgba(234, 255, 242, 0.98);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  opacity: 0;
  transition: opacity 0.18s ease;
  user-select: none;
}

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

.step-number {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--text);
}

.section-contact {
  padding-bottom: 20px;
}

.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) auto;
  gap: 24px;
  align-items: end;
}

.contact-links {
  justify-content: flex-end;
}

.interactive {
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

.glass-card.interactive:hover,
.about-grid article.interactive:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.22);
}

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 42px;
  height: 42px;
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 999;
  opacity: 0;
  mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 72%);
  transition:
    width 0.2s ease,
    height 0.2s ease,
    opacity 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.custom-cursor.active {
  width: 58px;
  height: 58px;
  border-color: var(--accent);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0) 78%);
}

body.has-custom-cursor .custom-cursor {
  opacity: 1;
}

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

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

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

@media (max-width: 860px) {
  .page-shell {
    width: min(var(--max-width), calc(100% - 24px));
    padding-top: 18px;
  }

  .topbar {
    top: 16px;
    padding: 16px 18px;
  }

  .hero {
    min-height: auto;
    padding-top: 40px;
  }

  .hero-grid,
  .about-grid,
  .skills-grid,
  .metrics,
  .projects-grid,
  .process-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    max-width: 13ch;
  }

  .knowledge-card,
  .knowledge-graph {
    min-height: 540px;
    height: 540px;
  }

  .contact-links {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .hero-actions,
  .contact-links {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .nav {
    gap: 12px;
  }

  .knowledge-card,
  .knowledge-graph {
    min-height: 460px;
    height: 460px;
  }
}

@media (pointer: coarse) {
  body,
  body a,
  body button {
    cursor: auto;
  }

  .custom-cursor {
    display: none;
  }
}