/* The website (pages/build.py), on top of the app's styles.css: a side menu, readable prose, tables that scroll. */
body.site { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.site-top { display: none; }
.site-nav { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 14px; border-right: 1px solid var(--border);
  background: var(--panel); }
.site-nav .grp { margin-bottom: 16px; }
.site-nav .lbl { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 10px 4px; }
.site-nav a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.site-nav a:hover { background: var(--panel-2); }
.site-nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.site-nav::before { content: "TinyStories ARM"; display: block; font-weight: 700; font-size: 16px; margin: 0 10px 18px; }
.site-main { padding: 32px 40px 40px; max-width: 1240px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 14px; }
a { color: var(--accent); }
.site-foot { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

/* landing */
.hero { padding: 24px 0 8px; max-width: 820px; }
.hero h1 { font-size: 34px; line-height: 1.15; margin: 8px 0 14px; }
.hero p { font-size: 16.5px; color: var(--muted); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero .btn { text-decoration: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 28px 0; }
.tile { display: block; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel);
  color: var(--text); text-decoration: none; box-shadow: var(--shadow); }
.tile:hover { border-color: var(--accent); }
.tile b { display: block; margin-bottom: 4px; }
.tile span { font-size: 13.5px; color: var(--muted); }

/* docs */
.doc-page { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 40px; align-items: start; }
.doc-toc { order: 2; position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; font-size: 13px; }
.doc-toc .lbl { font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.doc-toc a { display: block; color: var(--muted); text-decoration: none; padding: 3px 0; line-height: 1.35; }
.doc-toc a.l3 { padding-left: 12px; }
.doc-toc a:hover { color: var(--accent); }
.prose { max-width: 860px; min-width: 0; font-size: 15.5px; line-height: 1.65; }
.prose h1 { font-size: 30px; line-height: 1.2; margin: 4px 0 18px; }
.prose h2 { font-size: 22px; margin: 36px 0 12px; padding-top: 8px; border-top: 1px solid var(--border); }
.prose h3 { font-size: 17.5px; margin: 26px 0 8px; }
.prose h2, .prose h3, .prose h4 { scroll-margin-top: 16px; }
.prose img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); }
.prose pre { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.5; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose blockquote { margin: 16px 0; padding: 4px 16px; border-left: 3px solid var(--accent); background: var(--panel-2); border-radius: 0 8px 8px 0; }
.prose .ptable-scroll { margin: 14px 0; }
.prose table.doc-table td, .prose table.doc-table th { padding: 7px 12px 7px 0; }
.doc-src { margin: 0 0 6px; }

body.site .panel-head { margin-bottom: 18px; max-width: 960px; }
body.site .panel-head h1 { font-size: 28px; margin: 6px 0 10px; }
body.site .panel-head p { color: var(--muted); }

@media (max-width: 1100px) { .doc-page { grid-template-columns: minmax(0, 1fr); } .doc-toc { display: none; } }
@media (max-width: 820px) {
  body.site { display: block; }
  .site-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border);
    background: var(--panel); position: sticky; top: 0; z-index: 20; }
  .site-menu { background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 18px; padding: 2px 10px; }
  .site-nav { display: none; position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .site-nav::before { display: none; }
  body.nav-open .site-nav { display: block; }
  .site-main { padding: 20px 16px 32px; }
  .hero h1 { font-size: 26px; }
}

/* home page benchmark table: the difference from GPT-2 small under each score */
.home-bench th.num, .home-bench td.num { padding-left: 14px; }
.home-bench tr.ref td { background: var(--panel-2); }
.vs { font-size: 11.5px; font-weight: 600; margin-top: 2px; white-space: nowrap; }
.vs.up, .verdict.up { color: var(--good); }
.vs.down, .verdict.down { color: var(--bad); }
.vs.level, .verdict.level { color: var(--muted); }
.hint .vs { display: inline; font-size: inherit; }
.home-bench td.verdict { padding-left: 18px; min-width: 220px; font-weight: 600; font-size: 13px; }
.home-bench td.verdict .small { font-weight: 400; margin-top: 2px; }
.vs-notes { margin-top: 14px; }
.vs-notes ul { margin: 6px 0 0; padding-left: 20px; font-size: 14px; }
.vs-notes li { margin-bottom: 6px; }
.vs-notes b.up { color: var(--good); } .vs-notes b.down { color: var(--bad); }

/* Try it (G3): the model running in the browser */
.try-card label { display: inline-flex; gap: 8px; align-items: center; }
.try-card select { max-width: 100%; min-width: 0; }
.try-card label:has(select) { max-width: 100%; }
.try-card label.block { display: block; margin: 12px 0; }
.try-card textarea { width: 100%; box-sizing: border-box; margin-top: 6px; font: inherit; padding: 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text); }
.try-row { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.try-bar { height: 6px; border-radius: 3px; background: var(--panel-2); margin-top: 10px; overflow: hidden; }
.try-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.try-out { margin-top: 14px; padding: 14px; border-radius: 10px; background: var(--panel-2); white-space: pre-wrap; line-height: 1.55; }
.try-q { font-weight: 600; margin-bottom: 8px; }
.try-p { color: var(--muted); }
.try-stats { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.try-stats .stat { box-shadow: none; }
.try-stats .v { font-size: 20px; }
.try-chart-head { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; margin: 6px 0; font-size: 14px; }
.try-legend { font-size: 12.5px; color: var(--muted); display: inline-flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.try-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.sw.pre, .try-chart rect.pre { background: var(--series-val); fill: var(--series-val); }
.sw.dec, .try-chart rect.dec { background: var(--accent); fill: var(--accent); }
.try-chart { position: relative; }
.try-chart svg { display: block; overflow: visible; }
.try-chart text { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.try-chart line.grid { stroke: var(--border); stroke-width: 1; }
.try-tip { position: absolute; top: 0; padding: 6px 9px; border-radius: 8px; background: var(--panel); border: 1px solid var(--border);
  box-shadow: var(--shadow); font-size: 12.5px; pointer-events: none; white-space: nowrap; }
.try-table { overflow-x: auto; }
.try-table table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.try-table th, .try-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.try-table th { color: var(--muted); font-weight: 550; }
.try-chart text.cut { fill: var(--text); font-weight: 600; }
@media (max-width: 520px) { .try-stats { grid-template-columns: 1fr 1fr; gap: 8px; } .try-stats .stat { padding: 10px 12px; } .try-stats .v { font-size: 17px; } }
