/* ADG SaaS marketing site. Dark by default, light by toggle. No external fonts or scripts. */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080a11;
  --bg-2: #0d111b;
  --surface: #111724;
  --surface-2: #161d2d;
  --border: #212a3d;
  --border-strong: #2f3b55;
  --text: #e9edf6;
  --muted: #9aa5bb;
  --faint: #8b95ac;
  --accent: #5b8cff;
  --accent-2: #a06bff;
  --accent-3: #ff5fa2;
  --ok: #3ddc97;
  --code-bg: #0a0e17;
  --glow-1: rgba(91, 140, 255, 0.20);
  --glow-2: rgba(160, 107, 255, 0.16);
  --grid-line: rgba(130, 150, 200, 0.07);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --nav-bg: rgba(8, 10, 17, 0.72);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fc;
  --bg-2: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f3f5fb;
  --border: #dde2ee;
  --border-strong: #c5cde0;
  --text: #0e1422;
  --muted: #4f5b76;
  --faint: #5b6882;
  --accent: #2c5be0;
  --accent-2: #7b45e6;
  --accent-3: #d3317e;
  --ok: #138a5b;
  --code-bg: #0e1422;
  --glow-1: rgba(44, 91, 224, 0.12);
  --glow-2: rgba(123, 69, 230, 0.10);
  --grid-line: rgba(40, 60, 110, 0.07);
  --shadow: 0 10px 30px rgba(30, 45, 90, 0.12);
  --nav-bg: rgba(246, 248, 252, 0.8);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }
/* Plain text links get a colour change on hover instead of an underline. Cards, buttons and menus have their own hover styles. */
a:not([class]):hover { color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
a.card:hover, a.tile:hover { border-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 12px; }

.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
.section { padding: 88px 0; }
.section.alt { background: var(--bg-2); border-block: 1px solid var(--border); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 16px; }
h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); font-weight: 750; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 16px; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 62ch; }
.grad { background: linear-gradient(100deg, var(--accent), var(--accent-2) 55%, var(--accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--muted); font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.section-head { max-width: 720px; margin-bottom: 44px; }
.section-head p { color: var(--muted); }

/* ---- Navigation ---- */
.nav { position: sticky; top: 0; z-index: 50; background: var(--nav-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand svg:not(.lockup) { width: 30px; height: 30px; }
.brand svg.lockup { width: auto; height: 40px; display: block; }
.brand small { font-weight: 500; color: var(--muted); font-size: 0.95rem; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }
.menu-btn { display: none; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 11px;
  font-weight: 600; font-size: 0.98rem; border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(100deg, var(--accent), var(--accent-2)); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; padding: 96px 0 84px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(600px 380px at 15% 0%, var(--glow-1), transparent 70%),
    radial-gradient(520px 340px at 90% 20%, var(--glow-2), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000 30%, transparent 100%);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.hero h1 { margin-top: 20px; }
.hero-sm { padding: 72px 0 56px; }
.hero-sm .hero-grid { grid-template-columns: 1fr; }

/* ---- Terminal ---- */
.term { background: var(--code-bg); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid #1d2638; background: #0d1320; }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a3550; }
.term-bar span { margin-left: 8px; color: #7d89a6; font-size: 0.78rem; }
.term pre { margin: 0; padding: 18px 20px; font-size: 0.86rem; line-height: 1.75; color: #cdd6ea; overflow-x: auto; }
.term .p { color: #6d7a99; }
.term .k { color: #8fb0ff; }
.term .ok { color: #3ddc97; }
.term .c { color: #6d7a99; }

/* ---- Cards ---- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 26px;
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--border-strong); }
.card p { color: var(--muted); margin-bottom: 0; font-size: 0.97rem; }
.card .ico {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent-2) 22%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent);
}
.card .ico svg { width: 22px; height: 22px; }
.card ul { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 0.95rem; }
.card li { margin: 4px 0; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid var(--border-strong); color: var(--muted); }
.pill.live { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.pill.soon { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 45%, transparent); background: color-mix(in srgb, var(--accent-2) 10%, transparent); }

/* ---- Product cards ---- */
.product { display: flex; flex-direction: column; gap: 14px; min-height: 280px; }
.product .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.product h3 { font-size: 1.4rem; margin: 0; }
.product .more { margin-top: auto; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }

/* ---- Demo tiles (square) ---- */
.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 1 / 1; padding: 22px;
  border-radius: 18px; border: 1px solid var(--border); background: var(--surface); color: var(--text); overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.tile::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0.9;
  background: radial-gradient(260px 200px at 90% 0%, var(--glow-1), transparent 70%);
}
.tile > * { position: relative; z-index: 1; }
a.tile:hover { text-decoration: none; transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.tile .tile-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2) 60%, var(--accent-3)); }
.tile .tile-ico svg { width: 28px; height: 28px; }
.tile h3 { margin: 0 0 4px; font-size: 1.25rem; }
.tile p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.45; }
.tile .go { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-weight: 650; font-size: 0.92rem; color: var(--accent); }
.tile.is-soon { opacity: 0.72; border-style: dashed; cursor: default; }
.tile.is-soon .tile-ico { background: var(--surface-2); color: var(--faint); }

/* ---- Steps / flow ---- */
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { position: relative; padding: 26px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.step::before {
  counter-increment: step; content: "0" counter(step); display: block; margin-bottom: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; color: var(--accent);
}
.step p { color: var(--muted); font-size: 0.96rem; margin: 0; }

/* ---- Callout ---- */
.callout {
  border: 1px solid var(--border-strong); border-radius: 18px; padding: 40px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), color-mix(in srgb, var(--accent-2) 10%, var(--surface)));
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
}
.callout h2 { margin-bottom: 8px; }
.callout p { margin: 0; color: var(--muted); max-width: 56ch; }
.note { border-left: 3px solid var(--accent-2); padding: 14px 18px; background: var(--surface); border-radius: 0 12px 12px 0; color: var(--muted); font-size: 0.96rem; }
.note strong { color: var(--text); }

/* ---- Footer ---- */
.footer { border-top: 1px solid var(--border); padding: 56px 0 40px; background: var(--bg-2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer .footer-title { margin: 0 0 12px; font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); font-weight: 650; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin: 8px 0; }
.footer a { color: var(--muted); font-size: 0.95rem; }
.footer a:hover { color: var(--text); }
.footer p { color: var(--muted); font-size: 0.93rem; max-width: 38ch; }
.legal { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--faint); font-size: 0.85rem; }

/* ---- Reveal on scroll ---- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .grid-3, .flow { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .menu-btn { display: inline-grid; }
  .nav-links {
    position: absolute; left: 0; right: 0; top: 66px; flex-direction: column; align-items: stretch; gap: 2px; padding: 12px 20px 18px;
    background: var(--bg); border-bottom: 1px solid var(--border); display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
  .section { padding: 64px 0; }
  .hero { padding: 64px 0 56px; }
}
@media (max-width: 600px) {
  .grid-3, .grid-2, .grid-4, .flow { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .callout { padding: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card, .tile { transition: none; }
}

/* ---- Sub-navigation (ADG RMM pages) ---- */
.subnav { border-bottom: 1px solid var(--border); background: var(--bg-2); }
.subnav .wrap { display: flex; align-items: center; gap: 18px; overflow-x: auto; }
.subnav-title { font-weight: 700; font-size: 0.9rem; color: var(--text); white-space: nowrap; padding: 12px 0; }
.subnav nav { display: flex; gap: 2px; }
.subnav a { color: var(--muted); padding: 12px 12px; font-size: 0.92rem; white-space: nowrap; border-bottom: 2px solid transparent; }
.subnav a:hover { color: var(--text); text-decoration: none; }
.subnav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

/* ---- Long-form text (legal pages) ---- */
.prose { max-width: 780px; }
.prose h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.prose h2 { font-size: 1.45rem; margin-top: 40px; }
.prose h3 { margin-top: 24px; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); }
.prose ul { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin: 6px 0; }
.prose .meta { color: var(--faint); font-size: 0.93rem; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { color: var(--faint); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 650; background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table td:first-child { font-weight: 600; white-space: nowrap; }
.table td:last-child { color: var(--muted); }

/* ---- Releases and contributors (filled in by releases.js) ---- */
.release { border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; background: var(--surface); margin-bottom: 16px; }
.release h3 { margin: 0 0 4px; font-size: 1.2rem; }
.release .when { color: var(--faint); font-size: 0.88rem; margin-bottom: 12px; }
.release pre { margin: 0; white-space: pre-wrap; word-break: break-word; color: var(--muted); font-size: 0.9rem; line-height: 1.6; font-family: inherit; }
.contrib { display: flex; flex-wrap: wrap; gap: 14px; }
.contrib a { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 0.92rem; }
.contrib a:hover { text-decoration: none; border-color: var(--accent); }
.contrib img { width: 32px; height: 32px; border-radius: 50%; }

/* ---- Four-step flow ---- */
.flow-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .flow-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .flow-4 { grid-template-columns: 1fr; } }

.flow .step { min-width: 0; }
.flow .step p { overflow-wrap: anywhere; }

@media (max-width: 420px) { .brand svg.lockup { height: 34px; } }

/* ---- Product cards: the live product spans the full row, planned ones sit below ---- */
.product-live { grid-column: 1 / -1; min-height: 0; }
.product-live p { max-width: 70ch; }
.grid-4 .product { min-height: 0; }
.grid-4 .product .ico { margin-bottom: 4px; }
.grid-4 .product .top { flex-wrap: wrap; gap: 8px 10px; justify-content: flex-start; }
.grid-4 .product .top h3 { white-space: nowrap; }
.product-live .top { justify-content: space-between; }

.grid-3 .product .top { flex-wrap: wrap; gap: 8px 10px; justify-content: flex-start; }
.grid-3 .product-live .top { justify-content: space-between; }
.grid-3 .product { min-height: 0; }

/* Links inside running text carry a quiet underline at all times, so they do not rely on colour alone (hovering changes the colour, never adds or removes the line). */
p a:not([class]), li a:not([class]), .note a:not([class]) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Cloud: planned packages */
.plan { display: flex; flex-direction: column; }
.plan h3 { margin: 14px 0 6px; }
.plan .plan-for { min-height: 3.2em; }
.plan ul { margin-top: 16px; }
.plan-note { color: var(--muted); max-width: 760px; margin: 28px 0 0; }
.plan .plan-price { margin: 4px 0 2px; }
.plan .plan-price .amt { font-size: 1.7rem; font-weight: 700; color: var(--text); }
.plan .plan-price .per { color: var(--muted); font-size: 0.9rem; }
.plan .plan-min { color: var(--muted); font-size: 0.88rem; }
.plan .plan-tech { color: var(--text); font-size: 0.95rem; margin: 2px 0 2px; }

/* Header dropdown (ADG RMM) */
.dd { position: relative; }
.dd-btn { font: inherit; font-size: 0.95rem; color: var(--muted); background: none; border: 0; padding: 8px 12px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.dd-btn:hover, .dd-btn[aria-current="page"], .dd-btn[aria-expanded="true"] { color: var(--text); background: var(--surface-2); }
.dd-btn svg { transition: transform .15s ease; }
.dd-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.dd-menu { display: none; position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; padding: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); z-index: 60; }
.dd.open .dd-menu { display: block; }
.dd-menu a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 8px; }
@media (max-width: 860px) {
  .dd { width: 100%; }
  .dd-btn { width: 100%; justify-content: space-between; padding: 12px; }
  .dd-menu { position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 12px; min-width: 0; }
}
