/* =============================================================================
   KERNEL 2.1, by CEDIS Lab — css/layout.css
   -----------------------------------------------------------------------------
   Page structure: section themes, the content wrapper, the navigation bar and
   the grid of each section. Sections, in page order:
     0 Navigation · 1 Home · 2 Features · 3 Live demo · 4 Forecast ·
     5 Intelligence · 6 Control · 7 Library · 8 Download · 9 Version history · 10 Footer
   Phone and tablet adjustments live in responsive.css.
   ============================================================================= */
/* Section themes (as on the LiLi+ site): .dark (black), .light (paper grey)
   or .white. Each sets local colours that components read. */
.dark { background: var(--black); color: var(--white); --fg: var(--white); --fg-2: var(--gray); --line: var(--hair); --surface: var(--tile); --link: var(--sig); --cut: var(--black); }
.light { background: var(--paper); color: var(--ink); --fg: var(--ink); --fg-2: var(--ink-2); --line: var(--hair-l); --surface: var(--card); --link: var(--sig-deep); --cut: var(--card); }
.white { background: #FFFFFF; color: var(--ink); --fg: var(--ink); --fg-2: var(--ink-2); --line: var(--hair-l); --surface: var(--paper); --link: var(--sig-deep); --cut: var(--paper); }
section { padding-block: clamp(84px, 12vw, 150px); scroll-margin-top: 52px; }
.wrap { max-width: 1120px; margin-inline: auto; padding-left: max(clamp(16px, 4vw, 40px), env(safe-area-inset-left, 0px)); padding-right: max(clamp(16px, 4vw, 40px), env(safe-area-inset-right, 0px)); }
.head { display: grid; gap: 18px; margin-bottom: clamp(40px, 6vw, 72px); }
.light .panel, .white .panel { border-color: transparent; }
.dots { background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px); background-size: 26px 26px; }
.light .pill-btn, .white .pill-btn { background: var(--sig-deep); color: #FFFFFF; }
.light .seg, .white .seg { background: #E3E3E8; }
.light .seg button, .white .seg button { color: var(--ink-2); }
.light .seg button[aria-pressed="true"], .white .seg button[aria-pressed="true"] { background: #FFFFFF; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }

/* 0. Navigation: sticky translucent black bar with blur (as on LiLi+). */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: rgba(0, 0, 0, .72); -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.nav .wrap { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 52px; }
.nav .lab .mark { width: 30px; height: 30px; }
.nav-r { display: flex; align-items: center; gap: 22px; }
.nav-links { display: flex; align-items: center; gap: 22px; }
/* Menu button: phones only (responsive.css shows it). The two lines turn into a cross when open. */
.nav-menu { display: none; place-items: center; width: 40px; height: 40px; margin: 0 -10px 0 -10px; border: 0; border-radius: 50%; background: transparent; color: var(--white); cursor: pointer; }
.nav-menu svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.nav-menu path { transform-origin: 12px 12px; transition: transform .25s ease; }
.nav-menu[aria-expanded="true"] .a { transform: translateY(3.5px) rotate(45deg); }
.nav-menu[aria-expanded="true"] .b { transform: translateY(-3.5px) rotate(-45deg); }
.nav-r a.nl { color: rgba(245, 245, 247, .82); text-decoration: none; font-size: .8125rem; white-space: nowrap; }
.nav-r a.nl:hover, .nav-r a.nl[aria-current="true"] { color: var(--white); }
.nav-r a.nl.k-l { display: inline-flex; align-items: center; }
.nav-r a.nl.k-l .kw { height: 11px; }
.nav .pill-btn { padding: 7px 14px; font-size: .8125rem; }

/* 1. Home: centred text block, the load-curve line, the site drawing under a
   spotlight (::before) with a blue glow (::after), and the resource picker. */
.hero { padding-block: clamp(40px, 6vw, 80px) clamp(60px, 9vw, 110px); text-align: center; overflow: hidden; }
.hero-text { display: grid; gap: 22px; justify-items: center; }
.hero h1 { font-size: clamp(3rem, 8.6vw, 6.8rem); line-height: 1; letter-spacing: -0.045em; max-width: 12em; }
.hero-cta { display: flex; gap: 28px; align-items: center; justify-content: center; flex-wrap: wrap; }
.site-stage { position: relative; width: min(1040px, 100%); margin: 0 auto; }
.site-stage::before { content: ""; position: absolute; left: 50%; top: 0; width: 130%; height: 100%; transform: translateX(-50%); pointer-events: none;
  background: conic-gradient(from 148deg at 50% 0%, transparent 0deg, rgba(255, 255, 255, .045) 18deg, rgba(255, 255, 255, .06) 32deg, rgba(255, 255, 255, .045) 46deg, transparent 64deg);
  -webkit-mask-image: linear-gradient(#000 40%, transparent 96%); mask-image: linear-gradient(#000 40%, transparent 96%); }
.site-stage::after { content: ""; position: absolute; inset: 16% 8% 0; pointer-events: none; background: radial-gradient(ellipse 50% 55% at 50% 62%, rgba(var(--sig-rgb), .16), rgba(255, 255, 255, .03) 45%, transparent 70%); }
.res-pick { display: grid; gap: 14px; justify-items: center; margin-top: 18px; }

/* 2. Features: four cards. */
.feat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

/* 3. Live demo: chart card and readouts side by side. */
.sched { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.sched-main { display: grid; gap: 16px; align-content: start; }
.sched-side { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-content: start; }
.sched-side .sched-note { grid-column: 1 / -1; max-width: 60em; }

/* 4. Forecast: chart card and the analytics diagram side by side; four load cards below. */
.fc { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.fc-items { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }

/* 5. Intelligence: three methods, the brain, three capabilities. */
.ci { display: grid; grid-template-columns: minmax(0, 1fr) clamp(200px, 22vw, 270px) minmax(0, 1fr); gap: clamp(16px, 3vw, 40px); align-items: center; }
.ci-col { display: grid; gap: 12px; }

/* 6. Control: sphere, connector wires and the four controls. */
.dc { position: relative; display: grid; grid-template-columns: minmax(220px, 380px) minmax(0, 1fr); column-gap: clamp(60px, 14vw, 200px); align-items: center; }
.dc .sphere-wrap, .dc-list { position: relative; z-index: 1; }
.dc-list { display: grid; gap: 12px; }

/* 7. Library: task picker, then the configuration and the code side by side, facts below. */
.lib { display: grid; gap: 16px; }
.lib-grid { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }
.lib-facts { list-style: none; margin: clamp(36px, 5vw, 56px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 28px; }

/* 8. Download: centred call to action with a blue glow behind it. */
.cta { text-align: center; position: relative; overflow: hidden; }
.cta::before { content: ""; position: absolute; left: 50%; top: 0; width: min(900px, 140%); aspect-ratio: 1; transform: translate(-50%, -42%); background: radial-gradient(circle, rgba(var(--sig-rgb), .22), transparent 62%); pointer-events: none; }
.cta .wrap { position: relative; display: grid; gap: 22px; justify-items: center; }
.cta h2 { font-size: clamp(2.8rem, 8vw, 6rem); letter-spacing: -0.045em; line-height: 1; }
.cta h2 .kw { height: clamp(30px, 5.6vw, 60px); color: var(--white); }   /* the menu wordmark, larger; "2.1" in red */
.cta .sub { color: var(--gray); font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 600; max-width: 28em; }

/* 9. Version history (releases.html): one row per release, the version on
      the left, joined by the timeline (components.css). */
.rel-list { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 16px; max-width: 980px; }
.rel { position: relative; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; padding-left: 40px; }
.ci { position: relative; }

/* 10. Footer: legal notes and the bottom bar. */
.foot { padding-block: 40px; font-size: .75rem; line-height: 1.55; color: var(--ink-2); }
.foot .wrap { display: grid; gap: 18px; }
.legal { display: grid; gap: 7px; padding-bottom: 18px; border-bottom: 1px solid var(--hair-l); max-width: 92ch; }
.legal h2 { font-size: .8rem; font-weight: 600; color: var(--ink); letter-spacing: 0; }
.legal b { color: var(--ink); font-weight: 600; }
.foot .bot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px; }
.foot .bot .lab { color: var(--ink); }
.foot .bot .lab .mark { width: 24px; height: 24px; fill: #FFFFFF; }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot a { color: var(--ink); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
