:root {
  color-scheme: light;
  --bg: #f4ecdf;
  --bg-deep: #d8c6ae;
  --text: #1f1710;
  --muted: #6a5c50;
  --line: rgba(56, 37, 19, 0.12);
  --panel: rgba(255, 249, 242, 0.64);
  --panel-strong: rgba(255, 252, 248, 0.82);
  --accent: #f0672b;
  --accent-soft: rgba(240, 103, 43, 0.14);
  --accent-deep: #ba4415;
  --green: #2b8a62;
  --shadow: 0 30px 90px rgba(80, 49, 25, 0.16);
  --shadow-strong: 0 42px 120px rgba(64, 37, 16, 0.24);
  --radius: 30px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 205, 159, 0.58), transparent 26%),
    radial-gradient(circle at 84% 14%, rgba(255, 244, 220, 0.72), transparent 20%),
    radial-gradient(circle at 52% 100%, rgba(235, 100, 51, 0.18), transparent 32%),
    linear-gradient(145deg, var(--bg) 0%, var(--bg-deep) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 34vw;
  height: 34vw;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(24px);
  opacity: 0.45;
  z-index: 0;
  animation: floatBlob 18s ease-in-out infinite;
}

body::before {
  top: -10vw;
  right: -8vw;
  background: rgba(255, 179, 117, 0.45);
}

body::after {
  left: -10vw;
  bottom: -8vw;
  background: rgba(223, 121, 69, 0.22);
  animation-delay: -8s;
}

.site-shell {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding: 34px 0 72px;
}

.site-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 28px;
}

.site-kicker,
.panel-kicker,
.metric-card p,
.line-item span,
.mini-grid span,
.feature-list,
.helper-text {
  color: var(--muted);
}

.site-kicker,
.panel-kicker {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
}

.site-intro {
  max-width: 920px;
  animation: riseIn 0.8s ease both;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 12ch;
  font-size: clamp(38px, 6vw, 78px);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.site-lead {
  max-width: 62ch;
  margin-top: 20px;
  font-size: 18px;
  line-height: 1.72;
  color: var(--muted);
}

.source-tags,
.module-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.source-tags span,
.module-cloud span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.76);
  border: 1px solid rgba(72, 50, 30, 0.08);
  box-shadow: 0 16px 38px rgba(91, 62, 38, 0.12);
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.source-tags span:hover,
.module-cloud span:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(240, 103, 43, 0.18);
}

.admin-fab {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  border: 1px solid rgba(70, 49, 30, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 243, 233, 0.68));
  color: var(--text);
  font-size: 28px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    background 220ms ease;
}

.admin-fab:hover {
  transform: translateY(-4px) rotate(-6deg);
  box-shadow: var(--shadow-strong);
}

.public-grid,
.metric-grid,
.panel-grid,
.mini-grid,
.stat-columns {
  display: grid;
  gap: 18px;
}

.metric-grid-main {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.glass-panel,
.metric-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition:
    transform 240ms ease,
    box-shadow 240ms ease,
    border-color 240ms ease,
    background-color 240ms ease;
}

.glass-panel::before,
.metric-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 50%);
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
}

.glass-panel:hover::before,
.metric-card:hover::before {
  opacity: 1;
}

.focus-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 26px 72px rgba(64, 37, 16, 0.18);
  border-color: rgba(240, 103, 43, 0.22);
  background: rgba(255, 251, 246, 0.8);
}

.metric-card {
  padding: 24px;
  animation: riseIn 0.72s ease both;
}

.metric-card:nth-child(2) {
  animation-delay: 70ms;
}

.metric-card:nth-child(3) {
  animation-delay: 140ms;
}

.metric-card:nth-child(4) {
  animation-delay: 210ms;
}

.metric-card h2 {
  margin: 14px 0 6px;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.04em;
}

.metric-card span {
  display: block;
  color: var(--muted);
}

.metric-card.spotlight {
  background:
    radial-gradient(circle at top right, rgba(240, 103, 43, 0.22), transparent 40%),
    linear-gradient(135deg, rgba(235, 100, 51, 0.12), transparent 58%),
    var(--panel-strong);
}

.glass-panel {
  padding: 24px;
  animation: riseIn 0.86s ease both;
}

.glass-panel.tall {
  grid-column: span 2;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-head h3,
.glass-panel h3 {
  font-size: 28px;
  letter-spacing: -0.03em;
}

.status-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(45, 142, 98, 0.12);
  color: var(--green);
  font-weight: 600;
  white-space: nowrap;
}

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

.line-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.line-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.line-item strong,
.mini-grid strong {
  font-size: 20px;
  text-align: right;
}

.mini-grid {
  grid-template-columns: 1fr 1fr;
  margin-top: 18px;
}

.mini-grid div {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(72, 50, 30, 0.06);
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.mini-grid div:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.6);
}

.mini-grid span,
.mini-grid strong {
  display: block;
}

.mini-grid strong {
  margin-top: 8px;
}

.compact-grid {
  margin-top: 12px;
}

.feature-list {
  margin: 18px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 12px;
  line-height: 1.68;
}

.feature-list strong {
  color: var(--text);
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 30;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(10px);
  background: rgba(30, 20, 12, 0.24);
}

.modal-card {
  position: relative;
  width: min(460px, calc(100% - 24px));
  padding: 24px;
  border-radius: 28px;
  background: rgba(255, 249, 244, 0.88);
  border: 1px solid rgba(75, 51, 32, 0.1);
  box-shadow: var(--shadow-strong);
  animation: riseIn 0.24s ease;
}

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

.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 34px;
  cursor: pointer;
  line-height: 1;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.login-form label {
  font-size: 14px;
  color: var(--muted);
}

.login-form input,
.login-form button {
  min-height: 52px;
  border-radius: 18px;
  border: 1px solid rgba(72, 50, 30, 0.12);
  padding: 0 16px;
  font: inherit;
}

.login-form input {
  background: rgba(255, 255, 255, 0.74);
}

.login-form button {
  border: 0;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(186, 68, 21, 0.22);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatBlob {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(2vw, 2vw, 0) scale(1.08);
  }
}

@media (max-width: 1040px) {
  .metric-grid-main,
  .panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .glass-panel.tall {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100%, calc(100% - 20px));
    padding-top: 20px;
  }

  .site-hero {
    flex-direction: column;
  }

  .admin-fab {
    align-self: flex-end;
  }

  .metric-grid-main,
  .panel-grid,
  .stat-columns,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .panel-head {
    flex-direction: column;
  }

  .line-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .line-item strong {
    text-align: left;
  }

}
