:root {
  --bg: #0a0a0d;
  --surface: #121218;
  --surface-2: #1b1b23;
  --text: #f5f3f4;
  --muted: #b2abb0;
  --primary: #dc2626;
  --primary-2: #991b1b;
  --danger: #ef4444;
  --border: #2a2a33;
  --shadow: 0 14px 32px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(220, 38, 38, 0.18), transparent 42%),
    radial-gradient(circle at 18% 20%, rgba(153, 27, 27, 0.16), transparent 34%),
    radial-gradient(circle at 80% 80%, rgba(65, 18, 22, 0.3), transparent 46%),
    var(--bg);
  line-height: 1.6;
}

h1,
h2,
h3,
h4 {
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.2;
}

a {
  color: #fca5a5;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  background: rgba(10, 10, 13, 0.82);
  border-bottom: 1px solid var(--border);
  z-index: 20;
  transition: background 0.24s ease, box-shadow 0.24s ease;
}

.scroll-progress {
  height: 2px;
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
}

#scroll-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #f87171, #dc2626, #991b1b);
  box-shadow: 0 0 14px rgba(220, 38, 38, 0.7);
  transition: width 0.08s linear;
}

.site-header.scrolled {
  background: rgba(12, 12, 16, 0.95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.44);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  min-height: 72px;
}

.logo {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.main-nav {
  position: fixed;
  top: 84px;
  right: 4%;
  width: min(360px, 92vw);
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  display: grid;
  gap: 0.4rem;
  padding: 1rem;
  background: rgba(18, 18, 24, 0.98);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transform: translateY(-14px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.main-nav.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.main-nav a {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid transparent;
  color: #fee2e2;
}

.main-nav a.active {
  background: var(--surface-2);
  border-color: #7f1d1d;
  color: #fff1f2;
}

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

.nav-actions .btn {
  white-space: nowrap;
}

.user-chip {
  display: grid;
  justify-items: start;
  font-size: 0.75rem;
  color: var(--muted);
}

.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 44px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: #fecaca;
  border-radius: 10px;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 25;
}

body.nav-open .nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 1200px) {
  .main-nav {
    right: 2%;
    width: min(420px, 96vw);
  }

  .logo {
    font-size: 0.9rem;
    letter-spacing: 0.06em;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #ffffff;
  font-weight: 700;
  padding: 0.65rem 1rem;
  cursor: pointer;
}

.btn.btn-outline {
  background: transparent;
  color: #fecaca;
  border: 1px solid #7f1d1d;
}

.btn.btn-danger {
  background: linear-gradient(135deg, #dc2626, var(--danger));
}

.btn.btn-success {
  background: linear-gradient(135deg, #16a34a, #10b981);
  color: white;
}

.btn.btn-success:hover {
  background: linear-gradient(135deg, #15803d, #059669);
}

.hero {
  padding: 4rem 0 2rem;
}

.hero-banner {
  position: relative;
  min-height: 74vh;
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(8px);
  pointer-events: none;
  will-change: transform, opacity;
}

.hero-glow-left {
  left: -120px;
  top: -80px;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.22), rgba(220, 38, 38, 0));
  animation: glow-pulse-left 7s ease-in-out infinite;
}

.hero-glow-right {
  right: -120px;
  bottom: -80px;
  background: radial-gradient(circle, rgba(153, 27, 27, 0.22), rgba(153, 27, 27, 0));
  animation: glow-pulse-right 8s ease-in-out infinite;
}

.hero-center {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 760px;
}

.hero-parallax {
  will-change: transform;
}

.hero-title {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 5.2rem);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hero-subtitle {
  color: var(--muted);
  font-size: clamp(1.02rem, 2vw, 1.2rem);
  margin: 1rem auto 1.4rem;
  max-width: 680px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.scroll-indicator {
  position: absolute;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #fca5a5;
  animation: float-arrow 1.8s ease-in-out infinite;
}

.feature-grid {
  margin-top: -2.2rem;
}

.block-card {
  border-radius: 20px;
  padding: 1.3rem;
}

.block-index {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f87171;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
}

.eyebrow {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-2);
  font-weight: 700;
}

.hero-card,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 30px rgba(24, 18, 10, 0.12);
}

.section {
  padding: 2rem 0;
}

.section-alt {
  background: linear-gradient(180deg, transparent, rgba(127, 29, 29, 0.22));
}

.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: #fecaca;
  font-size: 0.78rem;
  font-weight: 700;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.contact-form,
.stack-form,
.entry-form {
  display: grid;
  gap: 0.5rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem;
  font: inherit;
  color: var(--text);
  background: #0f0f15;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.checkbox input {
  width: auto;
}

.form-hint {
  margin-top: 0.25rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.form-hint strong {
  color: var(--text);
}

.notice {
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
}

.notice.success {
  background: #14231b;
  border: 1px solid #1f3a2f;
}

.notice.error {
  background: #311013;
  border: 1px solid #7f1d1d;
}

.team-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}

.team-card {
  text-align: center;
}

.team-email {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.team-email a {
  color: #fca5a5;
  text-decoration: none;
  transition: color 0.2s ease;
}

.team-email a:hover {
  color: #f87171;
  text-decoration: underline;
}

.admin-layout {
  display: grid;
  gap: 1rem;
}

.quick-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem;
}

.quick-nav-grid .btn {
  width: 100%;
}

.downloads-hero {
  display: grid;
  gap: 0.75rem;
}

.download-toolbar {
  width: min(740px, 100%);
}

.download-grid {
  align-items: stretch;
}

.download-card {
  display: grid;
  gap: 0.8rem;
}

.download-card .btn {
  width: 100%;
}

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

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

.stats-grid article {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.6rem;
  text-align: center;
  background: #0f0f15;
}

.row-actions {
  display: flex;
  gap: 0.6rem;
}

.center {
  text-align: center;
}

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

.support-note {
  margin-top: 1rem;
  font-weight: 700;
}

.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  padding: 2rem 0;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 0.8rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.social-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid #7f1d1d;
  color: #fecaca;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 0.85rem;
  z-index: 40;
}

.cookie-actions {
  display: flex;
  gap: 0.5rem;
}

.hidden {
  display: none;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes float-arrow {
  0% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(6px);
  }
  100% {
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes glow-pulse-left {
  0% {
    opacity: 0.45;
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    opacity: 0.72;
    transform: translate3d(18px, -14px, 0) scale(1.08);
  }
  100% {
    opacity: 0.45;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes glow-pulse-right {
  0% {
    opacity: 0.4;
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    opacity: 0.66;
    transform: translate3d(-16px, 16px, 0) scale(1.06);
  }
  100% {
    opacity: 0.4;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-glow-left,
  .hero-glow-right,
  .scroll-indicator {
    animation: none;
  }

  #scroll-progress-bar,
  .reveal,
  .card {
    transition: none;
  }
}

@media (max-width: 920px) {
  .main-nav {
    right: 2%;
    width: 96%;
    top: 78px;
    max-height: calc(100vh - 96px);
  }

  .hero-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    margin-top: 0;
  }

  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-wrap {
    flex-wrap: wrap;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }

  body.nav-open {
    overflow: hidden;
  }
}

@media (max-width: 640px) {
  .container {
    width: 94%;
  }

  .nav-wrap {
    gap: 0.55rem;
    min-height: 66px;
  }

  .logo {
    font-size: 0.82rem;
    max-width: calc(100% - 56px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .main-nav {
    top: 72px;
    right: 1%;
    width: 98%;
    border-radius: 14px;
    padding: 0.8rem;
  }

  .main-nav a {
    padding: 0.58rem 0.64rem;
    font-size: 0.95rem;
  }

  .nav-actions {
    gap: 0.5rem;
  }

  .user-chip {
    font-size: 0.7rem;
  }

  .nav-actions .btn {
    padding: 0.52rem 0.8rem;
    font-size: 0.86rem;
  }
}

@media (max-width: 420px) {
  .menu-toggle {
    width: 40px;
    height: 36px;
  }

  .main-nav {
    top: 68px;
    max-height: calc(100vh - 82px);
  }

  .nav-actions {
    justify-content: stretch;
  }

  .nav-actions .btn {
    width: 100%;
  }

  .user-chip {
    width: 100%;
  }
}
