/* =============================================================
 * THEIR — web design system.
 * Cancun-blue glassmorphism, matching the iOS app (TheirBrand.swift).
 * Dark navy canvas, #17C1DE accent, frosted glass surfaces. No pink.
 * © 2026 Austin Harman Designs
 * ============================================================= */

:root {
  --ink:        #071522;   /* deepest navy (page base)        */
  --ink-top:    #0C2438;   /* gradient top                    */
  --panel:      rgba(255,255,255,.06);   /* frosted glass card */
  --panel-raised: rgba(255,255,255,.10);
  --fill-field: rgba(255,255,255,.05);
  --fg:         #EAF2F7;
  --muted:      #8397A6;
  --hairline:   rgba(255,255,255,.12);
  --hairline-soft: rgba(255,255,255,.07);
  --accent:     #17C1DE;   /* Cancun blue                     */
  --accent-deep:#0E4F7A;
  --cyan:       #5AD9EE;   /* verified                        */
  --gold:       #F5AF34;   /* kept / value                    */
  --human:      #3DDC97;   /* provenance record (RealME)      */
  --danger:     #FF5C6C;
  --on-accent:  #06202E;   /* text on accent fills            */
  --radius:     14px;
  --radius-lg:  18px;
  --maxw:       560px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  color: var(--fg);
  background: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Fixed navy gradient canvas behind everything. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1100px 620px at 50% -8%, var(--ink-top) 0%, var(--ink) 62%),
    var(--ink);
}

a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: 1.6rem; margin: 0 0 .4rem; }
h2 { font-size: 1.25rem; margin: 0 0 .5rem; }
h3 { font-size: 1.02rem; margin: 0 0 .35rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

/* -------------------------------------------------------------
 * App shell: frosted header + mobile tab bar
 * ----------------------------------------------------------- */
header.appbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1rem;
  background: rgba(9,24,38,.72);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--hairline);
}
.brand {
  color: var(--fg); font-weight: 800; letter-spacing: .16em;
  font-size: 1.02rem;
}
.brand .dot { color: var(--accent); }
header.appbar nav { display: flex; gap: .9rem; align-items: center; }
header.appbar nav a, header.appbar nav button.link {
  color: var(--muted); font: inherit; background: none; border: 0;
  cursor: pointer; padding: 0;
}
header.appbar nav a:hover { color: var(--fg); }

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem 1rem calc(84px + env(safe-area-inset-bottom));
}

/* Bottom tab bar — mirrors the iOS tabs. Shown on all widths;
 * becomes the primary nav on mobile. */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex; justify-content: space-around; align-items: center;
  padding: .5rem .4rem calc(.5rem + env(safe-area-inset-bottom));
  background: rgba(9,24,38,.82);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-top: 1px solid var(--hairline);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); font-size: .66rem; font-weight: 600;
  padding: .2rem .6rem; min-width: 56px; text-align: center;
}
.tabbar a.active { color: var(--accent); }
.tabbar a svg { width: 22px; height: 22px; }

/* -------------------------------------------------------------
 * Surfaces
 * ----------------------------------------------------------- */
.card, .panel, .post, .composer {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.card + .card, .post + .post, .panel + .panel { margin-top: .85rem; }
.panel.narrow { max-width: 400px; margin: 2.5rem auto; }
.raised { background: var(--panel-raised); }

/* -------------------------------------------------------------
 * Buttons
 * ----------------------------------------------------------- */
.btn, button.primary, button.ghost, a.primary, a.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .45rem;
  font: inherit; font-weight: 600;
  padding: .62rem 1.05rem; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
.btn:active, button.primary:active, .btn.keep:active { transform: scale(.97); }

.btn.primary, button.primary, a.primary {
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 6px 18px -8px var(--accent);
}
.btn.primary:hover, button.primary:hover, a.primary:hover { filter: brightness(1.06); }

.btn.ghost, button.ghost {
  background: var(--panel-raised); color: var(--fg);
  border-color: var(--hairline);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.btn.ghost:hover { border-color: var(--accent); }

.btn.keep {
  background: var(--accent); color: var(--on-accent);
  padding: .5rem .95rem; font-size: .92rem;
  box-shadow: 0 6px 18px -8px var(--accent);
}

.btn.block, button.block { background: rgba(255,92,108,.14); color: var(--danger); }

button.link, .btn.link {
  background: transparent; color: var(--muted);
  border: 0; padding: .3rem .2rem; font-weight: 600; cursor: pointer;
}
button.link:hover, .btn.link:hover { color: var(--fg); }
.btn.full, button.full { width: 100%; }
.btn:disabled, button:disabled { opacity: .5; cursor: not-allowed; }

/* -------------------------------------------------------------
 * Forms
 * ----------------------------------------------------------- */
label { display: block; margin: .7rem 0 .3rem; color: var(--muted); font-size: .82rem; font-weight: 600; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--fg);
  background: var(--fill-field);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: .68rem .8rem;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; min-height: 68px; }
select { appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 1.05rem center, right .8rem center;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
  padding-right: 2.2rem;
}
input[type=file] { padding: .5rem; border-style: dashed; }
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23,193,222,.28);
}

/* -------------------------------------------------------------
 * Post card
 * ----------------------------------------------------------- */
.post .p-head { display: flex; align-items: center; gap: .6rem; }
.post .p-head .who { min-width: 0; flex: 1; }
.post .handle { color: var(--fg); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.post .p-time { color: var(--muted); font-size: .78rem; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; color: var(--on-accent);
  background: var(--accent);
}
.avatar.lg { width: 66px; height: 66px; font-size: 1.35rem; }
.verified { color: var(--cyan); display: inline-flex; }
.verified svg { width: 15px; height: 15px; }

.post img.media {
  display: block; width: 100%; height: auto; max-height: 540px;
  object-fit: cover; border-radius: 12px; margin: .75rem 0 .1rem;
  background: var(--accent-deep);
}
.post .caption { margin: .6rem 0 0; color: var(--fg); }
.post .p-foot { display: flex; align-items: center; justify-content: space-between; margin-top: .85rem; gap: .5rem; }
.keepcount { color: var(--muted); font-size: .8rem; display: inline-flex; align-items: center; gap: 5px; }

/* Provenance record from RealME.
   The badge carries RealME's own colours, so the wrapper stays neutral — it is
   a frame around someone else's mark, not a THEIR-branded trust pill. */
.provenance {
  display: inline-flex; align-items: center; gap: 7px;
  margin: 0 0 .5rem; padding: 0;
  text-decoration: none; line-height: 0;
  border-radius: 4px;
}
.provenance:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Their badge is designed for light backgrounds; on the dark glass a hairline
   keeps the #222 wordmark plate from bleeding into the card. */
.rm-badge {
  display: block; border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.14);
  transition: box-shadow .15s ease, transform .15s ease;
}
.provenance:hover .rm-badge { box-shadow: 0 0 0 1px rgba(255,255,255,.30); }
.provenance .anchor { font-size: .8rem; line-height: 1; opacity: .75; color: var(--human); }

.codeblock {
  margin: .5rem 0 0; padding: .7rem .8rem;
  background: rgba(0,0,0,.28); border: 1px solid var(--hairline-soft);
  border-radius: 10px; color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem; line-height: 1.5;
  overflow-x: auto; white-space: pre;
}

/* Pills */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 700; padding: .22rem .6rem;
  border-radius: 999px; white-space: nowrap;
}
.pill svg { width: 12px; height: 12px; }
.pill.live   { background: rgba(131,151,166,.16); color: #B7C6D2; }
.pill.soon   { background: rgba(23,193,222,.16);  color: var(--cyan); }
.pill.kept   { background: rgba(245,175,52,.18);  color: var(--gold); }
.pill.verified { background: rgba(90,217,238,.14); color: var(--cyan); }
.pill.creator { background: rgba(23,193,222,.14); color: var(--cyan); }

/* -------------------------------------------------------------
 * Post overflow menu (report / block) — pure CSS via <details>
 * ----------------------------------------------------------- */
.moremenu { position: relative; }
.moremenu > summary {
  list-style: none; cursor: pointer; color: var(--muted);
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.moremenu > summary::-webkit-details-marker { display: none; }
.moremenu > summary:hover { background: var(--panel-raised); color: var(--fg); }
.moremenu[open] > summary { background: var(--panel-raised); color: var(--fg); }
.menu-pop {
  position: absolute; right: 0; top: 36px; z-index: 30;
  min-width: 190px;
  background: rgba(14,32,49,.96);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--hairline); border-radius: 14px;
  padding: .35rem; box-shadow: 0 18px 40px -18px #000;
}
.menu-pop form { margin: 0; }
.menu-pop button, .menu-pop a {
  width: 100%; text-align: left; background: none; border: 0;
  color: var(--fg); font: inherit; padding: .55rem .6rem;
  border-radius: 9px; cursor: pointer; display: flex; align-items: center; gap: .5rem;
}
.menu-pop button:hover, .menu-pop a:hover { background: var(--panel-raised); }
.menu-pop .danger { color: var(--danger); }
.menu-pop .sep { height: 1px; background: var(--hairline-soft); margin: .25rem .3rem; }

/* -------------------------------------------------------------
 * Profile / stats / rows
 * ----------------------------------------------------------- */
.profile-head { text-align: center; }
.profile-head .name { font-size: 1.15rem; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.profile-head .at { color: var(--muted); }
.statgrid { display: flex; gap: .55rem; margin: .9rem 0; }
.stat {
  flex: 1; text-align: center; background: var(--fill-field);
  border: 1px solid var(--hairline-soft); border-radius: 14px; padding: .7rem .4rem;
}
.stat .n { font-size: 1.15rem; font-weight: 800; color: var(--fg); }
.stat .l { font-size: .72rem; color: var(--muted); }

.rowlist { padding: .1rem .2rem; }
.row {
  display: flex; align-items: center; gap: .75rem;
  padding: .8rem .3rem; border-bottom: 1px solid var(--hairline-soft);
  color: var(--fg);
}
.row:last-child { border-bottom: 0; }
.row .ic { color: var(--accent); display: flex; width: 20px; }
.row .ic svg { width: 20px; height: 20px; }
.row .lbl { flex: 1; }
.row .chev { color: var(--muted); }

/* -------------------------------------------------------------
 * Hero / positioning (signed-out landing)
 * ----------------------------------------------------------- */
.hero { text-align: center; padding: 2.4rem 1rem 1.4rem; }
.hero h1 { font-size: 2rem; }
.hero .tag { color: var(--accent); font-weight: 700; letter-spacing: .02em; }
.hero p.lede { color: var(--muted); max-width: 30rem; margin: .6rem auto 1.3rem; font-size: 1.05rem; }

/* -------------------------------------------------------------
 * Misc: flashes, badges, empty, policy, spinner, skip-link
 * ----------------------------------------------------------- */
.flash {
  padding: .7rem .9rem; border-radius: 12px; margin: .6rem 0;
  border: 1px solid var(--hairline); border-left: 4px solid currentColor;
  background: var(--panel);
}
.flash.error { color: #FFB4BD; }
.flash.info, .flash.success { color: #8FE3F1; }

.badge {
  padding: .12rem .55rem; border-radius: 999px;
  background: var(--panel-raised); font-size: .7rem; color: var(--muted);
  vertical-align: middle;
}

.empty-state, .empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state h3 { color: var(--fg); }
.empty-state p { max-width: 22rem; margin: .3rem auto 0; }

.policy { line-height: 1.7; }
.policy h2 { margin-top: 0; }
.policy p { color: var(--fg); }
.policy .muted { color: var(--muted); }

.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(6,32,46,.4); border-top-color: var(--on-accent);
  border-radius: 50%; animation: spin .8s linear infinite;
  vertical-align: -2px; margin-right: .4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
[aria-busy="true"] { cursor: progress; opacity: .75; pointer-events: none; }

.skip-link {
  position: absolute; top: -100px; left: 0; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: .5rem 1rem;
  border-radius: 0 0 10px 0;
}
.skip-link:focus { top: 0; }

.ahd-footer { text-align: center; padding: 1.4rem 1rem; color: var(--muted); font-size: .78rem; }
.ahd-footer a { color: var(--muted); }
.ahd-footer a:hover { color: var(--fg); }

/* -------------------------------------------------------------
 * Tables + notices (creator earnings)
 * ----------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
.lifetime th, .lifetime td { padding: .5rem 0; border-bottom: 1px solid var(--hairline-soft); }
.lifetime th { color: var(--muted); font-weight: 600; text-align: left; }
.lifetime td { text-align: right; color: var(--fg); }
.lifetime tr:last-child th, .lifetime tr:last-child td { border-bottom: 0; }
.recent-keeps { font-size: .84rem; }
.recent-keeps th { color: var(--muted); text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--hairline); font-weight: 600; }
.recent-keeps td { padding: .5rem .4rem; border-bottom: 1px solid var(--hairline-soft); color: var(--fg); }
.notice { padding: 1rem; border-radius: 14px; border: 1px solid var(--hairline); background: var(--panel); }
.notice h3 { margin-top: 0; }
.notice.warn { border-color: rgba(245,175,52,.4); background: rgba(245,175,52,.08); }
.notice.ok   { border-color: rgba(23,193,222,.35); background: rgba(23,193,222,.07); }
.reason-select { width: auto; display: inline-block; padding: .35rem .5rem; }
.perk { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem 0; color: var(--fg); }
.perk .ic { color: var(--accent); flex: 0 0 auto; margin-top: 2px; }
.perk .ic svg { width: 18px; height: 18px; }

/* -------------------------------------------------------------
 * Consent checkbox (Terms acceptance, notification opt-out)
 * ----------------------------------------------------------- */
label.agree {
  display: flex; align-items: flex-start; gap: .6rem;
  margin: 0; color: var(--fg); font-size: .92rem; font-weight: 500;
  text-transform: none; letter-spacing: 0;
}
label.agree input[type=checkbox] {
  width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px;
  accent-color: var(--accent);
}

/* Destructive section (delete account) */
.danger-zone { border-color: rgba(255,92,108,.35); }
.danger-zone h3 { color: var(--danger); }

/* -------------------------------------------------------------
 * Moderation queue (admin)
 * ----------------------------------------------------------- */
.queue-filters { display: flex; gap: .4rem; margin-top: .7rem; flex-wrap: wrap; }
.queue-filters .pill { text-transform: capitalize; }
.report .report-head { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.report-actions {
  display: flex; gap: .45rem; flex-wrap: wrap; margin-top: .85rem;
  padding-top: .8rem; border-top: 1px solid var(--hairline-soft);
}
.report-actions form { margin: 0; }
.report-actions .btn { padding: .45rem .85rem; font-size: .88rem; }

/* Desktop: give the tab bar a comfortable max width, center it. */
@media (min-width: 620px) {
  .tabbar { left: 50%; transform: translateX(-50%); max-width: var(--maxw);
    border-radius: 18px 18px 0 0; border: 1px solid var(--hairline); border-bottom: 0; }
}
