/* ============================================================
   Absolutely Plausible — Business Plan
   Palette: cool watercolour brand (mirrors robotfantome.com)
   Font: Share Tech Mono
   ============================================================ */

/* ── Custom Properties ── */
:root {
  --rf-bg:          #eef0f2;
  --rf-surface:     #ffffff;
  --rf-card:        #f5f6f9;
  --rf-overlay:     #e9ebef;
  --rf-accent:      #3f7d9c;
  --rf-accent-mid:  #4b5fa8;
  --rf-accent-deep: #6a4f9e;
  --rf-text:        #1e2238;
  --rf-muted:       #5f6480;
  --rf-border:      #d6d8e0;
  --rf-link:        #3f7d9c;
  --rf-glow:        0 0 6px #3f7d9c44, 0 0 18px #3f7d9c1f;
  --rf-glow-mid:    0 0 6px #4b5fa844, 0 0 18px #4b5fa81f;
  --rf-card-shadow: 0 1px 3px rgba(30,34,56,0.10), 0 0 0 1px var(--rf-border);
  --rf-radius:      6px;

  /* MkDocs Material variable overrides */
  --md-default-bg-color:   #eef0f2;
  --md-default-fg-color:   #1e2238;
  --md-primary-fg-color:   #3f7d9c;
  --md-primary-bg-color:   #e7e9ee;
  --md-accent-fg-color:    #3f7d9c;
  --md-code-bg-color:      #f5f6f9;
  --md-code-fg-color:      #1e2238;
  --md-typeset-a-color:    #3f7d9c;
  --md-typeset-color:      #1e2238;
}

/* ── Body & base ── */
body {
  background: var(--rf-bg) !important;
  color: var(--rf-text) !important;
  font-family: 'Share Tech Mono', 'JetBrains Mono', monospace !important;
}

/* Scanlines removed — clean warm palette */

/* ── Header ── */
.ap-ops-return {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--rf-border);
  border-left: 3px solid var(--rf-accent-mid);
  border-radius: var(--rf-radius);
  background: rgba(255, 255, 255, 0.94);
  color: var(--rf-accent-mid) !important;
  box-shadow: var(--rf-card-shadow);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ap-ops-return:hover {
  color: var(--rf-accent) !important;
  border-left-color: var(--rf-accent);
}

/* ── Header ── */
.md-header {
  background: #e7e9ee !important;
  border-bottom: 1px solid var(--rf-border);
  box-shadow: none !important;
  color: var(--rf-text) !important;
}

.md-header__title,
.md-header__topic {
  color: var(--rf-text) !important;
  font-family: 'Share Tech Mono', monospace !important;
}

.md-header__button,
.md-header__button.md-icon {
  color: var(--rf-muted) !important;
}

.md-header__button:hover,
.md-header__button.md-icon:hover {
  color: var(--rf-accent) !important;
}

/* Hide hamburger — no sidebar to toggle */
.md-header__button[for="__drawer"] {
  display: none !important;
}

/* ── Hide MkDocs nav: top tabs + left sidebar + right TOC ── */
.md-tabs             { display: none !important; }
.md-sidebar--primary { display: none !important; }
.md-sidebar--secondary { display: none !important; }

/* Content fills full width with no sidebar offset */
.md-main__inner {
  margin-left: 0 !important;
}

/* ── Content area ── */
.md-content {
  background: transparent;
}

.md-content__inner {
  margin: 0 auto;
  max-width: 1280px;
  padding: 1.5rem 1.5rem 3rem;
}

/* ── Typography ── */
.md-typeset {
  color: var(--rf-text);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.7;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  color: var(--rf-text) !important;
  font-family: 'Share Tech Mono', monospace !important;
}

.md-typeset h1 {
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--rf-border) !important;
  padding-bottom: 0.4em;
  margin-bottom: 1.2em;
}

.md-typeset h2 {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--rf-border) !important;
}

.md-typeset h3 {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--rf-accent-mid) !important;
}

/* ── Interactive Checklist ── */
.md-typeset .task-list-item input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--rf-accent);
}

.md-typeset .task-list-item input[type="checkbox"]:checked + * {
  opacity: 0.5;
  text-decoration: line-through;
}

/* ── Internal Badge ── */
.internal-badge {
  display: inline-block;
  background: var(--rf-overlay);
  border: 1px solid var(--rf-border);
  border-left: 3px solid var(--rf-accent-mid);
  color: var(--rf-accent-mid);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.15rem 0.6rem;
  border-radius: 0 var(--rf-radius) var(--rf-radius) 0;
  margin-bottom: 1rem;
}

.md-typeset a {
  color: var(--rf-link);
  text-decoration: none;
  transition: color 0.15s;
}

.md-typeset a:hover {
  color: #5b9bb8;
}

/* ── Code ── */
.md-typeset code {
  background: var(--rf-card);
  color: var(--rf-text);
  border: 1px solid var(--rf-border);
  border-radius: 3px;
  font-size: 0.82em;
  padding: 0.1em 0.35em;
}

.md-typeset pre {
  background: var(--rf-card);
  border: 1px solid var(--rf-border);
  border-radius: var(--rf-radius);
}

.md-typeset pre code {
  background: transparent;
  border: none;
  padding: 0;
}

/* ── Tables ── */
.md-typeset table:not([class]) {
  border: 1px solid var(--rf-border);
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 0.82rem;
  box-shadow: var(--rf-card-shadow);
  border-radius: var(--rf-radius);
}

.md-typeset table:not([class]) th {
  background: var(--rf-overlay);
  color: var(--rf-text);
  border: 1px solid var(--rf-border);
  white-space: nowrap;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.md-typeset table:not([class]) td {
  border: 1px solid var(--rf-border);
  background: var(--rf-surface);
  color: var(--rf-text);
}

.md-typeset table:not([class]) tr:nth-child(even) td {
  background: var(--rf-card);
}

.md-typeset table:not([class]) tr:hover td {
  background: var(--rf-overlay);
}

/* ── Admonitions ── */
.admonition {
  border-left: 4px solid var(--rf-accent);
  background: var(--rf-card);
  border-radius: 0 var(--rf-radius) var(--rf-radius) 0;
}

.admonition.warning { border-left-color: var(--rf-accent-deep); }
.admonition.note    { border-left-color: var(--rf-accent-mid); }

/* ── Search ── */
.md-search__input {
  background: var(--rf-surface) !important;
  color: var(--rf-text) !important;
  border: 1px solid var(--rf-border) !important;
}

.md-search__input::placeholder { color: var(--rf-muted) !important; }

.md-search-result__article,
.md-search-result__link:hover {
  background: var(--rf-card) !important;
}

/* ── Footer ── */
.md-footer,
.md-footer-meta {
  background: #e7e9ee !important;
  border-top: 1px solid var(--rf-border);
  color: var(--rf-muted) !important;
}

.md-footer-copyright {
  color: var(--rf-muted) !important;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.md-footer-copyright a { color: var(--rf-accent-mid) !important; }

/* ============================================================
   GITHUB PROFILE WRAPPER — injected on every page
   ============================================================ */

.md-content__inner:has(.gh-profile-wrapper) {
  max-width: 1280px !important;
  padding: 2rem 1.5rem 3rem !important;
}

.gh-profile-wrapper {
  display: grid;
  grid-template-columns: 276px 1fr;
  gap: 2rem;
  width: 100%;
  font-family: 'Share Tech Mono', monospace;
  color: var(--rf-text);
  align-items: start;
}

/* ── SIDEBAR ── */
.gh-sidebar {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.gh-avatar-box {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--rf-border);
  box-shadow: 0 0 0 1px #3f7d9c33;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  background: var(--rf-surface);
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

/* Avatar scanlines removed — clean look */

.gh-fullname {
  font-size: 1.2rem !important;
  font-weight: 400 !important;
  color: var(--rf-text) !important;
  margin: 0 0 0.2rem !important;
  padding: 0 !important;
  border: none !important;
  line-height: 1.3 !important;
  letter-spacing: 0.04em !important;
}

.gh-login {
  font-size: 0.95rem;
  color: var(--rf-muted);
  margin: 0 0 0.75rem;
  line-height: 1.4;
}

.gh-bio {
  font-size: 0.82rem;
  color: var(--rf-text);
  margin: 0 0 1rem;
  line-height: 1.6;
  border-top: 1px solid var(--rf-border);
  padding-top: 0.75rem;
}

.gh-connect-btn {
  display: block;
  width: 100%;
  padding: 0.35rem 0.75rem;
  background: #e2e4ea;
  border: 1px solid var(--rf-border);
  color: var(--rf-text) !important;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  border-radius: var(--rf-radius);
  cursor: pointer;
  text-align: center;
  text-decoration: none !important;
  margin-bottom: 1.25rem;
  letter-spacing: 0.04em;
  transition: border-color 0.15s, background 0.15s;
  box-sizing: border-box;
}

.gh-connect-btn:hover {
  border-color: var(--rf-accent) !important;
  background: #d9dbe3 !important;
  color: var(--rf-text) !important;
  text-decoration: none !important;
}

/* Stats row */
.gh-stats-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rf-border);
}

.gh-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gh-stat-num {
  color: var(--rf-accent);
  font-size: 0.88rem;
  line-height: 1;
  text-shadow: var(--rf-glow);
}

.gh-stat-label {
  color: var(--rf-muted);
  font-size: 0.62rem;
  line-height: 1;
  letter-spacing: 0.04em;
}

/* Info list */
.gh-profile-wrapper .gh-info-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  padding-top: 0.75rem !important;
  border-top: 1px solid var(--rf-border);
}

.gh-profile-wrapper .gh-info-list li {
  font-size: 0.78rem;
  color: var(--rf-text);
  padding: 0.3rem 0 !important;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 !important;
  border: none;
  line-height: 1.5;
}

.gh-profile-wrapper .gh-info-list a {
  color: var(--rf-link) !important;
  text-decoration: none !important;
}

.gh-profile-wrapper .gh-info-list a:hover {
  color: #5b9bb8 !important;
  text-decoration: underline !important;
}

/* ── MAIN CONTENT ── */
.gh-main {
  min-width: 0;
}

/* Tabs nav — full-width sticky bar above the profile grid */
.gh-tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--rf-border);
  overflow-x: auto;
  scrollbar-width: none;
  /* Pull outside the padded .md-content__inner to span full width */
  margin: -1.5rem -1.5rem 1.5rem;
  padding: 0 1.5rem;
  /* Stick just below the MkDocs header when scrolling */
  position: sticky;
  top: var(--gh-header-offset, 2.4rem);
  z-index: 99;
  background: var(--rf-bg);
}

.gh-tabs-nav::-webkit-scrollbar { display: none; }

.gh-tab-item {
  padding: 0.55rem 1rem;
  font-size: 0.8rem;
  color: var(--rf-muted);
  text-decoration: none !important;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.15s;
  font-family: 'Share Tech Mono', monospace;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.04em;
}

.gh-tab-item:hover {
  color: var(--rf-text);
  text-decoration: none !important;
}

.gh-tab-item.active {
  color: var(--rf-text);
  border-bottom-color: var(--rf-accent);
}

/* Section header */
.gh-section-header {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--rf-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── PINNED CARDS ── */
.gh-pinned-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.875rem;
  margin-bottom: 2rem;
}

.gh-card {
  background: var(--rf-surface);
  border: 1px solid var(--rf-border);
  border-radius: var(--rf-radius);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: var(--rf-card-shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gh-card:hover {
  border-color: var(--rf-accent);
  box-shadow: 0 2px 12px rgba(63,125,156,0.16), 0 0 0 1px var(--rf-accent);
}

.gh-card-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.gh-card-icon {
  color: var(--rf-muted);
  font-size: 0.75rem;
}

.gh-card-name {
  font-size: 0.85rem !important;
  color: var(--rf-accent) !important;
  text-decoration: none !important;
  letter-spacing: 0.04em;
}

.gh-card-name:hover {
  text-decoration: underline !important;
  color: #5b9bb8 !important;
}

.gh-card-desc {
  font-size: 0.73rem;
  color: var(--rf-muted);
  line-height: 1.5;
  flex: 1;
  margin: 0;
}

.gh-card-footer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--rf-muted);
  margin-top: 0.25rem;
}

.gh-lang-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── CONTRIBUTION GRAPH ── */
.gh-contrib-section {
  margin-bottom: 1.25rem;
  background: var(--rf-surface);
  border: 1px solid var(--rf-border);
  border-radius: var(--rf-radius);
  padding: 1rem;
  box-shadow: var(--rf-card-shadow);
}

.gh-contrib-header {
  font-size: 0.8rem;
  color: var(--rf-text);
  margin-bottom: 0.75rem;
  letter-spacing: 0.04em;
}

.gh-contrib-outer {
  display: flex;
  align-items: flex-start;
}

.gh-day-labels {
  display: grid;
  grid-template-rows: repeat(7, 11px);
  gap: 2px;
  font-size: 9px;
  color: var(--rf-muted);
  text-align: right;
  padding-right: 6px;
  padding-top: 18px;
  flex-shrink: 0;
  font-family: 'Share Tech Mono', monospace;
}

.gh-graph-wrapper {
  overflow-x: auto;
  flex: 1;
}

.gh-month-labels {
  display: grid;
  gap: 2px;
  margin-bottom: 4px;
  height: 14px;
  font-size: 9px;
  color: var(--rf-muted);
  font-family: 'Share Tech Mono', monospace;
}

.gh-month-labels span {
  overflow: hidden;
  white-space: nowrap;
}

.gh-contrib-cells {
  display: grid;
  grid-auto-flow: column;
  gap: 2px;
}

.gh-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  cursor: default;
  transition: opacity 0.12s;
}

.gh-cell:hover {
  opacity: 0.75;
  outline: 1px solid rgba(30,34,56,0.3);
  outline-offset: 1px;
}

.gh-cell-empty {
  background: transparent !important;
  cursor: default;
}

.gh-contrib-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--rf-muted);
  margin-top: 0.75rem;
  justify-content: flex-end;
  font-family: 'Share Tech Mono', monospace;
}

.gh-legend-box {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── RECENT ACTIVITY ── */
.gh-activity-section {
  background: var(--rf-surface);
  border: 1px solid var(--rf-border);
  border-radius: var(--rf-radius);
  padding: 1rem;
  box-shadow: var(--rf-card-shadow);
}

.gh-profile-wrapper .gh-commits-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.gh-commit-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0 !important;
  border-bottom: 1px solid var(--rf-border);
  font-size: 0.76rem;
  margin: 0 !important;
}

.gh-commit-item:last-child { border-bottom: none; }

.gh-commit-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rf-accent);
  flex-shrink: 0;
}

.gh-commit-msg {
  color: var(--rf-text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gh-commit-time {
  color: var(--rf-muted);
  flex-shrink: 0;
  font-size: 0.7rem;
}

.gh-muted { color: var(--rf-muted); }

/* ── RESPONSIVE ── */
@media screen and (max-width: 960px) {
  .gh-profile-wrapper {
    grid-template-columns: 1fr;
  }

  .gh-sidebar {
    position: static;
  }

  .gh-avatar-box {
    width: 100px;
    max-width: 100px;
    font-size: 42px;
    aspect-ratio: 1;
  }

  .gh-pinned-grid {
    grid-template-columns: 1fr;
  }
}
