/* Boklyft R2 editorial review: CardNav / SpecularButton / ThoughtLine-inspired.
 * Existing semantic links + scripted demos retained. Static preview only.
 */
header .header-shell.bl-cn {
  position:relative;
  width:min(860px,calc(100vw - 36px));
  min-height:62px;height:62px;
  display:grid;grid-template-columns:minmax(120px,1fr) auto minmax(120px,1fr);
  align-items:center;gap:12px;
  padding:7px 9px;
  border-radius:21px;
  background:rgba(248,248,246,.94);
  border:1px solid rgba(255,255,255,.73);
  box-shadow:0 18px 46px rgba(12,26,49,.13), inset 0 1px 0 rgba(255,255,255,.78);
  -webkit-backdrop-filter:blur(19px) saturate(1.18);
  backdrop-filter:blur(19px) saturate(1.18);
  overflow:visible;
}
.header-shell.bl-cn .bl-cn-toggle {
  display:inline-flex;align-items:center;justify-content:center;
  gap:10px;justify-self:start;height:45px;padding:0 16px;
  color:inherit;background:transparent;border:1px solid transparent;
  border-radius:14px;cursor:pointer;font:650 13px/1 Inter,system-ui,sans-serif;
  white-space:nowrap;
}
.header-shell.bl-cn .bl-cn-toggle:hover,
.header-shell.bl-cn .bl-cn-toggle[aria-expanded="true"]{
  background:rgba(53,91,255,.055);
  border-color:rgba(53,91,255,.13);
}
.header-shell.bl-cn .bl-cn-lines{display:block;position:relative;width:17px;height:15px;flex:none}
.header-shell.bl-cn .bl-cn-lines i{
  display:block;position:absolute;width:100%;height:1.8px;left:0;
  background:currentColor;border-radius:3px;top:4px;
  transition:top .33s cubic-bezier(.22,1,.36,1),transform .33s cubic-bezier(.22,1,.36,1);
}
.header-shell.bl-cn .bl-cn-lines i:last-child{top:10px}
.header-shell.bl-cn.bl-cn-open .bl-cn-lines i:first-child{top:7px;transform:rotate(45deg)}
.header-shell.bl-cn.bl-cn-open .bl-cn-lines i:last-child{top:7px;transform:rotate(-45deg)}
.header-shell.bl-cn .header-brand{
  grid-column:2;grid-row:1;justify-self:center;min-width:0;
  display:inline-flex;align-items:center;gap:8px;
}
.header-shell.bl-cn .header-symbol-slot{width:31px;height:31px}
.header-shell.bl-cn .header-symbol{width:31px;height:31px}
.header-shell.bl-cn .header-word{font-size:18px;font-weight:690}
.header-shell.bl-cn .header-cta{
  grid-column:3;grid-row:1;justify-self:end;min-height:45px;
  display:inline-flex;padding:10px 18px;border-radius:13px;
  background:#355bff;color:#fff;font-size:13px;line-height:1;
}
.header-shell.bl-cn > .menu-btn{display:none!important}
.header-shell.bl-cn > nav.bl-cn-links{display:none!important}
header .header-shell.bl-cn .bl-cn-panel{
  position:absolute;z-index:88;left:0;right:0;top:calc(100% + 9px);
  border:1px solid rgba(255,255,255,.77);
  border-radius:25px;
  background:rgba(247,247,247,.96);
  color:#09152e;
  padding:10px;
  box-shadow:0 24px 70px rgba(7,18,38,.2);
  -webkit-backdrop-filter:blur(22px) saturate(1.2);
  backdrop-filter:blur(22px) saturate(1.2);
  isolation:isolate;
}
header .header-shell.bl-cn .bl-cn-panel[hidden]{display:none!important}
header .header-shell.bl-cn .bl-cn-panel nav.bl-cn-links{
  display:block!important;position:static;margin:0;padding:0;width:100%;
}
.bl-cn-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.bl-cn-card{
  position:relative;display:flex;flex-direction:column;min-width:0;
  min-height:200px;padding:22px 20px 18px;
  border-radius:18px;border:1px solid rgba(8,20,45,.085);
  background:linear-gradient(145deg,#fff,#f7f8fb);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 5px 16px rgba(8,20,45,.04);
  color:#101d36;
}
.bl-cn-card--blue{background:linear-gradient(145deg,#f3f6ff,#e7eeff)}
.bl-cn-card--navy{background:linear-gradient(155deg,#132540,#0b162a);color:#fff;border-color:rgba(255,255,255,.09)}
.bl-cn-card--warm{background:linear-gradient(145deg,#f7f2e9,#f1ece4)}
.bl-cn-card-title{font-family:var(--display-serif);font-size:clamp(19px,2vw,25px);line-height:1.06;letter-spacing:-.035em;font-weight:560;margin:0 0 8px}
.bl-cn-card-desc{font-size:12px;line-height:1.6;margin:0;color:#5d6981;max-width:30ch}
.bl-cn-card--navy .bl-cn-card-desc{color:#bdcce1}
.bl-cn-card-links{margin-top:auto;padding-top:18px;display:flex;flex-direction:column;gap:3px}
header .header-shell.bl-cn nav.bl-cn-links .bl-cn-card-links a{
  color:inherit!important;display:flex;align-items:center;justify-content:space-between;gap:8px;
  font-size:13px;font-weight:660;letter-spacing:-.012em;
  padding:8px 6px;border-radius:9px;width:100%;
}
header .header-shell.bl-cn nav.bl-cn-links .bl-cn-card-links a::after{
  content:'↗';font-size:15px;opacity:.7;transition:transform .25s cubic-bezier(.22,1,.36,1);
}
header .header-shell.bl-cn nav.bl-cn-links .bl-cn-card-links a:hover{background:rgba(53,91,255,.08)}
header .header-shell.bl-cn nav.bl-cn-links .bl-cn-card--navy a:hover{background:rgba(255,255,255,.10)}
header .header-shell.bl-cn nav.bl-cn-links .bl-cn-card-links a:hover::after{transform:translate(2px,-2px)}
.bl-cn-tools{
  display:flex;align-items:center;justify-content:flex-end;gap:13px;
  flex-wrap:wrap;min-height:49px;padding:8px 12px 1px;
  border-top:1px solid rgba(8,20,45,.09);margin-top:10px;
}
.header-shell.bl-cn .bl-cn-tools .lang,
.header-shell.bl-cn .bl-cn-tools .header-login{
  display:inline-flex!important;align-items:center;justify-content:center;
  min-height:37px;padding:8px 13px;border-radius:10px;
  color:#142747;background:rgba(8,20,45,.035);border:0;font-size:12px;
}
.header-shell.bl-cn .bl-cn-tools .bl-theme-control{display:flex}
.header-shell.bl-cn .bl-cn-tools .bl-theme-trigger{
  color:#142747;border-color:rgba(8,20,45,.13);
}
.header-shell.bl-cn .bl-cn-tools .bl-theme-panel{z-index:95}
.header-shell.bl-cn .bl-cn-tools .bl-theme-mobile{display:none}
.header-shell.bl-cn .bl-cn-toggle:focus-visible,
header .header-shell.bl-cn a:focus-visible,
.header-shell.bl-cn .bl-cn-tools button:focus-visible{outline:2px solid #355bff;outline-offset:3px}
body:has(.header-shell.bl-cn) #mobileMenu{display:none!important}

/* Keep navigation surfaces legible across current experimental themes. */
html[data-bl-theme="dark"] header .header-shell.bl-cn,
html[data-bl-theme="dark"] header .header-shell.bl-cn.is-night{
  background:rgba(12,24,43,.94);border-color:rgba(255,255,255,.15);color:#f5f7ff;
}
html[data-bl-theme="dark"] header .header-shell.bl-cn .bl-cn-panel{
  background:rgba(16,29,51,.97);border-color:rgba(255,255,255,.17);color:#f2f4ff;
}
html[data-bl-theme="dark"] .bl-cn-card--blue{background:linear-gradient(150deg,#1d375f,#162946);color:#f4f8ff}
html[data-bl-theme="dark"] .bl-cn-card--warm{background:linear-gradient(145deg,#213048,#1c293f);color:#f4f8ff}
html[data-bl-theme="dark"] .bl-cn-card-desc{color:#c3cde0}
html[data-bl-theme="dark"] header .header-shell.bl-cn .bl-cn-tools :is(.lang,.header-login,.bl-theme-trigger){
  color:#eef3ff;background:rgba(255,255,255,.09);
}
html[data-bl-theme="glass"] header .header-shell.bl-cn{
  background:rgba(247,248,249,.72);
  -webkit-backdrop-filter:blur(22px) saturate(1.3);
  backdrop-filter:blur(22px) saturate(1.3);
}
html[data-bl-theme="glass"] header .header-shell.bl-cn .bl-cn-panel{
  background:rgba(247,249,253,.82);
  -webkit-backdrop-filter:blur(24px) saturate(1.3);
  backdrop-filter:blur(24px) saturate(1.3);
}

/* SpecularButton-inspired focus + pointer-reactive border glow; preserves anchor hrefs. */
.bl-specular{
  --bl-sx:50%;--bl-sy:20%;
  position:relative;isolation:isolate;overflow:visible;
  transition:transform .23s cubic-bezier(.22,1,.36,1),box-shadow .23s ease!important;
}
.bl-specular::before{
  content:'';position:absolute;inset:-1px;border-radius:inherit;pointer-events:none;
  padding:1.5px;
  background:radial-gradient(circle 110px at var(--bl-sx) var(--bl-sy),
    rgba(255,255,255,.95),rgba(161,197,255,.65) 28%,rgba(255,255,255,.17) 80%);
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;
  mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0);
  opacity:.65;transition:opacity .22s ease;
}
.bl-specular::after{
  content:'';position:absolute;inset:1px;pointer-events:none;border-radius:inherit;
  background:radial-gradient(ellipse 150px 42px at var(--bl-sx) 0%,
    rgba(255,255,255,.19),transparent 90%);
  opacity:.45;transition:opacity .22s;
}
.bl-specular:hover::before,.bl-specular:focus-visible::before{opacity:1}
.bl-specular:hover::after,.bl-specular:focus-visible::after{opacity:.9}
.bl-specular:focus-visible{outline:2px solid #355bff!important;outline-offset:4px}
.bl-specular:active{transform:scale(.982)!important}
.bl-specular-hero{
  box-shadow:0 12px 36px rgba(7,18,38,.19),inset 0 1px 0 rgba(255,255,255,.65);
}
.bl-specular-hero::before{background:radial-gradient(circle 110px at var(--bl-sx) var(--bl-sy),#fff,rgba(124,163,255,.7) 32%,rgba(53,91,255,.16) 75%)}

/* ThoughtLine-inspired truthful local-demo wait state, not chain-of-thought. */
.typing-indicator.bl-answer-progress{
  display:inline-flex;align-items:center;min-width:156px;min-height:42px;
  width:max-content;max-width:85%;gap:9px;
  background:#f7f8fb;color:#1b2c48;padding:12px 16px;
}
.typing-indicator.bl-answer-progress > .bl-answer-glyph{
  display:inline-block;width:auto;height:auto;min-width:16px;flex:none;
  font:500 18px/1 Georgia,serif;color:#355bff;opacity:.75;
  animation:bl-r2-breathe 1.65s ease-in-out infinite;
  background:none;
}
.typing-indicator.bl-answer-progress > .bl-answer-label{
  display:inline-block;width:auto;height:auto;min-width:0;
  font:600 12px/1.35 Inter,system-ui,sans-serif;opacity:1;
  background:linear-gradient(110deg,#586982 15%,#0b234a 46%,#586982 78%);
  background-size:220% 100%;background-clip:text;
  -webkit-background-clip:text;color:transparent;
  animation:bl-r2-sheen 2.1s linear infinite;
}
@keyframes bl-r2-breathe{0%,100%{opacity:.34;transform:scale(.93)}50%{opacity:1;transform:scale(1.08)}}
@keyframes bl-r2-sheen{to{background-position:-220% 0}}

/* Existing scroll story, now clearer, more narrative and alive, with native reversibility. */
.chaos-stage{isolation:isolate}
.chaos-stage::before{
  content:'';position:absolute;inset:0;pointer-events:none;z-index:1;
  background:radial-gradient(ellipse 46% 35% at 50% 51%,rgba(80,119,255,.065),transparent 85%),
    radial-gradient(ellipse 34% 40% at 85% 70%,rgba(244,208,158,.10),transparent 100%);
}
.chaos-stage .room{z-index:0}
.chaos-stage .collector{z-index:7}
.bl-chaos-orbit{position:absolute;inset:-31px;pointer-events:none;z-index:0;opacity:.8}
.bl-chaos-orbit i{position:absolute;inset:0;border-radius:48px;border:1px solid rgba(53,91,255,.21);transform:rotate(16deg)}
.bl-chaos-orbit i:nth-child(2){inset:-13px;border-radius:58px;border-color:rgba(53,91,255,.11);transform:rotate(-24deg)}
.bl-chaos-orbit i:nth-child(3){
  inset:-24px;border:1px dashed rgba(53,91,255,.19);border-radius:68px;
  animation:bl-orbit 24s linear infinite;
}
@keyframes bl-orbit{to{transform:rotate(360deg)}}
.bl-chaos-story{
  position:absolute;top:23px;left:27px;z-index:11;
  display:flex;align-items:center;gap:11px;
  flex-wrap:wrap;max-width:min(86%,640px);pointer-events:none;
  font:600 12px/1.4 Inter,system-ui,sans-serif;color:#1c2d49;
}
.bl-chaos-story .bl-chaos-kicker{
  font-size:10px;font-weight:760;letter-spacing:.11em;
  color:#4b63a4;text-transform:uppercase;
}
.bl-chaos-story .bl-chaos-caption{font-size:12px;font-weight:620}
.bl-chaos-story .bl-chaos-count{
  font-size:11px;font-variant-numeric:tabular-nums;padding:5px 10px;
  border-radius:999px;background:rgba(255,255,255,.84);
  border:1px solid rgba(53,91,255,.13);color:#2c4d90;
}
.chaos-stage .interrupt{
  border:1px solid rgba(255,255,255,.95);
  box-shadow:0 18px 40px rgba(19,37,72,.12),inset 0 1px 0 rgba(255,255,255,.9);
}
.chaos-stage .sort-row span{
  border:1px solid rgba(53,91,255,.1);
  box-shadow:0 4px 16px rgba(8,20,45,.06);
}
@media(max-width:980px){
  header .header-shell.bl-cn{width:calc(100vw - 26px)}
  .bl-cn-cards{grid-template-columns:repeat(3,minmax(0,1fr))}
  .bl-cn-card{padding:16px;min-height:180px}
  .bl-cn-card-title{font-size:21px}
}
@media(max-width:690px){
  header .header-shell.bl-cn{
    width:calc(100vw - 18px);height:57px;min-height:57px;
    grid-template-columns:minmax(70px,1fr) auto minmax(70px,1fr);gap:2px;
    padding:5px 8px;border-radius:17px;
  }
  .header-shell.bl-cn .bl-cn-toggle{width:44px;height:44px;padding:0;justify-content:center}
  .header-shell.bl-cn .bl-cn-toggle-label{display:none}
  .header-shell.bl-cn .header-brand{gap:5px}
  .header-shell.bl-cn .header-symbol-slot,.header-shell.bl-cn .header-symbol{width:28px;height:28px}
  .header-shell.bl-cn .header-word{font-size:16px}
  .header-shell.bl-cn .header-cta{font-size:11px;min-height:42px;padding:11px 10px;border-radius:12px}
  header .header-shell.bl-cn .bl-cn-panel{
    top:calc(100% + 8px);padding:8px;max-height:calc(100dvh - 90px);overflow-y:auto;
    border-radius:20px;overscroll-behavior:contain;
  }
  .bl-cn-cards{grid-template-columns:1fr}
  .bl-cn-card{min-height:0;padding:14px 17px;gap:3px}
  .bl-cn-card-title{font-size:21px}
  .bl-cn-card-desc{font-size:11px}
  .bl-cn-card-links{padding-top:8px;gap:0}
  header .header-shell.bl-cn nav.bl-cn-links .bl-cn-card-links a{padding:6px;font-size:12px}
  .bl-cn-tools{justify-content:space-between;padding:8px 2px;gap:6px}
  .header-shell.bl-cn .bl-cn-tools .bl-theme-control{display:none}
  .header-shell.bl-cn .bl-cn-tools .bl-theme-mobile{
    display:block;flex-basis:100%;width:100%;margin:4px 0 0;
  }
  .header-shell.bl-cn .bl-theme-mobile-choices{
    display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;
  }
  .header-shell.bl-cn .bl-cn-tools .bl-theme-mobile .bl-theme-choice{
    display:flex!important;align-items:center;justify-content:center;flex-direction:column;
    gap:4px;padding:8px 5px;text-align:center;
    color:#17233b;min-height:55px;width:100%;border-radius:11px;font-size:11px;
  }
  html[data-bl-theme="dark"] .header-shell.bl-cn .bl-cn-tools .bl-theme-mobile .bl-theme-choice{color:#eef2ff}
  .bl-chaos-story{top:12px;left:14px;right:12px;max-width:calc(100% - 26px);gap:6px}
  .bl-chaos-story .bl-chaos-kicker{font-size:9px}
  .bl-chaos-story .bl-chaos-caption{font-size:10px}
  .bl-chaos-orbit{inset:-18px}
  .bl-chaos-orbit i:nth-child(3){inset:-14px}
}
@media(max-width:350px){
  .header-shell.bl-cn .header-word{font-size:14px}
  .header-shell.bl-cn .header-cta{padding:9px 7px;font-size:10px}
}
@media(prefers-reduced-motion:reduce){
  .bl-chaos-orbit i,.typing-indicator.bl-answer-progress > .bl-answer-glyph,
  .typing-indicator.bl-answer-progress > .bl-answer-label{animation:none!important}
  .typing-indicator.bl-answer-progress > .bl-answer-label{color:#243852!important;background:none}
  .header-shell.bl-cn .bl-cn-lines i{transition:none!important}
}
@media(prefers-reduced-transparency:reduce){
  header .header-shell.bl-cn,header .header-shell.bl-cn .bl-cn-panel{
    -webkit-backdrop-filter:none!important;backdrop-filter:none!important;background:#f7f5ef!important;
  }
  html[data-bl-theme="dark"] header .header-shell.bl-cn,
  html[data-bl-theme="dark"] header .header-shell.bl-cn .bl-cn-panel{background:#0b1830!important}
}
