:root {
  color-scheme: dark;
  --space: #020610;
  --space-deep: #00030a;
  --ink: rgba(238, 248, 255, 0.96);
  --ink-soft: rgba(197, 230, 255, 0.68);
  --cyan: #70ecff;
  --cyan-hot: #d7fbff;
  --blue: #4a8dff;
  --violet: #6e55ff;
  --warm-star: #fff0cf;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--space-deep);
}

body {
  color: var(--ink);
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cosmic-page {
  position: relative;
  isolation: isolate;
  width: 100vw;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background: #01030a;
}

.cosmic-page::before,
.cosmic-page::after {
  position: absolute;
  inset: 0;
  z-index: 26;
  pointer-events: none;
  content: "";
}

.cosmic-page::before {
  background:
    radial-gradient(circle at 50% 48%, transparent 0 25%, rgba(2, 6, 14, 0.04) 40%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.24), transparent 22% 78%, rgba(0, 0, 0, 0.3));
}

.cosmic-page::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 18% 78%, rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at 49% 51%, rgba(123, 241, 255, 0.1), transparent 18%);
  mix-blend-mode: screen;
  opacity: 0.72;
}

.cosmic-layer {
  transform: scale(var(--layer-scale, 1));
}

.cosmic-backdrop {
  --layer-scale: 1.04;
  position: absolute;
  inset: -2.6%;
  z-index: 0;
  pointer-events: none;
  background-image: url("assets/cosmic/cosmic-portal-bg.png");
  background-position: center center;
  background-size: cover;
  filter: saturate(1.04) contrast(1.02);
}

.nebula,
.starfield {
  position: absolute;
  inset: -6%;
  pointer-events: none;
}

.nebula {
  z-index: 1;
  opacity: 0.34;
  filter: blur(0.4px) saturate(1.08);
  mix-blend-mode: screen;
}

.nebula-left {
  --layer-scale: 1.05;
  background:
    radial-gradient(ellipse at 5% 63%, rgba(112, 236, 255, 0.26), transparent 18%),
    radial-gradient(ellipse at 11% 76%, rgba(75, 101, 255, 0.38), transparent 27%),
    radial-gradient(ellipse at 23% 42%, rgba(47, 142, 244, 0.18), transparent 21%),
    conic-gradient(from 226deg at 4% 78%, transparent 0 16%, rgba(116, 84, 255, 0.16), transparent 33% 100%);
}

.nebula-right {
  --layer-scale: 1.04;
  background:
    radial-gradient(ellipse at 92% 45%, rgba(125, 81, 238, 0.32), transparent 22%),
    radial-gradient(ellipse at 86% 72%, rgba(49, 128, 255, 0.18), transparent 24%),
    conic-gradient(from 38deg at 94% 54%, transparent 0 18%, rgba(96, 73, 223, 0.18), transparent 36% 100%);
}

.starfield {
  z-index: 3;
  opacity: 0.92;
  background-repeat: repeat;
  mix-blend-mode: screen;
}

.starfield-deep {
  --layer-scale: 1.04;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(125, 190, 255, 0.64) 0 1px, transparent 1.8px);
  background-position:
    12px 18px,
    98px 74px;
  background-size:
    172px 156px,
    246px 214px;
  opacity: 0.22;
}

.starfield-near {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1.2px, transparent 2px),
    radial-gradient(circle, rgba(119, 239, 255, 0.9) 0 1px, transparent 1.7px);
  background-position:
    42px 56px,
    8px 108px;
  background-size:
    292px 238px,
    388px 324px;
  opacity: 0.24;
}

.cosmic-horizon {
  position: absolute;
  left: -12%;
  right: -12%;
  bottom: -3%;
  z-index: 8;
  height: 30vh;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 0 44%, rgba(79, 160, 255, 0.08) 54%, transparent 64%),
    radial-gradient(ellipse at 50% 74%, rgba(112, 236, 255, 0.34), transparent 21%),
    radial-gradient(ellipse at 50% 96%, rgba(0, 0, 0, 0.72), transparent 62%);
  opacity: 0.36;
}

.portal-link {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 22;
  display: grid;
  width: clamp(320px, 58vmin, 760px);
  aspect-ratio: 1;
  place-items: center;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  border-radius: 50%;
  outline: none;
  isolation: isolate;
  transform: translate(-50%, -50%);
  filter:
    drop-shadow(0 0 34px rgba(100, 233, 255, 0.52))
    drop-shadow(0 0 82px rgba(74, 141, 255, 0.24));
  transition:
    filter 280ms ease;
}

.portal-link::before,
.portal-link::after,
.portal-aura,
.portal-ring,
.portal-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  content: "";
}

.portal-aura {
  z-index: -4;
  inset: -24%;
  background:
    radial-gradient(circle, rgba(101, 231, 255, 0.36), transparent 32%),
    radial-gradient(circle, rgba(69, 91, 255, 0.26), transparent 58%);
  filter: blur(20px);
  opacity: 0.38;
  animation: portal-aura 5.8s ease-in-out infinite alternate;
}

.portal-link::before {
  z-index: -3;
  inset: -12%;
  background:
    conic-gradient(
      from 18deg,
      transparent 0 6%,
      rgba(112, 236, 255, 0.56) 9%,
      transparent 14% 28%,
      rgba(94, 110, 255, 0.42) 34%,
      transparent 40% 55%,
      rgba(203, 249, 255, 0.62) 61%,
      transparent 69% 82%,
      rgba(76, 232, 255, 0.44) 88%,
      transparent 94% 100%
    );
  filter: blur(17px);
  opacity: 0.36;
  animation: portal-spin 17s linear infinite;
}

.portal-link::after {
  z-index: -2;
  inset: 12%;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 4, 12, 0.92) 0 49%, transparent 50%),
    radial-gradient(circle, rgba(112, 236, 255, 0.18), transparent 67%);
  box-shadow:
    inset 0 0 58px rgba(8, 18, 38, 0.94),
    inset 0 0 96px rgba(35, 125, 213, 0.32);
}

.portal-ring {
  z-index: -1;
  background:
    conic-gradient(
      from 124deg,
      rgba(71, 214, 255, 0.08),
      rgba(221, 252, 255, 0.94),
      rgba(66, 227, 255, 0.22),
      rgba(72, 87, 246, 0.58),
      rgba(127, 246, 255, 0.78),
      rgba(71, 214, 255, 0.08)
    );
  mask: radial-gradient(circle, transparent 0 38%, #000 41% 58%, transparent 62%);
  -webkit-mask: radial-gradient(circle, transparent 0 38%, #000 41% 58%, transparent 62%);
  filter: blur(1px);
  opacity: 0.34;
  animation: portal-spin 26s linear infinite reverse;
}

.portal-ring-inner {
  inset: 7%;
  opacity: 0.28;
  transform: rotate(18deg);
  animation-duration: 18s;
  animation-direction: normal;
}

.portal-core {
  inset: 27%;
  z-index: 0;
  background:
    radial-gradient(circle, rgba(4, 12, 27, 0.56) 0 42%, rgba(3, 8, 18, 0.9) 72%, rgba(1, 3, 8, 0.96) 100%),
    repeating-radial-gradient(circle, rgba(100, 236, 255, 0.16) 0 1px, transparent 1px 8px);
  box-shadow:
    inset 0 0 54px rgba(1, 8, 24, 0.94),
    inset 0 0 16px rgba(103, 228, 255, 0.18);
  opacity: 0.78;
}

.portal-core::before,
.portal-core::after {
  position: absolute;
  left: 50%;
  top: 50%;
  content: "";
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.portal-core::before {
  width: 86%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 251, 255, 0.88), transparent);
  box-shadow: 0 0 20px rgba(112, 236, 255, 0.76);
  opacity: 0.72;
}

.portal-core::after {
  width: 8px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--cyan-hot);
  box-shadow:
    0 0 11px rgba(255, 255, 255, 0.98),
    0 0 34px rgba(112, 236, 255, 0.96);
}

.portal-label {
  position: relative;
  z-index: 3;
  display: block;
  max-width: none;
  padding: 0.4em;
  color: rgba(239, 250, 255, 0.96);
  font-size: clamp(1.55rem, 0.98rem + 1.9vw, 3.65rem);
  font-weight: 350;
  line-height: 1.05;
  letter-spacing: 0.2em;
  white-space: nowrap;
  text-shadow:
    0 0 8px rgba(210, 249, 255, 0.9),
    0 0 28px rgba(112, 236, 255, 0.78),
    0 0 58px rgba(74, 141, 255, 0.48);
  transform: translateX(0.1em);
}

.portal-link:is(:hover, :focus-visible) {
  filter:
    drop-shadow(0 0 30px rgba(120, 242, 255, 0.62))
    drop-shadow(0 0 88px rgba(74, 141, 255, 0.36));
}

.portal-link:is(:hover, :focus-visible) .portal-aura {
  opacity: 1;
  filter: blur(17px);
}

.portal-link:is(:hover, :focus-visible) .portal-ring-outer {
  animation-duration: 11s;
}

.portal-link:focus-visible {
  outline: 2px solid rgba(214, 251, 255, 0.86);
  outline-offset: 14px;
}

.cosmic-page.is-chromium-portal::after {
  mix-blend-mode: normal;
  opacity: 0.58;
}

.cosmic-page.is-chromium-portal .nebula,
.cosmic-page.is-chromium-portal .starfield {
  mix-blend-mode: normal;
}

.cosmic-page.is-chromium-portal .nebula {
  opacity: 0.28;
  filter: saturate(1.04);
}

.cosmic-page.is-chromium-portal .portal-link {
  filter:
    drop-shadow(0 0 24px rgba(100, 233, 255, 0.46))
    drop-shadow(0 0 54px rgba(74, 141, 255, 0.2));
}

.cosmic-page.is-chromium-portal .portal-aura {
  inset: -18%;
  filter: blur(12px);
  opacity: 0.44;
}

.cosmic-page.is-chromium-portal .portal-link::before {
  filter: blur(9px);
  opacity: 0.32;
}

.cosmic-page.is-chromium-portal .portal-ring {
  filter: none;
  opacity: 0.3;
}

.cosmic-page.is-chromium-portal .portal-core {
  box-shadow:
    inset 0 0 42px rgba(1, 8, 24, 0.9),
    inset 0 0 14px rgba(103, 228, 255, 0.16);
}

.cosmic-page.is-chromium-portal .portal-core::before {
  box-shadow: 0 0 14px rgba(112, 236, 255, 0.62);
}

.cosmic-page.is-chromium-portal .portal-core::after {
  box-shadow:
    0 0 9px rgba(255, 255, 255, 0.94),
    0 0 24px rgba(112, 236, 255, 0.74);
}

.cosmic-page.is-chromium-portal .portal-link:is(:hover, :focus-visible) {
  filter:
    drop-shadow(0 0 26px rgba(120, 242, 255, 0.54))
    drop-shadow(0 0 62px rgba(74, 141, 255, 0.3));
}

.cosmic-page.is-chromium-portal .portal-link:is(:hover, :focus-visible) .portal-aura {
  filter: blur(12px);
}

.linkedin-star {
  position: absolute;
  right: clamp(22px, 3vw, 52px);
  top: clamp(20px, 3vw, 48px);
  z-index: 30;
  display: grid;
  width: clamp(27px, 2.7vw, 39px);
  aspect-ratio: 1;
  place-items: center;
  color: rgba(224, 244, 255, 0.78);
  text-decoration: none;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(221, 252, 255, 0.2), transparent 45%),
    rgba(6, 21, 38, 0.18);
  box-shadow:
    0 0 8px rgba(224, 244, 255, 0.74),
    0 0 22px rgba(73, 145, 255, 0.32);
  opacity: 0.74;
  outline: none;
  transition:
    opacity 220ms ease,
    box-shadow 220ms ease;
}

.linkedin-star::before,
.linkedin-star::after {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 180%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(220, 247, 255, 0.92), transparent);
  content: "";
  transform: translate(-50%, -50%);
  opacity: 0.5;
}

.linkedin-star::after {
  width: 1px;
  height: 180%;
  background: linear-gradient(180deg, transparent, rgba(220, 247, 255, 0.84), transparent);
}

.linkedin-star span {
  position: relative;
  z-index: 2;
  font-size: clamp(0.58rem, 0.5rem + 0.32vw, 0.82rem);
  font-weight: 760;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 10px rgba(224, 244, 255, 0.9);
  transform: translateY(-0.02em);
}

.linkedin-star:is(:hover, :focus-visible) {
  opacity: 1;
  box-shadow:
    0 0 12px rgba(243, 252, 255, 0.92),
    0 0 36px rgba(90, 170, 255, 0.54);
}

.linkedin-star:focus-visible {
  outline: 2px solid rgba(214, 251, 255, 0.86);
  outline-offset: 8px;
}

#cosmic-canvas {
  position: absolute;
  inset: 0;
  z-index: 18;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.terminal-line {
  appearance: none;
  position: absolute;
  left: clamp(16px, 3.2vw, 48px);
  right: clamp(16px, 3.2vw, 48px);
  bottom: clamp(13px, 2.3vh, 28px);
  z-index: 31;
  display: block;
  width: auto;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: rgba(186, 252, 231, 0.88);
  font-family:
    "SFMono-Regular", "Cascadia Mono", "Liberation Mono", Menlo, Consolas, monospace;
  font-size: clamp(0.68rem, 0.5rem + 0.56vw, 0.98rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
  text-align: left;
  background: transparent;
  border: 0;
  text-shadow:
    0 0 9px rgba(93, 255, 194, 0.58),
    0 0 22px rgba(112, 236, 255, 0.2);
  cursor: pointer;
}

.terminal-text {
  display: inline;
}

.terminal-hotkey {
  color: rgba(255, 65, 74, 0.96);
  text-shadow:
    0 0 8px rgba(255, 65, 74, 0.88),
    0 0 20px rgba(255, 44, 62, 0.38);
}

.terminal-cursor {
  display: inline-block;
  width: 0.64em;
  color: rgba(213, 255, 243, 0.96);
  text-shadow:
    0 0 10px rgba(213, 255, 243, 0.86),
    0 0 26px rgba(112, 236, 255, 0.4);
  animation: terminal-cursor 950ms steps(1, end) infinite;
}

.terminal-line:is(:hover, :focus-visible) {
  color: rgba(215, 255, 242, 0.98);
}

.terminal-line:focus-visible {
  outline: 1px solid rgba(186, 252, 231, 0.52);
  outline-offset: 6px;
}

@keyframes portal-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes portal-aura {
  from {
    opacity: 0.58;
    transform: scale(0.96);
  }
  to {
    opacity: 0.92;
    transform: scale(1.04);
  }
}

@keyframes terminal-cursor {
  0%,
  46% {
    opacity: 1;
  }
  47%,
  100% {
    opacity: 0;
  }
}

@media (max-width: 760px) {
  .cosmic-page {
    min-height: 100svh;
  }

  .cosmic-backdrop {
    inset: -1.2%;
    background-position: center center;
  }

  .portal-link {
    top: 50%;
    width: min(86vw, 430px);
  }

  .portal-label {
    font-size: clamp(1.35rem, 7vw, 2.15rem);
    letter-spacing: 0.14em;
  }

  .linkedin-star {
    right: 18px;
    top: 18px;
    width: 31px;
  }

  .cosmic-horizon {
    height: 27vh;
  }

  .terminal-line {
    left: 14px;
    right: 14px;
    bottom: 12px;
    font-size: clamp(0.58rem, 2.65vw, 0.72rem);
  }
}

@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;
  }

  .portal-link {
    transform: translate(-50%, -50%) !important;
  }
}
