/* The homepage on the night theme, on top of landing.css, landing-themes.css, landing-b.css and noir.css: the terminal hero (a prompt,
   the running ASCII horse, a small heading, the summary and two bracketed links) and the agent loop as a terminal card. */

/* ---------- the hero ---------- */
/* it fades into the page below instead of ending on a hard line */
.bhero { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:clamp(10px,2.2vh,24px);
  padding-top:clamp(84px,12vh,120px); padding-bottom:calc(clamp(36px,7vh,72px) + 12vh); margin-bottom:-12vh;
  background:linear-gradient(to bottom, var(--bg) 0%, var(--bg) 72%, rgba(11,5,9,0) 100%) !important; }

/* the title as a prompt: ">krypton" and a blinking cursor */
.plainname { margin-bottom:clamp(18px,5vh,56px); font:400 clamp(34px,5vw,72px)/1 var(--mono); letter-spacing:-.03em; color:var(--ink); }
.plainname .pr { color:var(--horse); margin-right:.18em; }
.plainname .cur { display:inline-block; width:.55em; height:.95em; margin-left:.12em; vertical-align:-.12em; background:var(--horse); animation:blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity:0; } }
@media (prefers-reduced-motion: reduce) { .plainname .cur { animation:none; } }

/* the horse: real characters (art/horse-frames.json, played by landing.js) with room between them. Its box is fixed to the largest frame,
   so nothing below it moves as the frames change; it is sized so its widest row fits the screen */
.bhero pre.horse-ascii { margin:0; padding:0; background:none !important; border:0 !important; box-shadow:none !important; box-sizing:content-box;
  font:500 min(calc(88vw / (var(--cols) * .6 * 1.18)), calc(38vh / var(--rows))) / 1 var(--mono); letter-spacing:.18em; color:var(--horse);
  white-space:pre; text-shadow:0 0 6px rgba(176,140,244,.35); user-select:none;
  height:calc(var(--rows) * 1em); width:calc(var(--cols) * (1ch + .18em)); max-width:94vw; overflow:hidden; }

/* the small heading, the summary and the links */
.bhero .msg { margin-top:clamp(14px,4vh,44px); gap:12px; }
.bhero .msg h1 { font:400 clamp(16px,1.3vw,19px)/1.4 var(--mono) !important; letter-spacing:-.01em !important; word-spacing:0; text-transform:none !important;
  color:var(--ink) !important; text-shadow:none !important; }
.bhero .msg p.sum { display:block; max-width:52ch; margin:2px auto 6px; text-align:center; font:300 clamp(15px,1.15vw,17px)/1.6 var(--sans); color:var(--ink2); text-shadow:none; }
.bhero .links a { font:400 14px var(--mono) !important; border-bottom:0 !important; padding:0; text-shadow:none; }
.bhero .links a::before { content:"[ "; color:var(--muted); } .bhero .links a::after { content:" ]"; color:var(--muted); }
.bhero .links svg { display:none; }

@media (max-width:820px) {
  .bhero pre.horse-ascii { font-size:min(calc(94vw / (var(--cols) * .6 * 1.18)), calc(32vh / var(--rows))); }
  .plainname { font-size:clamp(28px,9vw,44px); }
  .bhero .msg p.sum { font-size:15px; padding:0 8px; }
}

/* ---------- the loop, as a terminal card: the heading and its paragraph on the left, the four steps as lines on the right ---------- */
.loop { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.05fr); column-gap:clamp(32px,5vw,80px); align-items:center; }
.loop > h2, .loop > p { grid-column:1; }
.loop > .pipe { grid-column:2; grid-row:1 / span 2; }
.pipe { background:var(--card); border:1px solid var(--line); border-radius:10px; overflow:hidden; font:400 14px/1.5 var(--mono); }
.pipe-bar { display:flex; justify-content:space-between; padding:10px 18px; border-bottom:1px solid var(--line); color:var(--muted); font-size:12.5px; }
.pipe-row { display:grid; grid-template-columns:21ch minmax(0,1fr); gap:16px; padding:14px 18px; border-bottom:1px solid var(--line); align-items:baseline; }
.pipe-row .pc { color:var(--ink); font-weight:500; white-space:nowrap; }
.pipe-row .pc i { font-style:normal; color:var(--horse); margin-right:.6ch; }
.pipe-row .pd { font:300 15px/1.5 var(--sans); color:var(--ink2); }
.pipe-loop { display:flex; align-items:center; gap:10px; padding:10px 18px; border-bottom:1px solid var(--line); color:var(--muted); font-size:12.5px; background:rgba(46,27,71,.25); }
.pipe-loop .lp { width:15px; height:15px; fill:none; stroke:var(--horse); stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; flex:none; }
.pipe-row.end { border-bottom:0; }
.pipe-row.end .pc { color:var(--btn); }
@media (max-width:900px) {
  .loop { grid-template-columns:minmax(0,1fr); }
  .loop > .pipe { grid-column:1; grid-row:auto; margin-top:28px; }
  .pipe-row { grid-template-columns:minmax(0,1fr); gap:4px; }
}

/* ---------- the rows: "Your agent cleans up after itself" and the other row headings are white, like every heading ---------- */
.rows .row:not(.safety) h3, .row h3 { color:var(--ink) !important; }

/* ---------- phones: the menu ---------- */
/* noir.css takes the nav's background away so it reads as plain words on wide screens; on a phone the open menu needs a solid panel,
   or its links sit straight on the horse and the page. The menu button gets the same frosted night background. */
@media (max-width:820px) {
  .bbar .menu { background:rgba(26,16,36,.85) !important; border:1px solid var(--line) !important; color:var(--ink); }
  .bbar.open .bnav { background:rgba(15,9,20,.96) !important; border:1px solid var(--line) !important; box-shadow:0 18px 48px rgba(0,0,0,.6) !important;
    -webkit-backdrop-filter:blur(16px) !important; backdrop-filter:blur(16px) !important; }
  .bbar.open .bnav a { color:var(--ink) !important; }
  .bbar.open .bnav a:hover, .bbar.open .bnav a:focus-visible { color:var(--horse) !important; background:rgba(46,27,71,.5); }
}
