/* ============================================================================
   File        : style.css
   Project     : The Knowledge Lifecycle of Large Language Models
   Purpose     : Restrained academic styling. Color carries meaning only: the five
                 stage colors from the paper's lifecycle figure and three regime colors.
   Authors     : Amey Thakur (https://github.com/Amey-Thakur)
                 Sarvesh Talele (https://github.com/sarveshtalele)
   Repository  : https://github.com/Amey-Thakur/LLM-KNOWLEDGE-LIFECYCLE
   Release Date: August 18, 2026
   License     : CC BY 4.0
   ============================================================================ */

:root {
  --ink: #1a1a1a;
  --muted: #555;
  --faint: #888;
  --line: #d8d8d8;
  --accent: #1a4f8a;
  --bg: #ffffff;
  --panel: #fafafa;

  /* stage colors, matching Figure 1 of the paper */
  --st1: #4a7fd4;  /* acquire  */
  --st2: #2a9d8f;  /* store    */
  --st3: #e08a2e;  /* retrieve */
  --st4: #d05353;  /* update   */
  --st5: #8f5fb8;  /* forget   */

  /* regime colors */
  --ok: #2e7d32;
  --drift: #b57f00;
  --fail: #c62828;
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  padding: 3rem 1.5rem 4.5rem;
  max-width: 54rem;
  font: 16px/1.55 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    /* Stage-colour wash across the whole page, not only the header. */
    linear-gradient(180deg,
      rgba(74,127,212,.075) 0%, rgba(42,157,143,.055) 20%,
      rgba(224,138,46,.045) 40%, rgba(208,83,83,.04) 62%,
      rgba(143,95,184,.045) 82%, rgba(74,127,212,.04) 100%),
    /* Measurement grid: a major line every fifth cell, so the ground has
       structure at reading distance instead of an even hairline hum. */
    repeating-linear-gradient(0deg, transparent 0 119px, rgba(26,26,26,.07) 119px 120px),
    repeating-linear-gradient(90deg, transparent 0 119px, rgba(26,26,26,.07) 119px 120px),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(26,26,26,.035) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(26,26,26,.035) 23px 24px),
    var(--bg);
  /* The ground is a fixed surface the content moves across, so it stays put on
     scroll. One value per image layer, in the order declared above. */
  background-attachment: fixed, fixed, fixed, fixed, fixed;
}

header { text-align: center; }
header h1 { margin: 0 0 .35rem; font-size: 1.75rem; letter-spacing: -.01em; }
.subtitle { margin: 0 auto .7rem; color: var(--muted); max-width: 40rem; }
.badges { margin: 0 0 1rem; }
.badges img { vertical-align: middle; margin: 0 .15rem .3rem; }

/* GitHub-style alerts */
.alert {
  text-align: left;
  margin: .8rem auto 1rem;
  padding: .6rem .9rem;
  border-left: 3px solid var(--accent);
  background: var(--panel);
  font-size: .9rem;
  color: var(--muted);
  max-width: 44rem;
}
.alert-title { display: block; font-weight: 600; font-size: .85rem; }
.a-important { border-left-color: var(--st5); }
.a-important .alert-title { color: var(--st5); }
.a-note { border-left-color: var(--st1); }
.a-note .alert-title { color: var(--st1); }
.a-warning { border-left-color: var(--drift); }
.a-warning .alert-title { color: var(--drift); }

/* five-stage identity bar */
.stagebar { display: flex; height: 1.5rem; margin: .4rem 0 0; font-size: .72rem; color: #fff; text-align: center; }
.stagebar span { flex: 1; line-height: 1.5rem; }
.s1 { background: var(--st1); } .s2 { background: var(--st2); } .s3 { background: var(--st3); }
.s4 { background: var(--st4); } .s5 { background: var(--st5); }

.tabs { display: flex; margin: 1.2rem 0 0; border-bottom: 1px solid var(--line); }
.tab {
  padding: .5rem 1.1rem; border: none; background: none; cursor: pointer;
  font: inherit; font-size: .95rem; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.panel { display: none; padding-top: 1.8rem; }
.panel.active { display: block; }

/* loader */
#loader { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
#load-btn {
  padding: .45rem 1rem; font: inherit; font-size: .92rem; cursor: pointer;
  background: var(--accent); color: #fff; border: none;
}
#load-btn:disabled { background: var(--faint); cursor: default; }
#load-status { font-size: .88rem; color: var(--faint); }
#load-bar-wrap { flex-basis: 100%; height: 5px; background: var(--line); margin-top: 1rem; }
#load-bar { height: 100%; width: 0%; background: var(--accent); transition: width .2s; }

/* presets */
.presets { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: .4rem; }
.preset {
  flex: 1 1 12rem; padding: .5rem .7rem .55rem; text-align: left;
  font: inherit; font-size: .88rem; cursor: pointer; line-height: 1.35;
  background: #fff; border: 1px solid var(--line); border-left-width: 3px;
  color: var(--muted);
}
.preset strong { color: var(--ink); }
.preset span { display: block; font-size: .78rem; }
.r-fail { border-left-color: var(--fail); }
.r-fail span { color: var(--fail); }
.r-drift { border-left-color: var(--drift); }
.r-drift span { color: var(--drift); }
.r-influence { border-left-color: var(--st3); }
.r-influence span { color: var(--st3); }
.preset.active { background: var(--panel); border-color: var(--ink); border-left-width: 3px; }
.r-fail.active { border-left-color: var(--fail); }
.r-drift.active { border-left-color: var(--drift); }
.r-influence.active { border-left-color: var(--st3); }
.reading { font-size: .88rem; color: var(--muted); margin: .7rem 0 1rem; }

/* inputs */
.inputs label { display: block; margin-bottom: .7rem; font-size: .85rem; color: var(--muted); }
.dim { color: var(--faint); font-weight: 400; font-size: .82rem; }
textarea, input[type=text] {
  display: block; width: 100%; margin-top: .25rem;
  padding: .45rem .6rem; font: inherit; font-size: .93rem;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}
textarea:focus, input:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
.row { display: flex; gap: .8rem; align-items: flex-end; }
.grow { flex: 1; }
#run {
  padding: .5rem 1.5rem; font: inherit; cursor: pointer;
  background: var(--accent); color: #fff; border: none; height: 2.4rem;
}
#run:disabled { background: var(--faint); cursor: default; }

/* results */
#results { margin-top: 2.2rem; }
.verdict-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.chip {
  display: inline-block; padding: .18rem .7rem; font-size: .82rem; font-weight: 600;
  color: #fff; background: var(--faint);
}
.chip-ok { background: var(--ok); }
.chip-drift { background: var(--drift); }
.chip-fail { background: var(--fail); }
.chip-influence { background: var(--st3); }

.gauge-block { margin-bottom: 1.7rem; }
.gauge-label { display: flex; justify-content: space-between; font-size: .88rem; color: var(--muted); margin-bottom: .3rem; }
.gauge-label strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.gauge { position: relative; display: flex; height: 10px; }
.gauge.slim { height: 7px; }
.zone { height: 100%; }
.z-ok { background: #cde6cf; } .z-drift { background: #f2e3b3; }
.z-severe { background: #f5cfa0; } .z-fail { background: #f0bcbc; }
.z-inert { background: #f0bcbc; } .z-partial { background: #f2e3b3; } .z-strong { background: #cde6cf; }
.marker {
  position: absolute; top: -3px; bottom: -3px; width: 3px;
  background: var(--ink); transition: left .3s;
}
.gauge-ticks { position: relative; height: 2.2rem; font-size: .72rem; color: var(--faint); }
.gauge-ticks span { position: absolute; transform: translateX(-50%); text-align: center; line-height: 1.2; padding-top: .2rem; }
.gauge-ticks i { font-style: normal; color: #b0b0b0; }

table { border-collapse: collapse; width: 100%; margin: .5rem 0 1rem; font-size: .9rem; }
th, td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; border-bottom: 2px solid var(--ink); }

.kv td:first-child { color: var(--muted); width: 55%; }
.kv td:last-child { font-variant-numeric: tabular-nums; }

.cols { display: flex; gap: 2rem; flex-wrap: wrap; }
.cols > div { flex: 1 1 17rem; }
.cols h3 { font-size: .95rem; margin: .6rem 0 .2rem; }
.toks td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.toks tr.hit td { color: var(--accent); font-weight: 600; }

/* guide */
h2 { font-size: 1.15rem; margin: 2rem 0 .7rem; }
.dot { display: inline-block; width: .65rem; height: .65rem; margin-right: .4rem; vertical-align: baseline; }
.d1 { background: var(--st1); } .d2 { background: var(--st2); } .d3 { background: var(--st3); }
.d4 { background: var(--st4); } .d5 { background: var(--st5); }
.stages td.fail { color: var(--muted); font-size: .86rem; }
.grid2 th { background: var(--panel); }
.grid2 td { font-size: .88rem; }
.c-ok { color: var(--ok); } .c-drift { color: var(--drift); } .c-fail { color: var(--fail); }

.note { font-size: .85rem; color: var(--faint); }
a { color: var(--accent); }

/* footer */
footer { margin-top: 3rem; border-top: 1px solid var(--line); padding-top: 1.4rem; font-size: .9rem; color: var(--muted); text-align: center; }
.authors { display: flex; justify-content: center; gap: 3rem; margin-bottom: 1rem; }
.author p { margin: .25rem 0; }
.avatar { width: 84px; height: 84px; border-radius: 50%; border: 1px solid var(--line); }
footer pre { background: var(--panel); border: 1px solid var(--line); padding: .8rem; overflow-x: auto; font-size: .8rem; text-align: left; }
summary { cursor: pointer; }
.foot-links { margin-top: .8rem; }

/* lede and narrative */
.lede { max-width: 44rem; color: var(--muted); margin: 0 0 1.1rem; }
.narrative {
  max-width: 46rem; margin: 0 0 1.6rem; padding: .8rem 1rem;
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--accent);
  font-size: .95rem;
}
.small { font-size: .82rem; }

/* stage bar diagnostic states: participating stages carry a glyph, the
   others dim, so the diagnosis reads as intent rather than decoration */
.stagenote { text-align: center; font-size: .8rem; color: var(--faint); margin: .5rem 0 0; }
.stagebar span { transition: opacity .3s; }
.stagebar.diagnosed .dimstage { opacity: .4; }

/* paired bars */
#bars { margin: .4rem 0 1.6rem; background: #fff; border: 1px solid var(--line); padding: .7rem .9rem; }
.bar-row { display: flex; align-items: center; gap: .7rem; padding: .18rem 0; }
.bar-tok { flex: 0 0 7rem; text-align: right; font-family: ui-monospace, Consolas, monospace; font-size: .84rem; }
.bar-pair { flex: 1; display: grid; grid-template-columns: 1fr 5.2rem 1fr 5.2rem; align-items: center; gap: .35rem; }
.bar { display: block; height: 11px; min-width: 1px; }
.b-plain { background: #b9b9b9; }
.b-ctx { background: var(--accent); }
.bar-pair em { font-style: normal; font-size: .76rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.bar-row.hit .bar-tok { color: var(--ok); font-weight: 700; }
.bar-row.hit .bar { outline: 2px solid var(--ok); outline-offset: 1px; }
.bar-head em { font-size: .74rem; color: var(--faint); }
.bar-head { border-bottom: 1px solid var(--line); margin-bottom: .3rem; }

/* temperature control */
.temp-block { margin: 0 0 1.4rem; background: #fff; border: 1px solid var(--line); padding: .8rem 1rem; }
.temp-block input[type=range] { width: 100%; accent-color: var(--accent); margin: .4rem 0 .3rem; }

/* inputs on panels for readability over the grid */
.inputs, .presets .preset, fieldset { background-clip: padding-box; }
select { padding: .42rem .5rem; font: inherit; font-size: .93rem; border: 1px solid var(--line); background: #fff; margin-top: .25rem; display: block; }
.fine summary { font-size: .88rem; color: var(--muted); }
.fine { margin-bottom: 1rem; }

/* interaction polish */
#run, .preset, select, textarea, input[type=text], .chip, .alert, .narrative,
#bars, .temp-block, #load-bar-wrap { border-radius: 6px; }
.badges img { border-radius: 3px; }
#load-bar { border-radius: 6px; }
.avatar { transition: transform .15s ease, box-shadow .15s ease; }
.avatar:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(26,26,26,.18); }

#run {
  border-radius: 7px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  box-shadow: 0 1px 3px rgba(26,79,138,.3);
}
#run:hover:not(:disabled) {
  background: #16406f;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(26,79,138,.35);
}
#run:active:not(:disabled) { transform: translateY(0); box-shadow: 0 1px 3px rgba(26,79,138,.3); }

.preset { transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.preset:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(26,26,26,.08); }
.preset.active { box-shadow: 0 2px 8px rgba(26,26,26,.08); }

.tab { transition: color .12s ease; border-radius: 6px 6px 0 0; }
.tab:hover { color: var(--ink); background: rgba(26,79,138,.04); }

textarea:focus, input:focus, select:focus, #run:focus-visible, .preset:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.stagebar { border-radius: 6px; overflow: hidden; }

/* narrow screens: stack the paired bars rather than crushing four columns */
@media (max-width: 620px) {
  body { padding: 2rem 1rem 3rem; }
  .bar-tok { flex: 0 0 5rem; font-size: .78rem; }
  .bar-pair { grid-template-columns: 1fr 4rem; row-gap: .2rem; }
  .row { flex-wrap: wrap; }
  #run { width: 100%; }
  .authors { gap: 1.5rem; }
  .stagebar { font-size: .62rem; }
  .gauge-ticks span { font-size: .66rem; }
}

/* ---------------------------------------------------------------------------
   Typographic measure and rhythm.

   Prose is capped near 68 characters. Beyond that the eye loses the line
   start on the return sweep, which is what made the earlier full-width
   paragraphs tiring to read. Tables, bars, and gauges stay full width: they
   are scanned, not read.
   --------------------------------------------------------------------------- */

body { line-height: 1.65; }

.subtitle { max-width: 38rem; font-size: 1.02rem; }
.lede,
.reading,
#guide p,
.narrative,
.note,
.alert,
.glossary { max-width: none; }
.alert { line-height: 1.6; }
.subtitle { max-width: 44rem; }

.lede { margin-bottom: 1.6rem; font-size: 1rem; }
.reading { margin: 1rem 0 1.8rem; }

header { margin-bottom: 2.2rem; }
header h1 { font-size: 1.9rem; margin-bottom: .6rem; }
.badges { margin-bottom: 1.2rem; }

.panel { padding-top: 2.2rem; }
.inputs { margin-top: 1.8rem; }
.inputs label { margin-bottom: 1.1rem; }
#results { margin-top: 2.8rem; }
.verdict-row { margin-bottom: 1.4rem; }
.narrative { padding: 1rem 1.2rem; margin-bottom: 2rem; line-height: 1.7; }
#bars { padding: 1rem 1.2rem; margin-bottom: 2.2rem; }
.gauge-block { margin-bottom: 2rem; }
.temp-block { padding: 1rem 1.2rem; margin-bottom: 1.8rem; }

#guide h2 { margin: 2.4rem 0 .8rem; }
#guide h2:first-child { margin-top: .4rem; }
#guide p { margin-bottom: 1.2rem; }
#guide table { margin-bottom: 1.8rem; }
th, td { padding: .55rem .7rem; }

h3 { margin: 1.8rem 0 .3rem; }
.cols h3 { margin-top: 0; }

footer { margin-top: 4rem; padding-top: 2rem; }
.authors { margin-bottom: 1.6rem; }

/* glossary: term column narrow and steady so definitions align */
.glossary td:first-child { width: 11rem; color: var(--ink); }
.glossary td:last-child { color: var(--muted); }
.glossary { max-width: 46rem; }

/* stage table: the label column holds a colored dot and a one-word stage name,
   so it must never wrap. "Retrieve" was breaking onto its own line. */
.stages td:first-child { white-space: nowrap; width: 9.5rem; }
.stages td:nth-child(2) { width: 40%; }

/* tabs: the browser's default focus ring boxes the active tab after a mouse
   click, so the page supplies its own focus treatment. */
.tab:focus { outline: none; }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* the paper's title, given its own line so it is not buried mid-sentence */
.paper-line {
  margin: .5rem auto 1.1rem;
  font-size: .95rem;
  color: var(--muted);
}
.paper-line em { color: var(--ink); font-style: italic; }

/* ---------------------------------------------------------------------------
   Measure row.

   The repetition label is wider than its select, which left a gap of dead
   space before the button and made the button look adrift. The select now
   fills its label, so the three controls sit in one continuous run.
   --------------------------------------------------------------------------- */

.row { align-items: flex-end; gap: .9rem; margin-bottom: 1.1rem; }
/* flex-end aligns margin boxes, so a bottom margin on these labels would push
   the button below the controls it sits beside. The row carries it instead. */
.row > label { flex: 0 0 auto; margin-bottom: 0; }
.row > label.grow { flex: 1 1 auto; }
.row select { width: 100%; height: 2.5rem; }
.row input[type=text] { height: 2.5rem; }

#run {
  /* Flex centring rather than padding arithmetic, so the label sits on the
     optical centre whatever the text or font size. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  min-width: 8.5rem;
  padding: 0 1.6rem;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1;
}

/* With a more present ground, the panels need an edge to sit on rather than
   dissolving into it. */
.narrative, #bars, .temp-block, .alert { box-shadow: 0 1px 2px rgba(26,26,26,.05); }
.preset { background: rgba(255,255,255,.86); }
.preset.active { background: #fff; }
textarea, input[type=text], select { background: rgba(255,255,255,.94); }
textarea:focus, input:focus, select:focus { background: #fff; }

/* Panels are opaque against the tinted ground, which is what separates
   content from page now that the ground is visible. */
.narrative, #bars, .temp-block { background: #fff; }
.alert { background: rgba(255,255,255,.82); }
.preset { background: rgba(255,255,255,.92); }
table { background: rgba(255,255,255,.55); }
.grid2 th { background: rgba(250,250,250,.95); }
