/* ── Git viewer app styles ────────────────────────────── */

:root {
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* Background radial glow — matches xmpp.tel hero */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(124,58,237,.15) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 20% 80%, rgba(99,102,241,.1) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.g-page, .dedication, .footer { position: relative; z-index: 1; }

a { color: var(--accent); }
a:hover { filter: brightness(1.15); }

.g-page { max-width: 1100px; margin: 0 auto; padding: 1.5rem clamp(1rem,4vw,2rem) 4rem; }

/* Repo tabs */
.g-tabs { display: flex; gap: .4rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.g-tab { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .85rem .55rem; font-size: .85rem; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s; }
.g-tab:hover { color: var(--text); text-decoration: none; }
.g-tab.active { color: var(--text); border-bottom-color: var(--primary); }

/* Repo header */
.g-repo-head { padding: 1.25rem 0 1rem; }
.g-repo-head h1 { font-size: 1.4rem; font-weight: 800; margin-bottom: .25rem; }
.g-repo-head p  { color: var(--text-muted); font-size: .9rem; }
.g-clone-box { display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .35rem .6rem .35rem 1rem; margin-top: .75rem; width: fit-content; max-width: 100%; }
.g-clone-box input { background: none; border: none; outline: none; color: var(--text-muted); font-family: var(--mono); font-size: .8rem; width: 280px; max-width: 50vw; }
.g-clone-copy { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; color: var(--text-muted); font-size: .75rem; cursor: pointer; padding: .2rem .55rem; white-space: nowrap; }
.g-clone-copy:hover { color: var(--text); border-color: var(--primary); }

/* Commit table */
.g-commits { width: 100%; border-collapse: collapse; font-size: .875rem; }
.g-commits thead tr { border-bottom: 1px solid var(--border); }
.g-commits th { padding: .45rem 1rem .45rem 0; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); text-align: left; }
.g-commits td { padding: .55rem 1rem .55rem 0; border-bottom: 1px solid rgba(51,65,85,.35); color: var(--text-muted); vertical-align: top; white-space: nowrap; }
.g-commits td.subject { white-space: normal; width: 100%; color: var(--text); }
.g-commits td.subject a { color: var(--text); }
.g-commits td.subject a:hover { color: var(--accent); text-decoration: none; }
.g-commits td.hash a { font-family: var(--mono); font-size: .78rem; color: var(--text-dim); }
.g-commits tr:hover td { background: rgba(124,58,237,.04); }

/* File tree */
.g-tree { width: 100%; border-collapse: collapse; font-size: .875rem; }
.g-tree thead tr { border-bottom: 1px solid var(--border); }
.g-tree th { padding: .45rem 1rem .45rem 0; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); text-align: left; }
.g-tree td { padding: .5rem 1rem .5rem 0; border-bottom: 1px solid rgba(51,65,85,.25); color: var(--text-muted); }
.g-tree td.name { color: var(--text); }
.g-tree td.name a { color: var(--text); font-weight: 500; }
.g-tree td.name a:hover { color: var(--accent); text-decoration: none; }
.g-tree td.size { font-family: var(--mono); font-size: .78rem; text-align: right; white-space: nowrap; }
.g-tree tr:hover td { background: rgba(124,58,237,.04); }

/* Breadcrumb */
.g-crumb { font-size: .85rem; color: var(--text-dim); margin-bottom: 1rem; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.g-crumb a { color: var(--accent); }
.g-crumb .sep { color: var(--border); }

/* Blob viewer */
.blob-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: auto; }
.blob-head { padding: .5rem 1rem; border-bottom: 1px solid var(--border); font-size: .8rem; color: var(--text-muted); display: flex; gap: 1rem; align-items: center; }
table.blob-table { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: .8rem; line-height: 1.65; }
table.blob-table td { padding: 0 .75rem; vertical-align: top; }
td.ln { color: var(--text-dim); text-align: right; user-select: none; border-right: 1px solid var(--border); min-width: 48px; background: rgba(0,0,0,.15); white-space: nowrap; }
td.ln a { color: var(--text-dim); }
td.lc { color: var(--text); white-space: pre; width: 100%; }
tr:target { background: rgba(124,58,237,.12); }
tr:target td.ln { color: var(--accent); }
.g-binary { padding: 2rem; text-align: center; color: var(--text-muted); }

/* Diff */
.diff-pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; overflow-x: auto; font-family: var(--mono); font-size: .8rem; line-height: 1.6; }

/* Commit detail */
.g-commit-meta { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.g-commit-meta .subject { font-size: 1.1rem; font-weight: 700; margin-bottom: .75rem; }
.g-commit-meta table { border-collapse: collapse; font-size: .85rem; }
.g-commit-meta td { padding: .18rem .75rem .18rem 0; color: var(--text-muted); vertical-align: top; }
.g-commit-meta td:first-child { color: var(--text-dim); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; padding-right: 1rem; }
.g-commit-meta .body { margin-top: .75rem; font-size: .875rem; color: var(--text-muted); white-space: pre-wrap; border-top: 1px solid var(--border); padding-top: .75rem; }
.g-hash { font-family: var(--mono); font-size: .82rem; color: var(--text-dim); }

/* README */
.readme-wrap { margin-top: 1.5rem; }
.readme-head { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); padding-bottom: .5rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.readme-body { font-size: .9rem; color: var(--text-muted); line-height: 1.8; }
.readme-body h1,.readme-body h2,.readme-body h3 { color: var(--text); margin: 1.25rem 0 .5rem; }
.readme-body p { margin-bottom: .75rem; }
.readme-body ul,ol { padding-left: 1.5rem; margin-bottom: .75rem; }
.readme-body li { margin-bottom: .25rem; }
.readme-body code { background: var(--surface-2); border-radius: 4px; padding: .1rem .35rem; font-family: var(--mono); font-size: .82rem; color: var(--accent-soft); }
.readme-body pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; overflow-x: auto; margin-bottom: .75rem; }
.readme-body pre code { background: none; padding: 0; color: var(--text); }
.readme-body table { border-collapse: collapse; width: 100%; margin-bottom: .75rem; font-size: .85rem; }
.readme-body th,.readme-body td { padding: .4rem .75rem; border: 1px solid var(--border); }
.readme-body th { background: var(--surface-2); color: var(--text); }
.readme-body a { color: var(--accent); }
.readme-body blockquote { border-left: 3px solid var(--primary); padding-left: 1rem; color: var(--text-muted); margin-bottom: .75rem; }

/* Refs */
.g-refs-section { margin-bottom: 2rem; }
.g-refs-section h2 { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); margin-bottom: .75rem; }
.g-refs-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.g-refs-table td { padding: .5rem 1rem .5rem 0; border-bottom: 1px solid rgba(51,65,85,.3); color: var(--text-muted); }
.g-refs-table td:first-child { color: var(--text); font-weight: 600; width: 200px; }
.g-refs-table td .ref-hash { font-family: var(--mono); font-size: .75rem; color: var(--text-dim); }

/* Index */
.g-index-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.g-index-table thead tr { border-bottom: 1px solid var(--border); }
.g-index-table th { padding: .5rem 1rem .5rem 0; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); text-align: left; }
.g-index-table td { padding: .8rem 1rem .8rem 0; border-bottom: 1px solid rgba(51,65,85,.3); color: var(--text-muted); vertical-align: top; }
.g-index-table td.rname { color: var(--text); font-size: 1rem; font-weight: 600; white-space: nowrap; }
.g-index-table td.rname a { color: var(--text); }
.g-index-table td.rname a:hover { color: var(--accent); text-decoration: none; }
.g-index-table tr:hover td { background: rgba(124,58,237,.04); }

/* Pygments */
.hl .hll { background: rgba(124,58,237,.1); }

/* Pagination */
.g-pagination { display: flex; gap: .5rem; margin: 1.5rem 0; }
.g-pagination a,.g-pagination span { padding: .3rem .7rem; border: 1px solid var(--border); border-radius: 5px; font-size: .85rem; color: var(--text-muted); }
.g-pagination a:hover { color: var(--text); border-color: var(--primary); text-decoration: none; }
.g-pagination .cur { background: var(--primary); border-color: var(--primary); color: #fff; }
