:root {
  color-scheme: dark;
  --tone-1: 215 14% 28%;
  --tone-2: 210 16% 33%;
  --tone-3: 218 10% 21%;
  --tone-4: 215 12% 13%;
  --x-a: 18%;
  --y-a: 24%;
  --x-b: 82%;
  --y-b: 36%;
  --x-c: 50%;
  --y-c: 84%;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: hsl(var(--tone-4));
}

body {
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  font-family:
    "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body::selection {
  background: rgba(160, 200, 240, 0.28);
}

.page {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: clamp(18px, 5vw, 56px);
  isolation: isolate;
  background:
    linear-gradient(rgba(8, 18, 42, 0.08), rgba(8, 18, 42, 0.08)),
    radial-gradient(circle at var(--x-a) var(--y-a), hsl(var(--tone-2) / 0.9), transparent 42vmax),
    radial-gradient(circle at var(--x-b) var(--y-b), hsl(var(--tone-1) / 0.78), transparent 38vmax),
    radial-gradient(circle at var(--x-c) var(--y-c), hsl(var(--tone-3) / 0.84), transparent 46vmax),
    linear-gradient(135deg, hsl(215 12% 18%), hsl(210 14% 26%) 48%, hsl(218 10% 14%));
}

.page::before {
  position: absolute;
  inset: 0;
  z-index: 2;
  content: "";
  background: rgba(210, 225, 248, 0.03);
  backdrop-filter: blur(7px) saturate(1.02);
  -webkit-backdrop-filter: blur(7px) saturate(1.02);
  pointer-events: none;
}

.morph-layer {
  position: absolute;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  pointer-events: none;
}

.thermal-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  mix-blend-mode: screen;
  pointer-events: none;
}

.thermal-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.thermal-blob {
  position: absolute;
  top: 0;
  left: 0;
  width: 300px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(120, 180, 255, 0.55) 0%,
    rgba(50, 110, 245, 0.22) 45%,
    transparent 70%
  );
  filter: blur(30px);
  pointer-events: none;
  will-change: transform;
  opacity: 0;
}

.glow {
  position: absolute;
  width: 58vmax;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(96px);
  opacity: 0.78;
  transform: translate3d(-50%, -50%, 0);
}

.glow-a {
  left: var(--x-a);
  top: var(--y-a);
  background: hsl(var(--tone-2) / 0.64);
}

.glow-b {
  left: var(--x-b);
  top: var(--y-b);
  background: hsl(var(--tone-1) / 0.48);
}

.glow-c {
  left: var(--x-c);
  top: var(--y-c);
  background: hsl(var(--tone-3) / 0.5);
}

.content {
  position: relative;
  width: 100%;
  --text-color: rgba(12, 32, 80, 0.40);
}

.word {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: clamp(3.25rem, 12.5vw, 10.6rem);
  font-weight: 900;
  color: var(--text-color);
  text-align: center;
  line-height: 0.9;
  letter-spacing: 0;
  white-space: nowrap;
  text-wrap: balance;
  text-shadow: 0 18px 58px rgba(5, 15, 45, 0.22);
}

.bottom-bar {
  position: fixed;
  z-index: 5;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 0 clamp(1.25rem, 5vw, 2.5rem) clamp(1.25rem, 4vh, 2.5rem);
}

.bottom-link {
  display: block;
  background: none;
  border: none;
  padding: 12px 4px;
  margin: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: clamp(0.85rem, 1.4vw, 1.05rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.42);
  text-decoration: none;
  letter-spacing: -0.03em;
  touch-action: manipulation;
  transition: color 0.25s ease;
}

.bottom-link:hover {
  color: rgba(255, 255, 255, 0.65);
}

.bottom-link:focus-visible {
  outline: 2px solid rgba(160, 200, 248, 0.62);
  outline-offset: 4px;
}

#contact-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 5vw, 2.5rem);
  background: rgba(8, 18, 42, 0.55);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#contact-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 1.4em;
  max-width: 480px;
  width: 100%;
}

.contact-subject {
  margin: 0;
  font-size: clamp(0.85rem, 1.4vw, 1.05rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: -0.03em;
}

.contact-body {
  margin: 0;
  font-size: clamp(0.85rem, 1.4vw, 1.05rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: -0.03em;
  line-height: 1.6;
}

.contact-link {
  color: rgba(255, 255, 255, 0.42);
  text-decoration: none;
}

.contact-link:hover {
  color: rgba(255, 255, 255, 0.65);
}

.contact-email {
  font-size: clamp(0.85rem, 1.4vw, 1.05rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: -0.03em;
  text-decoration: none;
  transition: color 0.25s ease;
}

.contact-email:hover {
  color: rgba(255, 255, 255, 0.65);
}

@media (max-width: 720px) {
  body {
    overflow: hidden;
  }

  .page {
    padding: 22px;
  }

  .page::before {
    backdrop-filter: blur(3px) saturate(1.02);
    -webkit-backdrop-filter: blur(3px) saturate(1.02);
  }

  .word {
    font-size: clamp(2.05rem, 10.5vw, 4.45rem);
    white-space: nowrap;
    max-width: 100%;
    text-shadow:
      0 1px 0 rgba(210, 225, 248, 0.03),
      0 14px 42px rgba(5, 15, 45, 0.22);
  }

  .content {
    --text-color: rgba(8, 24, 65, 0.28);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
