/* ============================================================
   LATTICE product pages - builds on /assets/site.css tokens
   ============================================================ */
/* ---- LATTICE brand: red accent replaces Fraktal aqua on these pages ----
   #e31305 (LATTICE red) for fills, borders, icons and large text;
   #f03a2a (LATTICE red light) for small text, to keep AA contrast on ink. */
body[data-brand="lattice"]{
  --accent:#e31305; --accent-hover:#f03a2a; --accent-press:#c01004;
  --accent-quiet:rgba(227,19,5,0.12); --accent-line:rgba(227,19,5,0.40);
  --on-accent:#ffffff; --link:#f03a2a; --accent-text:#f03a2a;
  --glow-accent:0 0 0 1px rgba(227,19,5,0.40),0 0 28px rgba(227,19,5,0.24);
  --ring:0 0 0 3px rgba(240,58,42,0.55);
}
body[data-brand="lattice"] ::selection{background:rgba(227,19,5,0.30);color:var(--ink-50)}
body[data-brand="lattice"] .hero .field{background-image:url('/assets/fractal-field-lattice.svg')}
body[data-brand="lattice"] .lattice{background-image:
  linear-gradient(to right,rgba(227,19,5,0.05) 1px,transparent 1px),
  linear-gradient(to bottom,rgba(227,19,5,0.05) 1px,transparent 1px)}
body[data-brand="lattice"] .eyebrow,
body[data-brand="lattice"] .tag.accent,
body[data-brand="lattice"] .tag.live,
body[data-brand="lattice"] .feat .go,
body[data-brand="lattice"] .pitem .no,
body[data-brand="lattice"] .journey .no,
body[data-brand="lattice"] .arch .core .note{color:var(--accent-text)}

/* LATTICE lockup - matches the app (frontend-starter LatticeLogo.js): mark + wordmark both #e31305,
   Outfit 700, 0.08em tracking, line-height 1. Sizes: sidebar 28px/1.35rem/10px, login 40px/2rem/14px,
   compact 24px/1.125rem/8px. */
.lwm{font-family:"Outfit",sans-serif;font-weight:700;letter-spacing:0.08em;line-height:1;color:#e31305}
.lockup{display:inline-flex;align-items:center;color:#e31305}
.lockup svg{display:block;flex:none}

/* ---- product sub-nav ---- */
.subnav{position:sticky;top:68px;z-index:40;background:rgba(12,26,38,0.92);
  -webkit-backdrop-filter:saturate(140%) blur(12px);backdrop-filter:saturate(140%) blur(12px);
  border-top:1px solid var(--border-faint);border-bottom:1px solid var(--border)}
.subnav .row{display:flex;align-items:center;gap:28px;min-height:52px}
.subnav .brand{gap:10px;flex:none}
.subnav .brand svg{width:28px;height:28px}
.subnav .brand .lwm{font-size:1.35rem}
.subnav nav{flex:1;min-width:0}
.subnav .tabs{display:flex;gap:4px;list-style:none;margin:0;padding:0;overflow-x:auto;scrollbar-width:none}
.subnav .tabs::-webkit-scrollbar{display:none}
.subnav .tabs a{display:inline-flex;align-items:center;height:52px;padding:0 12px;white-space:nowrap;
  font-family:var(--font-mono);font-size:12.5px;letter-spacing:0.04em;color:var(--text-muted);
  border-bottom:2px solid transparent;transition:var(--tx)}
.subnav .tabs a:hover{color:var(--text)}
.subnav .tabs a[aria-current="page"]{color:var(--text);border-bottom-color:var(--accent)}
section{scroll-margin-top:136px}

/* ---- product hero ---- */
.phero .inner{padding-top:88px;padding-bottom:76px}
.phero h1{font-size:clamp(38px,5.2vw,66px)}
.phero .stats{grid-template-columns:repeat(4,auto)}
.phero .mark{display:flex;width:max-content;gap:14px;margin-bottom:22px}
.phero .mark svg{width:40px;height:40px}
.phero .mark .lwm{font-size:2rem}

/* ---- generic section ---- */
.lsec{padding:96px 0}
.lsec.tight{padding-top:24px}
.lsec.alt{background:var(--surface);border-top:1px solid var(--border);border-bottom:1px solid var(--border)}
.lead-xl{font-family:var(--font-display);font-weight:500;font-size:clamp(22px,2.4vw,30px);line-height:1.3;
  letter-spacing:-0.015em;color:var(--text);max-width:900px;text-wrap:pretty}
.lead-xl em{font-style:normal;color:var(--accent)}
.prose{max-width:720px;margin-top:22px}
.prose p{font-size:16px;line-height:1.65;color:var(--text-muted)}
.prose p+p{margin-top:14px}

/* ---- feature grid ---- */
.fgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-top:46px}
.fgrid.two{grid-template-columns:repeat(2,1fr)}
.feat{padding:28px;display:flex;flex-direction:column;gap:12px}
.feat .icon{width:42px;height:42px;display:inline-flex;align-items:center;justify-content:center;
  border-radius:var(--radius-sm);background:var(--accent-quiet);border:1px solid var(--accent-line);color:var(--accent)}
.feat .icon [data-lucide]{width:19px;height:19px}
.feat h3{font-size:19px;letter-spacing:-0.015em;margin-top:4px}
.feat p{font-size:14.5px;line-height:1.58;color:var(--text-muted)}
.feat .tags{display:flex;gap:7px;flex-wrap:wrap;margin-top:auto;padding-top:6px}
.feat .go{display:inline-flex;align-items:center;gap:8px;margin-top:auto;padding-top:8px;
  font-family:var(--font-mono);font-size:12.5px;letter-spacing:0.04em;color:var(--accent)}
.feat .go .ic{width:15px;height:15px}
a.feat{color:inherit}

/* ---- principles (numbered, two columns) ---- */
.plist{display:grid;grid-template-columns:repeat(2,1fr);gap:0 56px;margin-top:46px;border-top:1px solid var(--border)}
.pitem{display:grid;grid-template-columns:44px 1fr;gap:4px 14px;padding:26px 0;border-bottom:1px solid var(--border)}
.pitem .no{font-family:var(--font-mono);font-size:12px;color:var(--accent);letter-spacing:0.08em;padding-top:4px;
  font-feature-settings:"ss01","zero"}
.pitem h3{font-size:18px;font-weight:600;letter-spacing:-0.01em}
.pitem p{grid-column:2;font-size:14.5px;line-height:1.6;color:var(--text-muted);margin-top:6px}

/* ---- journey (numbered steps, wraps) ---- */
.journey{list-style:none;margin:46px 0 0;padding:0;display:grid;grid-template-columns:repeat(4,1fr);
  gap:0;border-top:1px solid var(--border)}
.journey li{padding:26px 24px 26px 0;border-bottom:1px solid var(--border)}
.journey li:not(:nth-child(4n+1)){padding-left:24px;border-left:1px solid var(--border)}
.journey .no{font-family:var(--font-mono);font-size:12px;color:var(--accent);letter-spacing:0.08em}
.journey h3{font-size:16.5px;font-weight:600;letter-spacing:-0.01em;margin-top:12px}
.journey p{font-size:13.5px;line-height:1.55;color:var(--text-muted);margin-top:8px}

/* ---- rule / data tables ---- */
.tablewrap{margin-top:40px;border:1px solid var(--border);border-radius:var(--radius-md);overflow:hidden;background:var(--surface)}
.dtable{width:100%;border-collapse:collapse;font-size:14px}
.dtable th{text-align:left;font-family:var(--font-mono);font-weight:500;font-size:11px;letter-spacing:0.12em;
  text-transform:uppercase;color:var(--text-subtle);padding:14px 18px;border-bottom:1px solid var(--border);background:var(--surface-inset)}
.dtable td{padding:15px 18px;border-bottom:1px solid var(--border-faint);vertical-align:top;color:var(--text-muted);line-height:1.5}
.dtable tr:last-child td{border-bottom:none}
.dtable td:first-child{color:var(--text);font-weight:600;width:30%}

/* ---- status tags ---- */
.tag.live{background:var(--accent-quiet);border-color:var(--accent-line);color:var(--accent)}
.tag.next{border-style:dashed;color:var(--text-subtle)}

/* ---- tiers ---- */
.tiers{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin-top:46px}
.tier{padding:24px;display:flex;flex-direction:column;gap:10px}
.tier .lvl{display:flex;gap:4px}
.tier .lvl i{display:block;width:18px;height:4px;border-radius:2px;background:var(--ink-700)}
.tier .lvl i.on{background:var(--accent)}
.tier h3{font-size:17px;font-weight:600;letter-spacing:-0.01em;margin-top:6px}
.tier p{font-size:13.5px;line-height:1.55;color:var(--text-muted)}

/* ---- checklist ---- */
.checks{list-style:none;margin:28px 0 0;padding:0;display:flex;flex-direction:column;gap:14px}
.checks li{display:grid;grid-template-columns:22px 1fr;gap:12px;font-size:15px;line-height:1.55;color:var(--text-muted)}
.checks li [data-lucide]{color:var(--accent);width:18px;height:18px;margin-top:2px}
.checks li b{color:var(--text);font-weight:600}

/* ---- split: copy + aside ---- */
.split{display:grid;grid-template-columns:1fr 1fr;gap:56px;align-items:start}
.panel{padding:28px}
.panel .ph{font-family:var(--font-mono);font-size:11px;letter-spacing:0.16em;text-transform:uppercase;color:var(--text-subtle)}
.chips{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.chips + .ph{margin-top:24px}

/* ---- architecture diagram (HTML, reflows on phones) ---- */
.arch{margin-top:46px;display:grid;grid-template-columns:1fr 64px 1.1fr 64px 1fr;align-items:stretch}
.arch .col{display:flex;flex-direction:column;gap:12px}
.arch .colh{font-family:var(--font-mono);font-size:11px;letter-spacing:0.16em;text-transform:uppercase;color:var(--text-subtle);margin-bottom:2px}
.arch .box{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);padding:16px 18px}
.arch .box h4{font-family:var(--font-sans);font-size:15px;font-weight:600;letter-spacing:0}
.arch .box p{font-size:13px;line-height:1.5;color:var(--text-muted);margin-top:6px}
.arch .box .chips{margin-top:10px;gap:6px}
.arch .box .chips .tag{font-size:10.5px;padding:3px 7px}
.arch .core{border-color:var(--accent-line);box-shadow:var(--glow-accent);background:var(--surface-raised);
  display:flex;flex-direction:column;gap:12px;padding:22px}
.arch .core .mk{gap:8px}
.arch .core .mk svg{width:24px;height:24px}
.arch .core .mk .lwm{font-size:1.125rem}
.arch .core ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.arch .core li{display:flex;align-items:center;gap:10px;font-size:13.5px;color:var(--text-muted)}
.arch .core li [data-lucide]{width:15px;height:15px;color:var(--accent)}
.arch .core .note{font-family:var(--font-mono);font-size:11.5px;color:var(--accent);letter-spacing:0.02em;
  border-top:1px solid var(--border);padding-top:12px}
.arch .link{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:var(--accent)}
.arch .link span{font-family:var(--font-mono);font-size:10px;letter-spacing:0.08em;text-transform:uppercase;
  color:var(--text-subtle);text-align:center;line-height:1.35}
.arch .link [data-lucide]{width:20px;height:20px}

/* ---- closing band ---- */
.closing{padding:84px 0;border-top:1px solid var(--border);background:var(--surface)}
.closing .row{display:flex;align-items:flex-end;justify-content:space-between;gap:40px;flex-wrap:wrap}
.closing h2{font-size:clamp(28px,3.2vw,40px);letter-spacing:-0.03em;line-height:1.08;margin-top:16px;max-width:640px}
.closing p{font-size:16px;line-height:1.6;color:var(--text-muted);margin-top:14px;max-width:560px}
.closing .cta{display:flex;gap:12px;flex-wrap:wrap}

/* ---- next-page pager ---- */
.pager{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:0}
.pager a{padding:22px 24px;display:flex;flex-direction:column;gap:6px}
.pager .k{font-family:var(--font-mono);font-size:11px;letter-spacing:0.14em;text-transform:uppercase;color:var(--text-subtle)}
.pager .t{font-family:var(--font-display);font-weight:600;font-size:19px;letter-spacing:-0.015em}
.pager a.nx{text-align:right;align-items:flex-end}

/* ---- responsive ---- */
@media (max-width:1080px){
  .fgrid{grid-template-columns:repeat(2,1fr)}
  .tiers{grid-template-columns:repeat(2,1fr)}
  .journey{grid-template-columns:repeat(2,1fr)}
  .journey li:not(:nth-child(4n+1)){padding-left:0;border-left:none}
  .journey li:nth-child(2n){padding-left:24px;border-left:1px solid var(--border)}
  .arch{grid-template-columns:1fr;gap:0}
  .arch .link{flex-direction:row;padding:14px 0}
  .arch .link [data-lucide]{transform:rotate(90deg)}
  .arch .link br{display:none}
}
@media (max-width:860px){
  .subnav{top:68px}
  .phero .stats{grid-template-columns:repeat(2,auto);gap:24px 40px}
  .plist{grid-template-columns:1fr}
  .split{grid-template-columns:1fr;gap:36px}
  .fgrid.two{grid-template-columns:1fr}
  .dtable td:first-child{width:auto}
}
@media (max-width:560px){
  .wrap{padding-left:16px;padding-right:16px}
  .subnav .row{gap:12px}
  .fgrid,.tiers{grid-template-columns:1fr}
  .journey{grid-template-columns:1fr}
  .journey li,.journey li:nth-child(2n){padding-left:0;border-left:none}
  .lsec{padding:72px 0}
  .pager{grid-template-columns:1fr}
  .dtable,.dtable tbody,.dtable tr,.dtable td{display:block;width:100%}
  .dtable thead{display:none}
  .dtable td{border-bottom:none;padding:4px 18px}
  .dtable td:first-child{padding-top:16px}
  .dtable tr{border-bottom:1px solid var(--border-faint);padding-bottom:14px}
}
