/* SEAP-UdeA — GitHub-inspired layout */

:root {
  --bg: #ffffff;
  --bg-muted: #f6f8fa;
  --bg-sidebar: #f6f8fa;
  --border: #d0d7de;
  --border-muted: #d8dee4;
  --text: #1f2328;
  --text-muted: #656d76;
  --text-subtle: #8c959f;
  --link: #0969da;
  --link-hover: #0550ae;
  --accent: #1f883d;
  --accent-bg: #dafbe1;
  --header-bg: #000000;
  --header-text: #ffffff;
  --header-muted: #c9d1d9;
  --shadow: 0 1px 0 rgba(31, 35, 40, 0.04);
  --radius: 6px;
  --radius-lg: 12px;
  --sidebar-width: 296px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --max-width: 1280px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

/* —— Header —— */
.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  border-bottom: 1px solid #000000;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid #57606a;
  color: var(--header-text);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.brand {
  display: flex;
  align-items: center;
  color: var(--header-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  line-height: 0;
}

.brand:hover {
  color: var(--header-text);
  text-decoration: none;
  opacity: 0.92;
}

.brand-logo {
  height: 44px;
  width: auto;
  max-width: min(420px, 72vw);
  display: block;
  object-fit: contain;
}

.header-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

.header-nav a {
  color: var(--header-muted);
  padding: 6px 10px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
}

.header-nav a:hover {
  color: var(--header-text);
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

/* —— Layout —— */
.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* —— Sidebar —— */
.sidebar {
  position: sticky;
  top: 72px;
}

.profile-card {
  padding-bottom: 16px;
}

.sidebar-logo {
  width: 100%;
  max-width: 296px;
  height: auto;
  display: block;
  background: transparent;
}

.profile-name {
  margin: 16px 0 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

.profile-login {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.25;
}

.profile-bio {
  margin: 0 0 16px;
  font-size: 16px;
  color: var(--text);
}

.profile-meta {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
}

.profile-meta li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.profile-meta svg {
  flex-shrink: 0;
  margin-top: 2px;
  fill: currentColor;
}

.profile-meta a {
  color: var(--text);
}

.profile-meta a:hover {
  color: var(--link);
}

.sidebar-nav {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 8px;
}

.sidebar-nav h2 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav a {
  display: block;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--bg-muted);
  text-decoration: none;
}

.sidebar-nav a.active {
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}

.stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-muted);
}

.stats strong {
  color: var(--text);
  font-weight: 600;
}

/* —— Main —— */
.main {
  min-width: 0;
}

.section {
  margin-bottom: 32px;
  scroll-margin-top: 80px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.section-header .count {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 14px;
}

.about-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.about-box h1 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
}

.about-box .lead {
  margin: 0 0 16px;
  font-size: 16px;
  color: var(--text-muted);
}

.about-box p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text);
}

.about-box p:last-child {
  margin-bottom: 0;
}

.research-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: #ddf4ff;
  color: #0969da;
  border: 1px solid transparent;
}

/* —— Repo cards (GitHub pinned style) —— */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.repo-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 168px;
  transition: border-color 0.15s ease;
}

.repo-card:hover {
  border-color: #afb8c1;
}

.repo-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.repo-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--text-muted);
}

.repo-name {
  font-weight: 600;
  font-size: 14px;
  word-break: break-word;
}

.repo-badge {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 7px;
  line-height: 18px;
}

.repo-gallery {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: #1a7f37;
  background: #dafbe1;
  border: 1px solid #4ac26b66;
  border-radius: 999px;
  padding: 0 7px;
  line-height: 18px;
  text-decoration: none;
}

.repo-gallery:hover {
  text-decoration: none;
  background: #aceebb;
  border-color: #1a7f37;
}

.repo-site {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: #9a6700;
  background: #fff8c5;
  border: 1px solid #d4a72c66;
  border-radius: 999px;
  padding: 0 7px;
  line-height: 18px;
  text-decoration: none;
}

.repo-site:hover {
  text-decoration: none;
  background: #fae17d;
  border-color: #9a6700;
}

.repo-badges {
  margin-left: auto;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.repo-type {
  flex-shrink: 0;
  font-size: 12px;
  color: #0969da;
  background: #ddf4ff;
  border-radius: 999px;
  padding: 0 7px;
  line-height: 18px;
  text-transform: lowercase;
}

.repo-fork-line {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.repo-pypi {
  font-weight: 600;
}

.section-intro {
  margin: 0 0 16px;
  color: var(--text-muted);
}

.section-intro code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.app-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
}

.app-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.app-desc {
  margin: 0;
  flex: 1;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.app-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.app-link {
  font-weight: 600;
  font-size: 13px;
}

.section-footer-link {
  margin: 16px 0 0;
  text-align: right;
}

.papers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.paper-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--bg);
}

.paper-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.paper-meta,
.paper-repos {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.paper-repos {
  margin-top: 8px;
}

.paper-repo {
  margin-right: 8px;
}

.repo-desc {
  margin: 0;
  flex: 1;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.repo-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: auto;
}

.repo-updated {
  display: inline-flex;
  align-items: center;
}

.repo-loading {
  margin: 0;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lang-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.repo-meta svg {
  vertical-align: text-bottom;
  fill: currentColor;
}

/* —— Lead developer —— */
.developer-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.developer-photo {
  width: 100%;
  max-width: 180px;
  height: auto;
  aspect-ratio: 1067 / 1600;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-muted);
}

.developer-name {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
}

.developer-role {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.developer-lead {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--text);
}

.developer-body p {
  margin: 0 0 12px;
  color: var(--text);
}

.developer-body p:last-of-type {
  margin-bottom: 16px;
}

.developer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 14px;
}

@media (max-width: 700px) {
  .developer-card {
    grid-template-columns: 1fr;
  }

  .developer-photo {
    max-width: 140px;
  }
}

.paper-kind {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #1a7f37);
  background: rgba(26, 127, 55, 0.08);
  border: 1px solid rgba(26, 127, 55, 0.25);
  border-radius: 999px;
  padding: 0 7px;
  line-height: 18px;
}

.subsection-title {
  margin: 20px 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.repo-emoji {
  font-size: 16px;
  line-height: 1;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.repo-type-emoji {
  margin-right: 2px;
}

/* —— Contributors —— */
.contrib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.contrib-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

a.contrib-card:hover {
  border-color: #afb8c1;
  background: var(--bg-muted);
  text-decoration: none;
}

.contrib-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.contrib-identity:hover {
  text-decoration: none;
}

.contrib-forks {
  flex: 1 1 100%;
  margin-top: 2px;
  padding-left: 52px;
  white-space: normal;
  line-height: 1.4;
}

.contrib-forks a {
  font-weight: 500;
}

.contrib-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.contrib-info {
  min-width: 0;
}

.contrib-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contrib-login {
  font-size: 12px;
  color: var(--text-muted);
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-muted);
  margin-top: 16px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.footer-block h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.footer-block p,
.footer-block a {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--text-muted);
}

.footer-block a:hover {
  color: var(--link);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px 24px;
  font-size: 12px;
  color: var(--text-subtle);
}

/* —— Gallery page —— */
.gallery-page .gallery-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px 48px;
  min-height: 50vh;
}

.gallery-status {
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.gallery-status.is-error {
  color: #cf222e;
  background: #ffebe9;
  border: 1px solid #ffcecb;
  border-radius: var(--radius);
  padding: 12px 14px;
}

.gallery-hero {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.gallery-eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.gallery-repo-name {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.gallery-abstract {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: justify;
  text-justify: inter-word;
}

.gallery-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.gallery-meta {
  margin: 0;
  font-size: 13px;
  color: var(--text-subtle);
}

.gallery-path {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border-muted);
  border-radius: 4px;
  padding: 1px 6px;
}

.gallery-section-heading {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.gallery-preview {
  margin-bottom: 36px;
}

.gallery-preview-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.gallery-nav-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.gallery-nav-btn:hover {
  background: var(--bg-muted);
  border-color: #afb8c1;
}

.gallery-counter {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 4.5em;
}

.gallery-hint {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-subtle);
}

.gallery-preview-stage {
  position: relative;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 240px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.gallery-preview-stage > img {
  max-height: min(62vh, 640px);
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  background: #fff;
}

.gallery-preview-stage.is-fit-width {
  padding-left: 0;
  padding-right: 0;
  background: transparent;
  border-color: transparent;
}

.gallery-preview-stage.is-fit-width > img {
  width: 100%;
  max-width: 100%;
  max-height: none;
  height: auto;
  border-radius: 0;
}

.gallery-preview-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.gallery-action-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.gallery-action-btn:hover {
  background: var(--bg-muted);
  border-color: #afb8c1;
}

.gallery-action-btn.is-active {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

.gallery-preview-name {
  margin: 0;
  max-width: 100%;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.gallery-preview-name a,
.gallery-fs-caption a,
.gallery-lightbox-caption a,
.gallery-grid-name a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.gallery-filmstrip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 2px 4px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.gallery-filmstrip-item {
  flex: 0 0 auto;
  width: 88px;
  height: 66px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--bg-muted);
  cursor: pointer;
  overflow: hidden;
  scroll-snap-align: center;
}

.gallery-filmstrip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-filmstrip-item.is-active,
.gallery-grid-item.is-active {
  border-color: var(--link);
}

.gallery-filmstrip-item:hover,
.gallery-grid-item:hover {
  border-color: #afb8c1;
}

.gallery-grid-section {
  margin-top: 8px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(var(--gallery-cols, 4), minmax(0, 1fr));
  gap: 14px;
}

.gallery-grid-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  text-align: left;
  min-width: 0;
}

.gallery-grid-thumb {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-muted);
}

.gallery-grid-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-grid-name {
  display: block;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(1, 4, 9, 0.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 24px;
  gap: 12px;
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox img {
  max-width: min(96vw, 1200px);
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: var(--radius);
  background: #fff;
}

.gallery-lightbox-caption {
  margin: 0;
  max-width: 90vw;
  color: #f0f6fc;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.gallery-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

body.gallery-lightbox-open {
  overflow: hidden;
}

/* —— Fullscreen gallery viewer —— */
.gallery-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: #0d1117;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gallery-fullscreen[hidden] {
  display: none;
}

.gallery-fs-chrome {
  position: relative;
  flex: 0 0 auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 56px 10px 16px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
}

.gallery-fs-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background: #0d1117;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.gallery-fs-image {
  height: 100%;
  width: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #0d1117;
  display: block;
}

.gallery-fs-nav {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(240, 246, 252, 0.35);
  border-radius: var(--radius);
  background: rgba(22, 27, 34, 0.85);
  color: #f0f6fc;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.gallery-fs-nav:hover {
  background: rgba(48, 54, 61, 0.95);
}

.gallery-fs-counter {
  min-width: 5em;
  text-align: center;
  color: #f0f6fc;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.gallery-fs-close {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.gallery-fs-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.gallery-fs-caption {
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 20px;
  text-align: center;
  color: #f0f6fc;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #161b22;
  border-top: 1px solid #30363d;
}

.gallery-fs-caption a,
.gallery-lightbox-caption a {
  color: #58a6ff;
  text-decoration: none;
}

.gallery-preview-name a,
.gallery-grid-name a {
  color: var(--link);
  text-decoration: none;
}

.gallery-fs-caption a:hover,
.gallery-lightbox-caption a:hover,
.gallery-preview-name a:hover,
.gallery-grid-name a:hover {
  text-decoration: underline;
}

body.gallery-fs-open {
  overflow: hidden;
}

@media (max-width: 700px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-repo-name {
    font-size: 22px;
  }

  .gallery-hint {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* —— Utilities —— */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* —— Responsive —— */
@media (max-width: 900px) {
  .page {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sidebar {
    position: static;
  }

  .sidebar-logo {
    width: 160px;
    max-width: 160px;
  }

  .profile-card {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 16px;
    align-items: start;
  }

  .profile-details {
    grid-column: 2;
  }

  .sidebar-nav,
  .stats {
    grid-column: 1 / -1;
  }

  .profile-name {
    margin-top: 0;
    font-size: 20px;
  }

  .profile-login {
    font-size: 16px;
  }

  .repo-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .header-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    margin-left: 0;
  }

  .header-nav.is-open {
    display: flex;
  }

  .header-inner {
    flex-wrap: wrap;
  }
}

@media (max-width: 520px) {
  .profile-card {
    grid-template-columns: 1fr;
  }

  .sidebar-logo {
    width: 200px;
    max-width: 70%;
  }

  .profile-details {
    grid-column: 1;
  }
}
