/* ulukalabs.com: black and white, in the Uluka terminal's font. The homepage streams an example Uluka session
   over the model's expert map; Platform, Performance, Security and Download are pages at #platform and so on. */
/* Layout: copy on the left; on the right the Uluka terminal streams a real-looking answer while the
   expert map (30 layers x 128 experts, 8 routed per token) lights up token by token. Black and white, by choice. */
:root {
  color-scheme: light;
  --void: #fbfbfd;          /* page */
  --panel: #ffffff;         /* terminal and map surfaces */
  --line: #e2e4ee;          /* hairlines */
  --hover-line: #c9cce0;
  --hover-bg: #f2f3f9;
  --text: #13141c;          /* headings, replies */
  --soft: #3d4152;          /* body copy */
  --muted: #6b7084;         /* secondary text */
  --faint: #a3a7b8;         /* axis labels */
  --accent: #000000;        /* the emphasis: headline, the model thinking, selected things */
  --tint: #0000000a;        /* a wash behind selected things */
  --dots: #13141c14;        /* the dot grid */
  --shadow: 0 30px 70px -36px #2a2f5a55, 0 2px 6px #2a2f5a0f;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "Cascadia Mono", "Cascadia Code", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: auto; }
body { margin: 0; background: var(--void); color: var(--text); font: 15px/1.55 var(--mono);
       -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(var(--dots) 1px, transparent 1.2px) 0 0 / 22px 22px; mask: linear-gradient(#000, #0000 90%); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1760px; margin: 0 auto; padding-inline: clamp(18px, 2.4vw, 56px); }

/* top bar */
.top { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; color: inherit; text-decoration: none; }
.nav { display: flex; gap: 22px; color: var(--soft); font-size: 14px; }
.nav a { color: inherit; text-decoration: none; }
.nav a:hover { color: var(--text); }
.top .cta { margin-left: auto; display: flex; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line);
       background: transparent; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { border-color: var(--hover-line); background: var(--hover-bg); }
.btn.primary { background: var(--text); color: var(--void); border-color: var(--text); }
.btn.primary:hover { background: var(--soft); border-color: var(--soft); }

/* hero */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 4vw, 72px); align-items: center;
        padding-block: clamp(32px, 4vh, 56px) 40px; min-height: calc(100svh - 64px); }
.copy { min-width: 0; position: relative; z-index: 2; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
           font-size: 12px; color: var(--accent); background: var(--panel); letter-spacing: .06em; }
.eyebrow b { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
h1 { margin: 22px 0 0; font-size: clamp(30px, 3.6vw, 62px); line-height: 1.02; letter-spacing: -0.03em; font-weight: 800; text-wrap: balance; }
h1 em { font-style: normal; color: var(--muted); }
.lede { margin: 20px 0 0; max-width: 50ch; color: var(--soft); font-size: clamp(16px, 1.05vw, 18px); }
.lede b { color: var(--text); }

.stage { min-width: 0; display: grid; gap: 14px; position: relative; z-index: 2; }

/* the terminal, as uluka/ui.py draws it */
.term { border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--panel) 92%, transparent);
        box-shadow: var(--shadow); overflow: hidden; backdrop-filter: blur(8px); }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.term-bar .dots { display: flex; gap: 6px; }
.term-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.term-bar .model { margin-left: auto; color: var(--accent); }
.term-body { height: min(46vh, 420px); overflow: auto; padding: 14px 16px; font-size: 13px; line-height: 1.6; scrollbar-width: thin; }
.banner { color: var(--muted); }
.banner b { color: var(--text); font-weight: 400; }
.echo { margin-top: 10px; color: var(--muted); }
.status { color: var(--accent); }
.reply { margin-top: 6px; padding-left: 1.5ch; border-left: 2px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.reply .label { display: block; color: var(--muted); }
.caret { display: inline-block; width: .6em; height: 1.1em; vertical-align: -0.2em; background: var(--text); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.term-foot { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted);
             font-variant-numeric: tabular-nums; }
.term-foot b { color: var(--text); font-weight: 600; }
.term-foot .ok { color: var(--text); }

.demo-note { margin: 0; font-size: 11px; color: var(--faint); }
.prompts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.chip { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 12px; color: var(--soft); }
.chip:hover { border-color: var(--hover-line); color: var(--text); }
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 99px var(--tint); }

/* the expert map */
/* the expert map fills the hero behind everything; the terminal floats on top */
main { overflow-x: clip; }
canvas.bg { position: absolute; top: 0; bottom: 0; left: calc(50% - 50vw); width: 100vw; height: 100%; z-index: 0; pointer-events: none;
            -webkit-mask: linear-gradient(90deg, #0003 0%, #0006 30%, #000 62%), linear-gradient(#0000, #000 14%, #000 86%, #0000);
            -webkit-mask-composite: source-in;
            mask: linear-gradient(90deg, #0003 0%, #0006 30%, #000 62%), linear-gradient(#0000, #000 14%, #000 86%, #0000);
            mask-composite: intersect; }
.term-body { height: min(46vh, 420px); }
/* glass: the routing shows through the terminal as it streams */
.term { background: color-mix(in srgb, var(--panel) 86%, transparent); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }

/* how it works: one strip under the hero */
.news { border-top: 1px solid var(--line); padding-top: 22px; margin-bottom: 96px; }
.news-viewport { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
/* The track is cloned once in main.js; sliding the rail by half loops it seamlessly. */
.news-rail { display: flex; width: max-content; animation: news 70s linear infinite; }
.news-viewport:hover .news-rail, .news-viewport:focus-within .news-rail { animation-play-state: paused; }
@keyframes news { to { transform: translateX(-50%); } }
.news-track { display: flex; gap: 16px; margin: 0; padding: 0 16px 0 0; list-style: none; }
.news-track li { width: 300px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.news-meta { margin: 0; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.news-track h3 { margin: 8px 0 0; font-size: 14px; }
.news-track li > p:last-child { margin: 6px 0 0; color: var(--soft); font-size: 13px; }

/* the inner pages */
.nav a[aria-current="page"] { color: var(--text); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.page { padding-bottom: 72px; }
.page-head { padding-block: 56px 36px; }
.page-head .lede { max-width: 62ch; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: start; }
.spec { margin: 0; border-top: 1px solid var(--line); }
.spec div { display: grid; grid-template-columns: 11ch minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.spec dt { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.spec dd { margin: 0; font-size: 14px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cards li { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.cards h3 { margin: 0; font-size: 14px; }
.cards p { margin: 6px 0 0; font-size: 13px; color: var(--soft); }
.sub { margin: 0 0 12px; font-size: 14px; }
.sub span { margin-left: 8px; font-weight: 400; font-size: 12px; color: var(--muted); }
.note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.next { margin: 40px 0 0; }
.next a { color: var(--text); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--text); }
/* The GPU network: Uluka in the middle, series branching out, one node per card.
   The nodes are real buttons; the canvas only draws the links and the signals along them. */
.net-switch { display: inline-flex; gap: 4px; margin: 4px 0 10px; padding: 4px; border: 1px solid var(--line);
               border-radius: 10px; background: var(--panel); }
.net-switch button { padding: 8px 16px; border: 0; border-radius: 7px; background: transparent; color: var(--muted);
                     font: 600 13px var(--mono); cursor: pointer; }
.net-switch button:hover { color: var(--text); }
.net-switch button[aria-selected="true"] { background: var(--text); color: var(--void); }
.gpu-net { position: relative; margin: 0; height: clamp(540px, 64vh, 780px);
           border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.gpu-net canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.gpu-net .hint { position: absolute; left: 18px; top: 14px; margin: 0; font-size: 11px; color: var(--faint); }
.gnode { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
         display: grid; gap: 1px; justify-items: center; padding: 7px 13px; border: 1px solid var(--line);
         border-radius: 10px; background: var(--panel); cursor: pointer; white-space: nowrap;
         transition: border-color .15s, box-shadow .15s, transform .15s; }
.gnode:hover, .gnode:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 4px var(--tint); }
.gnode b { font-size: 12.5px; font-weight: 700; }
.gnode span { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.gnode.hub { padding: 14px 20px; border-color: var(--accent); background: var(--text); color: var(--void); }
.gnode.hub b { font-size: 16px; }
.gnode.hub span { color: #ffffffa8; }
.gnode.group { cursor: default; border-style: dashed; }
.gnode.group:hover { border-color: var(--line); box-shadow: none; }
.gnode.card:hover { transform: translate(-50%, -50%) scale(1.04); }
.gnode.soon b { color: var(--muted); }

/* zooming into a card: the net scales toward it, then hands over to the viewer */
.gpu-net .field { position: absolute; inset: 0; transform-origin: 50% 50%; transition: transform .6s cubic-bezier(.3,0,.2,1), opacity .4s; }
.gpu-net.zooming .field { opacity: 0; }
.gpu-net.zooming .gnode { pointer-events: none; }

/* the card viewer */
.viewer3d { display: none; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px; margin-top: 8px; }
.viewer3d.open { display: grid; }
.gpu-net.open { display: none; }
.stage3d { position: relative; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
           height: clamp(460px, 56vh, 720px); overflow: hidden; }
.stage3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.stage3d canvas:active { cursor: grabbing; }
.stage3d .hint { position: absolute; left: 16px; bottom: 12px; margin: 0; font-size: 11px; color: var(--faint); }
.stage3d .back { position: absolute; left: 14px; top: 14px; }
.card-head h2 { margin: 0; font-size: clamp(22px, 2vw, 30px); letter-spacing: -0.02em; }
.card-head p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.fit { margin: 22px 0 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.fit h3 { margin: 0 0 4px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.fit .source { margin-top: 14px; }
.fit .bar { grid-template-columns: 13ch minmax(0, 1fr) 7ch; }
.verdict { margin: 16px 0 0; font-size: 13px; color: var(--soft); }
.verdict b { color: var(--text); }

@media (max-width: 1100px) {
}
@media (max-width: 760px) {
  /* no room for a graph: the same nodes become a plain list, and the links are dropped */
  .gpu-net { height: auto; padding: 14px; }
  .gpu-net canvas, .gpu-net .hint { display: none; }
  .gpu-net .field { position: static; }
  .gpu-net .net { display: grid; gap: 8px; }
  .gnode { position: static; transform: none; width: 100%; justify-items: start; }
  .gnode.card:hover { transform: none; }
  .gnode.group { margin-top: 10px; }
}

.chart { margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.chart figcaption { font-size: 13px; font-weight: 600; }
.chart figcaption span { margin-left: 8px; font-weight: 400; color: var(--muted); }
.bar { display: grid; grid-template-columns: 16ch minmax(0, 1fr) 6ch; gap: 12px; align-items: center; margin-top: 16px; font-size: 13px; }
.bar-track { height: 28px; background: var(--hover-bg); border-radius: 6px; overflow: hidden; }
.bar-track i { display: block; height: 100%; width: calc(var(--v) * 1%); background: var(--faint); }
.bar.now .bar-track i { background: var(--accent); }
.bar b { text-align: right; font-variant-numeric: tabular-nums; }
.bar.ticks { margin-top: 6px; }
.axis { position: relative; height: 1.4em; font-size: 10px; color: var(--faint); }
.axis span { position: absolute; left: calc(var(--v) * 1%); transform: translateX(-50%); }
.source { margin: 14px 0 0; font-size: 11px; color: var(--muted); }
.facts { margin: 28px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 13px; color: var(--soft); }
.facts li::before { content: "✓ "; color: var(--text); }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 36px; }
.node { padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.node b { display: block; font-size: 14px; }
.node span { font-size: 12px; color: var(--muted); }
.arrow { width: 36px; height: 1px; background: var(--text); position: relative; }
.arrow::after { content: ""; position: absolute; right: 0; top: -4px; border: 4px solid transparent; border-left: 6px solid var(--text); border-right: 0; }
.node.cut { margin-left: auto; border-style: dashed; color: var(--muted); }
.node.cut b { text-decoration: line-through; color: var(--muted); }
.calc { margin-top: 40px; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.calc-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: start; }
.calc-controls label { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px;
                       margin-top: 18px; font-size: 13px; color: var(--muted); }
.calc-controls label:first-child { margin-top: 0; }
.calc-controls output { font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.calc-controls input[type="range"] { width: 100%; margin: 8px 0 0; accent-color: var(--accent); }
.calc-controls .source { margin-top: 20px; }
.calc-big { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.calc-big b { font-size: clamp(32px, 4vw, 46px); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.calc-big span { font-size: 13px; color: var(--muted); }
.calc-out .spec { margin-top: 18px; }
.platforms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.platform { padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.platform h2 { margin: 0; font-size: 20px; }
.platform .meta { margin: 4px 0 18px; font-size: 13px; color: var(--muted); }
.platform .spec { margin-top: 20px; }
.btn.wide { width: 100%; justify-content: center; }
.btn:disabled { cursor: default; opacity: .55; }
.btn.primary:disabled:hover { background: var(--text); border-color: var(--text); }

.foot { padding-block: 20px 28px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

@media (max-width: 960px) {
  .split, .platforms, .calc-grid { grid-template-columns: minmax(0, 1fr); }
  .node.cut { margin-left: 0; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-block: 32px; }
  .top { flex-wrap: wrap; height: auto; padding-block: 12px; row-gap: 8px; }
  .nav { order: 3; width: 100%; overflow-x: auto; gap: 18px; }
  canvas.bg { -webkit-mask: linear-gradient(#0000, #000 60%); mask: linear-gradient(#0000, #000 60%); }
}
@media (max-width: 520px) {
  .top .cta .btn:not(.primary) { display: none; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .bar { grid-template-columns: 10ch minmax(0, 1fr) 5ch; }
  .term-body { height: 260px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .caret, .news-rail { animation: none; }
  .news-viewport { overflow-x: auto; mask-image: none; }
  .news-track[aria-hidden] { display: none; }
}
