@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* ---------------------------------------------------------------------------
   Livery-Lab — listmonk public pages
   Paste into: listmonk admin → Settings → Appearance → Public → Custom CSS.
   Served as /public/custom.css, i.e. after listmonk's own static/style.css,
   so everything here wins without !important.

   Design tokens mirror the website (src/styles/theme.css).
   --------------------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --border: #e4e0d6;
  --border-strong: #d4cec0;
  --fg: #0e0e12;
  --muted: #6b6a66;

  --pink: #d92e66;
  --blue: #4a3ae0;
  --accent: #3f0b5a;
  --pink-soft: rgba(217, 46, 102, 0.1);
  --blue-soft: rgba(74, 58, 224, 0.1);

  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(14, 14, 18, 0.06), 0 2px 8px rgba(14, 14, 18, 0.04);
  --shadow-lg: 0 12px 32px rgba(14, 14, 18, 0.12), 0 2px 8px rgba(14, 14, 18, 0.06);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e12;
    --surface: #17171d;
    --surface-2: #1e1e26;
    --border: #2a2a33;
    --border-strong: #3a3a45;
    --fg: #f7f5f0;
    --muted: #8d8c96;

    --pink: #ff5c8a;
    --blue: #6b5cff;
    --accent: #ff97ff;
    --pink-soft: rgba(255, 92, 138, 0.14);
    --blue-soft: rgba(107, 92, 255, 0.14);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
  }
}

/* ---------- page ---------- */

html,
body {
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica,
    Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

::selection {
  background: var(--blue);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

a {
  color: var(--blue);
  text-decoration-color: color-mix(in srgb, var(--blue) 35%, transparent);
  text-underline-offset: 3px;
  transition: color 0.18s var(--ease);
}

a:hover {
  color: var(--pink);
  text-decoration-color: color-mix(in srgb, var(--pink) 45%, transparent);
}

/* ---------- ambient backdrop ----------
   The two drifting colour fields work without JavaScript; the grid, grain and
   pointer spotlight are added by public.js. All of it is decorative and sits
   behind the body background, which paints the viewport canvas. */

body::before,
body::after {
  content: "";
  position: fixed;
  width: 46rem;
  height: 46rem;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.3;
  z-index: -1;
  pointer-events: none;
}

body::before {
  background: var(--pink);
  top: -20rem;
  left: -15rem;
  animation: ll-drift-a 24s var(--ease) infinite alternate;
}

body::after {
  background: var(--blue);
  bottom: -24rem;
  right: -17rem;
  animation: ll-drift-b 28s var(--ease) infinite alternate;
}

.ll-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

/* Fine engineering grid, faded out towards the edges. */
.ll-glow__grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      to right,
      color-mix(in srgb, var(--fg) 7%, transparent) 1px,
      transparent 1px
    ),
    linear-gradient(
      to bottom,
      color-mix(in srgb, var(--fg) 7%, transparent) 1px,
      transparent 1px
    );
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
}

/* Pointer spotlight — invisible until public.js marks it active. */
.ll-glow__spot {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  background: radial-gradient(
    26rem 26rem at var(--x, 50%) var(--y, 50%),
    color-mix(in srgb, var(--accent) 20%, transparent),
    transparent 70%
  );
}

.ll-glow__spot.is-active {
  opacity: 1;
}

/* Film grain, so the large flat gradients do not band. */
.ll-glow__grain {
  position: absolute;
  inset: -50%;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: ll-grain 6s steps(6) infinite;
}

/* ---------- card ---------- */

.container {
  max-width: 34rem;
  margin: clamp(2rem, 9vh, 4.5rem) auto 1rem;
  padding: 0 1.1rem;
}

.container.wrap {
  position: relative;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2.4rem 2.2rem;
  overflow: hidden;
  animation: ll-rise 0.7s var(--ease) both;
}

/* Signature gradient hairline along the top edge of the card. */
.container.wrap::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(
    100deg,
    var(--pink) 0%,
    var(--accent) 45%,
    var(--blue) 100%
  );
  opacity: 0.85;
}

/* ---------- header ---------- */

.header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.1rem;
  margin-bottom: 1.8rem;
}

.header .logo {
  display: flex;
  align-items: center;
}

.header .logo a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.header .logo img {
  display: block;
  width: auto;
  max-width: 132px;
  max-height: 34px;
}

/* Wordmark next to the logo, inserted by public.js. */
.ll-brand-word {
  font-weight: 650;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--fg);
}

/* ---------- typography ---------- */

h1,
h2,
h3,
h4 {
  color: var(--fg);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.9rem;
}

h1 {
  font-size: 1.85rem;
}

h2 {
  font-size: 1.6rem;
  background: linear-gradient(
    100deg,
    var(--pink) 0%,
    var(--accent) 45%,
    var(--blue) 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: ll-sweep 9s ease-in-out infinite 1s;
}

h3 {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

/* Secondary headings inside forms stay quiet — e.g. "Lists" above the
   checkbox group on the subscription form. */
.lists h2,
.manage-form h3 {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  -webkit-text-fill-color: currentColor;
  animation: none;
  margin: 0 0 0.6rem;
}

p {
  margin: 0 0 1.1rem;
  color: var(--muted);
}

section {
  margin-bottom: 0;
}

.section {
  margin-bottom: 2.2rem;
}

.small {
  font-size: 0.85em;
}

.error {
  color: var(--pink);
  font-weight: 600;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.8rem 0;
}

/* ---------- form fields ---------- */

label {
  display: inline-block;
  color: var(--fg);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  cursor: pointer;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: none;
  color: var(--fg);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background 0.18s var(--ease);
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 80%, transparent);
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover {
  border-color: var(--border-strong);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
}

input[disabled],
input[disabled] + label {
  opacity: 0.45;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--pink);
  width: 1.05rem;
  height: 1.05rem;
  margin: 0 0.15rem 0 0;
  vertical-align: -0.18em;
  cursor: pointer;
}

/* The honeypot field must stay hidden. */
.form .nonce {
  display: none;
}

.form .captcha {
  margin-top: 1.6rem;
}

/* ---------- buttons ---------- */

.button,
input[type="submit"].button {
  display: inline-block;
  min-width: 11rem;
  padding: 0.85rem 1.8rem;
  background: linear-gradient(120deg, var(--pink), var(--blue));
  border: 0;
  border-radius: var(--r-pill);
  color: #fff;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s var(--ease), filter 0.2s var(--ease),
    opacity 0.2s var(--ease);
}

.button:hover {
  background: linear-gradient(120deg, var(--pink), var(--blue));
  color: #fff;
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.button:active {
  transform: translateY(0);
}

.button.is-busy {
  opacity: 0.6;
  transform: none;
  cursor: progress;
}

.button.button-outline,
input[type="submit"].button-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--fg);
  box-shadow: none;
}

.button.button-outline:hover {
  background: var(--surface-2);
  border-color: var(--blue);
  color: var(--fg);
}

/* The OIDC login button carries a provider logo. */
.login button img {
  max-width: 20px;
  margin-right: 0.5rem;
}

.login .submit {
  margin-top: 1.4rem;
}

.login button {
  width: 100%;
}

.login input[name="totp_code"] {
  font-size: 1.7rem;
  letter-spacing: 0.4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---------- list / option rows ---------- */

.lists {
  list-style: none;
  margin: 1.6rem 0 1.4rem;
  padding: 0;
}

.lists li {
  margin: 0 0 0.5rem;
  padding: 0.75rem 0.95rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.lists li:hover {
  border-color: var(--border-strong);
}

.lists li:has(input:checked) {
  background: var(--pink-soft);
  border-color: color-mix(in srgb, var(--pink) 30%, transparent);
}

.lists li label {
  margin: 0 0 0 0.35rem;
  font-weight: 600;
}

.lists .description {
  margin: 0.3rem 0 0 1.6rem;
  color: var(--muted);
  font-size: 0.85em;
  line-height: 1.45;
}

.optin-form ul {
  list-style: none;
  margin: 1.4rem 0;
  padding: 0;
}

.optin-form li {
  padding: 0.75rem 0.95rem;
  margin-bottom: 0.5rem;
  background: var(--pink-soft);
  border: 1px solid color-mix(in srgb, var(--pink) 25%, transparent);
  border-radius: var(--r-md);
  font-weight: 600;
}

.row {
  margin-bottom: 1.2rem;
  padding: 0.9rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--muted);
  font-size: 0.9rem;
}

.row label {
  margin-bottom: 0;
  font-weight: 600;
}

.row strong {
  color: var(--fg);
}

.unsub-all {
  margin-top: 1.8rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--border);
}

/* Privacy block sits below the main card section. */
.data-form {
  margin-top: 2rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--border);
}

/* ---------- archive ---------- */

.archive {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.archive li {
  margin: 0 0 0.5rem;
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

.archive li:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.archive li a {
  font-weight: 650;
  color: var(--fg);
  text-decoration: none;
}

.archive li:hover a {
  color: var(--pink);
}

.archive .date {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.8em;
  font-variant-numeric: tabular-nums;
}

.right {
  text-align: right;
}

.center {
  text-align: center;
}

.feed {
  margin-right: 0.9rem;
  vertical-align: -0.15em;
}

.home-options {
  margin-top: 1.8rem;
}

.home-options a {
  margin: 0 0.5rem;
  font-weight: 600;
}

/* ---------- pagination ---------- */

.pagination {
  margin-top: 1.8rem;
  text-align: center;
}

.pg-page {
  display: inline-block;
  min-width: 2rem;
  padding: 0.3rem 0.65rem;
  margin: 0 0.15rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}

.pg-page:hover {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--fg);
}

.pg-page.pg-selected {
  background: var(--pink-soft);
  border-color: color-mix(in srgb, var(--pink) 30%, transparent);
  color: var(--pink);
  text-decoration: none;
}

/* ---------- footer ---------- */

footer.container {
  margin: 1.2rem auto 2.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  animation: ll-fade 0.9s var(--ease) both 0.4s;
}

footer.container a {
  color: inherit;
  text-decoration: none;
}

footer.container a:hover {
  color: var(--fg);
}

/* ---------- keyframes ---------- */

@keyframes ll-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

@keyframes ll-fade {
  from {
    opacity: 0;
  }
}

@keyframes ll-sweep {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes ll-drift-a {
  to {
    transform: translate3d(8rem, 5rem, 0) scale(1.15);
  }
}

@keyframes ll-drift-b {
  to {
    transform: translate3d(-7rem, -4rem, 0) scale(1.1);
  }
}

@keyframes ll-grain {
  0% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-3%, 2%);
  }
  40% {
    transform: translate(2%, -3%);
  }
  60% {
    transform: translate(-2%, -2%);
  }
  80% {
    transform: translate(3%, 1%);
  }
  100% {
    transform: translate(0, 0);
  }
}

/* ---------- responsive ---------- */

@media screen and (max-width: 650px) {
  .container {
    padding: 0 0.85rem;
  }

  .container.wrap {
    margin-top: 1.5rem;
    padding: 1.9rem 1.4rem 1.7rem;
    border-radius: var(--r-lg);
  }

  h2 {
    font-size: 1.4rem;
  }

  .button {
    width: 100%;
  }
}

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .ll-glow__grain {
    animation: none;
  }
}
