:root {
  color-scheme: light dark;
  --bg: #f5f1e8;
  --bg-gradient: linear-gradient(180deg, #f7f3ea 0%, #efe4cf 100%);
  --hero-glow: rgba(201, 143, 22, 0.16);
  --surface: rgba(255, 252, 246, 0.92);
  --surface-strong: #fffdf8;
  --ink: #1f2430;
  --muted: #59606d;
  --line: rgba(31, 36, 48, 0.1);
  --primary: #0f766e;
  --primary-soft: rgba(15, 118, 110, 0.12);
  --gold: #c98f16;
  --danger: #b42318;
  --shadow: 0 24px 70px rgba(63, 51, 27, 0.12);
  --hero-surface: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 248, 234, 0.96));
  --chip-bg: rgba(255, 255, 255, 0.72);
  --input-bg: rgba(255, 255, 255, 0.92);
  --panel-bg: rgba(255, 255, 255, 0.74);
  --status-loading: rgba(223, 247, 245, 0.92);
  --status-error: rgba(254, 243, 242, 0.96);
  --track: rgba(15, 118, 110, 0.1);
}

:root[data-theme="dark"] {
  --bg: #0f1720;
  --bg-gradient: linear-gradient(180deg, #101923 0%, #172434 100%);
  --hero-glow: rgba(12, 148, 136, 0.18);
  --surface: rgba(16, 25, 35, 0.94);
  --surface-strong: #182332;
  --ink: #edf4ff;
  --muted: #a9b6c7;
  --line: rgba(211, 226, 245, 0.12);
  --primary: #66d1c4;
  --primary-soft: rgba(102, 209, 196, 0.14);
  --gold: #f0b44b;
  --danger: #ff8b7a;
  --shadow: 0 24px 70px rgba(3, 8, 15, 0.42);
  --hero-surface: linear-gradient(135deg, rgba(20, 31, 45, 0.95), rgba(24, 35, 50, 0.98));
  --chip-bg: rgba(24, 35, 50, 0.9);
  --input-bg: rgba(12, 19, 30, 0.98);
  --panel-bg: rgba(24, 35, 50, 0.86);
  --status-loading: rgba(15, 62, 59, 0.94);
  --status-error: rgba(74, 25, 25, 0.94);
  --track: rgba(102, 209, 196, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background-color: var(--bg);
  background:
    radial-gradient(circle at top left, var(--hero-glow), transparent 28%),
    var(--bg-gradient);
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.hero {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--hero-surface);
  box-shadow: var(--shadow);
}

.hero-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.theme-toggle {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--ink);
  box-shadow: none;
}

.hero h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  line-height: 0.95;
}

.hero-copy {
  max-width: 720px;
  margin: 18px 0 0;
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--muted);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-point {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip-bg);
  font-size: 0.92rem;
}

.search-panel {
  margin-top: 28px;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.label,
.card h2 {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-row {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.search-actions {
  margin-top: 14px;
}

input {
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--input-bg);
  color: var(--ink);
}

input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.24);
  border-color: var(--primary);
}

input::placeholder {
  color: var(--muted);
}

button {
  padding: 16px 22px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f766e, #155e75);
  color: white;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 12px 24px rgba(21, 94, 117, 0.24);
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.75;
  transform: none;
  box-shadow: none;
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
}

.sample-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.sample-chip {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--ink);
  box-shadow: none;
}

.what-analyzes {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-bg);
}

.what-analyzes h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.what-analyzes p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.results {
  margin-top: 24px;
}

.hidden {
  display: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-card {
  margin-top: 24px;
}

.page-footer {
  margin-top: 18px;
  color: var(--muted);
  text-align: center;
}

.status-card[data-tone="loading"] {
  border-color: rgba(15, 118, 110, 0.3);
  background: var(--status-loading);
}

.status-card[data-tone="error"] {
  border-color: rgba(180, 35, 24, 0.24);
  background: var(--status-error);
  color: var(--danger);
}

.profile-header {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 20px;
  align-items: center;
}

.compare-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: stretch;
}

.compare-profile {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 20px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel-bg);
}

.compare-profile h2 {
  margin: 0 0 6px;
  font-size: 1.65rem;
}

.compare-profile p {
  margin: 6px 0;
  color: var(--muted);
}

.compare-vs {
  align-self: center;
  justify-self: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--line);
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.avatar {
  width: 112px;
  height: 112px;
  border-radius: 22px;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.7);
}

.profile-meta h2 {
  margin: 0 0 6px;
  font-size: 2rem;
  text-transform: none;
  letter-spacing: 0;
}

.profile-meta p {
  margin: 6px 0;
  color: var(--muted);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.pill {
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.95rem;
}

.metric-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.metric {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--panel-bg);
  border: 1px solid var(--line);
}

.metric-label,
.list-label {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.metric-value {
  display: block;
  margin-top: 8px;
  font-size: 1.25rem;
}

.score {
  font-size: clamp(3.2rem, 7vw, 5rem);
  line-height: 0.9;
}

.score-note {
  color: var(--muted);
  line-height: 1.6;
}

.explain-card {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.explain-card summary {
  cursor: pointer;
  font-weight: 700;
}

.explain-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.explain-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-bg);
}

.compare-table {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.compare-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-bg);
}

.compare-label {
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

.compare-value {
  font-weight: 700;
}

.compare-value:last-child {
  text-align: right;
}

.winner {
  color: var(--primary);
}

.bar-list,
.activity-list,
.repo-list {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.activity-visuals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.compare-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.compare-panel {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--panel-bg);
  border: 1px solid var(--line);
}

.mini-chart {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--panel-bg);
  border: 1px solid var(--line);
}

.spark-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
  align-items: end;
  height: 120px;
  margin-top: 14px;
}

.spark-item {
  display: grid;
  gap: 8px;
  align-items: end;
  justify-items: center;
  height: 100%;
}

.spark-bar {
  width: 100%;
  min-height: 10px;
  border-radius: 999px 999px 6px 6px;
  background: linear-gradient(180deg, var(--gold), var(--primary));
}

.spark-label {
  color: var(--muted);
  font-size: 0.8rem;
}

.compact-spark {
  height: 96px;
}

.bar-item,
.activity-item,
.repo-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--panel-bg);
  border: 1px solid var(--line);
}

.bar-top,
.item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.bar-track {
  width: 100%;
  height: 10px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}

.compare-track {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.compare-fill {
  height: 10px;
  border-radius: 999px;
}

.compare-fill-primary {
  justify-self: end;
  background: linear-gradient(90deg, transparent, var(--primary));
}

.compare-fill-secondary {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #c98f16);
}

.repo-item strong,
.activity-item strong {
  font-size: 1rem;
}

.repo-item p,
.activity-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

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

a {
  color: inherit;
}

.profile-card {
  animation: rise 240ms ease-out;
}

.grid .card {
  animation: rise 320ms ease-out;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

@media (max-width: 800px) {
  .hero-topline {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .activity-visuals {
    grid-template-columns: 1fr;
  }

  .input-grid,
  .compare-panels,
  .compare-header,
  .compare-profile {
    grid-template-columns: 1fr;
  }

  .compare-vs {
    width: fit-content;
  }

  .search-row,
  .profile-header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .metric-list {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 24px;
  }

  .hero-points {
    gap: 8px;
  }
}
