:root {
  --cream: #f4eee8;
  --paper: #fbf7f2;
  --ink: #2a2224;
  --muted: #7a6a6e;
  --line: rgba(42, 34, 36, 0.1);
  --rose: #b85a72;
  --rose-deep: #8e3d54;
  --blush: #e8c9d0;
  --gold: #b0894f;
  --gold-soft: #e8d5b0;
  --silver: #8d8a8c;
  --silver-soft: #ddd9d6;
  --bronze: #a56a4a;
  --bronze-soft: #e4cbb8;
  --white: #fffcf9;
  --shadow: 0 18px 50px rgba(42, 34, 36, 0.08);
  --radius: 22px;
  --font: "Sora", sans-serif;
  --serif: "Fraunces", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

.noise-layer { position: relative; z-index: 1; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 6vw;
  background: rgba(244, 238, 232, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.brand small {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.nav {
  display: flex;
  gap: 1.4rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.nav a:hover, .nav a.is-on { color: var(--ink); }
.nav-cta, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  padding: 0.72rem 1.15rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  transition: transform 0.25s ease, background 0.25s ease;
}
.btn:hover, .nav-cta:hover { transform: translateY(-2px); }
.btn.ghost, .nav-cta.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.rose { background: var(--rose); color: white; }

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  padding: 5.5rem 6vw 4.5rem;
  align-items: center;
}
.kicker {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rose);
  font-weight: 600;
}
h1, .display {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0.55rem 0 0;
  font-size: clamp(2.4rem, 5.2vw, 4.6rem);
}
.lead {
  max-width: 36rem;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.02rem;
}
.hero-actions { display: flex; gap: 0.7rem; margin-top: 1.8rem; flex-wrap: wrap; }
.hero-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
}
.mini-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  border-radius: 16px;
}
.mini-row + .mini-row { margin-top: 0.35rem; }
.mini-row.gold { background: linear-gradient(90deg, #f7efe0, transparent); }
.mini-row.silver { background: linear-gradient(90deg, #f1eeec, transparent); }
.mini-row.bronze { background: linear-gradient(90deg, #f6ece4, transparent); }
.rank-n {
  width: 1.6rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--muted);
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  flex-shrink: 0;
}
.avatar.lg { width: 72px; height: 72px; font-size: 1.2rem; }
.avatar.xl { width: 96px; height: 96px; font-size: 1.5rem; }
.who { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.who b { font-weight: 600; }
.who span { color: var(--muted); font-size: 0.78rem; }
.pts { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 0.82rem; color: var(--muted); }

.section { padding: 4.2rem 6vw; }
.section h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 500;
  margin: 0.4rem 0 1.6rem;
}
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.9rem; }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card h3 { margin: 0.4rem 0 0.35rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 0.92rem; }
.icon-soft {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #f3e7e3;
  color: var(--rose-deep);
  font-size: 0.95rem;
}

.disc-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.disc-chip:hover { border-color: var(--blush); transform: translateY(-3px); }
.disc-chip strong { display: block; }
.disc-chip em { font-style: normal; color: var(--muted); font-size: 0.78rem; }

.site-footer {
  padding: 2rem 6vw 2.4rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.86rem;
}
.copy-mark {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.seal {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
}
.daddy {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.3rem 1rem;
  border-right: 1px solid var(--line);
  background: rgba(244, 238, 232, 0.7);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.side nav { display: flex; flex-direction: column; gap: 0.25rem; }
.side a, .side button.linkish {
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  color: var(--muted);
}
.side a.is-on, .side a:hover, .side button.linkish:hover {
  background: var(--white);
  color: var(--ink);
}
.main { padding: 1.4rem 1.6rem 3rem; min-width: 0; }
.app-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.3rem;
}
.app-head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.search {
  width: min(360px, 100%);
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  outline: none;
}
.search:focus { border-color: var(--blush); }

.feed { display: grid; gap: 0.9rem; max-width: 720px; }
.post {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.1rem 1.15rem 0.9rem;
}
.post-top { display: flex; gap: 0.75rem; align-items: center; }
.post p { color: var(--ink); line-height: 1.6; margin: 0.75rem 0 0.6rem; }
.post-meta { display: flex; gap: 1rem; color: var(--muted); font-size: 0.8rem; }
.post-meta button {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--muted);
}
.post-meta button:hover { color: var(--rose); }
.composer {
  display: grid;
  gap: 0.7rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1rem;
  margin-bottom: 1rem;
  max-width: 720px;
}
.composer textarea {
  border: 0;
  resize: vertical;
  min-height: 72px;
  background: transparent;
  outline: none;
}
.composer-row { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }

.podium {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 0.8rem;
  align-items: end;
  margin-bottom: 1.2rem;
}
.podium-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.3rem 1rem 1.2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.podium-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
}
.podium-card.first { padding-top: 1.8rem; transform: translateY(-8px); }
.podium-card.first::after { background: var(--gold); }
.podium-card.second::after { background: var(--silver); }
.podium-card.third::after { background: var(--bronze); }
.podium-card.first { box-shadow: 0 20px 40px rgba(176, 137, 79, 0.16); border-color: var(--gold-soft); }
.podium-card.second { border-color: var(--silver-soft); }
.podium-card.third { border-color: var(--bronze-soft); }
.crown {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
  color: var(--gold);
  font-weight: 600;
}
.podium-card h3 { margin: 0.6rem 0 0.15rem; font-size: 1.05rem; }
.podium-card p { margin: 0; color: var(--muted); font-size: 0.8rem; }

.board { display: grid; gap: 0.45rem; }
.board-row {
  display: grid;
  grid-template-columns: 42px 1fr auto auto;
  gap: 0.8rem;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.7rem 0.9rem;
  transition: transform 0.2s ease;
}
.board-row:hover { transform: translateX(4px); }
.board-row.r1 { background: linear-gradient(90deg, #f7efe0, var(--white) 55%); border-color: var(--gold-soft); }
.board-row.r2 { background: linear-gradient(90deg, #f2efed, var(--white) 55%); }
.board-row.r3 { background: linear-gradient(90deg, #f6ece4, var(--white) 55%); }
.filters { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chip {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  font-size: 0.78rem;
}
.chip.is-on, .chip:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.queen {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.1rem;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--gold-soft);
  border-radius: 24px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  box-shadow: 0 16px 36px rgba(176, 137, 79, 0.1);
}
.badge {
  display: inline-flex;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #f7efe0;
  color: var(--gold);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.profile {
  max-width: 720px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 1.6rem;
}
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; margin-top: 1.2rem; }
.stat {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.85rem;
}
.stat b { display: block; font-size: 1.2rem; }
.stat span { color: var(--muted); font-size: 0.75rem; }

.gate {
  max-width: 460px;
  margin: 8vh auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 1.6rem;
  box-shadow: var(--shadow);
}
.field { display: grid; gap: 0.35rem; margin-bottom: 0.85rem; }
.field label { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.field input, .field select {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  background: var(--paper);
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--blush); }
.note { color: var(--rose-deep); font-size: 0.86rem; min-height: 1.2rem; }

.reveal { opacity: 0; transform: translateY(18px); animation: up 0.7s ease forwards; }
@keyframes up { to { opacity: 1; transform: none; } }

@media (max-width: 960px) {
  .hero, .grid-3, .grid-4, .podium, .app-shell, .queen, .site-footer {
    grid-template-columns: 1fr;
    display: grid;
  }
  .nav { display: none; }
  .side { display: none; }
  .app-shell { display: block; }
  .mobile-nav {
    display: flex !important;
  }
  .podium-card.first { transform: none; order: -1; }
}
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(251, 247, 242, 0.94);
  border-top: 1px solid var(--line);
  padding: 0.55rem 0.8rem calc(0.55rem + env(safe-area-inset-bottom));
  z-index: 50;
  justify-content: space-around;
}
.mobile-nav a { color: var(--muted); font-size: 0.72rem; text-align: center; }
.mobile-nav a.is-on { color: var(--ink); }
