/* panic.codes landing page.
   Palette, type and button treatments are copied from the client UI
   (client/panic/ui) so the site and the app look like one product. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./assets/inter-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./assets/inter-latin-600-normal.woff2") format("woff2");
}

:root {
  --font-sans: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, "Apple Color Emoji", Arial, sans-serif;
  --bg: #191919;
  --text: #f4f4ed;
  --muted: rgba(255, 255, 255, 0.45);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.24);
  --surface: #202020;
  --surface-hover: #262626;
  --surface-active: #2c2c2c;
  --accent: #4a051c;
  --accent-hover: #7d0e33;
  --accent-active: #380414;
  /* Burgundy glow (the primary button's colour family). */
  --glow-core: rgba(160, 20, 66, 0.85);
  --glow-mid: rgba(125, 14, 51, 0.5);
  --glow-far: rgba(74, 5, 28, 0.4);
  --glow-cycle: 4.4s;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  /* The halo behind the mark extends past the mark, so clip it instead of
     letting it add a horizontal scrollbar on narrow screens. */
  overflow-x: hidden;
}

body {
  margin: 0;
  background: radial-gradient(120% 90% at 50% 42%, #1e1e1e 0%, var(--bg) 55%, #151515 100%);
  color: var(--text);
  color-scheme: dark;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.landing {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 56px 24px;
  text-align: center;
}

/* ---------- brand ---------- */

.brand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fade-up 420ms ease both;
}

/* Soft burgundy halo behind the mark, breathing with the mark's glow. */
.brand::before {
  content: "";
  position: absolute;
  inset: -38% -22%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(160, 20, 66, 0.34) 0%,
    rgba(125, 14, 51, 0.18) 45%,
    transparent 72%
  );
  pointer-events: none;
  animation: halo-breathe var(--glow-cycle) ease-in-out infinite;
}

.brand__logo {
  position: relative;
  display: block;
  width: 416px;
  max-width: min(78vw, 416px);
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  animation: glow-breathe var(--glow-cycle) ease-in-out infinite;
}

.brand__tld {
  position: relative;
  margin-top: 12px;
  /* Same treatment as the app's brand mark (client/panic/ui/login.css). */
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--muted);
  text-shadow: 0 0 16px rgba(160, 20, 66, 0.55), 0 0 34px rgba(125, 14, 51, 0.35);
  animation: glow-breathe-text var(--glow-cycle) ease-in-out infinite;
}

/* ---------- actions ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  animation: fade-up 420ms ease both;
  animation-delay: 90ms;
}

.btn {
  display: inline-flex;
  min-width: 152px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: #ebebeb;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, transform 80ms ease;
}

.btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.btn:active {
  background: var(--surface-active);
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.4);
  outline-offset: 2px;
}

.btn--primary {
  border-color: rgba(0, 0, 0, 0.2);
  background: var(--accent);
  color: var(--text);
  font-weight: 600;
}

.btn--primary:hover {
  border-color: rgba(0, 0, 0, 0.2);
  background: var(--accent-hover);
}

.btn--primary:active {
  background: var(--accent-active);
}

/* The glow itself breathes: a burgundy bloom that swells and settles. */
@keyframes glow-breathe {
  0%,
  100% {
    filter: drop-shadow(0 0 14px var(--glow-mid)) drop-shadow(0 0 40px var(--glow-far));
  }
  50% {
    filter: drop-shadow(0 0 26px var(--glow-core)) drop-shadow(0 0 72px var(--glow-mid));
  }
}

@keyframes halo-breathe {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.97);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes glow-breathe-text {
  0%,
  100% {
    text-shadow: 0 0 14px rgba(125, 14, 51, 0.45), 0 0 30px rgba(74, 5, 28, 0.3);
  }
  50% {
    text-shadow: 0 0 20px rgba(160, 20, 66, 0.75), 0 0 42px rgba(125, 14, 51, 0.45);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand,
  .actions,
  .brand__logo,
  .brand__tld,
  .brand::before {
    animation: none;
  }

  /* Keep the burgundy glow, just hold it steady. */
  .brand__logo {
    filter: drop-shadow(0 0 20px var(--glow-mid)) drop-shadow(0 0 52px var(--glow-far));
  }

  .brand::before {
    opacity: 0.8;
  }
}

@media (max-width: 560px) {
  .landing {
    gap: 32px;
    padding: 40px 20px;
  }

  .brand__logo {
    width: 300px;
  }

  .brand__tld {
    font-size: 13px;
    margin-top: 10px;
  }

  .actions {
    width: 100%;
    max-width: 320px;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
