:root {
  color-scheme: light;
  --bg: #f4f2ef;
  --bg-radial: rgba(201, 194, 183, 0.45);
  --bg-secondary: rgba(255, 255, 255, 0.72);
  --card: rgba(255, 255, 255, 0.82);
  --card-strong: rgba(255, 255, 255, 0.9);
  --border: rgba(43, 43, 43, 0.08);
  --border-strong: rgba(43, 43, 43, 0.12);
  --shadow: 0 18px 50px rgba(32, 30, 28, 0.08), 0 4px 12px rgba(32, 30, 28, 0.04);
  --text: #242424;
  --text-muted: #7a7a76;
  --text-soft: #989691;
  --surface: rgba(247, 245, 241, 0.95);
  --surface-hover: rgba(242, 239, 234, 1);
  --accent: #1f1f1f;
  --link-hover: #ff3b4b;
  --accent-contrast: #ffffff;
  --success: #4bc968;
  --icon-bg: rgba(36, 36, 36, 0.03);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-radial: rgba(255, 255, 255, 0.05);
  --bg-secondary: rgba(10, 10, 10, 0.9);
  --card: rgba(18, 18, 18, 0.95);
  --card-strong: rgba(22, 22, 22, 0.98);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(255, 255, 255, 0.03);
  --text: #efede9;
  --text-muted: #a6a29a;
  --text-soft: #8f8c85;
  --surface: rgba(28, 28, 28, 0.98);
  --surface-hover: rgba(34, 34, 34, 1);
  --accent: #f1efe9;
  --link-hover: #ff3b4b;
  --accent-contrast: #000000;
  --success: #4fd86f;
  --icon-bg: rgba(255, 255, 255, 0.04);
}

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

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

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 22%, var(--bg-radial), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(145, 140, 132, 0.12), transparent 24%),
    linear-gradient(180deg, var(--bg), #ece8e1 100%);
  color: var(--text);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 18% 22%, var(--bg-radial), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.06), transparent 24%),
    linear-gradient(180deg, var(--bg), #000000 100%);
}

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

.page-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  overflow: hidden;
}

.ambient {
  position: absolute;
  pointer-events: none;
}

.ambient-one,
.ambient-two {
  width: 28rem;
  aspect-ratio: 1;
  border-radius: 999px;
  filter: blur(52px);
  opacity: 0.3;
}

.ambient-one {
  top: -10rem;
  left: -8rem;
  background: rgba(214, 204, 186, 0.55);
}

.ambient-two {
  right: -10rem;
  bottom: -12rem;
  background: rgba(210, 210, 210, 0.48);
}

:root[data-theme="dark"] .ambient-one {
  background: rgba(88, 88, 88, 0.34);
}

:root[data-theme="dark"] .ambient-two {
  background: rgba(64, 64, 64, 0.28);
}

.ambient-grid {
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
  opacity: 0.12;
}

:root[data-theme="dark"] .ambient-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  opacity: 0.1;
}

.card-shell {
  position: relative;
  width: min(100%, 380px);
}

.theme-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  border: 1px solid var(--border);
  background: var(--card-strong);
  color: var(--text);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(18px);
  cursor: pointer;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

:root[data-theme="dark"] .theme-toggle {
  background: rgba(22, 22, 22, 0.98);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.42);
}

.theme-toggle:focus-visible,
.profile-link:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.theme-toggle__icon,
.profile-link__icon,
.profile-link__chevron,
.footer-signature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle__icon svg {
  width: 18px;
  height: 18px;
}

.bio-card {
  position: relative;
  background: linear-gradient(180deg, var(--card), var(--card-strong));
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: 38px 0 18px;
}

:root[data-theme="dark"] .bio-card {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.045), transparent 34%),
    linear-gradient(180deg, var(--card), var(--card-strong));
}

.bio-card__inner {
  padding: 0 14px;
}

.profile-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

:root[data-theme="dark"] .profile-panel {
  background: linear-gradient(
    180deg,
    rgba(30, 30, 30, 0.98),
    rgba(20, 20, 20, 0.98)
  );
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 24px rgba(0, 0, 0, 0.22);
}

.profile-avatar {
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, #6ba5b9, #87d0d7 55%, #cfb985 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.profile-avatar--image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0.08) 8%,
    rgba(255, 255, 255, 0.3) 18%,
    rgba(255, 255, 255, 0.08) 33%
  );
  transform: translateX(-100%);
}

.profile-avatar--loading::before {
  animation: avatar-shimmer 1.2s ease-in-out infinite;
}

.profile-avatar__fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 180ms ease;
}

.profile-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 180ms ease;
}

.profile-avatar--ready img {
  opacity: 1;
}

.profile-avatar--ready::before,
.profile-avatar--error::before {
  display: none;
}

.profile-avatar--ready .profile-avatar__fallback {
  opacity: 0;
}

.profile-avatar--error .profile-avatar__fallback {
  opacity: 1;
}

.bio-card--noscript {
  margin-top: 18px;
  padding: 24px 0;
}

.noscript-copy {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.noscript-copy + .noscript-copy {
  margin-top: 8px;
}

.noscript-copy a {
  color: var(--text);
}

.profile-copy {
  min-width: 0;
}

.profile-name {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.profile-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.links-section {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.links-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-item + .link-item {
  margin-top: 4px;
}

.profile-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  padding: 12px 10px;
  border-radius: 14px;
  transition:
    background-color 180ms ease,
    transform 180ms ease,
    color 180ms ease;
}

.profile-link:hover {
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.profile-link:hover .profile-link__chevron {
  color: var(--link-hover);
}

.profile-link__main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.profile-link__copy {
  min-width: 0;
}

.profile-link__icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  color: var(--text);
  background: transparent;
  border-radius: 0;
  font-size: 1rem;
}

.profile-link__label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.profile-link__chevron {
  color: var(--text-soft);
  flex: 0 0 auto;
  font-size: 0.95rem;
  transition: color 180ms ease, transform 180ms ease;
}

.profile-link:hover .profile-link__chevron {
  transform: translate(1px, -1px);
}

.card-footer {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding: 14px 18px 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.footer-signature {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  white-space: nowrap;
}

.footer-signature__icon {
  font-size: 0.9rem;
}

svg {
  width: 18px;
  height: 18px;
}

.theme-toggle__icon svg,
.profile-link__icon svg,
.profile-link__chevron svg,
.footer-signature__icon svg {
  display: block;
}

@media (max-width: 480px) {
  .page-shell {
    padding: 20px 12px;
  }

  .card-shell {
    width: min(100%, 100%);
  }

  .bio-card {
    border-radius: 24px;
    padding-top: 34px;
  }

  .profile-name {
    font-size: 1.28rem;
  }

  .profile-link {
    padding: 12px 8px;
  }

  .card-footer {
    justify-content: center;
  }
}

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

@keyframes avatar-shimmer {
  100% {
    transform: translateX(100%);
  }
}
