/* ============================================================
   PowerDNS-AuthAdmin - marketing site
   Brand: blue braces #4f8ef7, green "Auth" #2f9e44, mono accents
   ============================================================ */

:root {
  --blue: #4f8ef7;
  --blue-strong: #3b7bf0;
  --green: #2f9e44;
  --green-soft: #38b84f;

  /* dark (default) */
  --bg: #0a0c11;
  --bg-soft: #0f1218;
  --bg-card: #121620;
  --bg-card-hover: #161b27;
  --border: #1e2430;
  --border-soft: #181d27;
  --text: #e8ecf3;
  --text-dim: #9aa4b4;
  --text-faint: #6b7585;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --shadow-card: 0 1px 0 0 rgba(255, 255, 255, 0.02), 0 18px 40px -28px rgba(0, 0, 0, 0.8);
  --glow: radial-gradient(60% 60% at 50% 0%, rgba(79, 142, 247, 0.16), transparent 70%);

  --maxw: 1120px;
  --radius: 14px;
  --radius-lg: 20px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

html[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --bg-card: #ffffff;
  --bg-card-hover: #fbfcfe;
  --border: #e3e8f0;
  --border-soft: #eceff4;
  --text: #0f1726;
  --text-dim: #51607a;
  --text-faint: #8a97ad;
  --shadow: 0 24px 60px -24px rgba(31, 50, 90, 0.28);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 30px -22px rgba(16, 24, 40, 0.18);
  --glow: radial-gradient(60% 60% at 50% 0%, rgba(79, 142, 247, 0.12), transparent 70%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.25s ease, color 0.25s ease;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

a { color: inherit; text-decoration: none; }

code { font-family: var(--mono); font-size: 0.88em; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--blue); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* theme-aware logo + screenshot swap */
.logo { height: 30px; width: auto; display: block; }
html[data-theme="dark"] .logo-light { display: none; }
html[data-theme="light"] .logo-dark { display: none; }
html[data-theme="dark"] .shot-light { display: none; }
html[data-theme="light"] .shot-dark { display: none; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 0.94rem; line-height: 1;
  padding: 11px 18px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 14px 24px; font-size: 1rem; border-radius: 12px; }
.btn-primary {
  background: var(--blue); color: #fff;
  box-shadow: 0 10px 24px -10px rgba(79, 142, 247, 0.7);
}
.btn-primary:hover { background: var(--blue-strong); box-shadow: 0 14px 30px -10px rgba(79, 142, 247, 0.8); }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-card-hover); border-color: var(--text-faint); }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; flex-shrink: 0; }
.nav { display: flex; gap: 26px; margin-left: 8px; flex: 1; }
.nav a { color: var(--text-dim); font-weight: 500; font-size: 0.94rem; transition: color 0.15s; }
.nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-card);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.theme-toggle:hover { border-color: var(--text-faint); }
.theme-toggle-icon { width: 16px; height: 16px; position: relative; display: block; }
/* moon (shown in dark) */
html[data-theme="dark"] .theme-toggle-icon {
  border-radius: 50%; box-shadow: inset -5px -3px 0 0 var(--text);
  transform: rotate(-30deg);
}
/* sun (shown in light) */
html[data-theme="light"] .theme-toggle-icon {
  border-radius: 50%; background: var(--text);
  transform: scale(0.6);
  box-shadow:
    0 -10px 0 -4px var(--text), 0 10px 0 -4px var(--text),
    -10px 0 0 -4px var(--text), 10px 0 0 -4px var(--text),
    7px 7px 0 -4px var(--text), -7px -7px 0 -4px var(--text),
    7px -7px 0 -4px var(--text), -7px 7px 0 -4px var(--text);
}

.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; transition: 0.2s; }

.mobile-nav { display: none; flex-direction: column; padding: 8px 24px 16px; border-bottom: 1px solid var(--border-soft); }
.mobile-nav a { padding: 12px 4px; color: var(--text-dim); border-bottom: 1px solid var(--border-soft); font-weight: 500; }
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav.open { display: flex; }

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; padding: 80px 0 40px; }
.hero::before {
  content: ""; position: absolute; inset: 0; background: var(--glow); pointer-events: none;
}
.hero-inner { position: relative; text-align: center; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 0.85rem; font-weight: 500;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 28px;
  transition: border-color 0.15s, color 0.15s;
}
.pill:hover { border-color: var(--blue); color: var(--text); }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-soft); box-shadow: 0 0 0 3px rgba(56, 184, 79, 0.18); }
.pill-arrow { color: var(--blue); font-weight: 700; }

.hero-title {
  font-size: clamp(2.1rem, 5.4vw, 3.7rem);
  line-height: 1.08; letter-spacing: -0.03em; font-weight: 800;
  margin: 0 0 20px;
}
.hero-title .accent {
  background: linear-gradient(90deg, var(--blue), var(--green-soft));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  max-width: 660px; margin: 0 auto 32px;
  font-size: clamp(1rem, 1.6vw, 1.18rem); color: var(--text-dim);
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.hero-meta {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  color: var(--text-faint); font-size: 0.88rem; font-family: var(--mono);
}
.hero-meta code { color: var(--green-soft); }
.hero-meta .dot { opacity: 0.5; }

/* browser frame */
.hero-shot { margin-top: 56px; perspective: 1600px; }
.browser {
  max-width: 1000px; margin: 0 auto;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-card);
  box-shadow: var(--shadow);
}
.browser-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; background: var(--bg-soft); border-bottom: 1px solid var(--border-soft);
}
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--border); display: block; }
.dots i:nth-child(1) { background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.browser-url {
  flex: 1; text-align: center; font-family: var(--mono); font-size: 0.8rem;
  color: var(--text-faint); background: var(--bg); border: 1px solid var(--border-soft);
  border-radius: 7px; padding: 5px 12px; max-width: 360px; margin: 0 auto;
}
.browser .shot { width: 100%; height: auto; display: block; }

/* ===== Trust strip ===== */
.strip { border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); background: var(--bg-soft); }
.strip-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 30px 24px; }
.strip-inner div { text-align: center; }
.strip-inner strong { display: block; font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; font-family: var(--mono); }
.strip-inner span { color: var(--text-dim); font-size: 0.86rem; }

/* ===== Sections ===== */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-soft); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.section-head { max-width: 680px; margin: 0 auto 52px; text-align: center; }
.eyebrow {
  display: inline-block; font-family: var(--mono); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--blue);
  font-weight: 600; margin-bottom: 14px;
}
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); letter-spacing: -0.025em; margin: 0 0 14px; font-weight: 800; }
.section-head p { color: var(--text-dim); font-size: 1.05rem; margin: 0; }

/* ===== Feature grid ===== */
.grid.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-card);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--blue) 50%, var(--border)); background: var(--bg-card-hover); }
.card-icon {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  font-size: 1.2rem; margin-bottom: 16px;
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--blue) 22%, transparent);
}
.card h3 { margin: 0 0 8px; font-size: 1.06rem; font-weight: 700; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--text-dim); font-size: 0.92rem; line-height: 1.55; }
.card code { color: var(--green-soft); background: color-mix(in srgb, var(--green) 12%, transparent); padding: 1px 5px; border-radius: 5px; }

/* ===== Screenshots ===== */
.shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.shot-card {
  margin: 0; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card);
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.shot-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--blue) 40%, var(--border)); }
.shot-card.wide { grid-column: 1 / -1; }
.shot-frame { border-bottom: 1px solid var(--border-soft); }
.shot-card .shot { width: 100%; height: auto; display: block; }
.shot-card figcaption { padding: 16px 20px; color: var(--text-dim); font-size: 0.92rem; }
.shot-card figcaption strong { color: var(--text); font-weight: 600; }

/* device switch */
.screens-switch {
  display: flex; gap: 4px; width: max-content; margin: 0 auto 30px;
  padding: 4px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
}
.seg {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 18px; border-radius: 9px; border: none; background: transparent;
  color: var(--text-dim); font-family: var(--font); font-weight: 600; font-size: 0.9rem;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.seg:hover { color: var(--text); }
.seg.active { background: var(--blue); color: #fff; }
.seg svg { stroke-width: 2; }

/* Pick the right gallery image by device (container) × theme (root).
   Both ancestors are in the selector chain, so we can AND them. */
.shots .shot { display: none; }
html[data-theme="dark"]  .shots[data-device="desktop"] .dev-desktop.shot-dark,
html[data-theme="light"] .shots[data-device="desktop"] .dev-desktop.shot-light,
html[data-theme="dark"]  .shots[data-device="mobile"]  .dev-mobile.shot-dark,
html[data-theme="light"] .shots[data-device="mobile"]  .dev-mobile.shot-light { display: block; }

/* In mobile mode each card keeps its slot; the phone shot is centered
   in a fixed-height frame so the grid stays tidy and the page doesn't jump. */
.shots[data-device="mobile"] .shot-frame {
  display: flex; align-items: center; justify-content: center;
  height: 460px; background: var(--bg-soft);
}
.shots[data-device="mobile"] .dev-mobile.shot {
  width: auto; max-width: 100%; height: auto; max-height: 420px;
  border-radius: 8px;
}

/* ===== Quickstart ===== */
.quickstart-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 26px; align-items: start; }
.terminal {
  background: #0c0f16; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
html[data-theme="light"] .terminal { background: #0c0f16; border-color: #1e2430; }
.terminal-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #11151e; border-bottom: 1px solid #1e2430; }
.terminal-title { flex: 1; text-align: center; font-family: var(--mono); font-size: 0.78rem; color: #6b7585; }
.tabs { display: flex; gap: 4px; flex: 1; min-width: 0; }
.tab {
  background: transparent; border: 1px solid transparent; color: #6b7585;
  font-family: var(--mono); font-size: 0.76rem; padding: 5px 11px; border-radius: 7px;
  cursor: pointer; white-space: nowrap; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tab:hover { color: #c7d0de; }
.tab.active { background: #1a2030; color: #e8ecf3; border-color: #2a3344; }
.copy-btn {
  background: #1a2030; border: 1px solid #2a3344; color: #c7d0de;
  font-size: 0.76rem; font-weight: 600; padding: 5px 12px; border-radius: 7px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.copy-btn:hover { background: #232b3d; border-color: #3a4456; }
.copy-btn.copied { color: var(--green-soft); border-color: var(--green); }
.terminal-body { margin: 0; padding: 20px; overflow-x: auto; font-family: var(--mono); font-size: 0.82rem; line-height: 1.7; color: #d7dde7; }
.terminal-body .c-comment { color: #5e6b7e; }
.terminal-body .c-cmd { color: var(--green-soft); font-weight: 600; }
.terminal-body .y-key { color: #6fa8ff; }
.terminal-body .y-val { color: #d7dde7; }
.terminal-body .y-var { color: var(--green-soft); }

.quickstart-notes h3 { margin: 4px 0 18px; font-size: 1.15rem; }
.steps { margin: 0 0 20px; padding-left: 20px; }
.steps li { color: var(--text-dim); font-size: 0.94rem; margin-bottom: 14px; padding-left: 4px; line-height: 1.55; }
.steps li::marker { color: var(--blue); font-weight: 700; }
.steps code, .note code, .warn code { color: var(--green-soft); background: color-mix(in srgb, var(--green) 12%, transparent); padding: 1px 5px; border-radius: 5px; font-size: 0.85em; }
.snippet { display: inline-block; }
.note { font-size: 0.88rem; color: var(--text-dim); margin: 0 0 20px; padding: 14px 16px; background: color-mix(in srgb, var(--blue) 7%, transparent); border: 1px solid color-mix(in srgb, var(--blue) 18%, transparent); border-radius: 10px; }
.quickstart-links { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.warn { font-size: 0.84rem; color: var(--text-faint); margin: 0; }
.warn a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }

/* ===== CTA / community ===== */
.cta { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.cta-text h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); letter-spacing: -0.025em; margin: 12px 0 14px; font-weight: 800; }
.cta-text p { color: var(--text-dim); margin: 0 0 24px; font-size: 1.02rem; }
.cta-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.cta-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mini-card {
  display: block; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; transition: transform 0.15s, border-color 0.15s;
}
.mini-card:hover { transform: translateY(-3px); border-color: var(--blue); }
.mini-card h4 { margin: 0 0 6px; font-size: 0.98rem; font-weight: 700; }
.mini-card p { margin: 0; color: var(--text-dim); font-size: 0.86rem; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border-soft); background: var(--bg); padding-top: 56px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 2fr; gap: 40px; padding-bottom: 40px; }
.footer-brand .logo { height: 26px; margin-bottom: 14px; }
.footer-brand p { color: var(--text-dim); font-size: 0.9rem; max-width: 320px; margin: 0; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-col h5 { margin: 0 0 14px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); font-weight: 600; }
.footer-col a { display: block; color: var(--text-dim); font-size: 0.92rem; padding: 5px 0; transition: color 0.15s; }
.footer-col a:hover { color: var(--blue); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 22px 24px; border-top: 1px solid var(--border-soft);
  color: var(--text-faint); font-size: 0.82rem;
}

/* ===== Responsive ===== */
@media (max-width: 920px) {
  .nav { display: none; }
  .header-actions .btn-ghost span, .header-actions .btn-ghost svg { }
  .menu-toggle { display: block; }
  .header-actions .btn { display: none; }
  .header-actions .theme-toggle { display: inline-flex; }
  .grid.features { grid-template-columns: repeat(2, 1fr); }
  .quickstart-grid { grid-template-columns: 1fr; }
  .cta { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .hero { padding: 56px 0 24px; }
  .strip-inner { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; }
  .grid.features { grid-template-columns: 1fr; }
  .shots { grid-template-columns: 1fr; }
  .cta-cards { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .section { padding: 60px 0; }
}

@media (max-width: 480px) {
  /* keep the code tabs readable without clipping on small phones */
  .terminal-bar .dots { display: none; }
  .tab { padding: 5px 9px; font-size: 0.72rem; }
}
@media (max-width: 400px) {
  /* prevent the header from overflowing on very narrow phones */
  .container { padding: 0 16px; }
  .header-inner { gap: 12px; }
  .logo { height: 24px; }
  .seg { padding: 8px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ===== Lightbox / image previewer ===== */
.shot { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(6, 8, 12, 0.86);
  backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox-img {
  max-width: min(1400px, 96vw); max-height: 90vh;
  width: auto; height: auto; object-fit: contain;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  cursor: zoom-out;
  transform: scale(0.97); transition: transform 0.2s ease;
}
.lightbox.open .lightbox-img { transform: scale(1); }
.lightbox-close {
  position: absolute; top: max(16px, 2vw); right: max(16px, 2vw);
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff; font-size: 1.5rem; line-height: 1; transition: background 0.15s, transform 0.15s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.05); }
.lightbox-hint {
  position: absolute; bottom: max(16px, 2.5vw); left: 0; right: 0;
  text-align: center; color: rgba(255, 255, 255, 0.55);
  font-size: 0.82rem; font-family: var(--mono); pointer-events: none;
}
body.lightbox-open { overflow: hidden; }
