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

:root {
  --bg: #1a4a8f;
  --bg-soft: #2563b8;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-hover: rgba(255, 255, 255, 0.12);
  --surface-active: rgba(255, 255, 255, 0.16);
  --border: rgba(255, 255, 255, 0.14);
  --border-hover: rgba(255, 255, 255, 0.28);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.65);
  --gold: #ffd700;
  --gold-dark: #e6b800;
  --radius: 14px;
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --max-width: 400px;
  --page-padding-x: 1.25rem;
  --touch-min: 56px;
  --footer-height: 3.25rem;
}

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

body {
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  font-family: var(--font-body);
  color: var(--text);
  background: radial-gradient(ellipse at 50% 0%, var(--bg-soft) 0%, var(--bg) 55%);
  background-attachment: fixed;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.page {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: max(2.25rem, env(safe-area-inset-top));
  padding-right: max(var(--page-padding-x), env(safe-area-inset-right));
  padding-bottom: calc(var(--footer-height) + max(1rem, env(safe-area-inset-bottom)));
  padding-left: max(var(--page-padding-x), env(safe-area-inset-left));
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page__content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Profile */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  margin-bottom: 1.75rem;
}

.profile__logo {
  width: min(140px, 36vw);
  height: min(140px, 36vw);
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 3px solid var(--gold);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  margin-bottom: 1.25rem;
}

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

.profile__bio {
  font-size: clamp(0.9375rem, 2.5vw, 1rem);
  color: var(--text-muted);
  max-width: 36ch;
  line-height: 1.6;
  padding: 0 0.25rem;
}

.profile__bio a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.profile__bio a:hover,
.profile__bio a:focus-visible {
  color: #fff;
  outline: none;
}

/* Links */
.links {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.links__empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 2rem 1rem;
}

.links__empty code {
  background: var(--surface);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
}

.link-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  aspect-ratio: 1;
  padding: 1rem 0.75rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.link-card:hover,
.link-card:focus-visible {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  outline: none;
}

.link-card:active {
  background: var(--surface-active);
  border-color: var(--border-hover);
  transform: scale(0.97);
}

.link-card__icon {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #000000;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.link-card__icon svg {
  width: 26px;
  height: 26px;
}

.link-card.link-card--instagram .link-card__icon svg {
  width: 28px;
  height: 28px;
}

.link-card--ebay .link-card__logo-img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.link-card__label {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.75rem;
  line-height: 1.2;
  text-align: center;
  color: var(--text);
}

/* Odd last item spans both columns, stays compact */
.link-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  aspect-ratio: 2.2 / 1;
  max-width: 220px;
  margin-inline: auto;
  width: 100%;
}

/* Footer */
.footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 100%;
  max-width: var(--max-width);
  padding: 0.75rem max(var(--page-padding-x), env(safe-area-inset-right))
    max(0.75rem, env(safe-area-inset-bottom))
    max(var(--page-padding-x), env(safe-area-inset-left));
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
  background: linear-gradient(to top, var(--bg) 70%, rgba(26, 74, 143, 0.9) 90%, transparent);
}

/* Small phones */
@media (max-width: 480px) {
  .profile {
    margin-bottom: 1.25rem;
  }

  .profile__bio {
    font-size: 0.9rem;
    max-width: 100%;
  }
}

@media (max-width: 380px) {
  .profile {
    margin-bottom: 1.25rem;
  }

  .links {
    gap: 0.625rem;
  }

  .link-card__icon {
    width: 50px;
    height: 50px;
  }

  .link-card__icon svg {
    width: 24px;
    height: 24px;
  }
}

/* Touch devices: skip hover-only effects */
@media (hover: none) {
  .link-card:hover {
    background: var(--surface);
    border-color: var(--border);
  }
}
