/* happyInference — landing page styles (extends assets/theme.css tokens) */

/* the console theme locks scroll; the landing scrolls */
html.landing, html.landing body { height: auto; overflow: visible; }
html.landing body {
  font-size: 16px;
  background:
    radial-gradient(700px 420px at 16% -120px, color-mix(in srgb, #2fc8ef 11%, transparent), transparent 70%),
    radial-gradient(860px 500px at 84% -140px, color-mix(in srgb, var(--brand) 13%, transparent), transparent 72%),
    radial-gradient(520px 320px at 50% -60px, color-mix(in srgb, var(--brand) 7%, transparent), transparent 75%),
    var(--bg);
}
/* fine engineering grid, fading out below the hero — precision, not noise */
html.landing body::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 920px; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(1150px 760px at 50% -40px, black 18%, transparent 82%);
  mask-image: radial-gradient(1150px 760px at 50% -40px, black 18%, transparent 82%);
}
/* film grain across the whole page — premium texture, nearly invisible but felt */
html.landing body::after {
  content: ""; position: fixed; inset: 0; z-index: 2000; pointer-events: none; opacity: .032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}
[data-theme="dark"] body::after { opacity: .05; }

/* accent variant — the logo's blue, as a Tweak */
[data-accent="blue"] { --brand:#2f96f0; --brand-2:#5eb1ff; --brand-weak:#10243c; --brand-ink:#9fcdff; }
[data-theme="light"][data-accent="blue"] { --brand:#1d7fe6; --brand-2:#4aa2ff; --brand-weak:#e8f2ff; --brand-ink:#1668c2; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }

/* ───────── nav ───────── */
.lnav { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--bg) 72%, transparent); -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%); }
.lnav-in { display: flex; align-items: center; gap: 28px; height: 64px; }
.lnav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.lnav-links { display: flex; gap: 26px; margin-left: auto; }
.lnav-links a { font-size: 13.5px; font-weight: 500; color: var(--muted); transition: color var(--d-fast) var(--ease); }
.lnav-links a:hover { color: var(--ink); }
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; font-weight: 600; font-size: 14px;
  padding: 10px 18px; border: 1px solid transparent; transition: all var(--d-base) var(--ease); white-space: nowrap; }
.btn-brand { background: var(--brand); color: #fff; box-shadow: var(--sh-sm); }
.btn-brand:hover { background: var(--brand-2); transform: translateY(-1px); box-shadow: var(--glow-brand); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-ink); }
.btn-lg { padding: 13px 24px; font-size: 15px; border-radius: 12px; }
.lnav .btn { padding: 8px 15px; font-size: 13.5px; }

/* ───────── hero ───────── */
.hero { padding: 92px 0 56px; text-align: center; }
.hero .wrap { position: relative; }
/* floating brand pixels — the logo's pixel structure, scattered as background motif */
.hero-pixels { position: absolute; inset: -40px 0 0 0; pointer-events: none; z-index: -1; }
.hero-pixels i { position: absolute; display: block; border-radius: 1.5px; animation: px-float var(--pxd, 7s) ease-in-out var(--pxw, 0s) infinite alternate; }
@keyframes px-float { to { transform: translateY(-12px); } }
@media (prefers-reduced-motion: reduce) { .hero-pixels i { animation: none; } }
.hero-mark { display: inline-grid; place-items: center; margin-bottom: 26px; position: relative; }
.hero-mark .hi-mark { filter: drop-shadow(0 10px 22px color-mix(in srgb, #2b93f1 26%, transparent)); }

/* composed brand mark: pixel spark + the real irregular smile (alpha mask → theme ink) */
.hi-mark { position: relative; display: inline-block; flex-shrink: 0; }
.hi-mark img { position: absolute; left: 26.4%; top: 18%; width: 46.8%; height: 46.4%; display: block; }
.hi-mark .hi-smile-wrap { position: absolute; left: 17%; top: 48.8%; width: 64.4%; height: 29.4%; }
.hi-mark .hi-smile-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hi-mark .hi-smile-wrap .smile-dark { display: none; }
[data-theme="dark"] .hi-mark .hi-smile-wrap .smile-light { display: none; }
[data-theme="dark"] .hi-mark .hi-smile-wrap .smile-dark { display: block; }
/* the smile arc orbits the pixel star (origin = spark center, relative to the smile box) */
.hero-mark .swing { transform-origin: 50.9% -25.9%; animation: hi-orbit 9s linear infinite; }
@keyframes hi-orbit { to { transform: rotate(360deg); } }
.eyebrow { font-size: 12px; font-weight: 650; letter-spacing: .18em; text-transform: uppercase; color: var(--brand-ink); margin-bottom: 18px; }
.hero h1 { font-size: clamp(40px, 5.4vw, 62px); line-height: 1.04; letter-spacing: -.035em; font-weight: 700; margin: 0 auto 22px; max-width: 880px; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--brand-ink); }
.hero-sub { font-size: 18.5px; line-height: 1.6; color: var(--muted); max-width: 660px; margin: 0 auto 34px; text-wrap: pretty; }
.hero-sub strong { color: var(--ink); font-weight: 600; }
.hero-cta { display: flex; gap: 14px; justify-content: center; margin-bottom: 30px; }
.hero-stack { display: flex; gap: 8px 22px; justify-content: center; flex-wrap: wrap; font-size: 12.5px; color: var(--faint); font-weight: 550; }
.hero-stack span::before { content: ""; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--brand); margin: 0 8px 2px 0; opacity: .65; }

/* ───────── product shot ───────── */
.shot-section { padding: 26px 0 30px; }
.shot-toggle { display: flex; justify-content: center; margin-bottom: 22px; }
.seg { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 3px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); }
.seg button { border: none; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 600; padding: 8px 16px; border-radius: var(--r-pill); transition: all var(--d-base) var(--ease); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.seg button .pct { font-family: var(--mono); font-size: 12.5px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-sm); }
.seg button[data-tone="bad"][aria-pressed="true"] .pct { color: var(--bad-ink); }
.seg button[data-tone="ok"][aria-pressed="true"] .pct { color: var(--ok-ink); }
.seg button[data-tone="brand"][aria-pressed="true"] .pct { color: var(--brand-ink); }
.browser { border: 1px solid var(--line-strong); border-radius: var(--r-lg); overflow: hidden; background: var(--surface);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 5%, transparent), 0 18px 40px -14px color-mix(in srgb, var(--ink) 16%, transparent), 0 44px 88px -32px color-mix(in srgb, var(--brand) 22%, transparent); }
.browser-bar { display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.browser-dots { display: flex; gap: 6px; }
.browser-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.browser-url { flex: 1; max-width: 360px; margin: 0 auto; text-align: center; font-family: var(--mono); font-size: 11.5px; color: var(--faint); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 4px 12px; }
.browser-stage { position: relative; aspect-ratio: 1440 / 900; transition: aspect-ratio .3s var(--ease); }
.browser-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .45s var(--ease); display: block; }
.shot-caption { text-align: center; font-size: 13px; color: var(--faint); margin-top: 16px; text-wrap: pretty; }
.shot-caption b { color: var(--muted); font-weight: 600; }

/* ───────── stats band ───────── */
.stats { padding: 64px 0 8px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.stat { background: var(--surface); padding: 28px 26px 24px; }
.stat .n { font-size: 40px; font-weight: 700; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .n small { font-size: 22px; font-weight: 650; color: var(--brand-ink); }
.stat .l { font-size: 13.5px; color: var(--muted); margin-top: 10px; line-height: 1.5; text-wrap: pretty; }
.stat .l code { font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* ───────── sections ───────── */
.section { padding: 96px 0 0; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.kicker { font-size: 11.5px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; color: var(--brand-ink); margin-bottom: 14px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 38px); letter-spacing: -.03em; line-height: 1.12; margin: 0 0 14px; font-weight: 700; text-wrap: balance; }
.section-head p { color: var(--muted); font-size: 16px; line-height: 1.65; margin: 0; text-wrap: pretty; }

/* loop cards */
.loop-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.loop-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px 18px; display: flex; flex-direction: column; gap: 10px; transition: all var(--d-base) var(--ease); }
.loop-card:hover { border-color: var(--brand); transform: translateY(-3px); box-shadow: var(--sh-base); }
.loop-num { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.loop-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-weak); color: var(--brand-ink); display: grid; place-items: center; }
.loop-card h3 { margin: 2px 0 0; font-size: 16px; letter-spacing: -.01em; }
.loop-card p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); flex: 1; text-wrap: pretty; }
.loop-card code { font-family: var(--mono); font-size: 10.5px; color: var(--brand-ink); background: var(--brand-weak); border-radius: 5px; padding: 3px 7px; align-self: flex-start; }

/* receipt */
.receipt-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 20px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); overflow: hidden; }
.card-hd { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-family: var(--mono); font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.card-hd b { color: var(--ink); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; border-radius: var(--r-pill); padding: 3px 9px; font-family: var(--sans); white-space: nowrap; }
.chip-ok { background: var(--ok-weak); color: var(--ok-ink); }
.chip-bad { background: var(--bad-weak); color: var(--bad-ink); }
.chip-brand { background: var(--brand-weak); color: var(--brand-ink); }
.doi-list { list-style: none; margin: 0; padding: 6px 0; display: flex; flex-direction: column; }
.doi-list li { display: grid; grid-template-columns: 16px 1fr auto; gap: 12px; align-items: baseline; padding: 10px 20px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.doi-list li:last-child { border-bottom: none; }
.doi-x { color: var(--bad); font-weight: 700; font-size: 12px; }
.doi-body .doi { font-family: var(--mono); font-size: 12.5px; color: var(--bad-ink); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.doi-body .topic { font-size: 12px; color: var(--muted); margin-top: 2px; }
.doi-verdict { font-family: var(--mono); font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.card-ft { display: flex; gap: 18px; flex-wrap: wrap; padding: 13px 20px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 12px; color: var(--muted); }
.card-ft b { color: var(--ink); font-variant-numeric: tabular-nums; }
.diag-block { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.diag-block:last-child { border-bottom: none; }
.diag-label { font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.diag-quote { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink); border-left: 2px solid var(--brand); padding-left: 14px; text-wrap: pretty; }
.fix-code { font-family: var(--mono); font-size: 12px; line-height: 1.7; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 0; white-space: pre-wrap; }
.fix-code .add { color: var(--ok-ink); }
.fix-code .del { color: var(--bad-ink); text-decoration: line-through; }
.diag-chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* connect */
.connect-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.connect-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; display: flex; flex-direction: column; gap: 14px; transition: all var(--d-base) var(--ease); }
.connect-card:hover { border-color: var(--line-strong); box-shadow: var(--sh-base); }
.connect-card h3 { margin: 0; font-size: 18px; letter-spacing: -.015em; }
.connect-card > p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.6; flex: 1; text-wrap: pretty; }
.codeblock { font-family: var(--mono); font-size: 12.5px; line-height: 1.8; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin: 0; overflow-x: auto; color: var(--ink); }
.codeblock .c-dim { color: var(--faint); }
.codeblock .c-brand { color: var(--brand-ink); }
.connect-note { font-size: 12px; color: var(--faint); }
.connect-note code { font-family: var(--mono); font-size: 11px; }

/* glass box / live shot */
.live-grid { display: grid; grid-template-columns: .9fr 1.4fr; gap: 44px; align-items: center; }
.live-points { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.live-points li { display: grid; grid-template-columns: 26px 1fr; gap: 13px; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.live-points b { color: var(--ink); font-weight: 600; }
.live-points .pt-ico { width: 26px; height: 26px; border-radius: 7px; background: var(--brand-weak); color: var(--brand-ink); display: grid; place-items: center; margin-top: 1px; }

/* stack */
.stack-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stack-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; transition: all var(--d-base) var(--ease); }
.stack-item:hover { border-color: var(--brand); transform: translateY(-2px); }
.stack-item .nm { font-weight: 650; font-size: 14.5px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.stack-item .nm::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--brand); flex-shrink: 0; }
.stack-item .role { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; text-wrap: pretty; }

/* closing cta — soft aurora glow behind the mark */
.closing { padding: 110px 0 90px; text-align: center; position: relative; }
.closing::before {
  content: ""; position: absolute; left: 50%; top: 40px; width: 760px; height: 420px; transform: translateX(-50%); z-index: -1; pointer-events: none;
  background:
    radial-gradient(340px 220px at 38% 42%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%),
    radial-gradient(340px 220px at 64% 55%, color-mix(in srgb, var(--ok) 9%, transparent), transparent 70%);
}
.closing h2 { font-size: clamp(30px, 4vw, 46px); letter-spacing: -.03em; margin: 26px 0 14px; font-weight: 700; }
.closing p { color: var(--muted); font-size: 16.5px; max-width: 540px; margin: 0 auto 32px; line-height: 1.6; text-wrap: pretty; }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 34px 0 44px; }
.footer-in { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; letter-spacing: -.02em; }
.footer-tag { color: var(--faint); font-size: 12.5px; }
.footer-meta { margin-left: auto; display: flex; gap: 20px; font-size: 12.5px; color: var(--faint); }
.footer-meta a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) { .hero-mark .swing { animation: none; } }

@media (max-width: 980px) {
  .loop-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .receipt-grid, .connect-grid, .live-grid { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
  .lnav-links { display: none; }
}
@media (max-width: 620px) {
  .loop-grid, .stats-grid, .stack-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 64px; }
  .hero-cta { flex-direction: column; align-items: center; }
  .seg { border-radius: 18px; }
  .seg button { padding: 7px 12px; font-size: 12.5px; }
}
