:root {
  --bg: #030304;
  --panel: rgba(14, 14, 17, 0.72);
  --panel-strong: rgba(16, 16, 20, 0.9);
  --line: rgba(255, 255, 255, 0.15);
  --text: #f2f2f5;
  --muted: #b5b5bf;
  --brand-a: #131318;
  --brand-b: #282830;
  --blur: 4px;
}

* {
  box-sizing: border-box;
}

a {
  background-color: transparent;
  color: var(--muted);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-motion {
  position: absolute;
  inset: 0;
  animation: bg-shift 14s ease-in-out infinite alternate;
}

.bg-image {
  position: absolute;
  inset: -6%;
  background-position: center;
  background-size: cover;
  filter: blur(var(--blur)) saturate(130%);
  transform-origin: center;
}

.bg-image.light {
  background-image: url("/assets/Dialoguer/bg_light.png");
  mix-blend-mode: normal;
  opacity: 1;
  animation: morph-light 24s linear infinite;
}

.bg-image.dark {
  background-image: url("/assets/Dialoguer/bg_dark.png");
  mix-blend-mode: normal;
  opacity: 0;
  animation: morph-dark 24s linear infinite;
}

.bg-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    140deg,
    rgba(0, 0, 0, 0.74),
    rgba(5, 5, 8, 0.68) 44%,
    rgba(3, 3, 5, 0.88)
  );
}

.layout {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-home .layout {
  padding: 24px;
}

.page-home .shell {
  width: min(1080px, 100%);
}

.page-home .hero {
  border: 1px solid var(--line);
  background: linear-gradient(
    160deg,
    rgba(17, 17, 21, 0.9),
    rgba(9, 9, 12, 0.82)
  );
  border-radius: 28px;
  padding: clamp(22px, 5vw, 44px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.page-home .tag {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.page-home h1 {
  margin: 14px 0 12px;
  max-width: 16ch;
  font-size: clamp(34px, 7vw, 66px);
  line-height: 0.95;
}

.page-home .lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: clamp(16px, 1.5vw, 19px);
}

.page-home .actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-home .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition:
    transform 130ms ease,
    border-color 130ms ease,
    background-color 130ms ease;
}

.page-home .btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

.page-home .btn.primary {
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(96deg, var(--brand-a), var(--brand-b));
  color: #fff;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.page-home .btn.code {
  border-color: rgba(255, 255, 255, 0.28);
  background: linear-gradient(
    96deg,
    rgba(38, 38, 48, 0.95),
    rgba(20, 20, 26, 0.95)
  );
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 12px 28px rgba(0, 0, 0, 0.4);
}

.page-home code {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 600;
  font-size: 0.92em;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 6px 14px rgba(0, 0, 0, 0.35);
}

.page-home .grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

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

.page-home .panel h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.page-home .panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.page-home .subgrid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 10px;
}

.page-home .list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 7px;
  line-height: 1.4;
}

.page-home .legal {
  margin-top: 6px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.page-home .legal a {
  color: var(--muted);
  font-size: 14px;
}

.page-legal .layout {
  padding: 20px;
}

.modal-panel {
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(10, 10, 13, 0.98);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 16, 22, 0.96);
}

.modal-header h1 {
  margin: 0;
  font-size: clamp(16px, 2.4vw, 24px);
  line-height: 1.2;
}

.modal-close {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 6px 12px;
  text-decoration: none;
  font-size: 14px;
}

.modal-body {
  padding: 18px;
  color: var(--muted);
}

.modal-body p {
  margin: 0 0 12px;
  line-height: 1.55;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-body a {
  color: var(--text);
}

@keyframes morph-light {
  0% {
    opacity: 1;
  }
  12.5% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  62.5% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes morph-dark {
  0% {
    opacity: 0;
  }
  12.5% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  62.5% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes bg-shift {
  0% {
    transform: translate(-0.55%, -0.35%) scale(1.02);
  }
  100% {
    transform: translate(0.55%, 0.35%) scale(1.02);
  }
}

@media (max-width: 960px) {
  .page-home .grid,
  .page-home .subgrid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-motion,
  .bg-image {
    animation: none;
  }
}
