/* loghq marketing surface — shared design tokens + components.
  Every marketing page (landing, feature pages, use-cases) links this so the
  whole surface stays visually identical. Light + dark, Space Grotesk, emerald accent. */

:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #f4f5f8;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0b0f19;
  --text-2: #4b5565;
  --text-3: #6b7280;
  --accent: #047857;
  --accent-line: rgba(4, 120, 87, 0.34);
  --code-bg: #0b0f19;
  --code-ink: #d6deeb;
  /* Caption ink for the code surface. Not --text-3: the code block is dark
   * in BOTH themes, so the light --text-3 (#6b7280) lands on it at 3.96:1 —
   * the one WCAG AA failure left after the token pass. This clears 6.37:1 on
   * the light --code-bg and 6.70:1 on the dark one, so it needs no variant. */
  --code-cap: #8b95ab;
  --r: 14px;
  --r-sm: 9px;
  --sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090b11; --surface: #10131c; --surface-2: #161a24;
    --border: rgba(148, 163, 184, 0.12); --border-strong: rgba(148, 163, 184, 0.2);
    --text: #f3f5f9; --text-2: #b3bccb; --text-3: #79839a;
    --accent: #34d399;
    --accent-line: rgba(52, 211, 153, 0.32);
    --code-bg: #05070c;
  }
}
:root[data-theme="dark"] {
  --bg: #090b11; --surface: #10131c; --surface-2: #161a24;
  --border: rgba(148, 163, 184, 0.12); --border-strong: rgba(148, 163, 184, 0.2);
  --text: #f3f5f9; --text-2: #b3bccb; --text-3: #79839a;
  --accent: #34d399;
  --accent-line: rgba(52, 211, 153, 0.32);
  --code-bg: #05070c;
}
:root[data-theme="light"] {
  --bg: #fbfbfd; --surface: #ffffff; --surface-2: #f4f5f8;
  --border: rgba(15, 23, 42, 0.09); --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0b0f19; --text-2: #4b5565; --text-3: #6b7280;
  --accent: #047857;
  --accent-line: rgba(4, 120, 87, 0.34);
  --code-bg: #0b0f19;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  color: var(--text); background: var(--bg);
  font-family: var(--sans); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

.shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.shell-narrow { width: min(920px, calc(100% - 48px)); margin: 0 auto; }
.mono { font-family: var(--mono); }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.brand-mark {
  /* Mono for the glyph: Space Grotesk draws lowercase "l" as a bare vertical
     stroke, which reads as a capital "I" at 30px. */
  font-family: var(--mono);
  display: grid; place-items: center; width: 30px; height: 30px;
  border: 1px solid var(--accent-line); border-radius: var(--r-sm);
  color: var(--accent); font-weight: 700; font-size: 1rem; line-height: 1;
}
.brand-name { font-weight: 700; font-size: 1.12rem; letter-spacing: -0.02em; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; margin-left: auto; color: var(--text-2); font-size: 0.9rem; }
.nav-links a { transition: color 0.16s ease; }
.nav-links a:hover { color: var(--text); }
.nav-cta { margin-left: 1.6rem; }

.nav-menu { display: none; margin-left: auto; position: relative; }
.nav-menu > summary {
  list-style: none; display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); cursor: pointer;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.burger, .burger::before, .burger::after {
  display: block; width: 18px; height: 1.5px; background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.burger { position: relative; }
.burger::before { content: ""; position: absolute; top: -5px; }
.burger::after { content: ""; position: absolute; top: 5px; }
.nav-menu[open] .burger { background: transparent; }
.nav-menu[open] .burger::before { transform: translateY(5px) rotate(45deg); }
.nav-menu[open] .burger::after { transform: translateY(-5px) rotate(-45deg); }
.nav-menu-panel {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 50;
  display: flex; flex-direction: column; gap: 0.25rem; min-width: 232px; padding: 0.6rem;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}
.nav-menu-panel a { padding: 0.6rem 0.7rem; border-radius: var(--r-sm); color: var(--text-2); font-size: 0.95rem; }
.nav-menu-panel a:hover { color: var(--text); background: var(--surface-2); }
.nav-menu-panel .btn { margin-top: 0.35rem; justify-content: center; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 46px; padding: 0 1.15rem; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  color: var(--text); font-family: var(--sans); font-weight: 600; font-size: 0.92rem;
  white-space: nowrap; background: transparent; cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.btn.sm { min-height: 38px; padding: 0 0.85rem; font-size: 0.86rem; }
.btn.primary { border-color: var(--accent); color: var(--accent-ink); background: var(--accent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.ghost:hover { border-color: var(--accent-line); }
.btn:active { transform: translateY(1px); }

/* section scaffolding */
.section { padding: 3.5rem 0; }
.section-head { max-width: 62ch; margin-bottom: 1.75rem; }
.section-title { margin: 0; font-weight: 700; font-size: clamp(1.6rem, 3.5vw, 2.2rem); letter-spacing: -0.03em; line-height: 1.1; }
.section-intro { margin: 0.9rem 0 0; color: var(--text-2); font-size: 1.02rem; line-height: 1.6; }
.eyebrow { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.textlink { color: var(--accent); font-weight: 500; }
.textlink:hover { text-decoration: underline; }

/* hero */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3.5rem; align-items: center; padding: 3.5rem 0 4rem; }
.hero-title { margin: 0; font-weight: 700; font-size: clamp(2.3rem, 5.4vw, 3.4rem); letter-spacing: -0.035em; line-height: 1.04; }
.hero-sub { margin: 1.25rem 0 0; color: var(--text-2); font-size: 1.08rem; line-height: 1.6; max-width: 54ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

/* single-column feature/use-case hero */
.feat-hero { padding: 2.5rem 0 1.5rem; max-width: 62ch; }
.feat-hero .kicker { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.feat-hero h1 { margin: 1rem 0 0; font-weight: 700; font-size: clamp(2.1rem, 5vw, 3.1rem); line-height: 1.05; letter-spacing: -0.03em; }
.feat-hero p { margin: 1.1rem 0 0; color: var(--text-2); font-size: 1.05rem; line-height: 1.6; }
.feat-hero .hero-actions { margin-top: 1.75rem; }

.subnav { display: flex; align-items: center; gap: 0.5rem; padding-top: 1.75rem; color: var(--text-3); font-size: 0.88rem; }
.subnav a { color: var(--text-2); transition: color 0.16s ease; }
.subnav a:hover { color: var(--text); }
.subnav .sep { color: var(--text-3); }
/* The trail is an <ol> so its order is exposed to assistive tech. The list and
  its items carry the flex layout the nav used to hold directly, so the visual
  result is unchanged. `display: contents` would be shorter and is avoided
  deliberately — several engines drop list items from the accessibility tree
  when it is applied, which would undo the reason for using a list. */
.subnav ol { display: flex; align-items: center; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.subnav li { display: flex; align-items: center; gap: 0.5rem; }

/* code panel */
.code { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.code-bar { display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 1rem; border-bottom: 1px solid rgba(148,163,184,0.14); }
.code-body { margin: 0; padding: 1.1rem 1.25rem; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; color: var(--code-ink); }
.chart-cap { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
/* Only on the code surface. `.chart-cap` is also used inside `.panel-head`,
  which sits on the normal page surface where --text-3 is the correct token. */
.code-bar .chart-cap { color: var(--code-cap); }

/* panel (data viz container) */
.panel { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); padding: 1.4rem 1.5rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.panel-tag { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.live { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--text-2); }
.live-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.stat-big { margin: 0; font-weight: 700; font-size: 2.6rem; letter-spacing: -0.03em; }
.stat-label { margin: 0.15rem 0 0; color: var(--text-3); font-size: 0.9rem; }

/* trackless bars */
.bar-row { display: grid; grid-template-columns: 148px 1fr 52px; align-items: center; gap: 0.9rem; padding: 0.5rem 0; }
.bar-row + .bar-row { border-top: 1px solid var(--border); }
.bar-label { color: var(--text-2); font-size: 0.88rem; }
.bar-track { height: 8px; border-radius: 999px; background: transparent; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); opacity: 0.82; min-width: 4px; }
.bar-value { font-family: var(--mono); font-size: 0.82rem; color: var(--text); text-align: right; }

/* stat/severity tiles */
.vitals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.vital { padding: 1.4rem 1.5rem; background: var(--surface); }
.vital-k { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.vital-v { margin-top: 0.5rem; font-weight: 700; font-size: 1.9rem; letter-spacing: -0.02em; color: var(--text); }
.vital-tag { margin-top: 0.4rem; display: inline-flex; font-size: 0.78rem; color: var(--accent); }

/* numbered flow */
.flow { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.flow-step { display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; padding: 1.4rem 1.5rem; background: var(--surface); }
.flow-num { font-family: var(--mono); font-size: 0.82rem; color: var(--accent); padding-top: 0.15rem; }
.flow-step h3 { margin: 0; font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }
.flow-step p { margin: 0.4rem 0 0; color: var(--text-2); font-size: 0.95rem; line-height: 1.55; }

/* metric tiles */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem 2.5rem; }
.metric .m-value { font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.4rem); letter-spacing: -0.02em; color: var(--text); }
.metric .m-label { margin-top: 0.35rem; color: var(--text-2); font-size: 0.9rem; line-height: 1.5; }

/* chips grid */
.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.chip { border: 1px solid var(--border); border-radius: var(--r); padding: 1.4rem 1.5rem; background: var(--surface); }
.chip h3 { margin: 0; font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }
.chip p { margin: 0.5rem 0 0; color: var(--text-2); font-size: 0.94rem; line-height: 1.6; }

/* feature bento (landing) */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.cell { display: block; padding: 1.5rem 1.6rem; background: var(--surface); transition: background 0.16s ease; }
a.cell { cursor: pointer; }
a.cell:hover { background: var(--surface-2); }
.cell h3 { margin: 0; font-weight: 600; font-size: 1.08rem; letter-spacing: -0.015em; }
.cell p { margin: 0.5rem 0 0; color: var(--text-2); font-size: 0.93rem; line-height: 1.55; }
.cell.lead { grid-column: span 1; }
.cell.tint { background: var(--accent-soft); }
a.cell.tint:hover { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
/* Featured bento cell: a soft rose wash (bughq accent) tinted into a corner, so
  the grid has visual variation rather than six identical text cards. */
.cell.feature { background: radial-gradient(120% 140% at 100% 0%, var(--accent-soft), transparent 58%), var(--surface); }
a.cell.feature:hover { background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%), var(--surface-2); }
.cell.feature h3 { color: var(--accent); }
.cell-more { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 1rem; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); transition: color 0.16s ease, gap 0.16s ease; }
.cell-more::after { content: "\2192"; }
a.cell:hover .cell-more { color: var(--accent); gap: 0.55rem; }

/* comparison table */
.cmp { display: grid; grid-template-columns: 1.1fr 1fr 1fr; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.cmp-cell { padding: 1rem 1.2rem; border-top: 1px solid var(--border); background: var(--surface); font-size: 0.92rem; }
.cmp-cell:nth-child(-n+3) { border-top: none; font-weight: 600; }
.cmp-dim { color: var(--text-3); }
.cmp-ghost { color: var(--text); }

/* related features */
.related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.related a { display: block; padding: 1.3rem 1.4rem; background: var(--surface); transition: background 0.16s ease; }
.related a:hover { background: var(--surface-2); }
.related .r-name { font-weight: 600; font-size: 1rem; color: var(--text); letter-spacing: -0.01em; }
.related .r-desc { margin-top: 0.3rem; color: var(--text-3); font-size: 0.86rem; line-height: 1.45; }

/* use-case cards */
.usecases { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.usecase { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.usecase img { display: block; width: 100%; height: 168px; object-fit: cover; }
.usecase-body { padding: 1.4rem 1.5rem 1.6rem; }
.usecase-body h2 { margin: 0; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.usecase-body p { margin: 0.55rem 0 0; color: var(--text-2); font-size: 0.94rem; line-height: 1.6; }
.usecase-body .textlink { margin-top: 0.9rem; display: inline-block; }

/* cta band */
.cta-band { border: 1px solid var(--border); border-radius: var(--r); padding: 2.5rem; background: var(--surface); text-align: center; }
.cta-band h2 { margin: 0 auto; max-width: 30ch; font-weight: 700; font-size: clamp(1.5rem, 3.5vw, 2rem); letter-spacing: -0.03em; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 1.5rem; }

/* subscribe form
  Sized to the band's own rhythm: the input borrows the .btn min-height so the
  field and its button line up without a magic number, and the row collapses to
  a stack under 30rem rather than squeezing a 40-character field. */
.sub-form { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin: 1.5rem auto 0; max-width: 27rem; }
.sub-field { flex: 1 1 15rem; min-width: 0; min-height: 44px; padding: 0 0.9rem; border: 1px solid var(--border-strong, var(--border)); border-radius: calc(var(--r) - 4px); background: var(--bg); color: var(--text); font: inherit; font-size: 0.95rem; transition: border-color 0.16s ease, box-shadow 0.16s ease; }
.sub-field::placeholder { color: var(--text-3); }
.sub-field:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
/* Defined here rather than assumed from the utility layer: this stylesheet is
  the page's own contract, and a visually-hidden helper that silently is not
  emitted shows up as a stray label sitting above the field. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sub-note { margin: 0.85rem auto 0; max-width: 40ch; color: var(--text-3); font-size: 0.84rem; line-height: 1.5; }
.sub-note a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
/* One line, reserved by min-height so a reply does not shift the section. */
.sub-status { margin: 0.85rem auto 0; min-height: 1.25rem; color: var(--text-2); font-size: 0.88rem; }
.sub-status[data-state="error"] { color: var(--accent); }
@media (max-width: 30rem) { .sub-form { flex-direction: column; } .sub-form .btn { width: 100%; justify-content: center; } }

/* footer */
.footer { padding: 2.5rem 0; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.5rem; border-top: 1px solid var(--border); color: var(--text-3); font-size: 0.88rem; }

/* motion — `.reveal` is NOT declared here.
 *
 * It used to be, and app-chrome.css declared it too: two `.reveal` rules and
 * two identically-named `@keyframes reveal` in two sheets that are both loaded
 * on every marketing page. This file wins on order, so marketing pages animated
 * over 0.6s/12px and the dashboard — the one app page that uses .reveal, and
 * which never loads this file — animated over 0.5s/10px. Nothing intended that
 * split; it was drift between two copies.
 *
 * The single definition lives in app-chrome.css, which is the site-wide sheet,
 * and it carries these values because 23 marketing pages used them against the
 * dashboard's one. A same-named @keyframes in a later sheet REPLACES rather
 * than merges, so the duplicate was also a live footgun: editing the copy here
 * would have silently changed marketing pages only.
 */

/* responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 2.5rem; }
  .bento, .related, .cmp { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .chips, .usecases { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-menu { display: block; }
}
@media (max-width: 560px) {
  .metrics, .vitals { grid-template-columns: 1fr; }
  .flow-step { grid-template-columns: 1fr; gap: 0.4rem; }
  .bar-row { grid-template-columns: 120px 1fr 44px; }
}

/* login link beside the Sign up nav button */
.nav-login { color: var(--text-2); font-size: 0.9rem; transition: color 0.16s ease; }
.nav-login:hover { color: var(--text); }
.nav-cta { margin-left: 0.95rem; }

/* CSS-only mega menu, from SiteNav.stx's <style> block. It lives here rather
 * than in the partial because none of what follows is expressible as a
 * utility: two pseudo-elements (the caret and the invisible hover bridge that
 * lets the pointer cross the 14px gap), ancestor-state descendants
 * (`.mega:hover .mega-panel`), a `:not(:first-child)`, and a max-width media
 * query — Crosswind emits nothing for any of them. The leaf styling that IS
 * expressible (.mega-t, .mega-d, the panel links, the menu group's own box)
 * became utilities in the markup and is deliberately absent here.
 *
 * A linked stylesheet is also the router-safe home: the SPA router destroys
 * every <head> style that is not the Crosswind tag on navigation.
 */
.mega { position: relative; display: inline-flex; align-items: center; }
.mega-trigger { display: inline-flex; align-items: center; gap: 0.32rem; cursor: pointer; }
.mega-trigger::after {
  content: "\25BE"; font-size: 0.62em; line-height: 1; color: var(--text-3);
  transition: transform 0.18s ease, color 0.18s ease;
}
.mega:hover .mega-trigger, .mega:focus-within .mega-trigger { color: var(--text); }
.mega:hover .mega-trigger::after, .mega:focus-within .mega-trigger::after { transform: rotate(180deg); color: var(--accent); }

.mega-panel {
  position: absolute; top: 100%; left: 50%; z-index: 50;
  margin-top: 14px;
  display: grid; grid-template-columns: repeat(2, minmax(216px, 1fr)); gap: 0.12rem;
  min-width: 484px; padding: 0.55rem;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(-50%) translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}
.mega-panel::before { content: ""; position: absolute; top: -14px; left: 0; right: 0; height: 14px; }
.mega:hover .mega-panel, .mega:focus-within .mega-panel {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-menu-group:not(:first-child) { margin-top: 0.35rem; border-top: 1px solid var(--border); }

@media (prefers-reduced-motion: reduce) {
  .mega-trigger::after, .mega-panel { transition: none; }
}
@media (max-width: 900px) {
  /* desktop mega hidden with .nav-links; the <details> menu takes over */
  .mega-panel { display: none; }
}
