:root {
  color-scheme: dark;
  --bg: #030611;
  --panel: rgba(7, 13, 28, 0.2);
  --panel-border: rgba(180, 214, 255, 0.18);
  --text: rgba(248, 250, 255, 0.96);
  --muted: rgba(207, 220, 241, 0.7);
  --accent: #8ec5ff;
  --accent-soft: rgba(142, 197, 255, 0.24);
  --shadow: 0 24px 80px rgba(1, 7, 20, 0.5);
  --page-padding: clamp(20px, 4vw, 56px);
  --card-width: min(34rem, calc(100vw - (var(--page-padding) * 2)));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", sans-serif;
  overflow-x: hidden;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 14%, rgba(117, 170, 255, 0.09), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(72, 111, 214, 0.11), transparent 24%),
    radial-gradient(circle at 50% 78%, rgba(54, 88, 166, 0.09), transparent 30%),
    linear-gradient(180deg, rgba(2, 6, 16, 0) 52%, rgba(2, 6, 16, 0.24) 100%);
  z-index: 1;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.07) 0,
      rgba(255, 255, 255, 0.07) 1px,
      transparent 1px,
      transparent 4px
    );
  opacity: 0.055;
  mix-blend-mode: screen;
  z-index: 1;
}

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

.inline-link {
  color: rgba(214, 235, 255, 0.96);
  text-decoration: underline;
  text-decoration-color: rgba(142, 197, 255, 0.45);
  text-underline-offset: 0.16em;
}

.inline-link:hover,
.inline-link:focus-visible {
  text-decoration-color: rgba(142, 197, 255, 0.9);
}

#spaceCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.page-shell {
  position: relative;
  z-index: 2;
}

.canvas-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(183, 215, 255, 0.2);
  border-radius: 999px;
  background: rgba(6, 12, 24, 0.82);
  backdrop-filter: blur(12px);
  color: rgba(247, 251, 255, 0.94);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 8px));
  opacity: 0;
  transition: opacity 180ms ease;
  z-index: 6;
}

.canvas-tooltip.is-visible {
  opacity: 1;
}

.masthead {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem var(--page-padding);
  z-index: 4;
  pointer-events: none;
}

.brand {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(247, 250, 255, 0.92);
}

.brand__icon {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 0.6rem rgba(142, 197, 255, 0.18));
}

.sections {
  position: relative;
}

.panel {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--page-padding) * 1.45) var(--page-padding);
}

.panel__inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  min-height: 100%;
}

.glass-card {
  position: relative;
  width: var(--card-width);
  padding: clamp(1.6rem, 3.2vw, 2.5rem);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    rgba(10, 18, 34, 0.08);
  backdrop-filter: blur(8px) saturate(108%);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: translateY(18px);
  opacity: 0.48;
  transition:
    transform 500ms ease,
    opacity 500ms ease,
    border-color 500ms ease,
    box-shadow 500ms ease;
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(193, 224, 255, 0.8), transparent);
}

.glass-card::after {
  content: none;
}

.panel.is-active .glass-card {
  transform: translateY(0);
  opacity: 1;
  border-color: rgba(208, 231, 255, 0.3);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(210, 230, 255, 0.08),
    0 0 3rem rgba(87, 132, 219, 0.12);
}

h1,
h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

h1 {
  font-size: clamp(3.8rem, 10vw, 7.75rem);
  max-width: 10ch;
}

h2 {
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  max-width: 11ch;
}

.lead,
.glass-card p:last-child {
  margin: 1.15rem 0 0;
  max-width: 32ch;
  font-size: clamp(1.04rem, 1.2rem + 0.1vw, 1.36rem);
  line-height: 1.65;
  color: var(--muted);
}

.project-links {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.project-link {
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem 1rem 0.95rem;
  border: 1px solid rgba(190, 224, 255, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(244, 248, 255, 0.9);
  transition:
    background 220ms ease,
    border-color 220ms ease,
    transform 220ms ease;
}

.project-link__name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: rgba(248, 251, 255, 0.96);
}

.project-link__meta {
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(214, 226, 244, 0.76);
}

.project-link:hover,
.project-link:focus-visible {
  background: rgba(142, 197, 255, 0.12);
  border-color: rgba(190, 224, 255, 0.42);
  transform: translateY(-1px);
}

.panel:nth-child(2) .panel__inner {
  justify-content: flex-end;
}

.panel:nth-child(3) .panel__inner {
  justify-content: flex-start;
}

@media (max-width: 980px) {
  .masthead {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.6rem;
    padding-top: 1.2rem;
  }

  .panel,
  .panel:nth-child(2) .panel__inner,
  .panel:nth-child(3) .panel__inner {
    align-items: flex-end;
    justify-content: flex-start;
  }

  .panel__inner {
    width: 100%;
    padding-bottom: clamp(2rem, 10vh, 5rem);
  }
}

@media (max-width: 720px) {
  .glass-card {
    width: 100%;
    border-radius: 12px;
  }

  h1 {
    max-width: none;
  }

  .lead,
  .glass-card p:last-child {
    max-width: none;
  }

  .canvas-tooltip {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .glass-card,
  .glass-card {
    transform: none;
    opacity: 1;
  }
}
