:root {
  color-scheme: light dark;

  /* Accent (overridden from config.json) */
  --accent: rgb(228 40 42);
  --accent-soft: color-mix(in srgb, var(--accent) 8%, transparent);
  --accent-ring: color-mix(in srgb, var(--accent) 35%, transparent);

  /* Warm neutrals (light) */
  --bg: #FAF7F2;
  --card: #FFFFFF;
  --muted: #F3EEE6;
  --border: #E9E2D6;
  --border-strong: #DDD3C3;
  --fg: #1C1917;
  --fg-muted: #78716C;

  --radius: 0.75rem;
  --shadow-sm: 0 1px 2px rgb(28 25 23 / 0.04);
  --shadow-md: 0 1px 2px rgb(28 25 23 / 0.04), 0 4px 12px -2px rgb(28 25 23 / 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
    --bg: #181614;
    --card: #211E1B;
    --muted: #2A2622;
    --border: #332E29;
    --border-strong: #423B35;
    --fg: #F5F1EA;
    --fg-muted: #A8A29E;
    --shadow-sm: none;
    --shadow-md: 0 4px 16px -4px rgb(0 0 0 / 0.4);
  }
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(60rem 30rem at 50% -10rem, var(--accent-soft), transparent 70%);
  background-repeat: no-repeat;
}

.page {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: 3.5rem 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ---------- Header ---------- */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.avatar {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 9999px;
  /* Logo is dark ink: keep a light plate in both themes */
  background: #FFFDF9;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.avatar img { width: 72%; height: auto; display: block; }

.profile h1 {
  margin: 0.25rem 0 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.profile p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
  max-width: 26rem;
  text-wrap: pretty;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.625rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg-muted);
  font-size: 0.75rem;
  font-weight: 500;
}
.badge .dot {
  width: 0.4rem; height: 0.4rem; border-radius: 9999px;
  background: var(--accent);
}

/* ---------- Links ---------- */
.links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.link {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background-color .15s ease;
}
.link:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.link:active { transform: translateY(0); }
.link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-ring);
}

.link .icon {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: calc(var(--radius) - 0.25rem);
  background: var(--muted);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  transition: background-color .15s ease, transform .15s ease;
}
.link:hover .icon { background: var(--accent-soft); transform: scale(1.06); }

.link .text { flex: 1; min-width: 0; }
.link .title {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.link .sub {
  display: block;
  color: var(--fg-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link .arrow {
  flex: none;
  color: var(--fg-muted);
  opacity: 0.6;
  transition: transform .15s ease, opacity .15s ease, color .15s ease;
}
.link:hover .arrow { opacity: 1; color: var(--accent); transform: translate(2px, -2px); }

/* Featured link */
.link.featured {
  border-color: var(--accent-ring);
  background:
    linear-gradient(var(--accent-soft), var(--accent-soft)),
    var(--card);
}
.link.featured .icon { background: var(--card); box-shadow: inset 0 0 0 1px var(--accent-ring); }
.link.featured:hover { border-color: var(--accent); }

.section-label {
  margin: 0.75rem 0 0.125rem;
  padding: 0 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}

/* ---------- Socials ---------- */
.socials {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}
.socials a {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg-muted);
  transition: color .15s ease, border-color .15s ease;
}
.socials a:hover { color: var(--accent); border-color: var(--accent-ring); }
.socials a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-ring);
}

/* ---------- Share button ---------- */
.share {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 85%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--fg);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s ease;
}
.share:hover { border-color: var(--border-strong); }
.share:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-ring);
}

/* ---------- Footer ---------- */
footer {
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.75rem;
}
footer a { color: inherit; }

svg { display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
