:root {
  color-scheme: dark;
  --bg: #040812;
  --bg-soft: #0a1320;
  --panel: rgba(12, 25, 40, 0.75);
  --panel-strong: #101d2d;
  --line: rgba(135, 184, 255, 0.22);
  --text: #f4f9ff;
  --text-muted: #9cb4ce;
  --accent: #3dd8ff;
  --accent-2: #ffc94a;
  --danger: #ff6d6d;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  --page-bg:
    radial-gradient(circle at 15% 10%, rgba(34, 84, 140, 0.35), transparent 45%),
    radial-gradient(circle at 80% 15%, rgba(255, 185, 76, 0.15), transparent 40%),
    linear-gradient(165deg, #03060f 0%, #060d19 35%, #050a14 100%);
  --glow-a: rgba(58, 211, 255, 0.2);
  --glow-b: rgba(255, 175, 52, 0.14);
  --topbar-bg: rgba(4, 10, 18, 0.72);
  --brand-mark-end: #9ff6ff;
  --brand-shadow: 0 0 14px rgba(61, 216, 255, 0.75);
  --hero-grid-line: rgba(99, 153, 214, 0.1);
  --hero-profile-bg: rgba(10, 21, 34, 0.85);
  --tag-border: rgba(61, 216, 255, 0.35);
  --tag-text: #b9ebff;
  --hero-subtitle: #b8ceea;
  --btn-primary-start: #1dbeea;
  --btn-primary-end: #4ee3ff;
  --btn-primary-text: #042232;
  --btn-primary-shadow: 0 12px 24px rgba(38, 202, 240, 0.35);
  --section-alt-bg: linear-gradient(180deg, rgba(10, 18, 30, 0.65), rgba(8, 16, 26, 0.3));
  --chip-border: rgba(255, 201, 74, 0.5);
  --chip-text: #ffe39e;
  --link: #93ddff;
  --link-hover: #c5efff;
  --cta-bg:
    linear-gradient(150deg, rgba(14, 37, 60, 0.8), rgba(18, 26, 42, 0.8)),
    radial-gradient(circle at 80% 20%, rgba(61, 216, 255, 0.2), transparent 50%);
  --tag-cloud-border: rgba(143, 191, 255, 0.35);
  --tag-cloud-text: #b8defe;
  --skill-track: rgba(132, 176, 245, 0.15);
  --skill-fill-start: #2ebadf;
  --skill-fill-end: #78e2ff;
  --timeline-time: #a8dcff;
  --filter-active-border: rgba(61, 216, 255, 0.7);
  --filter-active-bg: rgba(61, 216, 255, 0.14);
  --input-border: rgba(149, 188, 235, 0.3);
  --input-bg: rgba(6, 16, 30, 0.7);
  --form-status: #9ed7ff;
  --footer-link: #a7d9ff;
  --mobile-nav-bg: rgba(10, 19, 32, 0.98);
  --switch-track-bg: rgba(11, 25, 40, 0.92);
  --switch-track-border: rgba(122, 181, 235, 0.42);
  --switch-thumb-bg: linear-gradient(135deg, #ffe07a, #f9b739);
  --switch-thumb-shadow: 0 2px 9px rgba(0, 0, 0, 0.34);
  --switch-sun: #ffd55a;
  --switch-moon: #b7caf2;
}

:root[data-theme="light"] {
  color-scheme: light;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: #f7fbff;
  --line: rgba(46, 90, 132, 0.22);
  --text: #172433;
  --text-muted: #4c627a;
  --accent: #0f91df;
  --accent-2: #d59b13;
  --shadow: 0 16px 30px rgba(65, 98, 130, 0.18);
  --page-bg:
    radial-gradient(circle at 12% 8%, rgba(88, 166, 230, 0.22), transparent 45%),
    radial-gradient(circle at 86% 16%, rgba(255, 198, 94, 0.2), transparent 42%),
    linear-gradient(165deg, #f8fcff 0%, #eef5fb 48%, #e9f2fb 100%);
  --glow-a: rgba(94, 182, 242, 0.26);
  --glow-b: rgba(249, 186, 76, 0.22);
  --topbar-bg: rgba(243, 249, 255, 0.86);
  --brand-mark-end: #dff5ff;
  --brand-shadow: 0 0 10px rgba(29, 143, 209, 0.35);
  --hero-grid-line: rgba(80, 134, 191, 0.18);
  --hero-profile-bg: rgba(246, 251, 255, 0.94);
  --tag-border: rgba(35, 139, 209, 0.36);
  --tag-text: #24689b;
  --hero-subtitle: #3f5d78;
  --btn-primary-start: #1681ca;
  --btn-primary-end: #35a6ef;
  --btn-primary-text: #f4fbff;
  --btn-primary-shadow: 0 10px 20px rgba(38, 126, 191, 0.26);
  --section-alt-bg: linear-gradient(180deg, rgba(237, 246, 255, 0.92), rgba(230, 242, 255, 0.6));
  --chip-border: rgba(203, 154, 41, 0.45);
  --chip-text: #8f6200;
  --link: #0f7ec8;
  --link-hover: #0a5f97;
  --cta-bg:
    linear-gradient(150deg, rgba(238, 247, 255, 0.9), rgba(228, 241, 255, 0.9)),
    radial-gradient(circle at 80% 20%, rgba(35, 145, 217, 0.18), transparent 50%);
  --tag-cloud-border: rgba(85, 141, 193, 0.3);
  --tag-cloud-text: #325b82;
  --skill-track: rgba(129, 176, 217, 0.22);
  --skill-fill-start: #1d89d0;
  --skill-fill-end: #48b3f4;
  --timeline-time: #2f79b3;
  --filter-active-border: rgba(20, 128, 197, 0.75);
  --filter-active-bg: rgba(20, 128, 197, 0.12);
  --input-border: rgba(102, 149, 194, 0.38);
  --input-bg: rgba(247, 251, 255, 0.9);
  --form-status: #2e75a8;
  --footer-link: #0f6ca8;
  --mobile-nav-bg: rgba(244, 250, 255, 0.98);
  --switch-track-bg: rgba(228, 240, 251, 0.95);
  --switch-track-border: rgba(95, 141, 185, 0.4);
  --switch-thumb-bg: linear-gradient(135deg, #4d5d78, #222f43);
  --switch-thumb-shadow: 0 2px 8px rgba(47, 85, 121, 0.25);
  --switch-sun: #f1bf3d;
  --switch-moon: #6f87af;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--page-bg);
  font-family: "Exo 2", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

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

.container {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.bg-glow {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: -1;
}

.bg-glow-a {
  left: -160px;
  top: 100px;
  background: var(--glow-a);
}

.bg-glow-b {
  right: -100px;
  top: 40%;
  background: var(--glow-b);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 72px;
}

.nav-actions {
  margin-left: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 18px;
  height: 18px;
  background: linear-gradient(45deg, var(--accent), var(--brand-mark-end));
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow: var(--brand-shadow);
}

.brand-text {
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.site-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}

.site-nav a {
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s ease;
}

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

.menu-btn {
  display: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  font-family: inherit;
}

.theme-switch {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.theme-switch-track {
  position: relative;
  width: 62px;
  height: 34px;
  border-radius: 999px;
  background: var(--switch-track-bg);
  border: 1px solid var(--switch-track-border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.theme-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
}

.theme-icon-sun {
  left: 9px;
  color: var(--switch-sun);
}

.theme-icon-moon {
  right: 9px;
  color: var(--switch-moon);
}

.theme-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--switch-thumb-bg);
  box-shadow: var(--switch-thumb-shadow);
  transition: transform 0.22s ease;
}

.theme-switch:focus-visible .theme-switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-switch:hover .theme-switch-track {
  border-color: var(--accent);
}

.theme-switch[aria-checked="true"] .theme-thumb {
  transform: translateX(28px);
}

.theme-switch[aria-checked="false"] .theme-thumb {
  transform: translateX(0);
}

.theme-switch {
  cursor: pointer;
  transition: transform 0.18s ease;
}

.theme-switch:hover {
  transform: translateY(-1px);
}

.hero {
  position: relative;
  padding: 92px 0 88px;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--hero-grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--hero-grid-line) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent);
  pointer-events: none;
}

.hero-inner {
  position: relative;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 22px;
  align-items: center;
}

.hero-main {
  max-width: 760px;
}

.hero-profile {
  background: var(--hero-profile-bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.profile-photo {
  width: 100%;
  height: 360px;
  object-fit: cover;
  display: block;
}

.profile-meta {
  padding: 16px 16px 18px;
}

.profile-meta h3 {
  margin: 0 0 8px;
  font-family: "Orbitron", sans-serif;
  font-size: 1.1rem;
}

.profile-meta p {
  margin: 0;
  color: var(--text-muted);
}

.profile-meta p + p {
  margin-top: 6px;
}

.tag {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--tag-border);
  border-radius: 999px;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  color: var(--tag-text);
}

.hero-title,
.sub-title {
  font-family: "Orbitron", sans-serif;
  margin: 18px 0 16px;
  line-height: 1.16;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: clamp(2rem, 6.2vw, 4rem);
}

.hero-title span {
  display: block;
  margin-top: 10px;
  font-size: clamp(1rem, 2.5vw, 1.55rem);
  color: var(--hero-subtitle);
  font-family: "Exo 2", sans-serif;
  font-weight: 500;
}

.hero-copy,
.sub-copy {
  color: var(--text-muted);
  font-size: 1.06rem;
  line-height: 1.8;
  max-width: 760px;
}

.hero-cta {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.btn-primary {
  background: linear-gradient(92deg, var(--btn-primary-start), var(--btn-primary-end));
  color: var(--btn-primary-text);
  box-shadow: var(--btn-primary-shadow);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--text);
}

.stats {
  padding: 0 0 24px;
}

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

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.stat-num {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  font-family: "Orbitron", sans-serif;
}

.stat-label {
  margin: 8px 0 0;
  color: var(--text-muted);
}

.section {
  padding: 78px 0;
}

.section.alt {
  background: var(--section-alt-bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin: 14px 0 0;
  font-size: clamp(1.55rem, 3vw, 2.5rem);
  font-family: "Orbitron", sans-serif;
}

.card-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-card,
.ability-card,
.bio-card,
.timeline-item,
.cta-inner {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.feature-card {
  overflow: hidden;
}

.card-visual {
  height: 165px;
  border-bottom: 1px solid var(--line);
  background-size: 180% 180%;
  animation: hueShift 12s ease infinite;
}

.card-cover {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--line);
}

.card-cover-compact {
  height: 165px;
}

.visual-one {
  background-image: linear-gradient(120deg, #0f5ea5 0%, #31d2ff 45%, #b8f7ff 100%);
}

.visual-two {
  background-image: linear-gradient(130deg, #314f95 0%, #6aa3ff 45%, #f7fcff 100%);
}

.visual-three {
  background-image: linear-gradient(120deg, #715511 0%, #f4be43 45%, #fff5da 100%);
}

.visual-four {
  background-image: linear-gradient(120deg, #06495c 0%, #18b9d6 50%, #c4f8ff 100%);
}

.visual-five {
  background-image: linear-gradient(120deg, #2f3f7b 0%, #99b2ff 45%, #ffffff 100%);
}

.visual-six {
  background-image: linear-gradient(120deg, #6d4610 0%, #fcb045 45%, #fff2cc 100%);
}

.card-body {
  padding: 18px;
}

.card-body h3,
.ability-card h3,
.timeline-item h3,
.bio-card h2 {
  margin: 0 0 8px;
}

.card-body p,
.ability-card p,
.timeline-item p,
.bio-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.7;
}

.chip {
  margin-top: 12px;
  display: inline-block;
  border: 1px solid var(--chip-border);
  color: var(--chip-text);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-link {
  margin-top: 14px;
  display: inline-block;
  color: var(--link);
  font-weight: 700;
}

.inline-link:hover {
  color: var(--link-hover);
}

.meta-list {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--text-muted);
}

.meta-list li + li {
  margin-top: 4px;
}

.ability-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ability-card {
  padding: 22px;
}

.cta-block {
  padding-top: 44px;
}

.cta-inner {
  padding: 34px;
  text-align: center;
  background: var(--cta-bg);
}

.cta-inner h2 {
  margin: 14px 0 8px;
  font-family: "Orbitron", sans-serif;
}

.cta-inner p {
  margin: 0 0 22px;
  color: var(--text-muted);
}

.subpage {
  padding-top: 12px;
}

.sub-hero {
  padding: 68px 0 26px;
}

.sub-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.bio-card {
  padding: 24px;
}

.about-photo {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

.tag-cloud {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud span {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--tag-cloud-border);
  color: var(--tag-cloud-text);
  font-size: 0.8rem;
}

.skill + .skill {
  margin-top: 12px;
}

.skill-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.94rem;
  color: var(--text-muted);
}

.skill-bar {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--skill-track);
  overflow: hidden;
}

.skill-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--skill-fill-start), var(--skill-fill-end));
}

.timeline {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.timeline-item {
  padding: 20px;
}

.timeline-item .time {
  color: var(--timeline-time);
  margin-bottom: 6px;
  font-weight: 700;
}

.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.filter-btn.active,
.filter-btn:hover {
  border-color: var(--filter-active-border);
  color: var(--text);
  background: var(--filter-active-bg);
}

.project-card.hide {
  display: none;
}

.project-grid .project-card:first-child {
  grid-column: span 2;
}

.source-note {
  margin-top: 16px;
  color: var(--text-muted);
}

.source-note a {
  color: var(--link);
  margin-right: 6px;
  white-space: nowrap;
}

.contact-form label {
  margin: 12px 0 6px;
  display: block;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
}

.contact-form textarea {
  resize: vertical;
}

.form-status {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--form-status);
}

.contact-list {
  margin: 0 0 18px 0;
  padding-left: 20px;
  color: var(--text-muted);
}

.footer {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  margin-top: 36px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}

.footer a {
  color: var(--footer-link);
}

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

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

@keyframes hueShift {
  0%,
  100% {
    background-position: 0% 45%;
  }
  50% {
    background-position: 100% 55%;
  }
}

.ability-wide {
  grid-column: span 2;
}

.deploy-facts {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.deploy-facts li {
  margin-top: 9px;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.deploy-facts li strong {
  color: var(--timeline-time);
}

.showcase {
  margin: 28px 0 0;
}

.showcase img {
  width: 100%;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.showcase figcaption {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.showcase-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.showcase-grid .showcase {
  margin: 0;
}

.feature-wide {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .showcase-grid {
    grid-template-columns: 1fr;
  }

  .feature-wide,
  .ability-wide {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  .stat-grid,
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-layout {
    grid-template-columns: 1fr;
  }

  .hero-profile {
    max-width: 420px;
  }

  .split,
  .ability-grid {
    grid-template-columns: 1fr;
  }

  .project-grid .project-card:first-child {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  .container {
    width: min(1120px, calc(100% - 30px));
  }

  .menu-btn {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    right: 15px;
    top: 72px;
    width: min(220px, calc(100% - 30px));
    margin-left: 0;
    background: var(--mobile-nav-bg);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    display: none;
    flex-direction: column;
    gap: 12px;
  }

  .site-nav.open {
    display: flex;
  }

  .hero {
    padding-top: 72px;
  }

  .hero-copy,
  .sub-copy {
    font-size: 0.96rem;
  }

  .stat-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .card-cover {
    height: 190px;
  }

  .profile-photo {
    height: 300px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
