/* ═══════════════════════════════════════════════════════════════
   GitHub Profile Explorer — Editorial Terminal Aesthetic
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500&family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700&family=Fraunces:ital,opsz,wght@0,9..144,700;0,9..144,800;0,9..144,900;1,9..144,700&display=swap');

html:not([data-language]) body {
  visibility: hidden;
}

:root {
  color-scheme: dark;
  --font-sans: 'Instrument Sans', -apple-system, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'DM Mono', 'Fira Code', monospace;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4rem;

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 24px rgba(167,139,250,0.1);

  --text-xs: 0.7rem;
  --text-sm: 0.825rem;
  --text-base: 0.95rem;
  --text-lg: 1.05rem;
  --text-xl: clamp(1.3rem, 2vw, 1.6rem);
  --text-2xl: clamp(2.2rem, 5vw, 4rem);

  --bg: #09090b;
  --bg-muted: #0c0c0f;
  --surface: rgba(14,14,18,0.94);
  --surface-strong: #131316;
  --surface-soft: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.05);
  --text: #e4e4e7;
  --text-muted: #71717a;
  --accent: #a78bfa;
  --accent-strong: #7c3aed;
  --accent-soft: rgba(167,139,250,0.08);
  --success: #34d399;
  --danger: #f87171;

  --noise-opacity: 0.025;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fafaf9;
  --bg-muted: #f5f5f4;
  --surface: rgba(255,255,255,0.97);
  --surface-strong: #ffffff;
  --surface-soft: rgba(0,0,0,0.025);
  --border: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.05);
  --text: #1c1917;
  --text-muted: #78716c;
  --accent: #7c3aed;
  --accent-strong: #6d28d9;
  --accent-soft: rgba(124,58,237,0.06);
  --success: #059669;
  --danger: #dc2626;
  --noise-opacity: 0.012;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-glow: 0 0 20px rgba(124,58,237,0.05);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Noise texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* Ambient gradient glow */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 600px 400px at 15% 5%, rgba(167,139,250,0.06), transparent),
    radial-gradient(ellipse 500px 350px at 85% 8%, rgba(124,58,237,0.04), transparent),
    radial-gradient(ellipse 800px 600px at 50% 100%, rgba(167,139,250,0.02), transparent);
}

img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.5; }
a { color: inherit; }

/* ── Accessibility ── */
.skip-link {
  position: fixed;
  top: 1rem; left: 1rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #000;
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-sm);
  transform: translateY(-180%);
  transition: transform 180ms ease;
}
.skip-link:focus { transform: translateY(0); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Layout Shell ── */
.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

#main-content { scroll-margin-top: 5rem; }

.container {
  width: min(100% - 2.5rem, 72rem);
  margin: 0 auto;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.85rem 0;
  backdrop-filter: blur(16px) saturate(1.5);
  background: rgba(9,9,11,0.85);
  border-bottom: 1px solid var(--border);
}

:root[data-theme="light"] .site-header {
  background: rgba(250,250,249,0.9);
}

.header-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.header-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex: 1 1 auto;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 0.6rem;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(167,139,250,0.2);
  transition: box-shadow 300ms ease;
}

.brand-mark:hover {
  box-shadow: 0 0 24px rgba(167,139,250,0.35);
}

.brand-mark svg {
  width: 1.3rem;
  fill: #fff;
}

:root[data-theme="light"] .brand-mark svg {
  fill: #fff;
}

.brand-eyebrow, .section-kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

.brand h1, .hero h2, .recent-header h3 { margin: 0; }

.brand h1 {
  font-family: var(--font-sans);
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.5rem;
  padding: 0 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all 180ms ease;
  letter-spacing: -0.01em;
}

.header-menu-toggle__icon {
  font-size: 1rem;
  line-height: 1;
}

.header-menu-toggle__text {
  white-space: nowrap;
}

/* ── Buttons ── */
.theme-toggle,
.ghost-button,
.primary-button,
.text-button,
.language-switcher__select,
.icon-button,
.recent-chip,
.bookmark-button {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all 180ms ease;
  letter-spacing: -0.01em;
}

.theme-toggle,
.ghost-button,
.primary-button,
.language-switcher__select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0 0.85rem;
  text-decoration: none;
}

.header-menu-toggle {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px rgba(167,139,250,0.2);
}

.text-button {
  min-height: 1.75rem;
  padding: 0 0.6rem;
  background: transparent;
  font-size: var(--text-xs);
}

.language-switcher {
  display: inline-flex;
  align-items: center;
}

.language-switcher__label {
  display: none;
}

.language-switcher__select {
  min-height: 2.5rem;
  min-width: 4.5rem;
  padding: 0 0.85rem;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  appearance: none;
}

.icon-button {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.25rem;
  line-height: 1;
  display: grid;
  place-items: center;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(167,139,250,0.15);
}

:root[data-theme="light"] .primary-button {
  color: #fff;
}

.primary-button:hover {
  box-shadow: 0 0 20px rgba(167,139,250,0.3);
  transform: translateY(-1px);
}

.rate-badge {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

/* ── Hero ── */
.hero, .status-section, .results-section {
  padding: var(--space-5) 0;
}

.hero-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1.15fr 1fr;
  align-items: start;
}

.hero-copy {
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-4);
}

.hero h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-weight: 800;
  max-width: 11ch;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 60%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-text {
  max-width: 48ch;
  font-size: var(--text-base);
  color: var(--text-muted);
  line-height: 1.7;
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hero-pill, .shortcut-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  transition: border-color 200ms ease, color 200ms ease;
}

.hero-pill:hover, .shortcut-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Search Panel ── */
.search-panel,
.status-card,
.token-modal__content {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.search-panel {
  position: relative;
  overflow: hidden;
  padding: var(--space-3);
}

/* Accent line at top */
.search-panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.4;
}

.search-panel > * {
  position: relative;
  z-index: 1;
}

.search-form {
  display: grid;
  gap: var(--space-2);
}

.compare-panel {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.compare-form {
  display: grid;
  gap: var(--space-2);
}

.compare-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compare-field {
  display: grid;
  gap: 0.4rem;
}

.compare-submit {
  justify-self: start;
}

.search-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-1);
}

.search-input {
  min-height: 2.75rem;
  padding: 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  outline: none;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.search-input--compact {
  min-height: 2.5rem;
}

.search-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-glow);
}

.search-input:focus,
.header-menu-toggle:focus-visible,
.theme-toggle:focus-visible,
.ghost-button:focus-visible,
.primary-button:focus-visible,
.text-button:focus-visible,
.language-switcher__select:focus-visible,
.icon-button:focus-visible,
.recent-chip:focus-visible,
.bookmark-button:focus-visible,
.repo-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.search-input:focus {
  outline: none;
}

.search-hint, .recent-empty, .footer-grid, .token-modal p {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.shortcut-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.shortcut-pill kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.4rem;
  padding: 0 0.35rem;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 0.25rem;
  background: var(--bg);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
}

.compare-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.compare-hint code,
.profile-empty__code {
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

/* ── Collections (Recent + Bookmarks) ── */
.search-panel__collections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.recent-panel {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.search-panel__collections .recent-panel {
  min-height: 100%;
  margin-top: 0;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.search-panel__collections .recent-list {
  align-content: flex-start;
}

.recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.recent-header h3 {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 2rem;
}

.recent-chip {
  min-height: 2rem;
  padding: 0 0.65rem;
  font-size: 0.75rem;
}

.recent-list--bookmarks {
  gap: 0.5rem;
}

.recent-chip--bookmark::before {
  content: "★";
  margin-right: 0.3rem;
  color: var(--accent);
  font-size: 0.7rem;
}

/* ── Status Card ── */
.status-card {
  position: relative;
  overflow: hidden;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.status-card::before {
  content: "// status";
  display: block;
  margin-bottom: 0.3rem;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.status-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--border);
}

.status-card[data-state="loading"] {
  border-color: rgba(167,139,250,0.25);
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
}

.status-card[data-state="loading"]::after {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(167,139,250,0.4);
}

.status-card[data-state="success"] {
  border-color: rgba(167,139,250,0.2);
}

.status-card[data-state="success"]::after {
  background: var(--success);
  box-shadow: 0 0 8px rgba(167,139,250,0.3);
}

.status-card[data-state="error"] {
  border-color: rgba(244,112,103,0.25);
  color: var(--danger);
}

.status-card[data-state="error"]::after {
  background: var(--danger);
}

/* ── Results ── */
.results-section { padding-top: 0; }

.profile-region {
  display: grid;
  gap: var(--space-3);
}

.results-stack {
  display: grid;
  gap: var(--space-3);
}

/* ── Profile Card ── */
.profile-empty, .profile-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

/* Top accent line for cards */
.profile-empty::before,
.profile-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.3;
}

.profile-empty { padding: var(--space-4); }

.profile-empty--error {
  border-color: rgba(244,112,103,0.25);
}

.profile-empty--error::before {
  background: linear-gradient(90deg, transparent, var(--danger), transparent);
}

.profile-empty__eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
}

.profile-empty__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  line-height: 1.15;
  font-weight: 700;
}

.profile-empty__text {
  margin: 0;
  max-width: 58ch;
  color: var(--text-muted);
  line-height: 1.7;
}

.profile-empty__examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: var(--space-2);
}

.profile-empty__example-label {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.profile-card {
  padding: var(--space-4);
  display: grid;
  gap: var(--space-3);
}

.profile-card__header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
}

.profile-card__avatar {
  width: 7rem;
  height: 7rem;
  border-radius: 0.75rem;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  object-fit: cover;
  background: var(--surface-strong);
  transition: border-color 200ms ease;
}

.profile-card__avatar:hover {
  border-color: var(--accent);
}

.profile-card__intro {
  display: grid;
  gap: 0.6rem;
  min-width: 0;
}

.profile-card__title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.profile-card__title-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.profile-card__title-block { min-width: 0; }

.profile-card__name,
.profile-card__login,
.profile-card__bio,
.profile-card__joined-label,
.profile-card__joined-date,
.stat-card__label,
.stat-card__value { margin: 0; }

.profile-card__name {
  font-family: var(--font-sans);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.profile-card__login {
  margin-top: 0.15rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
}

.profile-card__badge {
  align-self: start;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(167,139,250,0.1);
  border: 1px solid rgba(167,139,250,0.2);
  color: var(--success);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.profile-card__bio {
  max-width: 62ch;
  color: var(--text-muted);
  font-size: var(--text-base);
  line-height: 1.6;
}

.bookmark-button {
  min-height: 2.25rem;
  padding: 0 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
}

.bookmark-button__icon {
  width: 0.85rem; height: 0.85rem;
  display: inline-grid;
  place-items: center;
  color: var(--text-muted);
}

.bookmark-button__icon svg {
  width: 0.85rem;
  fill: currentColor;
}

.bookmark-button.is-active {
  border-color: rgba(167,139,250,0.3);
  background: var(--accent-soft);
  color: var(--accent);
}

.bookmark-button.is-active .bookmark-button__icon {
  color: var(--accent);
}

/* ── Meta Items ── */
.profile-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: inherit;
  text-decoration: none;
  transition: all 180ms ease;
}

.meta-item:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.meta-item__icon {
  width: 2rem; height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 0.4rem;
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
}

.meta-item__icon svg {
  width: 1rem;
  fill: currentColor;
}

.meta-item__content { min-width: 0; }

.meta-item__label {
  display: block;
  margin-bottom: 0.1rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

.meta-item__value {
  display: block;
  overflow-wrap: anywhere;
  font-weight: 600;
  font-size: var(--text-sm);
}

/* ── Stat Cards ── */
.profile-card__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.stat-card {
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.15;
}

.stat-card__value {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stat-card__label {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ── Profile Footer ── */
.profile-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}

.profile-card__joined {
  display: grid;
  gap: 0.15rem;
}

.profile-card__joined-label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
}

.profile-card__joined-date {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.profile-card__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.profile-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* ── Language Stats ── */
.language-stats {
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.language-stats::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.2;
}

.language-stats--warning {
  border-color: rgba(244,112,103,0.2);
}

.language-stats__eyebrow,
.compare-layout__eyebrow,
.compare-column__eyebrow {
  margin: 0 0 0.3rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
}

.language-stats__title,
.language-stats__description,
.language-stats__empty,
.language-stats__legend-label,
.language-stats__legend-value,
.compare-layout__title,
.compare-layout__text,
.compare-column__title,
.compare-column__subtitle { margin: 0; }

.language-stats__title,
.compare-layout__title {
  font-family: var(--font-sans);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.language-stats__description,
.language-stats__empty,
.compare-layout__text,
.compare-column__subtitle {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.language-stats__description { margin-top: 0.25rem; }

.language-stats__bar {
  display: flex;
  width: 100%;
  height: 0.5rem;
  margin-top: var(--space-3);
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
  gap: 1px;
}

.language-stats__segment {
  min-width: 0.4rem;
  border-radius: 999px;
  transition: opacity 200ms ease;
}

.language-stats__segment:hover { opacity: 0.75; }

.language-stats__legend {
  display: grid;
  gap: 0.5rem;
  margin-top: var(--space-2);
}

.language-stats__legend-item,
.language-stats__legend-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.language-stats__legend-info {
  justify-content: flex-start;
}

.language-stats__legend-dot {
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.language-stats__legend-label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.language-stats__legend-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ── Compare Layout ── */
.compare-layout {
  display: grid;
  gap: var(--space-3);
}

.compare-layout__header,
.compare-column {
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.compare-layout__header::before,
.compare-column::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.2;
}

.compare-layout__text {
  max-width: 70ch;
  margin-top: 0.35rem;
}

.compare-layout__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.compare-column {
  display: grid;
  gap: var(--space-3);
}

.compare-column__title {
  font-size: 1.2rem;
  line-height: 1.15;
  font-weight: 700;
}

.compare-column__subtitle { margin-top: 0.15rem; }

/* ── Repository Explorer ── */
.repo-explorer {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.repo-explorer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.2;
}

.repo-explorer__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.repo-explorer__copy {
  display: grid;
  gap: 0.35rem;
}

.repo-explorer__eyebrow,
.repo-control__label {
  margin: 0;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
}

.repo-explorer__title,
.repo-explorer__summary,
.repo-empty__title,
.repo-empty__text,
.repo-explorer__note,
.repo-card__description,
.repo-card__updated { margin: 0; }

.repo-explorer__title {
  font-family: var(--font-sans);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.repo-explorer__summary,
.repo-explorer__note,
.repo-empty__text,
.repo-card__description,
.repo-card__updated {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.repo-explorer__controls {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.repo-control {
  display: grid;
  gap: 0.4rem;
  min-width: 12rem;
}

.repo-select {
  min-height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.repo-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.repo-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  transition: all 200ms ease;
}

.repo-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 200ms ease;
}

.repo-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm), var(--shadow-glow);
}

.repo-card:hover::before {
  opacity: 0.5;
}

.repo-card__title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.5rem;
}

.repo-card__name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 150ms ease;
}

.repo-card__name:hover { color: var(--accent); }

.repo-card__pill {
  flex-shrink: 0;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid rgba(167,139,250,0.15);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.repo-card__description {
  min-height: 2.5rem;
  line-height: 1.5;
  font-size: var(--text-sm);
}

.repo-card__meta,
.repo-card__footer,
.repo-card__stats-inline,
.repo-card__stat,
.repo-language {
  display: flex;
  align-items: center;
}

.repo-card__meta, .repo-card__footer {
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.repo-card__stats-inline {
  gap: 0.65rem;
  color: var(--text-muted);
}

.repo-card__stat {
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.repo-card__stat-icon {
  width: 0.85rem; height: 0.85rem;
  display: inline-grid;
  place-items: center;
  color: var(--text-muted);
}

.repo-card__stat-icon svg {
  width: 0.85rem;
  fill: currentColor;
}

.repo-language {
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
}

.repo-language__dot {
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  background: var(--language-color, var(--text-muted));
  box-shadow: 0 0 0 2px rgba(255,255,255,0.05);
}

.repo-card__link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 150ms ease;
}

.repo-card__link:hover { opacity: 0.75; }

.repo-explorer__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}

.repo-load-more { min-width: 10rem; }

.repo-empty {
  padding: 1.2rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.repo-empty--error {
  border-color: rgba(244,112,103,0.3);
}

.repo-empty__title {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* ── Skeleton Loading ── */
.profile-card--skeleton .skeleton,
.repo-explorer--skeleton .skeleton,
.repo-card--skeleton .skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.profile-card--skeleton .skeleton::after,
.repo-explorer--skeleton .skeleton::after,
.repo-card--skeleton .skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(167,139,250,0.04), transparent);
  animation: shimmer 1.5s infinite;
}

.skeleton-avatar {
  width: 7rem; height: 7rem;
  border-radius: 0.75rem;
}

.skeleton-line { height: 0.85rem; }
.skeleton-line--lg { width: min(18rem, 90%); height: 1.4rem; }
.skeleton-line--md { width: 50%; }
.skeleton-line--sm { width: 30%; }
.skeleton-meta, .skeleton-stat { min-height: 4.5rem; }
.skeleton-button { width: 10rem; height: 2.5rem; border-radius: var(--radius-sm); }
.skeleton-select { width: 12rem; height: 2.5rem; border-radius: var(--radius-sm); }
.skeleton-language-bar { width: 100%; height: 0.5rem; border-radius: 999px; }

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Footer ── */
.site-main { flex: 1; overflow: hidden; }

.site-footer {
  padding: var(--space-4) 0 var(--space-5);
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  flex-wrap: wrap;
}

.footer-grid p { margin: 0; }

.footer-meta {
  margin: 0;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.footer-link {
  color: var(--text);
  text-decoration: none;
  transition: color 180ms ease, opacity 180ms ease;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--accent);
}

.footer-link--muted {
  color: var(--text-muted);
}

.brand {
  text-decoration: none;
}

/* Legal Pages */
.legal-main {
  padding: var(--space-5) 0;
}

.legal-card {
  position: relative;
  overflow: hidden;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.legal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.35;
}

.legal-header,
.legal-content,
.legal-section {
  display: grid;
  gap: var(--space-2);
}

.legal-header {
  margin-bottom: var(--space-4);
}

.legal-kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.legal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.legal-lead,
.legal-meta,
.legal-section p,
.legal-list {
  margin: 0;
  color: var(--text-muted);
}

.legal-meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.legal-section {
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.legal-section h2 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.legal-list {
  padding-left: 1.25rem;
}

.legal-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

/* ── Token Modal ── */
.token-modal {
  width: min(100% - 2rem, 30rem);
  padding: 0;
  border: 0;
  background: transparent;
}

.token-modal::backdrop {
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
}

.token-modal__content {
  padding: var(--space-3);
  position: relative;
  overflow: hidden;
}

.token-modal__content::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.4;
}

.token-modal__content h2 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 700;
}

.token-form {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.token-modal__note,
.token-modal__status { margin: 0; }

.token-modal__note {
  font-size: var(--text-sm);
}

.token-modal__helper {
  display: grid;
  gap: 0.65rem;
  margin-top: var(--space-2);
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-soft) 92%, white 8%), transparent 70%),
    var(--surface-soft);
}

.token-modal__helper-title,
.token-modal__helper-text,
.token-modal__helper-list {
  margin: 0;
}

.token-modal__helper-title {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.token-modal__helper-text,
.token-modal__helper-list {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.token-modal__helper-list {
  padding-left: 1.1rem;
}

.token-modal__helper-list li + li {
  margin-top: 0.35rem;
}

.token-modal__helper-link {
  justify-self: flex-start;
  text-decoration: none;
}

.token-modal__note code {
  padding: 0.1rem 0.3rem;
  border-radius: 0.2rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
}

.token-modal__status {
  min-height: 1.4rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.token-modal__status[data-state="success"] { color: var(--success); }
.token-modal__status[data-state="error"] { color: var(--danger); }

.token-modal__header,
.token-modal__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.token-modal__header { margin-bottom: var(--space-2); }

.token-modal__actions {
  margin-top: var(--space-3);
  justify-content: flex-end;
}

.token-modal__actions-group {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ── Hover/Interaction States ── */
.header-menu-toggle:hover,
.theme-toggle:hover,
.ghost-button:hover,
.language-switcher__select:hover,
.text-button:hover,
.icon-button:hover,
.recent-chip:hover,
.bookmark-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.header-menu-toggle:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}

/* ── Animations ── */
.hero-copy,
.search-panel,
.status-card,
.results-stack > * {
  animation: rise-in 500ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.results-stack > *:nth-child(2) { animation-delay: 80ms; }
.results-stack > *:nth-child(3) { animation-delay: 140ms; }

/* ── Responsive ── */
@media (max-width: 58rem) {
  .hero-grid, .footer-grid {
    grid-template-columns: 1fr;
    display: grid;
  }
  .header-grid {
    align-items: center;
    gap: var(--space-2);
  }
  .header-actions { justify-content: flex-end; }
  .hero-copy { padding-top: 0; }
  .hero h2 { max-width: 16ch; }
  .search-panel__collections { grid-template-columns: 1fr; }
  .profile-card__meta,
  .profile-card__stats,
  .repo-grid,
  .compare-layout__grid,
  .compare-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 42rem) {
  .container { width: min(100% - 1rem, 72rem); }

  .site-header, .hero, .status-section, .results-section, .site-footer {
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
  }

  .search-row { grid-template-columns: 1fr; }
  .compare-grid, .compare-layout__grid { grid-template-columns: 1fr; }

  .primary-button, .ghost-button, .theme-toggle { width: 100%; }

  .header-grid {
    position: relative;
    display: block;
    padding-right: 5.5rem;
  }

  .header-controls {
    position: absolute;
    top: 0;
    right: 0;
    margin-left: 0;
  }

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

  .header-controls[data-menu-open="true"] .header-menu-toggle {
    border-color: var(--accent-strong);
    background: var(--accent-strong);
    color: #fff;
  }

  .header-actions {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: min(18rem, calc(100vw - 1rem));
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    z-index: 25;
  }

  .header-actions[hidden] {
    display: none !important;
  }

  .header-actions > * {
    width: 100%;
  }

  .header-actions .rate-badge {
    order: -1;
    text-align: left;
  }

  .language-switcher {
    width: 100%;
    display: grid;
    gap: 0.35rem;
  }

  .language-switcher__label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .language-switcher__select {
    width: 100%;
  }

  .hero-highlights, .shortcut-list, .profile-empty__examples {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-card, .profile-empty, .repo-explorer { padding: var(--space-3); }

  .profile-card__header { grid-template-columns: 1fr; }

  .profile-card__avatar, .skeleton-avatar {
    width: 5rem; height: 5rem;
  }

  .profile-card__meta,
  .profile-card__stats,
  .repo-grid {
    grid-template-columns: 1fr;
  }

  .profile-card__actions, .profile-card__action { width: 100%; }

  .profile-card__title-meta {
    width: 100%;
    justify-content: flex-start;
  }

  .language-stats, .compare-layout__header, .compare-column { padding: var(--space-3); }

  .repo-explorer__controls, .repo-control, .repo-select,
  .repo-explorer__footer, .repo-load-more {
    width: 100%;
  }

  .token-modal { width: min(100% - 1rem, 30rem); }

  .token-modal__actions, .token-modal__actions-group {
    width: 100%;
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .brand {
    min-width: 0;
    gap: 0.65rem;
  }

  .brand-mark {
    width: 2.2rem;
    height: 2.2rem;
  }

  .brand h1 {
    font-size: 0.95rem;
  }

  .legal-main {
    padding-top: var(--space-3);
  }

  .legal-card {
    padding: var(--space-3);
  }
}

/* ── Analysis Panel ── */
.analysis-panel {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  display: grid;
  gap: var(--space-4);
}

.analysis-panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #f59e0b, #ef4444, #8b5cf6, #3b82f6, #10b981);
  opacity: 0.8;
}

.analysis-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.analysis-panel__eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

.analysis-panel__title {
  margin: 0.25rem 0 0;
  font-family: var(--font-sans);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.analysis-panel__primary-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid color-mix(in srgb, var(--badge-color, #f59e0b) 30%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--badge-color, #f59e0b) 8%, var(--surface-soft));
  box-shadow: 0 0 24px color-mix(in srgb, var(--badge-color, #f59e0b) 12%, transparent);
  animation: rise-in 600ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 200ms;
}

.analysis-panel__badge-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.analysis-panel__badge-info {
  display: grid;
  gap: 0.15rem;
}

.analysis-panel__badge-label {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.analysis-panel__badge-sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* Summary */
.analysis-panel__summary {
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.analysis-panel__summary-text {
  margin: 0;
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text);
}

/* Scores */
.analysis-panel__scores {
  display: grid;
  gap: var(--space-2);
}

.analysis-panel__scores-title,
.analysis-panel__badges-title,
.analysis-panel__insights-title {
  margin: 0 0 var(--space-1);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.analysis-panel__score-grid {
  display: grid;
  gap: 0.6rem;
}

.score-row {
  display: grid;
  gap: 0.3rem;
}

.score-row--overall {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  margin-bottom: 0.5rem;
}

.score-row--overall .score-row__label {
  font-weight: 700;
  color: var(--text);
}

.score-row--overall .score-row__value {
  font-weight: 700;
  font-size: var(--text-base);
}

.score-row--overall .score-row__track {
  height: 0.55rem;
}

.score-row__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.score-row__label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
}

.score-row__value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 600;
}

.score-row__track {
  width: 100%;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  overflow: hidden;
}

.score-row__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 800ms cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.score-row__fill--high {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.score-row__fill--mid {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.score-row__fill--low {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Badges */
.analysis-panel__badges {
  display: grid;
  gap: var(--space-1);
}

.analysis-panel__badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.analysis-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--badge-color, #6e7681) 30%, var(--border));
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--badge-color, #6e7681) 6%, var(--surface-soft));
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  transition: all 200ms ease;
}

.analysis-badge-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--badge-color, #6e7681) 15%, transparent);
}

.analysis-badge-chip__icon {
  font-size: 0.85rem;
  line-height: 1;
}

.analysis-badge-chip__label {
  color: var(--text);
}

/* Insights */
.analysis-panel__insights {
  display: grid;
  gap: var(--space-2);
}

.analysis-insight {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  position: relative;
  overflow: hidden;
}

.analysis-insight::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 3px;
}

.analysis-insight--positive::before { background: #10b981; }
.analysis-insight--neutral::before,
.analysis-insight--info::before { background: #3b82f6; }
.analysis-insight--warning::before { background: #f59e0b; }

.analysis-insight__category {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.analysis-insight--positive .analysis-insight__category {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.analysis-insight--neutral .analysis-insight__category,
.analysis-insight--info .analysis-insight__category {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.analysis-insight--warning .analysis-insight__category {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.analysis-insight__text {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--text);
}

.analysis-panel__actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.analysis-panel__action-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.analysis-panel__note {
  margin: 0;
  max-width: 58ch;
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--text-muted);
}

.analysis-panel__action-button {
  min-width: 10rem;
}

.analysis-panel__action-button--secondary {
  background: transparent;
}

.detailed-analysis {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 4%, var(--surface)) 0%, var(--surface) 100%);
}

.detailed-analysis--loading,
.detailed-analysis--error {
  gap: 0.5rem;
}

.detailed-analysis__status,
.detailed-analysis__status-sub,
.detailed-analysis__meta-text,
.detailed-analysis__summary,
.detailed-analysis__confidence-note,
.detailed-analysis__role-reason,
.detailed-analysis__question-text,
.detailed-analysis__evidence-meta,
.detailed-analysis__evidence-description,
.detailed-analysis__evidence-summary {
  margin: 0;
}

.detailed-analysis__status {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.detailed-analysis__status-sub,
.detailed-analysis__meta-text,
.detailed-analysis__confidence-note,
.detailed-analysis__role-reason,
.detailed-analysis__evidence-meta,
.detailed-analysis__evidence-description,
.detailed-analysis__evidence-summary {
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.detailed-analysis__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.detailed-analysis__confidence {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.detailed-analysis__confidence--high {
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.18);
}

.detailed-analysis__confidence--mid {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.18);
}

.detailed-analysis__confidence--low {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.18);
}

.detailed-analysis__section {
  display: grid;
  gap: var(--space-2);
}

.detailed-analysis__section-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.detailed-analysis__summary {
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--text);
}

.detailed-analysis__insight-list,
.detailed-analysis__role-list,
.detailed-analysis__question-list {
  display: grid;
  gap: var(--space-2);
}

.detailed-analysis__role-row,
.detailed-analysis__question-card,
.detailed-analysis__evidence-card {
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.detailed-analysis__role-row {
  display: grid;
  gap: 0.55rem;
}

.detailed-analysis__role-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.detailed-analysis__role-label,
.detailed-analysis__role-score,
.detailed-analysis__question-index,
.detailed-analysis__evidence-title,
.detailed-analysis__check {
  font-family: var(--font-mono);
}

.detailed-analysis__role-label,
.detailed-analysis__role-score {
  font-size: var(--text-sm);
  font-weight: 600;
}

.detailed-analysis__question-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
}

.detailed-analysis__question-index {
  width: 1.8rem;
  height: 1.8rem;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
}

.detailed-analysis__question-text {
  line-height: 1.7;
  color: var(--text);
}

.detailed-analysis__evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.detailed-analysis__evidence-card {
  display: grid;
  gap: 0.65rem;
}

.detailed-analysis__evidence-title {
  color: var(--text);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 700;
}

.detailed-analysis__evidence-title:hover {
  color: var(--accent);
}

.detailed-analysis__check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.detailed-analysis__check {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  font-size: 0.65rem;
  font-weight: 600;
}

.detailed-analysis__check--positive {
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.18);
}

.detailed-analysis__check--warning {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.18);
}

.detailed-analysis__check--neutral {
  color: var(--text-muted);
  background: transparent;
}

/* ── Responsive for analysis ── */
@media (max-width: 42rem) {
  .analysis-panel { padding: var(--space-3); }
  .analysis-panel__header { flex-direction: column; }
  .analysis-panel__primary-badge { width: 100%; }
  .analysis-panel__actions,
  .analysis-panel__action-group,
  .detailed-analysis__meta {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .analysis-panel__action-button {
    width: 100%;
  }
  .detailed-analysis {
    padding: var(--space-2);
  }
  .detailed-analysis__question-card {
    grid-template-columns: 1fr;
  }
  .detailed-analysis__evidence-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-copy, .search-panel, .status-card, .results-stack > *,
  .analysis-panel__primary-badge,
  .profile-card--skeleton .skeleton::after,
  .repo-explorer--skeleton .skeleton::after,
  .repo-card--skeleton .skeleton::after {
    animation: none !important;
  }
  .header-menu-toggle:hover, .theme-toggle:hover, .ghost-button:hover, .primary-button:hover,
  .text-button:hover, .icon-button:hover, .recent-chip:hover,
  .meta-item:hover, .bookmark-button:hover, .repo-card:hover,
  .analysis-badge-chip:hover {
    transform: none;
  }
  .score-row__fill { transition: none; }
}
