/* =====================
   ROOT / VARIABLES
===================== */

:root {
  --bg: #0f0f0f;
  --panel: #161616;
  --text: #e6e6e6;
  --muted: #9aa0a6;
  --border: rgba(255,255,255,0.08);
  --accent: #1da1f2;
}


@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f8;
    --panel: #ffffff;
    --text: #1f1f1f;
    --muted: #5f6368;
    --border: rgba(0,0,0,0.08);
    --accent: #1a73e8;
  }
}



* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Neutralize links */
a {
  color: var(--text);
  text-decoration: none;
}


/* =====================
   DESKTOP LAYOUT
===================== */

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 320px;
  max-width: 1280px;
  margin: 0 auto;
  min-height: 100vh;
}

/* =====================
   LEFT RAIL
===================== */

.sidebar {
  padding: 24px 16px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

/* Brand card */
.brand-card {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
}


.brand-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}



.brand-bg {
  position: absolute;
  inset: 0;
}

.brand-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(30%) contrast(1.05) brightness(0.85);
}

.brand-overlay {
  position: absolute;
  inset: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.brand-meta {
  margin-bottom: 28px;
  padding: 0 4px;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.brand-desc {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}


/* Navigation */
.side-nav a {
  display: block;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 500;
}

.side-nav a:hover {
  background: rgba(255,255,255,0.06);
}

/* Auth block */
.auth-block {
  margin-top: auto;
  font-size: 0.85rem;
  padding: 0 14px;            /* 🔑 MATCH side-nav padding */
}


.tier {
  font-size: 0.75rem;
  color: var(--muted);
}

/* =====================
   CENTER CONTENT
===================== */

.content {
  padding: 24px 32px;
  max-width: 720px;
}

.feed-item {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.feed-item:hover {
  background: rgba(255,255,255,0.03);
}

/* Accent links */
.feed-item a.title {
  color: var(--accent);
}

.feed-item a.title:hover {
  text-decoration: underline;
}



/* =====================
   FEED THUMB OVERLAY
===================== */

.feed-item-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.feed-thumb-wrap {
  position: relative;
  flex-shrink: 0;
}

.feed-thumb {
  width: 240px;
  height: 135px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

/* overlay icon */
.feed-icon {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 14px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.65);
  color: white;
  line-height: 1;
}

/* optional variants */
.feed-icon-video {
  background: rgba(220, 38, 38, 0.85);
}

.feed-icon-image {
  background: rgba(29, 161, 242, 0.85);
}


/* =====================
   RIGHT RAIL
===================== */

.right-rail {
  padding: 24px 16px;
  border-left: 1px solid var(--border);
}

.docs-preview,
.perks {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}


.user-meta {
  margin-bottom: 6px;
  line-height: 1.2;
}


/* =====================
   LIBRARY
===================== */

.library-tree {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.library-section {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.library-section-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
}

.section-summary {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.library-list {
  list-style: none;
  padding: 0;
  margin-top: 12px;
}

.library-item {
  padding: 8px 0;
  display: flex;
  justify-content: space-between;
}

.library-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Access badges */
.access-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

.access-free {
  background: rgba(255,255,255,0.08);
}

.access-seeker {
  background: rgba(29,161,242,0.15);
  color: #1da1f2;
}

.access-archon {
  background: rgba(186,85,211,0.18);
  color: #ba55d3;
}

.access-spira {
  background: rgba(255,215,0,0.2);
  color: gold;
}

/* =====================
   AUTH PAGES
===================== */

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2rem;
  background: #121317;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
}

.auth-intro {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.form-group input {
  width: 100%;
  padding: 0.55rem 0.6rem;
  background: #0e0f13;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: var(--text);
  caret-color: var(--text);
}

.sidebar .link-button {
  background: none;
  border: none;
  padding: 6px 0;
  font-size: 0.85rem;
  color: var(--accent);
  cursor: pointer;
}


.site-footer{
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-nav{
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.footer-nav .sep{
  opacity: 0.4;
  margin: 0 4px;
}

.footer-nav a{
  color: var(--muted);
}

.footer-nav a:hover{
  color: var(--text);
  text-decoration: underline;
}

.doc-toc ul{
  list-style: none;
  padding: 0;
  margin: 0;
}

.doc-toc li{
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.doc-toc li.active a{
  color: var(--text);
  font-weight: 600;
}

.doc-toc a{
  color: var(--muted);
  flex: 1;
}

.doc-toc a:hover{
  color: var(--text);
  text-decoration: underline;
}

.doc-toc .access-badge{
  font-size: 0.65rem;
  padding: 2px 6px;
}

.doc-toc a:hover{
  color: var(--text);
  text-decoration: underline;
}


/* =====================
   RICH CONTENT SAFETY
===================== */

.content img,
.content video,
.content iframe {
  max-width: 100%;
  height: auto;
  display: block;
}



/* =====================
   CONTENT PROTECTION
===================== */

.protected-content {
  user-select: none;
  -webkit-user-select: none;
}

.protected-content img {
  pointer-events: none;
}

/* watermark */
.protected-content::after {
  content: "Heaxia · Exclusive";
  position: fixed;
  bottom: 14px;
  right: 16px;
  font-size: 11px;
  opacity: 0.12;
  pointer-events: none;
  z-index: 999;
}

/* legal */
.content-license {
  margin-top: 32px;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}




/* =====================
   MOBILE
===================== */

.mobile-top,
.mobile-drawer {
  display: none;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .right-rail {
    display: none;
  }

  .content {
    padding: 20px 16px;
  }

  .mobile-top {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
  }

  .mobile-drawer {
    position: static;
    top: 48px;
    inset-inline: 0;
    background: var(--bg);
    padding: 16px;
    display: none;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
  }


  body.menu-open .mobile-drawer {
    display: flex;
  }
}
