/* ==========================================================================
   Manifesto for Generative AI in Higher Education — Statement pages (v2)
   Farrell & McCarthy, GenAI:N3 (2025) · CC BY-SA 4.0
   --------------------------------------------------------------------------
   THEME TOKENS — edit only :root to restyle every page.
   ========================================================================== */

/* Theme colours and font families come from base.css (load it first). */
:root {
  --paper: #f7f6f2;
  --card: #ffffff;
  --ink: #21252e;
  --ink-soft: #565d6b;
  --line: #e3e0d8;
}

body[data-theme="1"] { --accent: var(--theme-1); }
body[data-theme="2"] { --accent: var(--theme-2); }
body[data-theme="3"] { --accent: var(--theme-3); }
body {
  /* Derived tones: a wash for backgrounds, a deepened tone for small text
     so lighter accents (notably theme 2) stay readable. */
  --accent-soft: color-mix(in srgb, var(--accent) 8%, transparent);
  --accent-deep: color-mix(in srgb, var(--accent) 78%, black);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

a { color: var(--accent-deep, var(--ink)); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent, var(--ink));
  outline-offset: 2px;
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.wrap.wide { max-width: 1200px; }

/* --- Site header ---------------------------------------------------------- */
.topbar {
  border-bottom: 3px solid var(--accent, var(--line));
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 900;
}
.topbar .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem 1.5rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}
.site-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--ink);
  text-decoration: none;
}
.site-nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-soft);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent-deep, var(--ink)); }

/* --- Hero: the number is the signature ------------------------------------ */
.hero {
  padding: 2.75rem 0 2.5rem;
  border-bottom: 5px solid var(--accent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--card)) 0%, var(--paper) 100%);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.counter-line {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.hero-grid {
  margin-top: 1.6rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 2.2rem;
  align-items: center;
}
.big-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(5.5rem, 14vw, 9.5rem);
  line-height: 0.9;
  color: var(--accent);
  letter-spacing: -0.03em;
}
h1.statement strong { color: var(--accent); }
.stmt-icon { color: var(--accent); margin-right: 1.1rem; font-size: 0.82em; vertical-align: baseline; }
h1.statement {
  font-family: var(--font-display);
  font-weight: 550;
  font-size: clamp(2rem, 4.8vw, 3.1rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  border-left: 1px solid var(--line);
  padding-left: 2.2rem;
}
@media (max-width: 620px) {
  .hero-grid { grid-template-columns: 1fr; gap: 1rem; }
  h1.statement strong { color: var(--accent); }
.stmt-icon { color: var(--accent); margin-right: 1.1rem; font-size: 0.82em; vertical-align: baseline; }
h1.statement { border-left: none; padding-left: 0; }
}

/* --- Sections --------------------------------------------------------------- */
section { padding: 2.4rem 0; }
section + section { border-top: 1px solid var(--line); }
h2 {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 1.1rem;
}
.rationale p, .question-block p { max-width: 42em; }
.question-block .question {
  position: relative;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.5;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  padding: 1.2rem 1.5rem 1.3rem 3.7rem;
  max-width: 36em;
}
.question-block .question::before {
  content: "\201C";
  position: absolute;
  left: 1rem;
  top: 0.5rem;
  font-family: var(--font-display);
  font-style: normal;
  font-size: 3.4rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.55;
}

/* --- Share your view --------------------------------------------------------- */
.share-form { display: grid; gap: 1.6rem; max-width: 44rem; width: 100%; }
.share-form > div:not(.demographics):not(.consent-row):not(.hp-field), .share-form .demographics, .share-form .consent-row { max-width: 44rem; }

fieldset.scale-group { border: none; }
fieldset.scale-group legend { font-weight: 600; margin-bottom: 0.55rem; }
.scale-row { display: grid; grid-template-columns: 8.5rem repeat(5, 2.7rem) auto; align-items: center; gap: 0.55rem; justify-content: start; }
@media (max-width: 560px) { .scale-row { display: flex; flex-wrap: wrap; justify-content: center; } }
.scale-anchor { font-size: 0.82rem; color: var(--ink-soft); white-space: nowrap; }
.scale-anchor.low { text-align: right; }
.scale-anchor.low { margin-right: 0.35rem; }
.scale-anchor.high { margin-left: 0.35rem; }
.scale-option { position: relative; display: flex; justify-content: center; }
.scale-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.scale-option span {
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  font-size: 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--card));
  border-radius: 50%;
  background: var(--card);
  font-weight: 500;
  color: var(--accent-deep);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}
.scale-option:hover span { transform: translateY(-2px); border-color: var(--accent); }
.scale-option input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.scale-option input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.share-form label { font-weight: 600; font-size: 0.94rem; }
.share-form label .optional { font-weight: 400; color: var(--ink-soft); }
.share-form textarea, .share-form input[type="text"], .share-form select {
  font: inherit;
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  margin-top: 0.35rem;
}
.share-form textarea { min-height: 7.5rem; resize: vertical; }
.share-form textarea:focus, .share-form input:focus, .share-form select:focus {
  border-color: var(--accent);
  outline: none;
}
.char-hint { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.25rem; }

.demographics { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .demographics { grid-template-columns: 1fr; } }

/* Honeypot: hidden from humans, tempting to bots */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.consent-row { display: flex; gap: 0.7rem; align-items: flex-start; max-width: 40em; }
.consent-row input { margin-top: 0.35rem; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.consent-row label { font-weight: 400; font-size: 0.92rem; }

.btn {
  justify-self: start;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.75rem 1.8rem;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: 0.55; cursor: default; }

.form-status { font-size: 0.95rem; min-height: 1.4em; }
.form-status.ok { color: var(--accent-deep); font-weight: 600; }
.form-status.err { color: #a13030; font-weight: 600; }
.privacy-note { font-size: 0.83rem; color: var(--ink-soft); max-width: 40em; }

/* --- The conversation so far -------------------------------------------------- */
.summary {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  padding: 1.3rem 1.5rem;
  max-width: 34rem;
}
.summary .resp-count { font-weight: 700; margin-bottom: 0.9rem; }
.dim { display: grid; grid-template-columns: 9.5rem 1fr 2.6rem; gap: 0.7rem; align-items: center; font-size: 0.92rem; }
.dim + .dim { margin-top: 0.55rem; }
.dim .bar { background: var(--accent-soft); height: 0.75rem; position: relative; }
.dim .bar > span { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.dim .val { font-weight: 700; text-align: right; }
.gap-callout { margin-top: 1rem; font-size: 0.88rem; color: var(--ink-soft); }
.gap-callout strong { color: var(--accent-deep); }

.observations { margin-top: 2rem; display: grid; gap: 1rem; }
.observation {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.1rem 1.3rem;
}
.observation .meta {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.observation .meta .name { font-weight: 700; color: var(--ink); }
.observation p { font-size: 0.98rem; }
.empty-state { color: var(--ink-soft); font-style: italic; }

/* --- Likes & replies ---------------------------------------------------------- */
.obs-actions { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.85rem; }
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.like-btn i { line-height: 1; }
.like-btn:hover { border-color: var(--accent); color: var(--accent-deep); }
.like-btn.liked { color: var(--accent-deep); border-color: var(--accent); }
.reply-toggle {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border: none;
  background: none;
  color: var(--accent-deep);
  cursor: pointer;
  border-radius: 4px;
}
.reply-toggle:hover { text-decoration: underline; }

.replies { margin-top: 0.7rem; display: grid; gap: 0.6rem; }
.replies:empty { display: none; }
.reply {
  border-left: 2px solid var(--line);
  padding: 0.35rem 0 0.35rem 0.9rem;
  margin-left: 0.5rem;
}
.reply-meta {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
}
.reply-meta .name { font-weight: 700; color: var(--ink); }
.reply p { font-size: 0.92rem; }

.reply-form {
  position: relative;
  margin-top: 0.85rem;
  display: grid;
  gap: 0.7rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  max-width: 34rem;
}
.reply-form label { display: block; font-weight: 600; font-size: 0.9rem; }
.reply-form .optional { font-weight: 400; color: var(--ink-soft); }
.reply-form textarea,
.reply-form input[type="text"] {
  font: inherit;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.reply-form textarea { min-height: 4.5rem; resize: vertical; }
.reply-form textarea:focus,
.reply-form input:focus { border-color: var(--accent); outline: none; }
.reply-form .rf-consent {
  font-weight: 400;
  font-size: 0.85rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}
.reply-form .rf-consent input { margin-top: 0.2rem; accent-color: var(--accent); }
.reply-form .rf-actions { display: flex; align-items: center; gap: 0.8rem; }
.reply-form .btn { justify-self: start; padding: 0.55rem 1.2rem; }
.reply-form .rf-status { font-size: 0.85rem; }
.reply-form .rf-status.ok { color: var(--accent-deep); font-weight: 600; }
.reply-form .rf-status.err { color: #a13030; font-weight: 600; }
.reply-form .hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- Pager & progress ---------------------------------------------------------- */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
  padding: 2.25rem 0 1rem;
}
.pager a {
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0.95rem 1.15rem;
  color: var(--ink);
  transition: border-color 0.15s ease;
}
.pager a:hover { border-color: var(--accent); }
.pager a .dir { display: block; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-deep); margin-bottom: 0.3rem; }
.pager a .label { font-family: var(--font-display); font-size: 0.95rem; line-height: 1.3; }
.pager a.all { align-self: center; border: none; background: none; font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); text-align: center; }
.pager a.all:hover { color: var(--accent-deep); }
.pager a.next { text-align: right; }
@media (max-width: 620px) {
  .pager { grid-template-columns: 1fr; }
  .pager a.next { text-align: left; }
}
.progress-note { text-align: center; font-size: 0.85rem; color: var(--ink-soft); padding-bottom: 1.5rem; }

/* --- Cite & footer -------------------------------------------------------------- */
.cite { padding: 0 0 2.2rem; }
.cite details { max-width: 44rem; }
.cite summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--ink-soft); }
.cite blockquote {
  margin-top: 0.7rem;
  font-size: 0.88rem;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 0.9rem 1.1rem;
  color: var(--ink-soft);
}
footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.75rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
footer p + p { margin-top: 0.45rem; }

/* --- Explore Responses page -------------------------------------------------------- */
body.explore { --accent: var(--ink); }
.explore-hero { padding: 2.75rem 0 2.25rem; border-bottom: 5px solid var(--ink); background: var(--card); }
.explore-hero h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.8rem, 4vw, 2.4rem); }
.explore-hero p { margin-top: 0.8rem; color: var(--ink-soft); max-width: 46em; }

.theme-key { display: flex; gap: 1.4rem; flex-wrap: wrap; padding: 1.4rem 0 0.4rem; font-size: 0.88rem; }
.theme-key span { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 600; }
.key-1 { color: var(--theme-1); }
.key-2 { color: var(--theme-2); }
.key-3 { color: var(--theme-3); }

.explore-table-wrap { overflow-x: auto; padding-bottom: 2.5rem; }
table.explore-table { width: 100%; border-collapse: collapse; font-size: 0.94rem; background: var(--card); border: 1px solid var(--line); }
.explore-table th, .explore-table td { padding: 0.65rem 0.8rem; text-align: left; border-bottom: 1px solid var(--line); }
.explore-table th {
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--paper);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.explore-table th .arrow { opacity: 0.5; }
.explore-table td.num { font-family: var(--font-display); font-weight: 600; }
.explore-table td.num a { text-decoration: none; }
.explore-table .glyph-1 { color: var(--theme-1); }
.explore-table .glyph-2 { color: var(--theme-2); }
.explore-table .glyph-3 { color: var(--theme-3); }
.explore-table td.stmt a { color: var(--ink); text-decoration: none; }
.explore-table td.stmt a:hover { text-decoration: underline; }
.explore-table td.metric { text-align: right; font-variant-numeric: tabular-nums; }
.explore-table td.gap { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.explore-loading { padding: 2rem 0; color: var(--ink-soft); font-style: italic; }


/* --- Statement page sidebar (injected by statement.js) ---------------------- */
main.wrap.has-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18.5rem;
  gap: 2.75rem;
  align-items: start;
}
@media (max-width: 900px) {
  main.wrap.has-side { grid-template-columns: 1fr; gap: 0; }
  .col-side { display: none; }
}
.col-side {
  position: sticky;
  top: 4.75rem;
  align-self: start;
  padding-top: 2.4rem;
  font-size: 0.9rem;
}
.side-progress {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: var(--card);
  padding: 0.75rem 0.9rem;
  margin-bottom: 1.4rem;
}
.side-progress .n { font-weight: 700; color: var(--accent-deep); }
.side-progress .track { height: 0.4rem; background: var(--accent-soft); margin-top: 0.5rem; }
.side-progress .track > span { display: block; height: 100%; background: var(--accent); transition: width 0.2s ease; }
.side-progress .sub { display: block; margin-top: 0.55rem; font-size: 0.82rem; color: var(--ink-soft); }
.side-progress .track.track-sub { margin-top: 0.4rem; }
.side-progress .track.track-sub > span { background: color-mix(in srgb, var(--accent) 55%, var(--card)); }

.side-nav .side-title {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.7rem;
}
.side-nav details { border-top: 1px solid var(--line); }
.side-nav details:last-of-type { border-bottom: 1px solid var(--line); }
.side-nav summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0;
  font-weight: 600;
}
.side-nav summary::-webkit-details-marker { display: none; }
.side-nav summary .tglyph { width: 0.7em; height: 0.7em; flex: none; }
.side-nav summary .caret { margin-left: auto; color: var(--ink-soft); transition: transform 0.15s ease; }
.side-nav details[open] summary .caret { transform: rotate(90deg); }
.side-nav .grp-1 { color: var(--theme-1); }
.side-nav .grp-2 { color: var(--theme-2); }
.side-nav .grp-3 { color: var(--theme-3); }
.side-nav ul { list-style: none; margin: 0 0 0.6rem; padding: 0; }
.side-nav li a {
  display: flex;
  gap: 0.55rem;
  padding: 0.32rem 0.4rem;
  text-decoration: none;
  color: var(--ink);
  border-radius: 3px;
  line-height: 1.35;
}
.side-nav li a .sn { color: var(--ink-soft); font-variant-numeric: tabular-nums; font-weight: 600; flex: none; }
.side-nav li a .st { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav li a:hover { background: var(--accent-soft); }
.side-nav li a[aria-current="true"] { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.side-nav li a[aria-current="true"] .sn { color: var(--accent-deep); }

/* --- Explore page: uniform inline-SVG theme marks --------------------------- */
.tglyph { width: 0.68em; height: 0.68em; fill: currentColor; margin-right: 0.4em; flex: none; vertical-align: -0.05em; }
.explore-table td.num a { display: inline-flex; align-items: center; }
.theme-key span { display: inline-flex; align-items: center; }
.explore-table td.stmt strong { font-weight: 700; }
