:root {
  --color-bg: #020706;
  --color-bg-soft: #07110f;
  --color-surface: rgba(7, 20, 17, 0.88);
  --color-surface-strong: rgba(4, 12, 10, 0.96);
  --color-text: #f4fbf9;
  --color-muted: #a8bbb6;
  --color-accent: #19c79d;
  --color-accent-bright: #42e4ba;
  --color-accent-dark: #087a62;
  --color-line: rgba(52, 220, 176, 0.18);
  --card-radius: 34px;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--color-bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--color-text);
  background: var(--color-bg);
  font-family: inherit;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ambient {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  contain: paint;
  background:
    radial-gradient(circle at 50% 8%, rgba(10, 102, 80, 0.18), transparent 34%),
    radial-gradient(circle at 10% 84%, rgba(13, 88, 71, 0.14), transparent 31%),
    linear-gradient(150deg, #010403 0%, #06100d 52%, #020706 100%);
}

.ambient::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(118deg, transparent 8%, rgba(255, 255, 255, 0.018) 22%, transparent 37%),
    linear-gradient(67deg, transparent 56%, rgba(19, 199, 157, 0.025) 72%, transparent 86%);
  content: "";
}

.ambient__grid {
  position: absolute;
  inset: -18%;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(41, 197, 158, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41, 197, 158, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(520px) rotateX(63deg) translateY(34%);
  transform-origin: center bottom;
  -webkit-mask-image: linear-gradient(to bottom, transparent 8%, black 66%, transparent 96%);
  mask-image: linear-gradient(to bottom, transparent 8%, black 66%, transparent 96%);
  animation: gridDrift 18s ease-in-out infinite alternate;
}

.ambient__glow {
  position: absolute;
  width: min(78vw, 760px);
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.33;
  background: radial-gradient(
    circle,
    rgba(16, 194, 150, 0.36) 0%,
    rgba(16, 194, 150, 0.12) 42%,
    transparent 72%
  );
  filter: blur(20px);
  will-change: transform, opacity;
  animation: glowDrift 12s ease-in-out infinite alternate;
}

.ambient__glow--top {
  top: -48%;
  right: -24%;
}

.ambient__glow--bottom {
  bottom: -53%;
  left: -26%;
  opacity: 0.2;
  animation-delay: -6s;
  animation-direction: alternate-reverse;
}

.network {
  --network-rotation: 0deg;
  position: absolute;
  width: min(86vw, 560px);
  overflow: visible;
  opacity: 0.38;
  stroke: rgba(151, 187, 178, 0.38);
  stroke-width: 0.75;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 8px rgba(36, 211, 168, 0.1));
  transform: translate3d(0, 0, 0) rotate(var(--network-rotation));
  animation: networkFloat 14s ease-in-out infinite alternate;
}

.network circle {
  fill: rgba(104, 231, 198, 0.68);
  stroke: none;
  transform-box: fill-box;
  transform-origin: center;
  animation: nodePulse 4.6s ease-in-out infinite;
}

.network circle:nth-of-type(3n + 2) {
  animation-delay: -1.3s;
}

.network circle:nth-of-type(3n) {
  animation-delay: -2.6s;
}

.network--top {
  --network-rotation: -8deg;
  top: -54px;
  left: -98px;
}

.network--bottom {
  --network-rotation: 172deg;
  right: -116px;
  bottom: -74px;
  animation-delay: -7s;
}

.page-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  place-items: center;
  padding: 12px;
  padding:
    calc(12px + env(safe-area-inset-top, 0px))
    calc(12px + env(safe-area-inset-right, 0px))
    calc(12px + env(safe-area-inset-bottom, 0px))
    calc(12px + env(safe-area-inset-left, 0px));
}

.language-card {
  position: relative;
  width: min(100%, 432px);
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(133, 234, 207, 0.17);
  border-radius: var(--card-radius);
  background:
    linear-gradient(145deg, rgba(14, 33, 28, 0.9), rgba(3, 10, 8, 0.97) 62%),
    var(--color-surface);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.58),
    0 0 70px rgba(11, 140, 106, 0.08),
    inset 0 1px rgba(255, 255, 255, 0.035);
  isolation: isolate;
  animation: cardEnter 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.language-card::before {
  position: absolute;
  z-index: -1;
  top: -28%;
  right: -55%;
  width: 130%;
  height: 50%;
  background: linear-gradient(120deg, transparent 15%, rgba(77, 239, 196, 0.07), transparent 72%);
  content: "";
  transform: rotate(18deg);
}

.language-card::after {
  position: absolute;
  z-index: -1;
  right: -78px;
  bottom: -86px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(54, 213, 172, 0.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 32px rgba(54, 213, 172, 0.025),
    0 0 0 68px rgba(54, 213, 172, 0.018);
  content: "";
  transform-origin: center;
  animation: ringBreath 7s ease-in-out infinite;
}

.language-card__edge {
  position: absolute;
  z-index: 3;
  inset: 0;
  border: 1px solid rgba(66, 228, 186, 0.2);
  border-radius: inherit;
  box-shadow:
    inset 0 0 16px rgba(46, 229, 182, 0.035),
    0 0 16px rgba(46, 229, 182, 0.05);
  pointer-events: none;
  animation: edgePulse 5.8s ease-in-out infinite;
}

@supports ((-webkit-mask-composite: xor) or (mask-composite: exclude)) {
  .language-card__edge {
    padding: 1px;
    border: 0;
    background: rgba(66, 228, 186, 0.16);
    -webkit-mask:
      linear-gradient(#fff 0 0) content-box,
      linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
      linear-gradient(#fff 0 0) content-box,
      linear-gradient(#fff 0 0);
    mask-composite: exclude;
  }

  .language-card__edge::before {
    position: absolute;
    inset: -145%;
    background: conic-gradient(
      from 0deg,
      transparent 0deg 250deg,
      rgba(45, 213, 171, 0.08) 270deg,
      rgba(83, 245, 204, 0.76) 291deg,
      rgba(228, 255, 248, 0.98) 300deg,
      rgba(83, 245, 204, 0.52) 309deg,
      transparent 330deg 360deg
    );
    content: "";
    will-change: transform;
    animation: edgeSpin 9s linear infinite;
  }
}

.language-card__content {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  padding: clamp(28px, 8vw, 46px) clamp(18px, 7vw, 40px) clamp(24px, 7vw, 38px);
  flex-direction: column;
}

.hero {
  min-width: 0;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 clamp(18px, 6vw, 30px);
  align-items: center;
  gap: 9px;
  color: var(--color-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.19em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow__signal {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent-bright);
  box-shadow: 0 0 13px rgba(66, 228, 186, 0.74);
}

.eyebrow__signal::after {
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(66, 228, 186, 0.32);
  border-radius: inherit;
  content: "";
  animation: signalPulse 2.6s ease-out infinite;
}

h1 {
  margin: 0;
  color: var(--color-text);
  font-size: clamp(2.28rem, 12.6vw, 3.72rem);
  font-weight: 850;
  letter-spacing: -0.055em;
  line-height: 0.96;
  text-transform: uppercase;
  text-wrap: balance;
}

h1 span {
  display: block;
}

.hero__accent {
  margin-top: 0.11em;
  color: var(--color-accent);
  text-shadow: 0 0 28px rgba(25, 199, 157, 0.17);
}

.hero__description {
  max-width: 26ch;
  margin: clamp(16px, 4.4vw, 22px) auto 0;
  color: var(--color-muted);
  font-size: clamp(0.88rem, 3.8vw, 0.98rem);
  line-height: 1.55;
  text-wrap: balance;
}

.language-list {
  display: grid;
  min-width: 0;
  margin-top: clamp(28px, 8vw, 42px);
  gap: 13px;
}

.language-option {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 76px;
  padding: 12px 13px;
  overflow: hidden;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  border: 1px solid rgba(133, 209, 189, 0.58);
  border-radius: 19px;
  color: var(--color-text);
  background:
    linear-gradient(112deg, rgba(255, 255, 255, 0.035), transparent 46%),
    rgba(1, 6, 5, 0.88);
  box-shadow:
    0 13px 28px rgba(0, 0, 0, 0.25),
    inset 0 1px rgba(255, 255, 255, 0.025);
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    border-color 220ms ease,
    background-color 220ms ease,
    transform 220ms ease,
    box-shadow 220ms ease,
    opacity 220ms ease;
}

.language-option::before {
  position: absolute;
  top: -100%;
  left: -45%;
  width: 42%;
  height: 300%;
  background: linear-gradient(90deg, transparent, rgba(86, 240, 200, 0.08), transparent);
  content: "";
  pointer-events: none;
  transform: rotate(22deg) translateX(-170%);
  transition: transform 620ms ease;
}

.language-option:focus-visible {
  outline: 3px solid var(--color-accent-bright);
  outline-offset: 4px;
}

.language-option:active:not(.is-disabled) {
  transform: scale(0.985);
}

.language-option.is-disabled {
  border-style: dashed;
  opacity: 0.56;
  cursor: not-allowed;
  filter: saturate(0.55);
}

.language-option__flag {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.025),
    0 8px 18px rgba(0, 0, 0, 0.32);
}

.language-option__flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.language-option__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.language-option__label {
  max-width: 100%;
  font-size: clamp(1.02rem, 4.5vw, 1.12rem);
  font-weight: 720;
  letter-spacing: -0.015em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.language-option__hint {
  color: var(--color-muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.language-option__arrow {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid rgba(70, 222, 182, 0.18);
  border-radius: 50%;
  color: var(--color-accent-bright);
  background: rgba(23, 174, 138, 0.08);
  transition:
    color 220ms ease,
    background-color 220ms ease,
    transform 220ms ease;
}

.language-option__arrow svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.card-footer {
  display: flex;
  margin-top: clamp(25px, 7vw, 36px);
  align-items: center;
  gap: 10px;
  color: rgba(168, 187, 182, 0.48);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.card-footer__line {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, rgba(42, 211, 168, 0.3), rgba(151, 183, 175, 0.08));
}

@media (hover: hover) and (pointer: fine) {
  .language-option:not(.is-disabled):hover {
    border-color: rgba(66, 228, 186, 0.55);
    background-color: rgba(6, 20, 16, 0.94);
    box-shadow:
      0 16px 34px rgba(0, 0, 0, 0.3),
      0 0 28px rgba(25, 199, 157, 0.08),
      inset 0 1px rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
  }

  .language-option:not(.is-disabled):hover::before {
    transform: rotate(22deg) translateX(470%);
  }

  .language-option:not(.is-disabled):hover .language-option__arrow {
    color: #03110d;
    background: var(--color-accent-bright);
    transform: translateX(2px);
  }
}

@media (min-width: 480px) {
  .page-shell {
    padding: 24px;
    padding:
      calc(24px + env(safe-area-inset-top, 0px))
      calc(24px + env(safe-area-inset-right, 0px))
      calc(24px + env(safe-area-inset-bottom, 0px))
      calc(24px + env(safe-area-inset-left, 0px));
  }

  .language-card {
    width: min(100%, 520px);
  }

  .language-card__content {
    min-height: min(
      680px,
      calc(
        100dvh - 48px - env(safe-area-inset-top, 0px) -
          env(safe-area-inset-bottom, 0px)
      )
    );
    justify-content: center;
  }
}

@media (min-width: 600px) {
  :root {
    --card-radius: 40px;
  }

  .page-shell {
    padding: 32px;
    padding:
      calc(32px + env(safe-area-inset-top, 0px))
      calc(32px + env(safe-area-inset-right, 0px))
      calc(32px + env(safe-area-inset-bottom, 0px))
      calc(32px + env(safe-area-inset-left, 0px));
  }

  .language-card {
    width: min(100%, 680px);
  }

  .language-card__content {
    min-height: min(
      720px,
      calc(
        100dvh - 64px - env(safe-area-inset-top, 0px) -
          env(safe-area-inset-bottom, 0px)
      )
    );
    padding: clamp(42px, 6vw, 58px) clamp(38px, 7vw, 64px);
  }

  .hero {
    width: 100%;
    max-width: 560px;
    margin-inline: auto;
  }

  h1 {
    font-size: clamp(3.45rem, 8vw, 4.8rem);
  }

  .hero__description {
    font-size: 1rem;
  }

  .language-list {
    width: min(100%, 520px);
    margin-inline: auto;
    margin-top: 44px;
    gap: 15px;
  }

  .language-option {
    min-height: 82px;
    padding: 14px 16px;
    gap: 15px;
  }

  .language-option__flag {
    width: 52px;
    height: 52px;
  }

  .language-option__label {
    font-size: 1.16rem;
  }

  .language-option__arrow {
    width: 38px;
    height: 38px;
  }

  .card-footer {
    width: min(100%, 520px);
    margin-inline: auto;
    margin-top: 42px;
  }

  .network {
    width: min(64vw, 680px);
  }
}

@media (min-width: 900px) {
  :root {
    --card-radius: 42px;
  }

  .language-card {
    width: min(100%, 880px);
  }

  .language-card__content {
    display: grid;
    min-height: min(
      600px,
      calc(
        100dvh - 64px - env(safe-area-inset-top, 0px) -
          env(safe-area-inset-bottom, 0px)
      )
    );
    padding: clamp(46px, 5vw, 64px);
    grid-template-columns: minmax(0, 1.05fr) minmax(310px, 0.95fr);
    grid-template-areas:
      "hero options"
      "footer footer";
    align-items: center;
    column-gap: clamp(44px, 5vw, 64px);
    justify-content: stretch;
  }

  .hero {
    max-width: none;
    margin: 0;
    grid-area: hero;
    text-align: left;
  }

  .eyebrow {
    margin-bottom: 28px;
  }

  h1 {
    font-size: clamp(3.45rem, 5.8vw, 4.7rem);
  }

  .hero__description {
    margin-right: 0;
    margin-left: 0;
  }

  .language-list {
    width: 100%;
    margin: 0;
    grid-area: options;
  }

  .language-option {
    min-height: 86px;
  }

  .card-footer {
    width: 100%;
    max-width: none;
    margin: 46px 0 0;
    grid-area: footer;
    grid-column: 1 / -1;
  }
}

@media (max-width: 360px) {
  :root {
    --card-radius: 28px;
  }

  .language-card__content {
    padding-right: 16px;
    padding-left: 16px;
  }

  .language-option {
    min-height: 72px;
    padding: 10px 11px;
    gap: 11px;
  }

  .language-option__flag {
    width: 43px;
    height: 43px;
  }

  .language-option__arrow {
    width: 32px;
    height: 32px;
  }
}

@media (max-height: 590px) {
  .language-card__content {
    padding-top: 22px;
    padding-bottom: 20px;
  }

  .eyebrow {
    margin-bottom: 14px;
  }

  .hero__description {
    margin-top: 12px;
  }

  .language-list {
    margin-top: 22px;
  }

  .card-footer {
    margin-top: 20px;
  }
}

@media (max-width: 360px) and (max-height: 520px) {
  .language-card__content {
    padding: 18px 14px 16px;
  }

  h1 {
    font-size: clamp(2.05rem, 11.5vw, 2.4rem);
  }

  .language-list {
    gap: 10px;
  }

  .language-option {
    min-height: 64px;
  }

  .card-footer {
    display: none;
  }
}

@media (orientation: landscape) and (min-width: 560px) and (max-height: 590px) {
  :root {
    --card-radius: 28px;
  }

  .page-shell {
    padding: 12px;
    padding:
      calc(12px + env(safe-area-inset-top, 0px))
      calc(12px + env(safe-area-inset-right, 0px))
      calc(12px + env(safe-area-inset-bottom, 0px))
      calc(12px + env(safe-area-inset-left, 0px));
  }

  .language-card {
    width: min(100%, 760px);
  }

  .language-card__content {
    display: grid;
    min-height: 0;
    padding: 18px clamp(22px, 5vw, 38px);
    grid-template-columns: minmax(0, 0.95fr) minmax(225px, 1.05fr);
    grid-template-areas:
      "hero options"
      "footer footer";
    align-items: center;
    column-gap: clamp(22px, 4vw, 38px);
    justify-content: stretch;
  }

  .hero {
    max-width: none;
    margin: 0;
    grid-area: hero;
    text-align: left;
  }

  .eyebrow {
    margin-bottom: 12px;
    font-size: 0.62rem;
  }

  h1 {
    font-size: clamp(2.05rem, 6vw, 3.15rem);
  }

  .hero__description {
    margin: 10px 0 0;
    font-size: 0.82rem;
    line-height: 1.4;
  }

  .language-list {
    width: 100%;
    margin: 0;
    grid-area: options;
    gap: 10px;
  }

  .language-option {
    min-height: 64px;
    padding: 8px 10px;
    gap: 10px;
    border-radius: 16px;
  }

  .language-option__flag {
    width: 40px;
    height: 40px;
  }

  .language-option__label {
    font-size: 1rem;
  }

  .language-option__hint {
    font-size: 0.67rem;
  }

  .language-option__arrow {
    width: 31px;
    height: 31px;
  }

  .card-footer {
    width: 100%;
    max-width: none;
    margin: 14px 0 0;
    grid-area: footer;
    grid-column: 1 / -1;
  }

  .network {
    width: min(58vw, 520px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ambient__grid,
  .ambient__glow,
  .network,
  .network circle,
  .language-card,
  .language-card::after,
  .language-card__edge,
  .language-card__edge::before,
  .eyebrow__signal::after {
    animation: none;
  }

  .language-option,
  .language-option::before,
  .language-option__arrow {
    transition-duration: 0.01ms;
  }
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes glowDrift {
  from {
    opacity: 0.2;
    transform: translate3d(-2%, -1%, 0) scale(0.94);
  }

  to {
    opacity: 0.36;
    transform: translate3d(4%, 3%, 0) scale(1.06);
  }
}

@keyframes networkFloat {
  from {
    opacity: 0.27;
    transform: translate3d(0, 0, 0) rotate(var(--network-rotation));
  }

  to {
    opacity: 0.42;
    transform: translate3d(7px, 6px, 0) rotate(var(--network-rotation));
  }
}

@keyframes gridDrift {
  from {
    opacity: 0.25;
    transform: perspective(520px) rotateX(63deg) translate3d(0, 34%, 0);
  }

  to {
    opacity: 0.36;
    transform: perspective(520px) rotateX(63deg) translate3d(-18px, 37%, 0);
  }
}

@keyframes nodePulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.88);
  }

  48% {
    opacity: 0.95;
    transform: scale(1.18);
  }
}

@keyframes ringBreath {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.97);
  }

  50% {
    opacity: 0.76;
    transform: scale(1.02);
  }
}

@keyframes edgePulse {
  0%,
  100% {
    opacity: 0.68;
  }

  50% {
    opacity: 0.92;
  }
}

@keyframes edgeSpin {
  0%,
  12% {
    transform: rotate(0turn);
  }

  88%,
  100% {
    transform: rotate(1turn);
  }
}

@keyframes signalPulse {
  0% {
    opacity: 0.7;
    transform: scale(0.5);
  }

  72%,
  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}
