.page-head {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
  padding: 40px 34px;
  border-radius: 34px;
  border: 1px solid var(--shell-border);
  background: var(--surface-strong);
  box-shadow:
    0 28px 70px rgba(112, 77, 173, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.78), transparent 32%),
    radial-gradient(circle at 86% 18%, rgba(157, 46, 197, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 40%);
}

.head-left,
.head-right {
  position: relative;
  z-index: 1;
}

.head-left {
  max-width: 42rem;
}

.page-head h1 {
  margin: 0 0 10px;
  font-size: clamp(2.7rem, 5vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.muted {
  margin: 0;
  color: var(--copy-muted);
  line-height: 1.8;
}

.head-right {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.dashboard-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 18px;
  border-radius: 16px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  border: 1px solid transparent;
  transition:
    background 0.18s ease,
    transform 0.12s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.dashboard-btn:active {
  transform: translateY(1px);
}

.dashboard-btn-solid {
  background: linear-gradient(135deg, var(--brand), var(--brand-600));
  color: #fff;
  box-shadow: 0 14px 30px rgba(157, 46, 197, 0.18);
}

.dashboard-btn-solid:hover {
  background: linear-gradient(135deg, #8e23b5, #b33fe0);
  box-shadow: 0 18px 34px rgba(157, 46, 197, 0.24);
}

.dashboard-btn-ghost {
  color: var(--brand);
  background: rgba(124, 58, 237, 0.08);
  border-color: var(--shell-border);
}

.dashboard-btn-ghost:hover {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(157, 46, 197, 0.2);
}

.container {
  padding-top: 24px;
  display: grid;
  gap: 22px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 188px;
  padding: 24px 22px;
  border-radius: 24px;
  border: 1px solid var(--shell-border);
  background: var(--surface);
  box-shadow:
    0 18px 40px rgba(90, 61, 140, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(157, 46, 197, 0.92), rgba(157, 46, 197, 0));
}

.stat-card::after {
  content: "";
  position: absolute;
  top: -28px;
  right: -38px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(157, 46, 197, 0.16), transparent 70%);
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(157, 46, 197, 0.2);
  box-shadow:
    0 24px 46px rgba(90, 61, 140, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.stat-head,
.stat-value {
  position: relative;
  z-index: 1;
}

.stat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.stat-head span {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6f6481;
}

.stat-head svg {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 14px;
  color: var(--brand);
  background: rgba(157, 46, 197, 0.1);
  border: 1px solid rgba(157, 46, 197, 0.12);
}

.stat-value {
  margin-top: 18px;
  font-size: clamp(2.6rem, 4vw, 3.3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.06em;
}

.getting-started {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 18px;
  align-items: center;
  padding: 30px;
  border-radius: 28px;
  border: 1px solid var(--shell-border);
  background: var(--surface);
  box-shadow:
    0 18px 40px rgba(90, 61, 140, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.getting-started::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 88% 18%, rgba(157, 46, 197, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 40%);
}

.getting-started > * {
  position: relative;
  z-index: 1;
}

.getting-started h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  letter-spacing: -0.04em;
}

.getting-started .muted {
  max-width: 58ch;
}

.getting-started .dashboard-btn {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}

html[data-theme="dark"] .page-head,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .getting-started {
  border-color: #304158;
  background: linear-gradient(180deg, rgba(20, 29, 46, 0.94), rgba(13, 20, 34, 0.88));
  box-shadow:
    0 22px 42px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .page-head::before {
  background:
    radial-gradient(circle at 12% 18%, rgba(30, 44, 68, 0.84), transparent 32%),
    radial-gradient(circle at 86% 18%, rgba(161, 96, 235, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(17, 25, 39, 0.16), transparent 40%);
}

html[data-theme="dark"] .muted {
  color: #a7b5c8;
}

html[data-theme="dark"] .dashboard-btn-ghost {
  background: rgba(161, 96, 235, 0.12);
  border-color: #304158;
  color: #efdfff;
}

html[data-theme="dark"] .dashboard-btn-ghost:hover {
  background: rgba(161, 96, 235, 0.18);
}

html[data-theme="dark"] .stat-head span {
  color: #a7b5c8;
}

html[data-theme="dark"] .stat-head svg {
  background: rgba(161, 96, 235, 0.12);
  border-color: rgba(161, 96, 235, 0.18);
  color: #e8d6ff;
}

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

@media (max-width: 900px) {
  .page-head {
    grid-template-columns: 1fr;
    padding: 32px 24px;
  }

  .head-right {
    justify-content: flex-start;
  }

  .getting-started {
    grid-template-columns: 1fr;
    padding: 24px 22px;
  }

  .getting-started .dashboard-btn {
    grid-column: auto;
    grid-row: auto;
    justify-self: flex-start;
  }
}

@media (max-width: 680px) {
  .page-head h1 {
    font-size: clamp(2.4rem, 13vw, 3.7rem);
  }

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

  .stat-card,
  .getting-started {
    border-radius: 22px;
  }

  .dashboard-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-btn,
  .stat-card {
    transition: none;
  }
}
