:root {
  --night: #020106;
  --ink: #f5f2eb;
  --muted: rgba(245, 242, 235, 0.62);
  --hairline: rgba(245, 242, 235, 0.18);
  --focus: #b7a6ff;
  --ease: cubic-bezier(0.2, 0.75, 0.18, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "DM Sans", Arial, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #05040a;
}

body {
  color: var(--ink);
  overflow-x: hidden;
}

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

button {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.skip {
  position: fixed;
  z-index: 1000;
  top: -80px;
  left: 18px;
  padding: 10px 14px;
  background: #fff;
  color: #09090d;
}

.skip:focus {
  top: 18px;
}

.webgl-hero {
  position: relative;
  height: 100svh;
  min-height: 720px;
  overflow: hidden;
  background: #05040a;
  isolation: isolate;
}

.portal-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  clip-path: inset(0 calc(50% - 1px));
  background:
    radial-gradient(circle at 66% 34%, rgba(38, 18, 84, 0.2), transparent 43%),
    radial-gradient(circle at 38% 77%, rgba(13, 18, 61, 0.14), transparent 39%),
    #010104;
  will-change: clip-path;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

.portal-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 46%,
    transparent 33%,
    rgba(0, 0, 3, 0.52) 100%
  );
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: 0;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

.hero-fallback {
  position: absolute;
  inset: 0;
  display: none;
  margin: 0;
}

.hero-fallback img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.webgl-failed .hero-canvas {
  display: none;
}

.webgl-failed .hero-fallback {
  display: block;
}

.hero-header {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  align-items: center;
  min-height: calc(70px + var(--safe-top));
  padding: var(--safe-top) clamp(22px, 2.4vw, 40px) 0;
  opacity: 0;
}

.hero-brand {
  justify-self: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 1.45vw, 24px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.hero-content {
  position: absolute;
  z-index: 10;
  inset: 0;
  pointer-events: none;
}

.hero-content > * {
  pointer-events: auto;
}

.hero-title {
  position: absolute;
  left: clamp(26px, 4vw, 72px);
  top: clamp(132px, 18vh, 196px);
  width: min(500px, 38vw);
  opacity: 0;
}

.hero-title h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 4.2vw, 66px);
  font-weight: 300;
  line-height: 0.94;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

.service-selector {
  position: absolute;
  left: clamp(26px, 4vw, 72px);
  top: 65%;
  display: grid;
  justify-items: stretch;
  width: 190px;
  max-width: calc(100% - 52px);
  gap: 12px;
  transform: translateY(-50%);
  opacity: 0;
}

.service-selector button,
.service-selector a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid rgba(245, 242, 235, 0.38);
  border-radius: 999px;
  color: rgba(245, 242, 235, 0.9);
  background: rgba(34, 32, 40, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 1px 10px rgba(0, 0, 0, 0.06);
  font:
    500 14px/1.35 "DM Sans",
    sans-serif;
  cursor: pointer;
  backdrop-filter: blur(16px) saturate(108%);
  -webkit-backdrop-filter: blur(16px) saturate(108%);
  transform: none;
  transition:
    color 0.3s,
    background 0.3s,
    border-color 0.3s,
    opacity 0.3s;
}

.service-selector button:not(.is-active):hover,
.service-selector a:not(.is-active):hover,
.service-selector button:not(.is-active):focus-visible,
.service-selector a:not(.is-active):focus-visible {
  color: rgba(245, 242, 235, 0.98);
  background: rgba(48, 45, 56, 0.46);
  border-color: rgba(245, 242, 235, 0.68);
}

.service-selector a {
  margin-top: 0;
  text-decoration: none;
}

.hero-support {
  position: absolute;
  right: clamp(26px, 4vw, 72px);
  bottom: clamp(38px, 6vh, 76px);
  display: grid;
  grid-template-columns: minmax(240px, 360px) auto;
  gap: clamp(30px, 4.2vw, 72px);
  align-items: center;
  opacity: 0;
}

.hero-support p {
  max-width: 34ch;
  margin: 0;
  color: rgba(245, 242, 235, 0.72);
  font-size: clamp(13px, 1vw, 15px);
  line-height: 1.5;
  text-shadow: 0 1px 20px rgba(0, 0, 0, 0.28);
}

.hero-cta {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 24px;
  overflow: hidden;
  border: 1px solid rgba(248, 250, 255, 0.38);
  border-radius: 999px;
  color: #f8f6f1;
  text-align: center;
  background:
    radial-gradient(
      circle at 24% -20%,
      rgba(255, 255, 255, 0.24),
      transparent 38%
    ),
    linear-gradient(
      140deg,
      rgba(255, 255, 255, 0.115),
      rgba(255, 255, 255, 0.025) 42%,
      rgba(135, 104, 255, 0.08) 100%
    ),
    rgba(12, 10, 21, 0.34);
  backdrop-filter: blur(22px) saturate(175%) contrast(106%);
  -webkit-backdrop-filter: blur(22px) saturate(175%) contrast(106%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    inset 1px 0 0 rgba(255, 255, 255, 0.08),
    0 12px 40px rgba(0, 0, 0, 0.22),
    0 0 28px rgba(112, 82, 255, 0.08);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease;
}

.hero-cta::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -110%;
  left: -38%;
  width: 42%;
  height: 320%;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent,
    rgba(255, 255, 255, 0.06) 26%,
    rgba(255, 255, 255, 0.34) 48%,
    rgba(255, 255, 255, 0.08) 65%,
    transparent
  );
  filter: blur(2px);
  transform: rotate(12deg);
  opacity: 0.62;
  transition:
    left 520ms var(--ease),
    opacity 220ms ease;
}

.hero-cta::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.055),
    inset 0 12px 22px rgba(255, 255, 255, 0.035);
}

.hero-cta > * {
  position: relative;
  z-index: 1;
}

.hero-cta:hover,
.hero-cta:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(252, 253, 255, 0.58);
  background:
    radial-gradient(
      circle at 24% -20%,
      rgba(255, 255, 255, 0.3),
      transparent 40%
    ),
    linear-gradient(
      140deg,
      rgba(255, 255, 255, 0.14),
      rgba(255, 255, 255, 0.035) 42%,
      rgba(135, 104, 255, 0.12) 100%
    ),
    rgba(15, 12, 26, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    inset 1px 0 0 rgba(255, 255, 255, 0.1),
    0 15px 44px rgba(0, 0, 0, 0.26),
    0 0 34px rgba(112, 82, 255, 0.14);
}

.hero-cta:hover::before,
.hero-cta:focus-visible::before {
  left: 110%;
  opacity: 0.88;
}

.hero-cta:active {
  transform: translateY(0) scale(0.985);
}

.hero-cta:focus-visible {
  outline: 2px solid #b7a6ff;
  outline-offset: 3px;
}

.webgl-status {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 760px) {
  .webgl-hero {
    min-height: 720px;
  }

  .hero-header {
    min-height: calc(66px + var(--safe-top));
    padding-inline: 22px;
  }

  .hero-brand {
    font-size: 20px;
  }

  .hero-title {
    left: 26px;
    right: 28px;
    top: calc(var(--safe-top) + 145px);
    width: auto;
  }

  .hero-title h1 {
    max-width: 318px;
    font-size: clamp(36px, 9.8vw, 42px);
    line-height: 0.94;
    letter-spacing: -0.045em;
  }

  .service-selector {
    left: 26px;
    right: auto;
    top: 58.5%;
    bottom: auto;
    display: grid;
    gap: 4px;
    overflow: visible;
    padding: 0;
    transform: translateY(-50%);
  }

  .service-selector button,
  .service-selector a {
    min-height: 44px;
    padding: 9px 14px;
    font-size: 14px;
  }

  .service-selector button.is-active {
    padding-inline: 16px;
  }

  .service-selector a {
    margin-top: 0;
  }

  .hero-support {
    left: 24px;
    right: 22px;
    bottom: calc(var(--safe-bottom) + 28px);
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
  }

  .hero-support p {
    max-width: 220px;
    color: rgba(245, 242, 235, 0.76);
    font-size: 12.5px;
    line-height: 1.45;
  }

  .hero-cta {
    min-height: 48px;
    padding: 0 17px;
    font-size: 12px;
    backdrop-filter: blur(20px) saturate(170%);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
  }
}

@media (max-width: 390px) {
  .hero-header {
    padding-inline: 18px;
  }

  .hero-title {
    left: 22px;
    right: 22px;
    top: calc(var(--safe-top) + 136px);
  }

  .hero-title h1 {
    max-width: 292px;
    font-size: 36px;
  }

  .service-selector {
    left: 22px;
    top: 59%;
  }

  .service-selector button,
  .service-selector a {
    min-height: 44px;
    padding: 9px 13px;
    font-size: 13.5px;
  }

  .hero-support {
    left: 22px;
    right: 18px;
    gap: 14px;
  }

  .hero-support p {
    max-width: 188px;
    font-size: 12px;
  }

  .hero-cta {
    min-height: 46px;
    padding-inline: 15px;
    font-size: 11.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-scene {
    clip-path: none;
  }

  .hero-header,
  .hero-title,
  .service-selector,
  .hero-support {
    opacity: 1;
    transform: none;
  }

  .hero-cta::before {
    transition: none;
  }
}

@media (forced-colors: active) {
  .portal-scene {
    background: Canvas;
  }

  .service-selector button,
  .service-selector a,
  .hero-cta {
    border: 1px solid ButtonText;
  }

  .service-selector button.is-active {
    background: Highlight;
    color: HighlightText;
  }
}
