/* ============================================================
   PROFILE — desktop layer
   Loads AFTER styles.css + discover.css + community.css.
   ============================================================ */

.profile {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  background:
    radial-gradient(70% 40% at 50% -6%, rgba(116,189,178,0.07), transparent 60%),
    var(--abyss);
}
.profile .grain { position: fixed; }

.pf-wrap { max-width: 1180px; margin: 0 auto; padding: 0 40px 90px; }

/* ============================================================
   Identity header
   ============================================================ */
.pf-cover {
  height: 220px; position: relative;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  overflow: hidden;
  background:
    radial-gradient(80% 130% at 25% 0%, rgba(116,189,178,0.28), transparent 60%),
    radial-gradient(70% 110% at 85% 30%, rgba(217,164,65,0.22), transparent 55%),
    repeating-linear-gradient(115deg, rgba(236,227,210,0.03) 0 2px, transparent 2px 10px),
    linear-gradient(160deg, #0F2426, #060E10);
  border: 1px solid var(--fog); border-top: none;
}
.pf-cover::after { /* beam */
  content: ""; position: absolute; top: -30%; right: 10%;
  width: 50%; height: 160%;
  background: conic-gradient(from 150deg at 100% 0%, transparent 0deg, rgba(217,164,65,0.12) 10deg, transparent 22deg);
  filter: blur(8px);
}

.pf-id {
  display: flex; align-items: flex-end; gap: 26px;
  margin-top: -52px; position: relative; z-index: 2;
  padding: 0 12px;
}
.pf-ava {
  flex: none; width: 124px; height: 124px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-ui); font-size: 38px; font-weight: 700; color: var(--abyss);
  background: linear-gradient(150deg, var(--seaglass), var(--amber));
  border: 5px solid var(--abyss);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.8);
}
.pf-id-meta { flex: 1; padding-bottom: 6px; min-width: 0; }
.pf-name { font-family: var(--font-display); font-size: 44px; font-weight: 600; line-height: 1; }
.pf-handle-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.pf-handle { font-family: var(--font-ui); font-size: 14px; color: var(--seaglass); }
.pf-joined { font-family: var(--font-ui); font-size: 12px; color: var(--seafoam-dim); }
.pf-id-actions { display: flex; gap: 12px; padding-bottom: 10px; }
.pf-id-actions .btn { padding: 12px 22px; font-size: 13px; }

.pf-bio { font-family: var(--font-body); font-size: 18px; line-height: 1.65; color: var(--seafoam); max-width: 60ch; margin: 22px 12px 0; }
.pf-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 12px 0; }

/* ============================================================
   Stats band
   ============================================================ */
.pf-stats {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 16px; margin: 34px 0 56px;
}
@media (max-width: 900px) { .pf-stats { grid-template-columns: repeat(2, 1fr); } }
.pf-stat {
  text-align: center;
  background: var(--tide); border: 1px solid var(--fog);
  border-radius: var(--r-md); padding: 22px 12px;
}
.pf-stat b { font-family: var(--font-display); font-size: 38px; font-weight: 600; color: var(--parchment); line-height: 1; }
.pf-stat span { display: block; font-family: var(--font-ui); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--seafoam-dim); margin-top: 9px; }
.pf-stat .accent { color: var(--amber); }

/* ============================================================
   Section heads (reuse cb-section-head pattern)
   ============================================================ */
.pf-section { margin-bottom: 60px; }
.pf-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; }
.pf-section-title { font-family: var(--font-display); font-weight: 600; font-size: 32px; }
.pf-see-all { font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; color: var(--seaglass); text-decoration: none; }
.pf-see-all:hover { color: var(--parchment); }

/* ============================================================
   Shelves
   ============================================================ */
.shelf-tabs { display: flex; gap: 6px; margin-bottom: 22px; }
.shelf-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
@media (max-width: 1000px) { .shelf-row { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 680px)  { .shelf-row { grid-template-columns: repeat(3, 1fr); } }
.shelf-book { cursor: pointer; text-decoration: none; }
.shelf-book .bk {
  aspect-ratio: 2/3; border-radius: 7px; overflow: hidden;
  border: 1px solid var(--fog); position: relative;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.shelf-book:hover .bk { transform: translateY(-5px); border-color: rgba(217,164,65,0.5); box-shadow: 0 24px 44px -24px rgba(0,0,0,0.8); }
.shelf-book .bk .ph { height: 100%; }
.shelf-book .bk .reading-badge {
  position: absolute; top: 8px; left: 8px;
  font-family: var(--font-ui); font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--abyss); background: var(--seaglass);
  padding: 4px 8px; border-radius: var(--r-pill);
}
.shelf-book .sb-t { font-family: var(--font-display); font-size: 16.5px; font-weight: 600; color: var(--parchment); line-height: 1.1; margin-top: 10px; }
.shelf-book .sb-r { color: var(--amber); font-size: 11.5px; letter-spacing: 1px; margin-top: 4px; }
.shelf-book .sb-r .empty { color: var(--seafoam-dim); }

/* ----- author tools (compact) ----- */
.at-card {
  background: var(--tide); border: 1px solid var(--fog); border-radius: var(--r-md);
  padding: 20px 24px;
}
.at-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.at-title { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--parchment); }
.at-hint { font-family: var(--font-body); font-style: italic; font-size: 13.5px; color: var(--seafoam-dim); margin-top: 3px; max-width: 56ch; }
.at-list { margin-top: 6px; }
.at-list:empty { margin-top: 0; }
.at-row {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  padding: 13px 4px; border-top: 1px solid var(--fog); margin-top: 6px;
  border-radius: var(--r-sm); transition: background .15s;
}
.at-row:hover { background: var(--fog-soft); }
.at-cover { flex: none; width: 34px; height: 50px; border-radius: 4px; overflow: hidden; display: block; }
.at-meta { flex: 1; min-width: 0; display: block; }
.at-meta b { display: block; font-family: var(--font-ui); font-size: 14px; font-weight: 700; color: var(--parchment); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.at-meta i { display: block; font-family: var(--font-body); font-style: italic; font-size: 12.5px; color: var(--seafoam-dim); margin-top: 2px; }
.at-status {
  flex: none; font-family: var(--font-ui); font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--r-pill);
}
.at-status.live { color: var(--abyss); background: var(--seaglass); }
.at-status.draft { color: var(--seafoam); border: 1px dashed var(--fog); }
.at-edit { flex: none; font-family: var(--font-ui); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--seaglass); }
.at-row:hover .at-edit { color: var(--parchment); }

/* publish-book modal */
.pb-scrim {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(3,7,8,0.72); backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.pb-modal {
  width: 460px; max-width: 100%;
  background: var(--tide); border: 1px solid var(--fog); border-radius: var(--r-md);
  padding: 26px 28px; box-shadow: 0 30px 80px rgba(0,0,0,0.51);
}
.pb-title { font-family: var(--font-display); font-size: 28px; font-weight: 600; }
.pb-sub { font-family: var(--font-body); font-size: 14.5px; color: var(--seafoam); line-height: 1.6; margin: 8px 0 20px; }
.pb-field { margin-bottom: 16px; }
.pb-label {
  display: block; font-family: var(--font-ui); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--seafoam-dim); margin-bottom: 7px;
}
.pb-input {
  width: 100%; box-sizing: border-box;
  background: var(--fog-soft); border: 1px solid var(--fog); border-radius: var(--r-sm);
  padding: 11px 14px; outline: none;
  font-family: var(--font-ui); font-size: 14px; color: var(--parchment);
}
.pb-input:focus { border-color: var(--seaglass); }
.pb-input::placeholder { color: var(--seafoam-dim); }
.pb-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; }
.shelf-empty {
  grid-column: 1 / -1;
  font-family: var(--font-body); font-style: italic; font-size: 16px;
  color: var(--seafoam-dim); text-align: center;
  border: 1px dashed var(--fog); border-radius: var(--r-md);
  padding: 44px 24px;
}
.shelf-tabs .tab-count {
  font-family: var(--font-ui); font-size: 10px; font-weight: 700;
  background: var(--fog); color: var(--parchment);
  border-radius: var(--r-pill); padding: 2px 7px; margin-left: 4px;
}
.shelf-tabs .feed-tab[aria-selected="true"] .tab-count { background: rgba(6,14,16,0.18); color: var(--abyss); }

/* reading goal (year card) */
.year-goal { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--fog); }
.yg-row { display: flex; align-items: baseline; justify-content: space-between; font-family: var(--font-ui); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--seafoam-dim); }
.yg-row b { font-family: var(--font-display); font-size: 18px; letter-spacing: 0; text-transform: none; color: var(--parchment); }
.yg-bar { height: 7px; border-radius: 4px; background: var(--fog); overflow: hidden; margin-top: 9px; }
.yg-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--seaglass), var(--amber)); }
.yg-sub { font-family: var(--font-body); font-style: italic; font-size: 13px; color: var(--seafoam); margin-top: 8px; }

/* ============================================================
   Activity feed (left) + Year in books (right)
   ============================================================ */
.pf-cols { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 28px; align-items: start; }
@media (max-width: 900px) { .pf-cols { grid-template-columns: 1fr; } }

.activity { display: flex; flex-direction: column; }
.act-row {
  display: flex; gap: 14px; padding: 18px 4px;
  border-top: 1px solid var(--fog);
}
.act-row:first-child { border-top: none; }
.act-glyph {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-size: 15px;
  background: var(--fog-soft); border: 1px solid var(--fog);
}
.act-body { flex: 1; min-width: 0; }
.act-text { font-family: var(--font-body); font-size: 16.5px; line-height: 1.5; color: var(--seafoam); }
.act-text b { font-family: var(--font-display); font-style: italic; font-weight: 600; color: var(--parchment); }
.act-text .rate { color: var(--amber); letter-spacing: 1px; }
.act-time { font-family: var(--font-ui); font-size: 11.5px; color: var(--seafoam-dim); margin-top: 5px; }

/* year in books */
.year-card {
  background: var(--tide); border: 1px solid var(--fog);
  border-radius: var(--r-md); padding: 26px;
}
.year-title { font-family: var(--font-ui); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--seafoam-dim); margin-bottom: 20px; }
.year-big { font-family: var(--font-display); font-size: 64px; font-weight: 600; line-height: 0.9; color: var(--parchment); }
.year-big span { font-size: 22px; color: var(--seafoam-dim); font-style: italic; }
.year-sub { font-family: var(--font-ui); font-size: 12px; color: var(--seafoam-dim); margin-top: 8px; }
.year-bars { display: flex; align-items: flex-end; gap: 7px; height: 90px; margin-top: 26px; }
.year-bars i {
  flex: 1; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--seaglass), rgba(116,189,178,0.25));
  min-height: 8px;
}
.year-bars i.hot { background: linear-gradient(180deg, var(--amber), rgba(217,164,65,0.3)); }
.year-months { display: flex; gap: 7px; margin-top: 8px; }
.year-months span { flex: 1; text-align: center; font-family: var(--font-ui); font-size: 8.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--seafoam-dim); }
.year-foot { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--fog); font-family: var(--font-body); font-style: italic; font-size: 15px; line-height: 1.5; color: var(--seafoam); }
.year-foot b { color: var(--amber); font-style: normal; font-family: var(--font-ui); font-size: 13px; }

/* ============================================================
   Your clubs (member + running)
   ============================================================ */
.club-subhead {
  font-family: var(--font-ui); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--seafoam-dim);
  margin: 0 0 14px;
}
.pf-clubs-running { margin-bottom: 30px; }
.pf-club-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 760px) { .pf-club-grid { grid-template-columns: 1fr; } }

.pf-club {
  display: flex; align-items: center; gap: 16px;
  background: var(--tide); border: 1px solid var(--fog);
  border-radius: var(--r-md); padding: 18px 20px;
  text-decoration: none; transition: border-color .2s, transform .2s;
}
.pf-club:hover { border-color: rgba(217,164,65,0.4); transform: translateY(-3px); }
.pf-club.owner { border-color: rgba(217,164,65,0.35); background: linear-gradient(160deg, rgba(217,164,65,0.06), var(--tide) 60%); }
.pf-club-glyph {
  flex: none; width: 50px; height: 50px; border-radius: 13px;
  display: grid; place-items: center; font-size: 23px;
  background: var(--deepwater); border: 1px solid var(--fog);
}
.pf-club-body { flex: 1; min-width: 0; }
.pf-club-name { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.05; color: var(--parchment); }
.pf-club-meta { font-family: var(--font-ui); font-size: 11.5px; color: var(--seafoam-dim); margin-top: 4px; letter-spacing: 0.03em; }
.pf-club-reading { font-family: var(--font-body); font-style: italic; font-size: 13.5px; color: var(--seafoam); margin-top: 6px; }
.pf-club-tag {
  flex: none; font-family: var(--font-ui); font-size: 9px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--r-pill);
}
.pf-club-tag.host { color: var(--abyss); background: var(--amber); }
.pf-club-tag.live { color: var(--seaglass); border: 1px solid rgba(116,189,178,0.4); display: inline-flex; align-items: center; gap: 6px; }
.pf-club-tag.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--oxblood); }
.pf-club-arrow { flex: none; color: var(--seafoam-dim); font-size: 18px; }
.pf-club:hover .pf-club-arrow { color: var(--amber); }
.year-foot { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--fog); font-family: var(--font-body); font-style: italic; font-size: 15px; line-height: 1.5; color: var(--seafoam); }
.year-foot b { color: var(--amber); font-style: normal; font-family: var(--font-ui); font-size: 13px; }
