:root {
  --shell-max-width: 32rem;
  --side-gap: 1rem;
  --overlay: rgba(3, 18, 35, 0.56);
  --text-main: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.9);
  --primary: #0b4f93;
  --accent: #d8b46b;
  --focus: #ffe6a8;
  --shadow-main: 0 24px 60px rgba(0, 0, 0, 0.45);
  --bg-fade-ms: 1200ms;
  --reveal-duration: 420ms;
  --reveal-stagger: 120ms;
}

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

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text-main);
  font-family: "Montserrat", "Segoe UI", Tahoma, sans-serif;
  background: #05172d;
  overflow-x: hidden;
}

.background {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: radial-gradient(circle at 50% 20%, #2167ad 0%, #061a31 64%, #031022 100%);
}

.bg-layer {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity var(--bg-fade-ms) ease-in-out;
  will-change: opacity;
}

.bg-layer.is-visible {
  opacity: 1;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--overlay) 0%, rgba(4, 16, 31, 0.72) 100%),
    linear-gradient(135deg, rgba(2, 12, 25, 0.06) 35%, rgba(2, 10, 22, 0.72) 100%);
  pointer-events: none;
}

.shell {
  width: 100%;
  max-width: var(--shell-max-width);
  margin: 0 auto;
  min-height: 100dvh;
  padding: 4.6rem var(--side-gap) 1.5rem;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1rem;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem clamp(0.9rem, 3.2vw, 2.8rem) 0;
  z-index: 30;
}

.dropdown-menu[hidden] {
  display: none !important;
}

.dropdown-wrap {
  position: relative;
}

.trigger-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.7rem;
  min-width: 3.9rem;
  padding: 0.45rem 0.72rem;
  border: 1px solid rgba(216, 180, 107, 0.72);
  border-radius: 0.8rem;
  color: var(--text-main);
  background: linear-gradient(180deg, rgba(24, 90, 162, 0.88), rgba(9, 52, 99, 0.9));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.trigger-button.share {
  width: 2.7rem;
  min-width: 2.7rem;
  padding: 0;
  gap: 0;
  justify-content: center;
  border-radius: 999px;
}

.trigger-button .trigger-icon {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1;
}

.trigger-button .trigger-icon.has-image {
  display: inline-block;
  width: 1.2rem;
  height: 1.2rem;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  font-size: 0;
}

.trigger-flag {
  width: 1.12rem;
  height: 0.85rem;
  border-radius: 0.18rem;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.trigger-label {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  min-width: 10.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.32rem;
  display: grid;
  gap: 0.26rem;
  background: rgba(3, 20, 40, 0.95);
  box-shadow: var(--shadow-main);
  backdrop-filter: blur(6px);
  z-index: 20;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top left;
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity var(--reveal-duration) cubic-bezier(0.22, 1, 0.36, 1),
    transform var(--reveal-duration) cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear var(--reveal-duration);
}

.dropdown-menu.align-end {
  left: auto;
  right: 0;
  transform-origin: top right;
}

.dropdown-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s, 0s, 0s;
}

.dropdown-item {
  position: relative;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.55rem;
  background: rgba(14, 53, 98, 0.95);
  color: #fff;
  min-height: 2.2rem;
  padding: 0.5rem 0.58rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
}

.dropdown-item > * {
  position: relative;
  z-index: 1;
}

.dropdown-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 48%, transparent 100%);
  transform: translateX(-120%);
  transition: transform 500ms ease;
}

.dropdown-item:hover {
  background: rgba(20, 74, 132, 0.96);
}

.dropdown-item.is-selected {
  border-color: rgba(216, 180, 107, 0.9);
  background: rgba(24, 84, 148, 0.98);
}

.dropdown-item:hover::after,
.dropdown-item:focus-visible::after {
  transform: translateX(120%);
}

.dropdown-item .item-flag {
  width: 1rem;
  height: 0.8rem;
  border-radius: 0.18rem;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.dropdown-item .item-icon {
  width: 1rem;
  height: 1rem;
  border-radius: 0.2rem;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

.dropdown-item .item-label {
  flex: 1;
}

.brand {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  text-align: center;
  width: 100%;
  max-width: var(--shell-max-width);
  margin: 0 auto;
}

.brand-logo {
  width: clamp(10.5rem, 36vw, 15.25rem);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.45));
}

.brand-name-image {
  max-width: min(90vw, 20rem);
  width: auto;
  max-height: 4rem;
  object-fit: contain;
}

.brand-title {
  margin: 0;
  color: var(--accent);
  font-size: clamp(1.75rem, 8vw, 2.8rem);
  line-height: 1.1;
  text-wrap: balance;
}

.brand-description {
  max-width: 34ch;
  margin: 0;
  color: var(--text-soft);
  font-size: clamp(1rem, 3.65vw, 1.45rem);
  font-weight: 600;
  line-height: 1.35;
  text-wrap: balance;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.links {
  display: grid;
  align-content: start;
  width: 100%;
  max-width: var(--shell-max-width);
  margin: 0 auto;
}

.links-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.46rem;
}

.link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.46rem;
  align-items: center;
}

.link-item {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity var(--reveal-duration) ease,
    transform var(--reveal-duration) ease;
  transition-delay: calc(var(--reveal-stagger) * var(--item-order));
}

body.is-ready .link-item {
  opacity: 1;
  transform: translateY(0);
}

.link-button {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.7rem;
  min-height: 3rem;
  border-radius: 0.75rem;
  padding: 0.64rem 0.9rem;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(216, 180, 107, 0.76);
  background:
    linear-gradient(180deg, rgba(29, 98, 173, 0.89), rgba(8, 56, 109, 0.92));
  box-shadow: 0 12px 20px rgba(4, 18, 36, 0.42);
  overflow: hidden;
}

.link-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.18) 48%, transparent 100%);
  transform: translateX(-120%);
  transition: transform 500ms ease;
}

.link-button:hover::after,
.link-button:focus-visible::after {
  transform: translateX(120%);
}

.link-icon {
  width: 1.2rem;
  height: 1.2rem;
  object-fit: contain;
}

.link-label {
  font-size: clamp(1rem, 2.8vw, 1.03rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.link-share-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  min-width: 3rem;
  min-height: 3rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(216, 180, 107, 0.76);
  background: linear-gradient(180deg, rgba(29, 98, 173, 0.89), rgba(8, 56, 109, 0.92));
  box-shadow: 0 12px 20px rgba(4, 18, 36, 0.42);
  cursor: pointer;
  overflow: hidden;
}

.link-share-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.18) 48%, transparent 100%);
  transform: translateX(-120%);
  transition: transform 500ms ease;
}

.link-share-button:hover::after,
.link-share-button:focus-visible::after {
  transform: translateX(120%);
}

.link-share-icon {
  position: relative;
  z-index: 1;
  width: 1.15rem;
  height: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.link-share-icon.has-image {
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  font-size: 0;
}

.share-modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 12, 24, 0.62);
  backdrop-filter: blur(4px);
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--reveal-duration) cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear var(--reveal-duration);
}

.share-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s, 0s;
}

.share-modal {
  width: min(100%, 24rem);
  border-radius: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(3, 20, 40, 0.97);
  box-shadow: var(--shadow-main);
  padding: 0.9rem;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition:
    transform var(--reveal-duration) cubic-bezier(0.22, 1, 0.36, 1),
    opacity var(--reveal-duration) cubic-bezier(0.22, 1, 0.36, 1);
}

.share-modal-backdrop.is-open .share-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.share-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.share-modal-title {
  margin: 0;
  font-size: 1.02rem;
  color: #fff;
}

.share-modal-close {
  width: 2rem;
  min-width: 2rem;
  min-height: 2rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(14, 53, 98, 0.95);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.share-modal-target {
  margin: 0.55rem 0 0.72rem;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.share-modal-actions {
  display: grid;
  gap: 0.3rem;
}

.share-modal-actions .dropdown-item {
  min-height: 2.38rem;
}

body.modal-open {
  overflow: hidden;
}

.footer {
  display: grid;
  place-items: center;
  padding: 0.4rem 0 0.2rem;
  width: 100%;
  max-width: var(--shell-max-width);
  margin: 0 auto;
}

.footer small {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

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

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity var(--reveal-duration) cubic-bezier(0.22, 1, 0.36, 1),
    transform var(--reveal-duration) cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--reveal-order) * var(--reveal-stagger));
}

body.is-ready .reveal {
  opacity: 1;
  transform: translateY(0);
}

body.no-entrance .reveal,
body.no-entrance .link-item {
  opacity: 1;
  transform: none;
  transition: none;
}

a:focus-visible,
button:focus-visible,
.dropdown-item:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (min-width: 768px) {
  :root {
    --shell-max-width: 34rem;
    --side-gap: 1.2rem;
  }

  .shell {
    padding-top: 4.8rem;
  }

  .brand {
    gap: 0.92rem;
  }
}

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

  .reveal,
  .link-item {
    opacity: 1 !important;
    transform: none !important;
  }
}
