/* ------------------------------------------------------------------ */
/* Carried over from smt-fa2026/src/app.css, cut down to what a single  */
/* page uses. Color scheme defined once here; nothing else in the file  */
/* carries a literal color.                                             */
/* ------------------------------------------------------------------ */
:root {
  --bg:      #2424e0;                  /* blue */
  --fg:      #ffffff;                  /* text */
  --hi:      #00ff00;                  /* highlight: selection, hover */
  --hi-fg:   #000000;                  /* text on a highlight */
  --fg-dim:  rgba(255, 255, 255, 0.75); /* secondary text */
  --rule:    rgba(255, 255, 255, 0.35); /* borders */
  --code-bg: rgba(0, 0, 0, 0.25);       /* unused here; kept with the tokens */

  /* The fixed header (1rem padding, a 1rem/1.6 title, 1rem padding) plus room
     to breathe. The course site's 8rem also cleared the pill nav, which this
     page does not have. */
  --chrome-top: 4.5rem;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto Mono', monospace;
  line-height: 1.6;
  color: var(--fg);
  background-color: var(--bg);
  margin: 0;
  padding: 0;
}

::selection {
  background: var(--hi);
  color: var(--hi-fg);
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  background: var(--bg);
}

.site-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--fg);
  text-decoration: none;
}

.site-title:hover {
  background: var(--hi);
  color: var(--hi-fg);
}

/* Main content */
.site-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  padding-top: var(--chrome-top);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--fg);
}

/* Content article styles */
.content-article {
  font-size: 0.9rem;
  line-height: 1.7;
}

.content-article h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--fg);
}

.content-article p {
  margin-bottom: 1rem;
}

.content-article ul,
.content-article ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.content-article li {
  margin-bottom: 0.5rem;
}

.content-article a {
  color: var(--fg);
  text-decoration: underline;
  transition: background 0.15s ease;
}

.content-article a:hover {
  background: var(--hi);
  color: var(--hi-fg);
  text-decoration: none;
}

/* Images */
.content-article img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 4px;
}

/* Reference lists. Borrowed from the course site's list pages: the item rules
   are carried over as written. Its `.content-list-item a` rule (no underline,
   1rem, inline-block) is not - a citation here is a sentence with links inside
   it, so the links keep the prose behavior above and wrap with the text. */
.content-list {
  list-style: none;
  padding: 0;
}

.content-article .content-list {
  padding-left: 0;
}

.content-list-item {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.content-list-item:last-child {
  border-bottom: none;
}

/* Secondary lines: the header meta, the note beside the PDF, the closing line. */
.meta {
  color: var(--fg-dim);
}

/* A curated note on a reference: dimmer than the citation, on its own line.
   Not <em>, which in these lists means the title of a work. */
.note {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.55);
}

.site-footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8rem;
  color: var(--fg-dim);
}

[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------ */
/* Password gate. Until index.html's gate script adds .unlocked to    */
/* <html>, only the form shows.                                       */
/* ------------------------------------------------------------------ */
html:not(.unlocked) .site-header,
html:not(.unlocked) .site-main {
  display: none;
}

html.unlocked .gate {
  display: none;
}

.gate {
  max-width: 24rem;
  margin: 0 auto;
  padding: 30vh 2rem 2rem;
  font-size: 0.9rem;
}

.gate-title {
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.gate label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--fg-dim);
}

.gate-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.gate input {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--rule);
  padding: 0.4rem 0.6rem;
}

.gate input:focus {
  outline: none;
  border-color: var(--fg);
}

/* ------------------------------------------------------------------ */
/* AI traces viewer (viz/viewer.js, viz/render.js). The canvas draws  */
/* its own ground in --bg; Inter is bundled because render.js fits    */
/* its labels to it. SIL Open Font License 1.1, viz/fonts/LICENSE.txt */
/* ------------------------------------------------------------------ */
@font-face {
  font-family: "Inter 18pt";
  src: url("viz/fonts/Inter18pt-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter 18pt";
  src: url("viz/fonts/Inter18pt-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

/* The breakout below is sized in vw, which includes the scrollbar. */
body {
  overflow-x: clip;
}

.gate button,
.views button,
.viz-sets button,
.viz-panels button {
  font: inherit;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--rule);
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.gate button:hover,
.views button:hover,
.viz-sets button:hover,
.viz-panels button:hover,
.views button[aria-pressed="true"],
.viz-sets button[aria-pressed="true"],
.viz-panels button[aria-pressed="true"] {
  background: var(--hi);
  color: var(--hi-fg);
  border-color: var(--hi);
}

/* The page's two views: sources and the AI traces panels. */
.views {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.views button {
  font-weight: 700;
}

#view-traces {
  padding-top: 1.5rem;
}

.viz-sets,
.viz-panels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.viz-sets button {
  font-weight: 700;
}

.viz-panels button {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
}

/* Out of the 800px column to 75% of the window: the EOYS panels have about a
   thousand works a year. Full width on a phone, where the panels stack. */
.viz-wide {
  width: 75vw;
  margin-left: calc(50% - 37.5vw);
}

@media (max-width: 899px) {
  .viz-wide {
    width: 100vw;
    margin-left: calc(50% - 50vw);
  }
}

.viz-stage canvas {
  display: block;
  max-width: 100%;
  margin: 0 auto;
}

/* Tooltip */
#tip {
  position: fixed;
  z-index: 1100;
  max-width: 340px;
  background: var(--hi-fg);
  color: var(--fg);
  border: 1px solid var(--rule);
  padding: 12px 14px;
  font-size: 0.8rem;
  line-height: 1.45;
  pointer-events: none;
}

#tip b, .sheet-card b { font-weight: 700; }
#tip .meta, .sheet-card .meta { font-size: 0.75rem; }
#tip p, .sheet-card p { margin: 8px 0 0; }
#tip .words, .sheet-card .words { color: var(--hi); }
#tip .go { margin-top: 8px; font-size: 0.75rem; color: var(--fg-dim); }
#tip img, .sheet-card img {
  margin-top: 10px;
  width: 96px;
  height: 96px;
  object-fit: cover;
  display: block;
}

@media (pointer: coarse), (max-width: 899px) {
  #tip { display: none !important; }
}

/* Bottom sheet: the tooltip on a phone */
#sheet {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.42);
  display: flex;
  align-items: flex-end;
}

.sheet-card {
  position: relative;
  width: 100%;
  background: var(--hi-fg);
  color: var(--fg);
  padding: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  max-height: 80vh;
  overflow-y: auto;
}

.sheet-card .close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: 0;
  color: var(--fg-dim);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.sheet-card .open {
  display: block;
  margin-top: 16px;
  padding: 12px;
  background: var(--hi);
  color: var(--hi-fg);
  text-align: center;
  text-decoration: none;
  font-weight: 700;
}

/* Responsive styles */
@media (max-width: 768px) {
  .site-header {
    padding: 1rem;
  }

  .site-main {
    padding: 1.5rem;
    padding-top: var(--chrome-top);
  }

  .page-title {
    font-size: 1.25rem;
  }
}
