/* Design tokens shared by the public page and the admin panel. */
:root {
  color-scheme: dark;

  --bg: #0b0d10;
  --bg-glow: #121722;
  --surface: #14181e;
  --surface-hover: #1b212a;
  --border: #262d38;
  --border-strong: #3b4655;
  --text: #f3f6fa;
  --text-muted: #a3adbb;
  --accent: #7fb0ff;
  --accent-soft: rgba(127, 176, 255, 0.14);
  --danger: #ff8f8f;
  --success: #7ee0a8;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.28);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, var(--bg-glow), var(--bg) 60%) no-repeat var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Author rules beat the UA [hidden] rule, so make hiding explicit. */
[hidden] {
  display: none !important;
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.button {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.button:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.button--primary {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

/* ---------- Public page layout ---------- */

.page {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-4) var(--space-6);
}

.profile {
  text-align: center;
  margin-bottom: var(--space-6);
}

.avatar {
  width: 88px;
  height: 88px;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar__fallback {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-muted);
}

.profile__name {
  margin: 0 0 var(--space-2);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.profile__tagline {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.status {
  min-height: 0;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.card--invalid {
  opacity: 0.6;
  pointer-events: none;
}

.card__icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-glow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card__icon-fallback {
  font-weight: 600;
  color: var(--text-muted);
}

.card__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card__title {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card__subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card__chevron {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.card--skeleton {
  box-shadow: none;
}

.skeleton {
  display: block;
  background: linear-gradient(90deg, #1c222b, #242c37, #1c222b);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--radius-sm);
}

.skeleton--icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex: 0 0 auto;
}

.skeleton--line {
  height: 12px;
  width: 70%;
}

.skeleton--short {
  width: 40%;
  height: 10px;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.state {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.state__text {
  margin: 0 0 var(--space-3);
}

@media (max-width: 360px) {
  .page {
    padding: var(--space-6) var(--space-3) var(--space-5);
  }
  .card {
    padding: var(--space-3);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .card:hover,
  .card:focus-visible {
    transform: none;
  }
}
