/* ── Base ─────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: #e8e8f2;
  line-height: 1.55;
  min-height: 100dvh;
  padding: clamp(14px, 3vw, 28px) clamp(12px, 3vw, 24px) 64px;
  background: var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1060px; margin: 0 auto; }

/* ── Themes ───────────────────────────────────────────── */

/* Hub — neutral slate */
body.slate {
  --bg:
    radial-gradient(1100px 700px at 15% -10%, #1e2a55 0%, transparent 60%),
    radial-gradient(900px 650px at 95% 5%, #3a1f4d 0%, transparent 55%),
    linear-gradient(165deg, #06070f, #0e1222 55%, #080a14);
  --accent-a: #7c9cff;
  --accent-b: #c77dff;
  --section: #a8b6ff;
}

/* SJA & Ouss — violet / rose */
body.aurora {
  --bg:
    radial-gradient(1100px 750px at 18% -12%, #2c1d75 0%, transparent 60%),
    radial-gradient(950px 700px at 92% 8%, #5d1f56 0%, transparent 55%),
    linear-gradient(165deg, #0a0919, #151038 55%, #0c0a20);
  --accent-a: #8b7cff;
  --accent-b: #ff5f8f;
  --section: #c3b5ff;
  --p1: #a99bff;  --p1g: linear-gradient(135deg, #667eea, #764ba2);
  --p2: #ff92b4;  --p2g: linear-gradient(135deg, #f093fb, #f5576c);
}

/* Three Souls — amber / crimson / ash */
body.ember {
  --bg:
    radial-gradient(1100px 750px at 16% -12%, #5a2410 0%, transparent 58%),
    radial-gradient(950px 700px at 94% 6%, #58122c 0%, transparent 55%),
    linear-gradient(165deg, #0f0b0a, #22120f 55%, #120c0e);
  --accent-a: #f5af19;
  --accent-b: #f12711;
  --section: #ffc766;
  --p1: #ffc46b;  --p1g: linear-gradient(135deg, #f5af19, #e8710a);
  --p2: #ff8a63;  --p2g: linear-gradient(135deg, #f12711, #b81d43);
  --p3: #8b93a1;  --p3g: linear-gradient(135deg, #4a4a4a, #2b2b2b);
}

/* SweetHearts — rose / gold / mint */
body.bloom {
  --bg:
    radial-gradient(1100px 750px at 14% -12%, #5c1443 0%, transparent 58%),
    radial-gradient(950px 700px at 95% 8%, #7a2b1e 0%, transparent 52%),
    linear-gradient(165deg, #170622, #2f0d33 55%, #1a0826);
  --accent-a: #ff6b9d;
  --accent-b: #ffc75f;
  --section: #ffd28a;
  --p1: #ff8fb8;  --p1g: linear-gradient(135deg, #ff6b9d, #c44569);
  --p2: #ffd177;  --p2g: linear-gradient(135deg, #ffc75f, #ee8f24);
  --p3: #6fe9c4;  --p3g: linear-gradient(135deg, #43e97b, #38c8d7);
}

/* ── Avatars (always circular) ────────────────────────── */
.ring {
  display: inline-block;
  padding: 2.5px;
  border-radius: 50%;
  background: var(--pg, linear-gradient(135deg, var(--accent-a), var(--accent-b)));
  line-height: 0;
  flex: none;
}
.avatar {
  display: block;
  width: var(--size, 64px);
  height: var(--size, 64px);
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 50%;
  background: #17172c;
  border: 2.5px solid rgba(10, 10, 24, 0.85);
}
/* focal points for the photos that aren't pre-cropped */
.avatar[data-face="dude"] { object-position: 50% 74%; }
.avatar[data-face="sum"]  { object-position: 50% 44%; }
.avatar[data-face="baby"] { object-position: 53% 40%; }

/* ── Hero ─────────────────────────────────────────────── */
.hero { text-align: center; padding: 22px 4px 8px; }

.hero-avatars {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(10px, 3vw, 22px);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.hero-avatars .avatar { --size: clamp(72px, 17vw, 104px); }

.hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.9rem, 6.5vw, 3rem);
  line-height: 1.12;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-bottom: 4px;
}
.hero .tagline {
  color: #c4c4de;
  font-style: italic;
  font-size: clamp(0.9rem, 2.6vw, 1.05rem);
  margin-top: 6px;
}
.hero .sub {
  color: #8f90b0;
  font-size: clamp(0.76rem, 2.2vw, 0.86rem);
  margin: 16px auto 0;
  max-width: 560px;
  line-height: 1.7;
}
.hero .emoji-row { font-size: 1.3rem; margin-top: 14px; letter-spacing: 6px; }

/* ── Back link ────────────────────────────────────────── */
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9fa0c4;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 9px 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.2s;
}
.back:hover { color: #fff; border-color: rgba(255,255,255,0.28); background: rgba(255,255,255,0.09); }

/* ── Table panel ──────────────────────────────────────── */
.panel {
  margin: 30px 0 0;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.cmp { width: 100%; border-collapse: separate; border-spacing: 0; }

.cmp thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 16px 12px;
  vertical-align: bottom;
}
.cmp thead th:first-child {
  background: #14142c;
  color: #9a9ac0;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border-top-left-radius: 18px;
}
.cmp thead th.ph { background: var(--pg); }
.cmp thead th.ph.p1 { --pg: var(--p1g); }
.cmp thead th.ph.p2 { --pg: var(--p2g); }
.cmp thead th.ph.p3 { --pg: var(--p3g); }
.cmp thead th:last-child { border-top-right-radius: 18px; }

.ring.r1 { --pg: var(--p1g); }
.ring.r2 { --pg: var(--p2g); }
.ring.r3 { --pg: var(--p3g); }
.phead .ring { background: rgba(0, 0, 0, 0.3); }

.phead { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.phead .avatar { --size: clamp(46px, 8vw, 62px); }
.phead .pname {
  color: #fff;
  font-weight: 600;
  font-size: clamp(0.82rem, 2.2vw, 0.95rem);
  letter-spacing: 0.02em;
}
.phead .prole {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cmp thead th.ash .pname,
.cmp thead th.ash .prole { color: #b9bdc7; }

.cmp tbody tr:nth-child(odd)  { background: rgba(255, 255, 255, 0.022); }
.cmp tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.055); }
.cmp tbody tr:hover { background: rgba(255, 255, 255, 0.085); }

.cmp td {
  padding: 15px 14px;
  font-size: 0.83rem;
  line-height: 1.6;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.cmp td.trait {
  font-weight: 600;
  color: #b6b6d6;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  width: 20%;
}
.cmp td.p1 { --pc: var(--p1); }
.cmp td.p2 { --pc: var(--p2); }
.cmp td.p3 { --pc: var(--p3); }
.cmp tbody td[data-p] { color: var(--pc); }
.cmp td.full { text-align: center; color: #dcdcec; font-style: italic; }

.cmp tr.section-row td {
  background: rgba(255, 255, 255, 0.075);
  color: var(--section);
  font-weight: 600;
  font-size: 0.74rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding: 12px;
}
.cmp tbody tr:last-child td:first-child { border-bottom-left-radius: 18px; }
.cmp tbody tr:last-child td:last-child  { border-bottom-right-radius: 18px; }
.cmp tbody tr:last-child td { border-bottom: none; }

/* ── Footer ───────────────────────────────────────────── */
.footer { text-align: center; margin-top: 46px; padding: 10px 16px; }
.footer .quote {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: clamp(1rem, 3vw, 1.25rem);
  color: #cbcbe4;
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.65;
}
.footer .emoji-row { font-size: 1.5rem; margin-top: 16px; letter-spacing: 6px; }

/* ── Hub cards ────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.card {
  --pg: linear-gradient(135deg, var(--ca), var(--cb));
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px 24px 24px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--pg);
}
.card::after {
  content: "";
  position: absolute;
  inset: -40% -30% auto auto;
  width: 240px; height: 240px;
  background: radial-gradient(circle, var(--ca) 0%, transparent 68%);
  opacity: 0.16;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--ca) 45%, transparent);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.5);
}
.card:focus-visible { outline: 2px solid var(--ca); outline-offset: 3px; }

.card-avatars { display: flex; margin-bottom: 20px; }
.card-avatars .ring { --pg: linear-gradient(135deg, var(--ca), var(--cb)); }
.card-avatars .ring + .ring { margin-left: -16px; }
.card-avatars .avatar { --size: 58px; }

.card h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 1.42rem;
  background: var(--pg);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-bottom: 2px;
}
.card .card-tag { color: #a9aac8; font-size: 0.83rem; font-style: italic; margin-top: 6px; }
.card .card-desc { color: #8b8caa; font-size: 0.8rem; margin-top: 14px; line-height: 1.65; flex: 1; }
.card .card-cta {
  margin-top: 22px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ca);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.card:hover .card-cta { gap: 13px; }
.card .card-cta span { transition: transform 0.22s; }

/* ── Mobile: table → cards ────────────────────────────── */
@media (max-width: 820px) {
  .panel {
    border: none;
    background: none;
    box-shadow: none;
    margin-top: 24px;
  }
  .cmp, .cmp tbody, .cmp tbody tr, .cmp td { display: block; width: 100%; }
  .cmp thead { display: none; }

  .cmp tbody tr,
  .cmp tbody tr:nth-child(odd),
  .cmp tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    margin-bottom: 14px;
    padding: 4px 0 10px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28);
  }
  .cmp tbody tr:hover { background: rgba(255, 255, 255, 0.04); }

  .cmp td {
    border-bottom: none;
    padding: 12px 18px 4px;
    font-size: 0.87rem;
  }
  .cmp td.trait {
    width: auto;
    color: #d3d3ea;
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    padding: 16px 18px 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .cmp tbody td[data-p]::before {
    content: attr(data-p);
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--pc);
    background: color-mix(in srgb, var(--pc) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--pc) 32%, transparent);
    padding: 5px 10px;
    border-radius: 999px;
    margin: 0 9px 3px 0;
    line-height: 1;
  }
  .cmp td.full { text-align: left; padding-top: 14px; }
  /* a "—" placeholder adds nothing on a phone-sized card */
  .cmp td.dash { display: none; }

  .cmp tbody tr.section-row,
  .cmp tbody tr.section-row:nth-child(odd),
  .cmp tbody tr.section-row:nth-child(even) {
    background: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
    margin: 26px 0 12px;
    padding: 0;
  }
  .cmp tr.section-row td {
    background: none;
    border-radius: 0;
    padding: 0 4px;
    text-align: left;
    font-size: 0.72rem;
  }
  .cmp tbody tr:last-child td:first-child,
  .cmp tbody tr:last-child td:last-child { border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
