/* BaseMod.ai landing and "Under the hood" page layout. Colours, type, radii and shadows are BaseMod AI tokens
   (css/tokens.css); components come from the BaseMod AI bundle. Class names here start with l- so they never
   collide with the section styles in page.css. */

html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--background); color: var(--text-primary); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
img, video { max-width: 100%; display: block; }
.l-wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 24px; box-sizing: border-box; }
.l-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); color: var(--text-primary); padding: 8px 12px; border-radius: 8px; }
.l-skip:focus { left: 16px; }

/* Top bar additions */
.l-nav { display: flex; gap: 22px; margin-left: 20px; }
.l-nav a { color: var(--text-secondary); text-decoration: none; font: 500 14px var(--font-sans); white-space: nowrap; }
.l-nav a:hover, .l-nav a[aria-current="page"] { color: var(--text-primary); }
.l-theme {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text-secondary); cursor: pointer;
}
.l-theme:hover { color: var(--text-primary); }
.l-theme svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Hero */
.l-hero { padding: 84px 0 48px; position: relative; overflow: hidden; }
.l-hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 120%; pointer-events: none;
  background: radial-gradient(60% 50% at 70% 0%, color-mix(in srgb, var(--brass) 16%, transparent), transparent 70%);
}
.l-hero-copy { position: relative; }
#hero-title { margin-top: 18px; }
#hero-title h1 { margin: 0; font-size: clamp(44px, 5.8vw, 78px); line-height: 1.02; letter-spacing: -0.04em; }
.l-muted { color: var(--text-muted); }
#closing-eyebrow { margin-bottom: 14px; }
.l-lede { margin: 26px 0 0; max-width: 60ch; font: 400 19px/1.6 var(--font-body); color: var(--text-secondary); }
.l-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.l-stage { position: relative; margin: 60px 0 0; aspect-ratio: 1200 / 640; }
.l-crop {
  position: absolute; inset: 0; overflow: hidden; border-radius: 22px; container-type: size; isolation: isolate;
  background: #5b5a48; box-shadow: var(--shadow-elegant); outline: 1px solid var(--border);
}
.l-media {
  --mx: -50%; position: absolute; left: 50%; top: 50%;
  width: max(100cqw, calc(100cqh * 16 / 9)); aspect-ratio: 16 / 9;
  transform: translate(var(--mx), -50%); animation: l-drift 26s ease-in-out infinite alternate; will-change: transform;
}
.l-media video { width: 100%; height: 100%; object-fit: cover; }
@keyframes l-drift { from { transform: translate(var(--mx), -50%) scale(1); } to { transform: translate(calc(var(--mx) + 1.2%), -49%) scale(1.045); } }
.l-stage.still .l-media { animation: none; }
.l-anchor { position: absolute; width: 0; height: 0; }
.l-leader { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 2; }
.l-leader .halo { fill: none; stroke: rgba(255, 255, 255, .72); stroke-width: 4; }
.l-leader .line { fill: none; stroke: var(--brass); stroke-width: 1.7; }
.l-leader .end { fill: #FFFFFF; stroke: var(--brass); stroke-width: 2.2; }

.l-runcard {
  position: absolute; right: 20px; top: 20px; z-index: 3; width: min(350px, 37%);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-xl); overflow: hidden; color: var(--text-primary);
}
.l-rc-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--border); }
.l-rc-head > div { flex: 1; min-width: 0; }
.l-rc-title { margin: 0; font: 650 15px/1.3 var(--font-sans); letter-spacing: -0.01em; }
.l-rc-sub { margin: 3px 0 0; font: 400 12.5px/1.45 var(--font-body); color: var(--text-muted); }
.l-rc-rows { list-style: none; margin: 0; padding: 0; }
.l-rc-rows li {
  display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 10px; position: relative;
  padding: 9px 16px; font: 500 13.5px/1.3 var(--font-sans); transition: background .35s ease;
}
.l-rc-rows li + li { border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.l-rc-rows li > [data-icon] { color: var(--text-muted); display: inline-flex; }
.l-rc-rows li.on { background: color-mix(in srgb, var(--brass) 12%, transparent); }
.l-rc-rows li.on::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brass); }
.l-rc-rows li.on > [data-icon] { color: var(--brass); }
.l-activity {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 16px 12px; border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-sunken) 80%, transparent); font: 400 12.5px/1.45 var(--font-body); color: var(--text-secondary); min-height: 52px;
}
.l-pulse { flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 0 0 color-mix(in srgb, var(--brass) 60%, transparent); animation: l-ping 2.4s ease-out infinite; }
@keyframes l-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brass) 55%, transparent); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.l-activity-text { transition: opacity .35s ease; }
.l-activity-text.swap { opacity: 0; }
.l-rc-foot { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); font: 500 12.5px var(--font-sans); color: var(--text-secondary); }

.l-cap {
  position: absolute; left: 0; right: 0; top: 100%; margin-top: 12px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font: 400 13px/1.5 var(--font-body); color: var(--text-muted);
}
.l-cap > span:first-child { flex: 1 1 420px; }
.l-motion {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-secondary); font: 500 12.5px var(--font-sans);
}
.l-motion svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Principles */
.l-principles { margin-top: 92px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 48px 0; }
.l-principles .l-wrap { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px; }
.l-principles b { display: block; margin-top: 14px; font: 650 15.5px/1.35 var(--font-sans); letter-spacing: -0.01em; }
.l-principles span { display: block; margin-top: 6px; font: 400 14px/1.55 var(--font-body); color: var(--text-secondary); }

/* Sections reuse page.css (.sec, .plate, .card …); this only sets the page width. */
.l-main { max-width: 1200px; margin-inline: auto; padding: 0 24px 40px; box-sizing: border-box; }
.l-main > .sec { padding-block: 104px 8px; }
.l-main > .sec:first-child { padding-top: 96px; }

/* Network map */
.l-network { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(250px, 1fr); gap: 24px; align-items: start; }
.l-netmap { position: relative; margin: 0; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-lg); background: #3c5b3a; }
.l-netmap img { width: 100%; height: auto; }
.l-netmap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.l-netmap .shape { fill: none; stroke: #FFFFFF; stroke-width: 1.4; stroke-dasharray: 5 4; opacity: .9; vector-effect: non-scaling-stroke; transition: fill .3s, stroke .3s, opacity .3s; }
.l-netmap .shape.reused { fill: rgba(161, 115, 69, .30); stroke: #F2E7D9; stroke-dasharray: none; stroke-width: 2; opacity: 1; }
.l-netmap .arc { fill: none; stroke: #FFFFFF; stroke-width: 1.6; stroke-dasharray: 2 5; opacity: .9; vector-effect: non-scaling-stroke; }
.l-netmap .site { fill: var(--brass); stroke: #FFFFFF; stroke-width: 2; vector-effect: non-scaling-stroke; }
.l-netmap .lbl { font: 600 13px var(--font-sans); fill: #FFFFFF; paint-order: stroke; stroke: rgba(20, 20, 20, .72); stroke-width: 3px; }
.l-attrib { font: 400 11.5px/1.4 var(--font-body); color: var(--text-muted); }
.l-on-map { position: absolute; right: 8px; bottom: 6px; padding: 2px 6px; border-radius: 4px; background: rgba(255, 255, 255, .8); color: #333; font-size: 10.5px; }
.l-seg { display: grid; gap: 6px; }
.l-seg button {
  text-align: left; min-height: 44px; padding: 11px 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-primary); font: 600 14.5px var(--font-sans);
}
.l-seg button[aria-checked="true"] { border-color: var(--brass); box-shadow: inset 3px 0 0 var(--brass); background: color-mix(in srgb, var(--brass) 10%, var(--surface)); }
.l-tiers { margin: 18px 0 0; display: grid; gap: 10px; }
.l-tiers div { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.l-tiers dt { font: 650 14.5px var(--font-sans); }
.l-tiers dd { margin: 0; grid-column: 1 / -1; font: 400 13.5px/1.5 var(--font-body); color: var(--text-secondary); }

/* Simulator plan view: the moved approach after the D1 revision */
.pm-moved { fill: none; stroke: var(--brass); stroke-width: 5; stroke-dasharray: 10 7; stroke-linecap: round; }

/* Built on, guardrail band, closing */
.l-stack { padding: 64px 0 0; }
.l-stack .l-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 40px; }
.l-stack h2 { margin: 0; font: 600 14px var(--font-sans); color: var(--text-muted); }
.l-stack ul { display: flex; flex-wrap: wrap; gap: 12px 36px; list-style: none; margin: 0; padding: 0; }
.l-stack li { font: 650 20px var(--font-sans); letter-spacing: -0.02em; color: var(--text-secondary); }
.l-never { margin-top: 96px; background: var(--background-dark); color: var(--text-primary); padding: 88px 0; }
.l-never h2 { margin: 0; font: 650 clamp(26px, 3vw, 36px)/1.15 var(--font-sans); letter-spacing: -0.025em; }
.l-never ul { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 40px; }
.l-never li { position: relative; padding-left: 26px; font: 400 16px/1.55 var(--font-body); color: var(--text-secondary); }
.l-never li::before { content: ""; position: absolute; left: 0; top: .7em; width: 12px; height: 2px; background: var(--brass); }
.l-never a { color: var(--brass-text); }
.l-closing { padding: 120px 0; }
.l-closing h2 { margin: 0 0 32px; max-width: 18ch; font: 650 clamp(32px, 4.6vw, 58px)/1.04 var(--font-sans); letter-spacing: -0.035em; }

/* Under the hood page */
.l-subhero { padding: 72px 0 8px; }
.l-subhero h1 { margin: 16px 0 0; font: 650 clamp(38px, 5vw, 64px)/1.02 var(--font-sans); letter-spacing: -0.04em; }
.l-subhero p { margin: 20px 0 0; max-width: 64ch; font: 400 18px/1.6 var(--font-body); color: var(--text-secondary); }

@media (max-width: 1100px) {
  .l-nav { display: none; }
  .l-principles .l-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .l-network { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .topbar .tb-badge { display: none; }
  .l-wrap, .l-main { padding-inline: 16px; }
  .l-hero { padding-top: 52px; }
  .l-stage { aspect-ratio: auto; margin-top: 40px; }
  .l-crop { position: relative; aspect-ratio: 4 / 3.2; border-radius: 16px; }
  .l-media { --mx: -43%; }
  .l-runcard { position: static; width: auto; margin-top: 12px; box-shadow: var(--shadow-md); }
  .l-leader { display: none; }
  .l-cap { position: static; margin-top: 12px; }
  .l-principles { margin-top: 48px; }
  .l-principles .l-wrap, .l-never ul { grid-template-columns: 1fr; }
  .l-main > .sec { padding-top: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .l-media { animation: none; }
  .l-pulse { animation: none; }
}

/* Status chips in the network panel (rendered after the design-system hydrate pass). */
.l-chip { display: inline-flex; align-items: center; white-space: nowrap; padding: 5px 9px; border-radius: 999px; font: 600 12px/1 var(--font-sans); }
.l-chip.ok { background: var(--success-bg); color: var(--success-text); box-shadow: inset 0 0 0 1px var(--success-border); }
.l-chip.new { background: var(--warning-bg); color: var(--warning-text); box-shadow: inset 0 0 0 1px var(--warning-border); }
.l-brand { text-decoration: none; color: inherit; display: inline-flex; align-items: center; }
.l-specmain { min-width: 0; padding-bottom: 40px; }
.l-specmain > .sec:first-child { padding-top: 48px; }

@media (max-width: 420px) {
  .topbar .bm-btn-sm { padding-inline: 10px; font-size: 13px; }
  .topbar-in { gap: 8px; }
}

/* The network map plate spans the full width of its two-column grid so the map reads at size. */
.grid-2 > .l-wide { grid-column: 1 / -1; }

/* Network section: the flywheel and the map each take the full width, the flywheel centred. */
#network .grid-2 { grid-template-columns: minmax(0, 1fr); }
#network .grid-2 > .plate:first-child { display: grid; justify-items: center; text-align: center; }
#network .grid-2 > .plate:first-child svg { width: 100%; max-width: 620px; height: auto; }

/* Public build (basemod.ai): staff-only links and badges are hidden. build.mjs sets data-public on <html>. */
html[data-public="1"] .l-private { display: none !important; }
