/* OnlyChucks — visual language inspired by the card/feed conventions of
   subscription-profile sites, redrawn with an original mark and palette. */

:root {
  --ink: #0b1220;
  --ink-soft: #4b5768;
  --paper: #ffffff;
  --wash: #f4f6f9;
  --line: #e6e9ee;
  --brand: #0e7fb8;
  --brand-dark: #0a5f8a;
  --brand-tint: #e6f4fb;
  --accent: #ff5d73;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(11, 18, 32, 0.06), 0 8px 24px rgba(11, 18, 32, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* The [hidden] attribute only wins the cascade over the browser's default
   UA stylesheet, not over author rules like `.feed { display: flex }` below —
   so any hidden element with its own `display` rule stays visible. Force it. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

.page { min-height: 100vh; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; text-decoration: none; color: var(--ink); }
.brand__logo { height: 44px; width: auto; display: block; }

/* ---------- Buttons ---------- */
.btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: #fff;
  transition: transform 0.05s ease, opacity 0.15s ease;
}
.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--brand); }
.btn--primary:hover { background: var(--brand-dark); }
.btn--pill { border-radius: var(--radius-pill); }
.btn--wide { width: 100%; padding: 13px 18px; font-size: 15px; border-radius: var(--radius-pill); }

/* ---------- Profile ---------- */
.profile { max-width: 720px; margin: 0 auto; padding-bottom: 60px; }

.cover {
  height: 200px;
  background: linear-gradient(120deg, var(--brand) 0%, #4fb7e0 45%, var(--accent) 100%);
}

.identity {
  background: var(--paper);
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.avatar {
  width: 96px;
  height: 96px;
  margin-top: -48px;
  border: 4px solid var(--paper);
  border-radius: 50%;
  background: var(--brand-tint);
  object-fit: cover;
  display: block;
}
.identity__name { margin: 12px 0 0; font-size: 22px; }
.identity__handle { margin: 2px 0 0; color: var(--ink-soft); font-size: 14px; }
.identity__tagline { margin: 10px 0 0; font-size: 15px; }

.identity__aliases {
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.identity__aliases-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 2px;
}
.alias-pill {
  background: var(--brand-tint);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.alias-pill[title] { cursor: help; }

.stats { display: flex; gap: 24px; margin: 16px 0; padding: 0; }
.stats__item { text-align: left; }
.stats__item dt { font-size: 12px; color: var(--ink-soft); order: 2; }
.stats__item dd { margin: 0; font-size: 16px; font-weight: 700; order: 1; }
.stats__item { display: flex; flex-direction: column; }

.bio { color: var(--ink-soft); font-size: 14px; line-height: 1.5; margin: 4px 0 16px; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 57px;
  z-index: 9;
}
.tabs__item {
  flex: 1;
  padding: 14px 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
}
.tabs__item.is-active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- Feed ---------- */
.feed { display: flex; flex-direction: column; gap: 14px; padding: 16px 20px; }

.post-card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.post-card__media { aspect-ratio: 4 / 3; }
.post-card__body { padding: 14px 16px; }
.post-card__caption { margin: 0 0 10px; font-size: 14px; }
.post-card__meta { display: flex; gap: 16px; font-size: 13px; color: var(--ink-soft); }

/* ---------- Lockable media (shared by the feed cards and the Media grid) ---------- */
.lockable {
  background: var(--brand-tint);
  position: relative;
  overflow: hidden;
}
.lockable img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.5s ease, transform 0.5s ease;
}
.lockable.is-locked img { filter: blur(18px) saturate(0.9); transform: scale(1.08); }
.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  font-weight: 700;
  font-size: 13px;
  background: rgba(11, 18, 32, 0.15);
}
.lock-icon { font-size: 26px; display: block; margin-bottom: 6px; }
.lock-overlay--compact .lock-icon { margin-bottom: 0; font-size: 20px; }

/* ---------- Media grid ---------- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
}
.media-grid__item { aspect-ratio: 1 / 1; }

/* ---------- 404 ---------- */
.not-found {
  max-width: 480px;
  margin: 0 auto;
  padding: 80px 20px 60px;
  text-align: center;
}
.not-found__code {
  margin: 0;
  font-size: 72px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
}
.not-found h1 { font-size: 22px; margin: 8px 0 12px; }
.not-found__body { color: var(--ink-soft); font-size: 15px; margin: 0 0 28px; }

/* ---------- About panel ---------- */
.about-panel { background: var(--paper); padding: 20px; }

.also-known-as__heading { font-size: 15px; margin: 24px 0 8px; }
.also-known-as { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.also-known-as__item { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.also-known-as__item dt { font-weight: 700; font-size: 14px; }
.also-known-as__item dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-style: italic;
}
.also-known-as__item dd::before { content: "— "; }

.fine-print { color: var(--ink-soft); font-size: 12px; margin-top: 24px; }

/* ---------- Modal ---------- */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(11, 18, 32, 0.5); }
.modal__card {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 28px 24px 24px;
  max-width: 340px;
  width: calc(100% - 40px);
  text-align: center;
  box-shadow: var(--shadow-card);
}
.modal__card h2 { margin: 0 0 8px; font-size: 18px; }
.modal__card p { margin: 0 0 18px; color: var(--ink-soft); font-size: 14px; }
.modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wash);
  border: none;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}
.modal__close:hover { background: var(--line); }

@media (max-width: 480px) {
  .stats { gap: 18px; }
}
