/* Public profile page. Self-contained: it must not inherit the site chrome. */

:root {
  --accent: #1a5c9e;
  --bg-a: #17122e;
  --bg-b: #08060f;
  --fg: #ffffff;
  --fg-muted: rgba(255, 255, 255, 0.62);
  --tile: rgba(255, 255, 255, 0.08);
  --tile-hover: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.14);
  --btn-radius: 14px;
  --drop: rgba(0, 0, 0, 0.3);
  --drop-hover: rgba(0, 0, 0, 0.22);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ---------- Themes ----------
   Twelve palettes. Each sets the page gradient and the text/tile colours;
   --accent stays whatever the owner picked. Keep in step with Theme in
   profiles/models.py and the .theme-swatch-* previews in site.css. */

/* Light */
.theme-daylight { --bg-a: #ffffff; --bg-b: #eef4fa; --fg: #0f2a43; --fg-muted: rgba(15, 42, 67, 0.62); --tile: #ffffff; --tile-hover: #f4f8fc; --line: rgba(15, 42, 67, 0.12); }
.theme-paper    { --bg-a: #fdfcfa; --bg-b: #f1ede5; --fg: #2b2724; --fg-muted: rgba(43, 39, 36, 0.62); --tile: #ffffff; --tile-hover: #faf8f4; --line: rgba(43, 39, 36, 0.14); }
.theme-sand     { --bg-a: #fdf4e7; --bg-b: #f4e2c8; --fg: #3d2f1f; --fg-muted: rgba(61, 47, 31, 0.62); --tile: rgba(255, 255, 255, 0.78); --tile-hover: #ffffff; --line: rgba(61, 47, 31, 0.14); }
.theme-mint     { --bg-a: #f0fbf6; --bg-b: #d9f0e6; --fg: #10362a; --fg-muted: rgba(16, 54, 42, 0.62); --tile: rgba(255, 255, 255, 0.82); --tile-hover: #ffffff; --line: rgba(16, 54, 42, 0.13); }
.theme-candy    { --bg-a: #ffe6f2; --bg-b: #e6ecff; --fg: #2a1030; --fg-muted: rgba(42, 16, 48, 0.6);  --tile: rgba(255, 255, 255, 0.7);  --tile-hover: #ffffff; --line: rgba(42, 16, 48, 0.12); }
.theme-slate    { --bg-a: #f6f8fb; --bg-b: #e2e8f0; --fg: #1f2a37; --fg-muted: rgba(31, 42, 55, 0.62); --tile: #ffffff; --tile-hover: #f8fafc; --line: rgba(31, 42, 55, 0.13); }

/* The light palettes share their shadow treatment: the dark drop shadows of the
   default palette would read as smudges on a pale background. */
.theme-daylight, .theme-paper, .theme-sand, .theme-mint, .theme-candy, .theme-slate {
  color-scheme: light;
  --drop: rgba(15, 42, 67, 0.14);
  --drop-hover: rgba(15, 42, 67, 0.12);
}
.theme-daylight .link-tile, .theme-paper .link-tile, .theme-sand .link-tile,
.theme-mint .link-tile, .theme-candy .link-tile, .theme-slate .link-tile {
  box-shadow: 0 1px 2px rgba(15, 42, 67, 0.07);
}

/* Dark */
.theme-midnight { --bg-a: #17122e; --bg-b: #08060f; }
.theme-ocean    { --bg-a: #0b2545; --bg-b: #04101f; }
.theme-forest   { --bg-a: #0d2b25; --bg-b: #05130f; }
.theme-sunset   { --bg-a: #3b1046; --bg-b: #170a1f; }
.theme-berry    { --bg-a: #3d0f2b; --bg-b: #180614; }
.theme-mono     { --bg-a: #111111; --bg-b: #000000; --tile: rgba(255, 255, 255, 0.06); --tile-hover: rgba(255, 255, 255, 0.12); }

/* ---------- Button shapes ---------- */
.btns-rounded { --btn-radius: 14px; }
.btns-pill { --btn-radius: 999px; }
.btns-square { --btn-radius: 4px; }
.btns-outline { --btn-radius: 14px; }
.btns-outline .link-tile { background: transparent; border-color: var(--accent); }
.btns-outline .link-tile:hover { background: var(--tile); }

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--fg);
  background: linear-gradient(170deg, var(--bg-a), var(--bg-b));
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.card-page {
  max-width: 620px;
  margin: 0 auto;
  padding: 56px 20px 40px;
  text-align: center;
}

.glow {
  position: fixed; inset: -20% auto auto 50%;
  width: 640px; height: 440px; transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--accent), transparent 70%);
  opacity: 0.28;
  pointer-events: none;
  z-index: -1;
}

.avatar {
  width: 118px; height: 118px; border-radius: 50%;
  margin: 0 auto 18px;
  object-fit: cover;
  border: 3px solid var(--line);
  box-shadow: 0 14px 40px var(--drop);
}
.avatar-fallback {
  display: grid; place-items: center;
  background: var(--accent);
  color: #fff; font-size: 2.4rem; font-weight: 700;
}

.name { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.handle { color: var(--fg-muted); font-size: 0.95rem; margin: 2px 0 0; }
.headline { font-size: 1.02rem; margin: 12px 0 0; }
.bio { color: var(--fg-muted); margin: 10px auto 0; max-width: 44ch; font-size: 0.97rem; }
.location { color: var(--fg-muted); font-size: 0.87rem; margin-top: 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 20px 0 0; padding: 0; }
.chips li {
  list-style: none;
  font-size: 0.82rem; padding: 5px 13px; border-radius: 999px;
  background: var(--tile); border: 1px solid var(--line);
}

.links { margin: 30px 0 0; padding: 0; display: grid; gap: 12px; }
.links li { list-style: none; }
.link-tile {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 18px;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  font-weight: 600;
  transition: transform 0.14s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.link-tile:hover {
  background: var(--tile-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px var(--drop-hover);
}
/* No accent-coloured plate behind the icon: the platform glyphs carry their own
   colours, and a filled square fought with them. */
.link-tile .icon {
  flex: none; width: 26px; height: 26px;
  display: grid; place-items: center;
  font-size: 1.05rem; line-height: 1;
}
.link-tile .label { flex: 1; text-align: left; }
.link-tile .chevron { opacity: 0.4; font-size: 0.9rem; }

.share-row { display: flex; gap: 10px; justify-content: center; margin-top: 28px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--tile); border: 1px solid var(--line);
  color: inherit; font: inherit; font-size: 0.87rem; font-weight: 600;
  cursor: pointer;
}
.share-btn:hover { background: var(--tile-hover); }

.owner-bar {
  position: sticky; top: 12px; z-index: 5;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 0 auto 20px; max-width: 420px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(15, 42, 67, 0.82); border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff; font-size: 0.84rem;
  backdrop-filter: blur(10px);
}
.owner-bar a { text-decoration: underline; }

.card-footer { margin-top: 44px; font-size: 0.82rem; color: var(--fg-muted); }
.card-footer a { font-weight: 600; }
.card-footer a:hover { color: var(--fg); }

.qr-modal {
  border: none; border-radius: 20px; padding: 24px;
  background: #fff; color: #111; text-align: center;
}
.qr-modal::backdrop { background: rgba(0, 0, 0, 0.6); }
.qr-modal canvas, .qr-modal img { margin: 0 auto; }

@media (max-width: 480px) {
  .card-page { padding: 36px 16px 32px; }
  .avatar { width: 96px; height: 96px; }
}
