:root {
  color-scheme: dark;

  /* Soft dark palette — warm/cool charcoal, never pitch black */
  --bg: #191b20;
  --bg-elevated: #20232a;
  --bg-hover: #252932;

  --border: rgba(229, 231, 236, 0.08);
  --border-hover: rgba(229, 231, 236, 0.17);

  --text: #e5e7ec;
  --text-secondary: #9ca3b2;
  --text-muted: #6e7685;

  --accent: #93b4d8;
  --accent-soft: rgba(147, 180, 216, 0.12);
  --status: #82b89a;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius: 10px;
  --max-width: 700px;
  --transition: 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Barely-there atmospheric glow to soften the top edge */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    75% 45% at 50% 0%,
    rgba(147, 180, 216, 0.055) 0%,
    transparent 70%
  );
  z-index: 0;
}

::selection {
  background-color: rgba(147, 180, 216, 0.24);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  padding: 8px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.875rem;
  z-index: 100;
}

.skip-link:focus {
  left: 16px;
}

.page {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 72px;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.brand:hover {
  color: var(--text);
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background-color: var(--accent);
  opacity: 0.85;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.site-nav a:hover {
  color: var(--text);
}

/* Hero */
.hero {
  margin-bottom: 84px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--status);
  box-shadow: 0 0 0 3px rgba(130, 184, 154, 0.14);
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2.25rem, 5vw, 2.85rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--text);
}

.lead {
  margin: 0;
  max-width: 540px;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition);
}

.btn-primary {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  color: var(--text);
}

.btn-primary:hover {
  background-color: var(--bg-hover);
  border-color: rgba(229, 231, 236, 0.28);
}

.btn-ghost {
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding-inline: 12px;
}

.btn-ghost:hover {
  color: var(--text);
  background-color: rgba(229, 231, 236, 0.04);
}

.arrow,
.arrow-down {
  display: inline-block;
  font-size: 0.85em;
  color: var(--text-muted);
  transition: transform var(--transition), color var(--transition);
}

.btn:hover .arrow,
.link-row:hover .arrow,
.repo-card:hover .arrow {
  transform: translate(2px, -2px);
  color: var(--accent);
}

.btn:hover .arrow-down {
  transform: translateY(2px);
  color: var(--text-secondary);
}

/* Sections */
.section {
  margin-bottom: 76px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.section-link {
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.section-link:hover {
  color: var(--accent);
}

.section-copy {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.7;
}

.inline-link {
  color: var(--text);
  border-bottom: 1px solid var(--border-hover);
  transition: border-color var(--transition), color var(--transition);
}

.inline-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Metadata grid in About */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 0;
  padding: 16px 18px;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.meta-item dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.meta-item dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Repositories list */
.repo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.repo-card {
  display: block;
  padding: 18px 20px;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition:
    background-color var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.repo-card:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.repo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.repo-name-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.repo-name {
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repo-badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background-color: rgba(229, 231, 236, 0.05);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.repo-desc {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.repo-desc.is-empty {
  color: var(--text-muted);
  font-style: italic;
}

.repo-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
}

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

.lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent);
}

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

/* Skeleton loading state */
.repo-skeleton {
  pointer-events: none;
}

.skeleton-line {
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    rgba(229, 231, 236, 0.05) 25%,
    rgba(229, 231, 236, 0.09) 50%,
    rgba(229, 231, 236, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite linear;
}

.skeleton-title {
  width: 34%;
  height: 16px;
  margin-bottom: 12px;
}

.skeleton-desc {
  width: 82%;
  height: 13px;
  margin-bottom: 14px;
}

.skeleton-meta {
  width: 45%;
  height: 11px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Connect link list */
.link-list {
  margin-top: 20px;
  border-top: 1px solid var(--border);
}

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  transition: border-color var(--transition), padding-inline var(--transition);
}

.link-row:hover {
  border-bottom-color: var(--border-hover);
  padding-inline: 6px;
}

.link-label {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}

.link-value {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Footer */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Subtle entrance animation */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.reveal:nth-child(2) {
  animation-delay: 60ms;
}

.reveal:nth-child(3) {
  animation-delay: 120ms;
}

.reveal:nth-child(4) {
  animation-delay: 180ms;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 600px) {
  .page {
    padding: 28px 18px 56px;
  }

  .site-header {
    margin-bottom: 52px;
  }

  .site-nav {
    gap: 16px;
  }

  .hero {
    margin-bottom: 64px;
  }

  .section {
    margin-bottom: 56px;
  }

  .meta-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .repo-card {
    padding: 16px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .skeleton-line {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
