:root {
  --bg: #070912;
  --panel: rgba(12, 18, 34, 0.82);
  --panel-strong: rgba(16, 24, 44, 0.96);
  --text: #eef7ff;
  --muted: #93a8bd;
  --line: rgba(0, 245, 255, 0.22);
  --cyan: #00f5ff;
  --magenta: #ff2bd6;
  --lime: #b6ff3b;
  --amber: #ffb000;
  --shadow: 0 28px 90px rgba(0, 245, 255, 0.12);
}

:root[data-theme="light"] {
  --bg: #eef7ff;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --text: #0b1220;
  --muted: #526276;
  --line: rgba(35, 86, 132, 0.2);
  --cyan: #007f95;
  --magenta: #b01895;
  --lime: #3b7f18;
  --amber: #aa6500;
  --shadow: 0 24px 70px rgba(19, 48, 78, 0.14);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 43, 214, 0.18), transparent 28%),
    radial-gradient(circle at 78% 4%, rgba(0, 245, 255, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(0, 245, 255, 0.08) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, 42px 42px, auto;
  color: var(--text);
  font-family: Inter, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.62;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 245, 255, 0.06), transparent 16%, transparent 84%, rgba(255, 43, 214, 0.06)),
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(255, 255, 255, 0.025) 8px);
  mix-blend-mode: screen;
  z-index: 0;
}

.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(0, 245, 255, 0.09), transparent);
  height: 36vh;
  animation: scan 9s linear infinite;
  z-index: 4;
}

@keyframes scan {
  from {
    transform: translateY(-45vh);
  }
  to {
    transform: translateY(110vh);
  }
}

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

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 6;
  width: 286px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  border-right: 1px solid var(--line);
  padding: 28px 22px;
  background: rgba(6, 10, 21, 0.76);
  backdrop-filter: blur(18px);
  box-shadow: 12px 0 36px rgba(0, 0, 0, 0.22);
}

:root[data-theme="light"] .sidebar {
  background: rgba(239, 247, 255, 0.82);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--cyan);
  border-radius: 8px;
  color: var(--cyan);
  font-weight: 850;
  text-shadow: 0 0 14px var(--cyan);
  box-shadow: inset 0 0 22px rgba(0, 245, 255, 0.2), 0 0 24px rgba(0, 245, 255, 0.16);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav {
  display: grid;
  gap: 5px;
}

.nav a {
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  padding: 10px 12px;
  font-weight: 750;
}

.nav a:hover,
.nav a:focus-visible {
  border-color: var(--line);
  background: rgba(0, 245, 255, 0.08);
  color: var(--cyan);
  outline: none;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.icon-button,
.language-switch button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.language-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.language-switch button {
  min-width: 54px;
  height: 38px;
  border: 0;
  border-radius: 0;
  font-weight: 800;
}

.language-switch button.active {
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  color: #041018;
}

main {
  min-width: 0;
  margin-left: 286px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.62fr);
  align-items: center;
  gap: 36px;
  min-height: 82vh;
  padding: 58px clamp(22px, 5vw, 78px);
}

.hero-copy {
  max-width: 860px;
}

.eyebrow,
.section-heading span,
.panel-label {
  color: var(--magenta);
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  font-size: clamp(3.1rem, 6.2vw, 5.6rem);
  line-height: 0.98;
}

h1 small {
  color: var(--cyan);
  font-size: clamp(1.15rem, 2vw, 1.7rem);
  text-shadow: 0 0 22px rgba(0, 245, 255, 0.45);
}

h2 {
  font-size: clamp(1.75rem, 3vw, 3rem);
  line-height: 1.14;
}

h3 {
  font-size: 1.08rem;
  line-height: 1.28;
}

.lede {
  max-width: 790px;
  color: var(--muted);
  font-size: clamp(1.06rem, 1.55vw, 1.28rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-weight: 800;
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  color: #06101c;
}

.cyber-orb {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 430px;
}

.orb-core,
.orb-ring {
  position: absolute;
  border-radius: 50%;
}

.orb-core {
  width: min(74vw, 340px);
  aspect-ratio: 1;
  border: 1px solid rgba(0, 245, 255, 0.32);
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.22), transparent 15%),
    radial-gradient(circle, rgba(0, 245, 255, 0.2), rgba(255, 43, 214, 0.08) 46%, transparent 68%);
  box-shadow: 0 0 80px rgba(0, 245, 255, 0.2), inset 0 0 60px rgba(255, 43, 214, 0.16);
}

.orb-ring {
  width: min(82vw, 410px);
  aspect-ratio: 1;
  border: 1px solid rgba(0, 245, 255, 0.38);
  transform: rotateX(72deg) rotateZ(-18deg);
}

.ring-a {
  animation: orbit 12s linear infinite;
}

.ring-b {
  width: min(70vw, 300px);
  border-color: rgba(255, 43, 214, 0.4);
  animation: orbit 9s linear reverse infinite;
}

@keyframes orbit {
  to {
    transform: rotateX(72deg) rotateZ(342deg);
  }
}

.orb-data {
  position: absolute;
  bottom: 28px;
  left: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(4, 8, 18, 0.78);
  color: var(--cyan);
  box-shadow: var(--shadow);
}

.orb-data span,
.orb-data strong {
  display: block;
}

.orb-data span {
  color: var(--muted);
  font-size: 0.78rem;
}

.section {
  padding: 66px clamp(22px, 5vw, 78px);
  border-top: 1px solid var(--line);
}

.section-heading {
  max-width: 920px;
  margin-bottom: 28px;
}

#science .section-heading {
  max-width: none;
}

#science .section-heading p {
  max-width: none;
}

@media (min-width: 1181px) {
  #science .section-heading p {
    white-space: nowrap;
    font-size: 0.98rem;
  }
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: 16px;
  align-items: stretch;
}

.goal-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.goal-strip a {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.goal-strip span,
.research-grid span {
  color: var(--magenta);
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.goal-strip strong {
  display: block;
  margin: 12px 0 8px;
  color: var(--cyan);
  font-size: 1.25rem;
}

.goal-strip p {
  color: var(--muted);
}

.intro-card,
.metrics article,
.ability-card,
.stack-grid article,
.future-grid article,
.earth-console,
.hobby-detail,
.story-grid article,
.contact {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.intro-card {
  padding: 28px;
}

.intro-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

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

.metrics article {
  padding: 22px;
}

.metrics strong {
  display: block;
  color: var(--cyan);
  font-size: clamp(1.65rem, 2.6vw, 2.4rem);
  line-height: 1;
}

.metrics span,
.ability-card p,
.stack-grid p,
.future-grid p,
.story-grid li,
.contact-links a,
.place-panel p,
.globe-hint {
  color: var(--muted);
}

.ability-grid,
.stack-grid,
.story-grid,
.research-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ability-card,
.stack-grid article,
.story-grid article,
.research-grid article {
  padding: 22px;
}

.research-grid {
  margin-top: 16px;
}

.research-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.ability-card svg {
  color: var(--cyan);
  margin-bottom: 14px;
}

.stack {
  background:
    linear-gradient(90deg, rgba(0, 245, 255, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(255, 43, 214, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
}

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

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

.chips span,
.map-cloud span,
.place-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(0, 245, 255, 0.06);
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 850;
}

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

.future-grid article {
  min-height: 260px;
  padding: 24px;
}

.future-grid span {
  color: var(--magenta);
  font-size: 0.8rem;
  font-weight: 850;
}

.earth-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
  padding: 16px;
  background: rgba(5, 9, 20, 0.72);
}

:root[data-theme="light"] .earth-console {
  background: rgba(255, 255, 255, 0.78);
}

.globe-wrap {
  min-width: 0;
}

#globeViz {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: radial-gradient(circle, rgba(0, 245, 255, 0.12), rgba(0, 0, 0, 0.22));
}

.globe-hint {
  margin-top: 10px;
  font-size: 0.92rem;
}

.place-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 10px;
}

.place-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
  padding-right: 4px;
}

.place-chip {
  cursor: pointer;
}

.place-chip.active {
  background: var(--cyan);
  color: #06101c;
}

.hobby-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.hobby-card {
  position: relative;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hobby-card img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  filter: saturate(0.95) contrast(1.05) brightness(0.72);
  transition: transform 380ms ease, filter 380ms ease;
}

.hobby-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(3, 7, 16, 0.86));
}

.hobby-card div {
  position: absolute;
  z-index: 1;
  left: 18px;
  right: 18px;
  bottom: 18px;
}

.hobby-card span {
  color: var(--cyan);
  font-weight: 850;
}

.hobby-card.active,
.hobby-card:hover {
  border-color: var(--magenta);
}

.hobby-card.active img,
.hobby-card:hover img {
  transform: scale(1.06);
  filter: saturate(1.25) contrast(1.1) brightness(0.84);
}

.hobby-detail {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 18px;
}

.hobby-detail p {
  margin-bottom: 0;
  color: var(--muted);
}

.story-grid ul {
  margin: 0;
  padding-left: 20px;
}

.story-grid li + li {
  margin-top: 10px;
}

.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 66px clamp(22px, 5vw, 78px);
  padding: 30px;
}

.contact-links {
  display: grid;
  gap: 10px;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

svg {
  width: 18px;
  height: 18px;
}

canvas {
  max-width: 100%;
}

@media (max-width: 1180px) {
  .stack-grid,
  .hobby-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar {
    position: sticky;
    width: auto;
    left: auto;
    z-index: 5;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .nav {
    display: flex;
    min-width: max-content;
  }

  .sidebar-footer {
    margin-left: auto;
    margin-top: 0;
  }

  .hero,
  .profile-grid,
  .earth-console {
    grid-template-columns: 1fr;
  }

  main {
    margin-left: 0;
  }

  .cyber-orb {
    min-height: 320px;
    order: -1;
  }
}

@media (max-width: 720px) {
  .sidebar {
    gap: 14px;
    padding: 14px;
  }

  .brand small,
  .nav {
    display: none;
  }

  .hero,
  .section {
    padding-inline: 18px;
  }

  h1 {
    font-size: clamp(2.6rem, 15vw, 4rem);
  }

  .metrics,
  .goal-strip,
  .ability-grid,
  .stack-grid,
  .future-grid,
  .story-grid,
  .research-grid,
  .hobby-board {
    grid-template-columns: 1fr;
  }

  .contact {
    display: grid;
    margin-inline: 18px;
  }
}
