:root {
  --bg-ink: #0a0f17;
  --bg-deep: #101826;
  --bg-glow: #17263d;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.14);
  --stroke: rgba(255, 255, 255, 0.12);
  --text: #e8f0f8;
  --muted: #a7b2c4;
  --accent: #7ad7ff;
  --accent-strong: #35c2ff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

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

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 10% 10%, rgba(67, 150, 255, 0.12), transparent 50%),
    radial-gradient(900px 700px at 90% 20%, rgba(96, 255, 214, 0.1), transparent 55%),
    linear-gradient(120deg, var(--bg-ink), var(--bg-deep));
  min-height: 100vh;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body::before {
  content: "";
  position: fixed;
  inset: -20vh -10vw;
  background: radial-gradient(600px 600px at 20% 30%, rgba(122, 215, 255, 0.22), transparent 60%),
    radial-gradient(500px 500px at 80% 70%, rgba(53, 194, 255, 0.18), transparent 65%);
  opacity: 0.6;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.05), transparent 45%);
  pointer-events: none;
  z-index: -1;
}

#hyperspace-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(1200px 800px at 50% 20%, rgba(70, 120, 200, 0.25), transparent 60%),
    radial-gradient(900px 700px at 80% 80%, rgba(50, 200, 255, 0.16), transparent 55%),
    rgba(6, 10, 16, 0.95);
  transition: opacity 0.25s ease;
}

#hyperspace-overlay.active {
  opacity: 1;
  pointer-events: all;
}

#hyperspace-overlay canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#hyperspace-overlay .fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: #dbe7f5;
  font-family: "Sora", "Manrope", sans-serif;
  letter-spacing: 0.6px;
}

#hyperspace-overlay .fallback .bar {
  width: min(360px, 70vw);
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

#hyperspace-overlay .fallback .bar span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(122, 215, 255, 0.2), rgba(122, 215, 255, 0.9));
  animation: hyperspacePulse 1.2s ease-in-out infinite;
}

@keyframes hyperspacePulse {
  0% { transform: translateX(-60%); }
  50% { transform: translateX(40%); }
  100% { transform: translateX(160%); }
}

@media (prefers-reduced-motion: reduce) {
  #hyperspace-overlay canvas {
    display: none;
  }

  #hyperspace-overlay .fallback {
    display: flex;
  }
}

header {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1100px, 92vw);
  padding: 14px 20px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  animation: headerDrop 0.7s ease both;
}

header h1 {
  font-family: "Sora", "Manrope", sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--text);
}

header > a {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

header > a:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

#content {
  max-width: 1100px;
  margin: 120px auto 60px;
  padding: 48px 36px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.8s ease both;
}

#content::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 400px at 20% 0%, rgba(122, 215, 255, 0.16), transparent 60%);
  opacity: 0.5;
  pointer-events: none;
}

.section,
.project {
  margin-bottom: 28px;
  padding: 24px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.section:last-child,
.project:last-child {
  margin-bottom: 0;
}

.section:hover,
.project:hover {
  transform: translateY(-4px);
  border-color: rgba(122, 215, 255, 0.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.section h2,
.project h2 {
  font-family: "Sora", "Manrope", sans-serif;
  font-size: 26px;
  margin-bottom: 12px;
  color: var(--accent);
}

.section p,
.project p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  max-width: 900px;
}

.section p + p,
.project p + p {
  margin-top: 12px;
}

.section ul,
.project ul {
  margin-top: 12px;
  padding-left: 18px;
}

.section li,
.project li {
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.detail-list {
  list-style: disc;
}

p {
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

#content a {
  border-bottom: 1px solid rgba(122, 215, 255, 0.4);
  padding-bottom: 2px;
}

#content a:hover {
  color: #ffffff;
  border-color: #ffffff;
}

@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes headerDrop {
  0% {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 768px) {
  header {
    padding: 12px 16px;
  }

  header h1 {
    font-size: 18px;
  }

  header > a {
    font-size: 11px;
    left: 12px;
  }

  #content {
    margin: 100px auto 40px;
    padding: 28px 20px;
  }

  .section,
  .project {
    padding: 18px;
  }

  .section h2,
  .project h2 {
    font-size: 22px;
  }

  .section p,
  .project p {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
