:root {
  color-scheme: dark;
  --ink: #f7f7f7;
  --muted: #c9c9c9;
  --paper: #000000;
  --surface: #151515;
  --line: #343434;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 28rem),
    var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.page-shell {
  width: min(100% - 24px, 440px);
  min-height: 100svh;
  margin: 0 auto;
  padding: calc(max(40px, env(safe-area-inset-top)) + 62px) 0 max(28px, env(safe-area-inset-bottom));
}

.home-shell {
  padding-top: max(34px, env(safe-area-inset-top));
}

.hero {
  margin: 0 0 28px;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: clamp(1.85rem, 8.6vw, 3.25rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.hero-avatar {
  display: block;
  width: min(42vw, 160px);
  height: min(42vw, 160px);
  margin: 18px auto 0;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  box-shadow: var(--shadow);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.page-menu {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 20;
  width: min(100% - 24px, 440px);
  padding: max(8px, env(safe-area-inset-top)) 0 8px;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}

.menu-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 11px 14px;
  color: #d8d8d8;
  background: #151515;
  border: 1px solid #333333;
  border-radius: 8px;
  font-size: 1.12rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.menu-button::before {
  content: "⌂";
  font-size: 1.28em;
  line-height: 1;
}

.menu-button.active {
  color: #000000;
  background: #ffffff;
  border-color: #ffffff;
}

.link-list,
#linksContainer {
  display: grid;
  gap: 12px;
}

.page-description {
  margin: -6px 0 22px;
  color: var(--muted);
  font-size: 1.28rem;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
}

.link-button {
  display: grid;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 112px;
  width: 100%;
  padding: 24px 18px;
  color: var(--text-color, var(--ink));
  background: var(--button-color, var(--surface));
  border: 1px solid var(--border-color, var(--line));
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.link-button.has-link-image {
  grid-template-columns: min(32%, 116px) minmax(0, 1fr);
  gap: 14px;
  justify-content: stretch;
  min-height: 132px;
  padding: 14px;
  text-align: left;
}

.button-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
  text-align: center;
}

.has-link-image .button-copy {
  text-align: center;
}

.button-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.48rem;
  font-weight: 850;
  line-height: 1.18;
}

.has-link-image .button-title {
  justify-content: center;
}

.platform-icon {
  width: 1.35em;
  height: 1.35em;
  flex: 0 0 auto;
}

.button-description {
  display: block;
  color: var(--description-color, #6c6c6c);
  font-size: 1.28rem;
  font-weight: 400;
  line-height: 1.4;
}

.link-image {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.link-note {
  margin: 10px 0 0;
  padding: 18px 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 1.08rem;
  line-height: 1.5;
  text-align: center;
}

.link-note strong {
  display: inline-block;
  margin: 6px 0;
  color: #ffffff;
  font-size: 1.18em;
}

.link-button:active {
  transform: translateY(1px);
}

.link-button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.28);
  outline-offset: 3px;
}

.open-page {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 24px;
}

.open-shell {
  width: min(100%, 440px);
  text-align: center;
}

.open-shell h1 {
  font-size: clamp(2rem, 9vw, 3rem);
}

.open-shell p {
  margin: 18px 0 24px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.5;
}

.open-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  width: 100%;
  margin-top: 10px;
  padding: 14px 18px;
  color: #000000;
  background: #ffffff;
  border: 0;
  border-radius: 8px;
  font-size: 1.15rem;
  font-weight: 850;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
}

.open-copy {
  color: #ffffff;
  background: #1877f2;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 32px;
  padding-bottom: 8px;
  text-align: center;
}

.site-footer a {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:focus-visible,
.site-footer a:hover {
  color: #ffffff;
}

.legal-shell {
  padding-top: max(40px, env(safe-area-inset-top));
}

.legal-card {
  padding: 22px 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  line-height: 1.55;
}

.legal-card h2,
.legal-card h3 {
  color: #ffffff;
}

.legal-card h2 {
  margin: 0 0 22px;
  font-size: 2rem;
}

.legal-card h3 {
  margin: 22px 0 8px;
  font-size: 1.2rem;
}

.legal-card p {
  margin: 0;
  font-size: 1.05rem;
}

.legal-card a {
  color: #ffffff;
  font-weight: 800;
}

@media (max-width: 380px) {
  .page-shell {
    width: min(100% - 20px, 440px);
  }

  .link-button {
    min-height: 108px;
    padding-inline: 14px;
  }

  .link-button.has-link-image {
    grid-template-columns: 92px minmax(0, 1fr);
    min-height: 120px;
    padding: 12px;
  }

  .menu-button {
    min-height: 48px;
    font-size: 1.06rem;
  }
}
