/*
 * Public pages (landing, pricing). Always dark, whatever theme a signed-in user chose: these pages are the first impression and are
 * not themeable. The theme tokens are redefined on body.pub, so the shared skin (buttons, tables, .surface) follows without changes.
 * Status colours always travel with a word (the tag column in the trace), never colour alone.
 */
body.pub {
  --bg: #071016; --surface: #0d1820; --surface-2: #11202b; --text: #e8eef2; --muted: #93a5b2; --line: #1d2f3c;
  --brand: #eef4f7; --brand-ink: #071016; --link: #8fd3ff; --accent: #55e6b8;
  --pub-ok: #55e6b8; --pub-bad: #ff7d6b; --pub-warn: #ffc15e; --pub-blue: #8fd3ff;
  --ring: rgba(143, 211, 255, .55);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  background: var(--bg); color: var(--text);
}
body.pub .text-body-secondary, body.pub small { color: var(--muted) !important; }
body.pub .table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--line); --bs-table-striped-bg: transparent; }
body.pub .btn-outline-primary, body.pub .btn-outline-secondary { background: transparent; }
body.pub .surface { background: var(--surface); border: 1px solid var(--line); box-shadow: none; }

/* ---------- header ---------- */
.pub-head { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; padding: .7rem max(1.25rem, calc((100% - 69.5rem) / 2)); background: rgba(7, 16, 22, .82); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line); }
.pub-head .brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--text); font-family: var(--font-display); font-weight: 750; font-size: 1.15rem; letter-spacing: -.02em; }
.pub-head nav { display: flex; gap: 1.4rem; margin-left: auto; align-items: center; }
.pub-head nav a:not(.pbtn) { color: var(--muted); text-decoration: none; font-weight: 550; }
.pub-head nav a:not(.pbtn):hover { color: var(--text); }
@media (max-width: 719px) { .pub-head nav .opt { display: none; } .pub-head nav { gap: 1rem; } }

/* ---------- buttons ---------- */
.pbtn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .65rem 1.2rem; border-radius: 12px; border: 1px solid transparent; font-weight: 650; font-size: 1rem; text-decoration: none; cursor: pointer; transition: transform .08s, background-color .15s, border-color .15s; }
.pbtn:active { transform: scale(.98); }
.pbtn.solid { background: var(--brand); color: var(--brand-ink); }
.pbtn.solid:hover { background: #fff; }
.pbtn.ghost { border-color: #2c4251; color: var(--text); background: transparent; }
.pbtn.ghost:hover { border-color: var(--link); }
.pbtn.sm { min-height: 40px; padding: .4rem .95rem; font-size: .95rem; }

/* ---------- layout ---------- */
.pub-wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem 3rem; }
.pub-sec { padding: 4.5rem 0 0; }
body.pub .pub-sec > h2 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem); font-weight: 780; letter-spacing: -.025em; max-width: 24ch; margin: 0 0 .8rem; }
.pub-sec > .intro { color: var(--muted); font-size: 1.1rem; max-width: 56ch; margin: 0 0 2.2rem; }

/* ---------- hero ---------- */
.pub-hero { display: grid; gap: 2.5rem; padding: 3.5rem 0 0; position: relative; }
.pub-hero::before { content: ""; position: absolute; z-index: -1; right: -8%; top: 4%; width: 60%; height: 80%; background: radial-gradient(closest-side, rgba(85, 230, 184, .13), transparent 70%); pointer-events: none; }
body.pub .pub-hero h1 { font-size: clamp(2.6rem, 1.4rem + 5.6vw, 5rem); font-weight: 800; line-height: .98; letter-spacing: -.04em; margin: 0 0 1.4rem; max-width: 13ch; }
.pub-hero .lead { font-size: 1.2rem; line-height: 1.55; color: var(--muted); max-width: 34rem; margin: 0 0 1.8rem; }
.pub-hero .cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.1rem; }
.pub-hero .fine { color: var(--muted); font-size: .95rem; max-width: 34rem; margin: 0; }
@media (min-width: 960px) { .pub-hero { grid-template-columns: 1fr 1.05fr; align-items: center; gap: 3.5rem; padding-top: 5rem; } }

/* ---------- the incident trace (the one memorable thing) ---------- */
.trace { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; font-family: var(--mono); font-size: .86rem; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7); }
.trace-top { display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.trace-top .live { width: 9px; height: 9px; border-radius: 50%; background: var(--pub-ok); box-shadow: 0 0 0 0 rgba(85, 230, 184, .6); animation: live 2.4s ease-out 3; }
@keyframes live { 70%, 100% { box-shadow: 0 0 0 9px rgba(85, 230, 184, 0); } }
.trace-top .what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trace-tabs { display: flex; gap: .35rem; padding: .6rem .8rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.trace-tabs[hidden] { display: none; }
.trace-tabs button { flex: none; font: inherit; font-family: var(--font-ui); font-size: .88rem; font-weight: 600; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 9px; padding: .4rem .75rem; min-height: 36px; cursor: pointer; }
.trace-tabs button:hover { color: var(--text); }
.trace-tabs button[aria-selected="true"] { color: var(--text); background: var(--surface-2); border-color: #2a4050; }
.trace-body { padding: .6rem 0; min-height: 17.5rem; }
.trace-body [role="tabpanel"][hidden] { display: none; }
.tr-row { display: grid; grid-template-columns: 3.9rem 5.6rem 1fr; gap: .2rem .7rem; padding: .42rem 1rem; line-height: 1.45; }
.js .tr-row { opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s; }
.js .tr-row.in { opacity: 1; transform: none; }
.tr-row .t { color: #5f7686; }
.tr-row .tag { font-weight: 600; }
.tag-check, .tag-ping { color: var(--muted); }
.tag-incident, .tag-listed { color: var(--pub-bad); }
.tag-alert { color: var(--pub-warn); }
.tag-resolved { color: var(--pub-ok); }
.tr-row .x { color: #cfdbe3; min-width: 0; overflow-wrap: anywhere; }
.trace-foot { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border-top: 1px solid var(--line); color: #5f7686; font-family: var(--font-ui); font-size: .85rem; }
.trace-foot b { font-weight: 600; color: var(--pub-ok); }
@media (max-width: 519px) { .tr-row { grid-template-columns: 3.2rem 1fr; } .tr-row .tag { grid-column: 2; } .tr-row .x { grid-column: 2; } .trace { font-size: .82rem; } }

/* ---------- the services, as small apps ---------- */
.svc-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.svc { position: relative; overflow: hidden; padding: 1.4rem 1.5rem 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; transition: transform .25s ease, border-color .25s ease; }
.svc::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(143, 211, 255, .11), transparent 70%); }
.svc:hover { transform: translateY(-3px); border-color: #34536a; }
.svc:hover::before { opacity: 1; }
.svc .tile { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 1rem; border-radius: 13px; color: var(--link); background: var(--surface-2); border: 1px solid #25394a; }
.svc.big .tile { width: 54px; height: 54px; border-radius: 15px; }
body.pub .svc h3 { font-size: 1.15rem; font-weight: 720; letter-spacing: -.015em; line-height: 1.2; margin: 0 0 .5rem; }
.svc p { margin: 0; color: var(--muted); max-width: 46ch; }
.svc.big p { font-size: 1.02rem; }
body.pub .svc.big h3 { font-size: 1.5rem; letter-spacing: -.025em; line-height: 1.12; }
@media (min-width: 720px) { .svc-grid { grid-template-columns: repeat(2, 1fr); } .svc.big:first-child { grid-column: 1 / -1; } }
@media (min-width: 1000px) {
  .svc-grid { grid-template-columns: repeat(12, 1fr); }
  .svc { grid-column: span 3; }
  .svc.big, .svc.big:first-child { grid-column: span 4; padding: 1.7rem 1.7rem 1.8rem; }
}

/* small living pictures inside the three big cards (decorative, aria-hidden) */
.viz { margin-top: 1.4rem; }
.viz.bars { display: flex; align-items: flex-end; gap: 3px; height: 38px; }
.viz.bars i { flex: 1; height: 100%; border-radius: 2px; background: var(--pub-ok); opacity: .75; transform-origin: bottom; transition: transform .5s cubic-bezier(.2, .8, .2, 1) calc(var(--i) * 28ms); }
.viz.bars i.w { background: var(--pub-warn); }
.viz.scan { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; font-family: var(--mono); font-size: .78rem; }
.viz.scan span { padding: .3rem .5rem; border: 1px solid var(--line); border-radius: 8px; color: var(--pub-ok); background: rgba(85, 230, 184, .06); transition: opacity .4s calc(var(--i) * 260ms), transform .4s calc(var(--i) * 260ms); }
.js .svc:not(.seen) .viz.bars i { transform: scaleY(.08); }
.js .svc:not(.seen) .viz.scan span { opacity: 0; transform: translateY(5px); }

/* icon motion: plays once when the card first scrolls into view, and again whenever the pointer is on it */
.svc-ic .a-sweep { transform-origin: 12px 12px; }
.svc-ic .a-merid { transform-origin: 12px 12px; }
.svc-ic .a-dot { transform-origin: 6.5px 6.8px; }
.svc-ic .a-draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
.js .svc:not(.seen) .a-draw { stroke-dashoffset: 1; }
.js .svc:not(.seen) .a-fade { opacity: 0; }
.svc.seen .a-sweep { animation: sweep 1.8s cubic-bezier(.4, 0, .2, 1) 1; }
.svc.seen .a-draw { animation: draw 1s ease-out both; }
.svc.seen .a-fade { animation: appear .8s .2s both; }
.svc.seen .a-dot { animation: beat 1.2s ease-in-out 3; }
.svc.seen .a-merid { animation: spin 1.8s ease-in-out 1; }
.svc:hover .a-sweep { animation: sweep 2.2s linear infinite; }
.svc:hover .a-draw { animation: draw2 .9s ease-out both; }
.svc:hover .a-dot { animation: beat2 1s ease-in-out infinite; }
.svc:hover .a-merid { animation: spin2 1.8s ease-in-out infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes draw2 { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes beat { 50% { transform: scale(2); } }
@keyframes beat2 { 50% { transform: scale(2); } }
@keyframes spin { 50% { transform: scaleX(.15); } }
@keyframes spin2 { 50% { transform: scaleX(.15); } }

/* ---------- developers and agents ---------- */
.dev { display: grid; gap: 2rem; align-items: start; }
.dev .copy p { color: var(--muted); font-size: 1.1rem; max-width: 40ch; margin: 0 0 1.2rem; }
.dev .copy a { color: var(--link); font-weight: 600; }
.code { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; font-family: var(--mono); font-size: .85rem; line-height: 1.65; overflow-x: auto; color: #cfdbe3; }
.code .c { color: #5f7686; }
.code .k { color: var(--pub-ok); }
.ask { margin: 0 0 .9rem; padding: 1rem 1.2rem; border-radius: 14px; border: 1px solid #2a4050; background: var(--surface-2); font-size: 1.05rem; line-height: 1.5; }
.ask small { display: block; margin-bottom: .3rem; font-size: .85rem; }
@media (min-width: 900px) { .dev { grid-template-columns: .85fr 1.15fr; gap: 3.5rem; } }

/* ---------- plans ---------- */
.plans { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.plan { padding: 1.4rem 1.5rem; border-bottom: 1px solid var(--line); }
.plan:last-child { border-bottom: 0; }
body.pub .plan h3 { font-size: 1.1rem; font-weight: 700; margin: 0 0 .3rem; }
.plan .price { font-family: var(--font-display); font-size: 2.1rem; font-weight: 780; letter-spacing: -.03em; line-height: 1.1; }
.plan .price small { font-family: var(--font-ui); font-size: .95rem; font-weight: 500; letter-spacing: 0; }
.plan p { margin: .55rem 0 0; color: var(--muted); }
@media (min-width: 900px) { .plans { grid-template-columns: repeat(4, 1fr); } .plan { border-bottom: 0; border-right: 1px solid var(--line); } .plan:last-child { border-right: 0; } }
.more { margin: 1.2rem 0 0; color: var(--muted); }
.more a { color: var(--link); font-weight: 600; }

/* ---------- closing ---------- */
.closer { margin-top: 5rem; padding: 3rem 0 0; border-top: 1px solid var(--line); display: grid; gap: 1.5rem; }
body.pub .closer h2 { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 3rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; margin: 0; max-width: 18ch; }
.closer p { margin: 0; color: var(--muted); }

/* ---------- footer ---------- */
.pub-foot { border-top: 1px solid var(--line); padding: 1.6rem max(1.25rem, calc((100% - 69.5rem) / 2)); color: var(--muted); }
.pub-foot .in { display: flex; gap: 1.5rem 2rem; flex-wrap: wrap; justify-content: space-between; }
.pub-foot a { color: var(--muted); }
.pub-foot a:hover { color: var(--text); }
.pub-foot ul { list-style: none; padding: 0; margin: 0; display: flex; gap: .4rem 1.2rem; flex-wrap: wrap; }

/* pricing page, legacy markup on the dark skin */
.pub-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.pub-grid .surface { padding: 1.25rem; }
.pub-plan .price { font-size: 2rem; line-height: 1.1; }
.pub-plan ul { padding-left: 1.1rem; margin: .8rem 0 0; }
.pub-wrap > .page-head { padding-top: 3rem; }

@media (prefers-reduced-motion: reduce) {
  .svc, .svc::before, .viz.bars i, .viz.scan span { transition: none; }
  .svc:hover { transform: none; }
  .svc .svc-ic * { animation: none !important; }
  .js .svc:not(.seen) .a-draw { stroke-dashoffset: 0; }
  .js .svc:not(.seen) .a-fade, .js .svc:not(.seen) .viz.scan span { opacity: 1; transform: none; }
  .js .svc:not(.seen) .viz.bars i { transform: none; }
  .js .tr-row { opacity: 1; transform: none; transition: none; }
  .trace-top .live { animation: none; }
}

body.pub .dev h2 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem); font-weight: 780; letter-spacing: -.025em; max-width: 16ch; margin: 0 0 .8rem; }

/* plan comparison */
.compare th[scope="row"] { font-weight: 550; max-width: 30rem; }
.compare .yes { color: var(--pub-ok); font-weight: 700; }
.compare .no { color: #5f7686; }
