/* Public profile — redesign layer (2026-10). Loaded after u.html's inline
   styles. The profile is the product's payoff: identity first, #1 picks as
   hero art, ranks as typography, one clear share action. */
:root {
  --bg: #f8f5ef; --surface: #ffffff; --surface-2: #f1ece3; --divider: #e7e0d3;
  --text: #17140f; --text-muted: #5f5a50; --accent: #b9400f;
  --ember: linear-gradient(135deg, #ff8a3d 0%, #f0544f 55%, #d63a7a 100%);
  --glass: rgba(248, 245, 239, 0.8);
  --shadow-sm: 0 1px 2px rgba(40, 28, 10, 0.05);
  --shadow-md: 0 2px 4px rgba(40, 28, 10, 0.04), 0 12px 32px rgba(40, 28, 10, 0.09);
  --shadow-lg: 0 6px 12px rgba(40, 28, 10, 0.06), 0 28px 64px rgba(40, 28, 10, 0.18);
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --out: cubic-bezier(0.2, 0.8, 0.2, 1);
}
:root[data-theme="dark"] {
    --bg: #12100d; --surface: #1c1915; --surface-2: #25211c; --divider: #2d2822;
    --text: #f3eee6; --text-muted: #b3aa9c; --accent: #ff9a5c; --glass: rgba(18, 16, 13, 0.75);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.5); --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.6);
  }
body { font-family: var(--sans); background: var(--bg); }
.page { max-width: 680px; padding: 0 20px 140px; }
.topbar {
  position: sticky; top: 0; z-index: 30; margin: 0 -20px; padding: calc(12px + env(safe-area-inset-top)) 20px 12px;
  background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
}
.brand { font-family: var(--serif); font-weight: 400; font-size: 22px; letter-spacing: -0.01em; }
.topbar-cta { font-size: 14px; font-weight: 600; color: var(--text); padding: 8px 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--divider); }

/* Hero */
.p-hero { position: relative; text-align: center; padding: 28px 0 8px; isolation: isolate; }
.p-hero::before {
  content: ''; position: absolute; z-index: -1; left: 50%; top: 0; width: 320px; height: 220px; transform: translateX(-50%);
  background: var(--ember); filter: blur(80px); opacity: 0.28; border-radius: 50%;
}
.p-avatar {
  width: 96px; height: 96px; margin: 0 auto 16px; border-radius: 50%; padding: 3px; background: var(--ember);
  box-shadow: var(--shadow-md);
}
.p-avatar > span, .p-avatar > img {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; object-fit: cover;
  background: var(--surface); border: 3px solid var(--bg);
  font-family: var(--serif); font-size: 38px; color: var(--text);
}
.p-name { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 9vw, 56px); line-height: 1; letter-spacing: -0.02em; margin: 0; }
.p-handle { margin: 8px 0 0; color: var(--text-muted); font-size: 15px; }
.p-tagline { margin: 14px auto 0; max-width: 32ch; font-size: 17px; line-height: 1.45; }
.p-stats { display: flex; justify-content: center; gap: 22px; margin: 18px 0 0; color: var(--text-muted); font-size: 14px; }
.p-stats b { display: block; font-family: var(--serif); font-weight: 400; font-size: 28px; color: var(--text); line-height: 1; margin-bottom: 2px; }
.p-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.p-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border-radius: 999px; font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer; border: 0;
  background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--divider), var(--shadow-sm);
  transition: transform 180ms var(--spring), box-shadow 200ms var(--out);
}
.p-btn:active { transform: scale(0.95); }
.p-btn--primary { background: var(--text); color: var(--bg); box-shadow: var(--shadow-md); }
.p-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Taste match (signed-in visitors) */
.p-match {
  margin: 22px 0 0; padding: 14px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--divider);
  display: flex; align-items: center; gap: 14px; text-align: left;
}
.p-match-score { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--ember); font: 600 15px/1 var(--sans); }
.p-match-copy { font-size: 14px; color: var(--text-muted); line-height: 1.4; }
.p-match-copy strong { color: var(--text); }

/* Chip nav: sticky under the top bar */
.chipnav { position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 20; background: var(--glass);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  margin: 26px -20px 0 !important; padding: 8px 20px !important; flex-wrap: nowrap !important; overflow-x: auto !important; }
.chip { min-height: 40px; padding: 0 14px; font-size: 14px; font-weight: 500; background: var(--surface); border: 0; box-shadow: 0 0 0 1px var(--divider); color: var(--text); }
.chip.is-on { background: var(--text); color: var(--bg); box-shadow: none; }

/* Category sections */
.p-cat { margin-top: 30px; scroll-margin-top: 120px; }
.p-cat-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 14px; }
.p-cat-title { font-family: var(--serif); font-weight: 400; font-size: 32px; letter-spacing: -0.01em; margin: 0; display: flex; align-items: center; gap: 10px; }
.p-cat-title svg { width: 20px; height: 20px; color: var(--text-muted); }
.p-cat-meta { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }

/* #1: hero art */
.p-one {
  position: relative; display: block; overflow: hidden; border-radius: 24px; cursor: pointer;
  aspect-ratio: 4 / 3; background: var(--surface-2); box-shadow: var(--shadow-lg);
  transition: transform 260ms var(--spring);
}
.p-one[data-media="poster"] { aspect-ratio: 4 / 5; }
.p-one:active { transform: scale(0.985); }
.p-one:focus-visible, .p-row:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.p-one .media-img, .p-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.p-one[data-media="poster"] .media-img { object-position: center 20%; }
.p-one::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.78) 100%); pointer-events: none; }
.p-one-body { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 20px; color: #fff; }
.p-one-rank { font-family: var(--serif); font-style: italic; font-size: 64px; line-height: 0.8; display: block; margin-bottom: 8px; text-shadow: 0 2px 20px rgba(0,0,0,0.3); }
.p-one-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.p-one-sub { margin: 6px 0 0; font-size: 14px; opacity: 0.9; }
.p-score { position: absolute; z-index: 2; top: 14px; right: 14px; padding: 6px 10px; border-radius: 999px; font: 700 13px/1 var(--sans);
  background: rgba(255,255,255,0.92); color: #17140f; box-shadow: var(--shadow-sm); font-variant-numeric: tabular-nums; }

/* #2–#5: ranked rows */
.p-rest { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.p-row {
  display: grid; grid-template-columns: 34px 56px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 10px 10px 4px; border-radius: 16px; cursor: pointer;
  transition: background 200ms var(--out), transform 200ms var(--spring);
}
.p-row:hover { background: var(--surface); box-shadow: var(--shadow-sm); }
.p-row:active { transform: scale(0.98); }
.p-row-rank { font-family: var(--serif); font-style: italic; font-size: 30px; line-height: 1; text-align: center; color: var(--accent); }
.p-row-art { position: relative; width: 56px; height: 56px; border-radius: 14px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-sm); }
.p-row[data-media="poster"] .p-row-art { height: 76px; border-radius: 10px; }
.p-row-art .media-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.p-row-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; margin: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.p-row-sub { margin: 3px 0 0; font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-row-score { font: 600 14px/1 var(--sans); color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* No image: a generated, title-seeded gradient with a serif monogram */
.p-art { display: grid; place-items: center; color: rgba(255,255,255,0.92); font-family: var(--serif); background: var(--art, var(--ember)); }
.p-one .p-art { font-size: 120px; }
.p-row-art .p-art { font-size: 26px; }

/* Invite CTA */
.p-invite {
  position: relative; overflow: hidden; isolation: isolate; margin: 48px 0 0; padding: 30px 24px; border-radius: 28px; text-align: center;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg);
}
.p-invite::before { content: ''; position: absolute; z-index: -1; inset: -30% -10% auto 30%; height: 160%; background: var(--ember); filter: blur(70px); opacity: 0.55; }
.p-invite h2 { font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1.05; margin: 0 0 10px; letter-spacing: -0.01em; }
.p-invite p { margin: 0 auto 20px; max-width: 34ch; font-size: 15px; line-height: 1.5; opacity: 0.85; }
.p-invite .p-btn { background: var(--bg); color: var(--text); box-shadow: none; }
.p-invite .p-btn--ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35); }
:root[data-theme="dark"] .p-invite .p-btn--ghost { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25); }
.footer { margin-top: 36px; }

/* Entrance */
.p-cat, .p-hero { animation: pIn 600ms var(--out) both; }
.p-cat:nth-of-type(2) { animation-delay: 60ms; } .p-cat:nth-of-type(3) { animation-delay: 120ms; } .p-cat:nth-of-type(4) { animation-delay: 180ms; }
@keyframes pIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .p-cat, .p-hero { animation: none; }
  .p-one, .p-row, .p-btn { transition: none; }
}
@media (min-width: 720px) {
  .p-cat-body { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: start; }
  .p-rest { margin-top: 0; }
}
@media (min-width: 720px) { .page { max-width: 880px; } .p-cat-body { grid-template-columns: 1fr 1fr; gap: 24px; } }

.p-demo-badge { display: inline-block; margin: 0 0 14px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Whole tile is one real button (stretched); keeps li/article semantics. */
.p-one, .p-row { position: relative; }
.p-hit { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.p-hit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Reserve room under the last row for the fixed bottom bar (tab bar or Make your own). */
@media (max-width: 767px) { main#main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); } }
