/* Talking Rubrics viewer — warm paper, phone-first, built to be screen-recorded */
:root {
  --bg: #FBF7F0;
  --surface: #FFFFFF;
  --ink: #211D16;
  --muted: #6F675B;
  --line: #EAE2D6;
  --accent: #E4572E;
  --accent-soft: #FCEAE2;
  --l4: #2E7D5B; --l4-soft: #E3F2EB;
  --l3: #2C6E91; --l3-soft: #E4EFF6;
  --l2: #C77D1F; --l2-soft: #FAF0DE;
  --l1: #B5443F; --l1-soft: #F9E7E6;
  --radius: 18px;
  --display: "Fraunces", Georgia, serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
}
#app { max-width: 520px; margin: 0 auto; padding: 20px 18px 80px; }
a { color: inherit; }

/* ---------- shared ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 650; letter-spacing: .02em;
  padding: 3px 10px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent);
}
.chip.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.backlink {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--muted);
  text-decoration: none; margin-bottom: 18px;
}
.backlink:hover { color: var(--ink); }
h1.display {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(30px, 8vw, 42px); line-height: 1.08;
  letter-spacing: -0.015em; margin: 10px 0 8px;
}
.sub { color: var(--muted); font-size: 15.5px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
  box-shadow: 0 1px 2px rgba(33,29,22,.04), 0 8px 24px -18px rgba(33,29,22,.25);
}

/* ---------- home ---------- */
.hero { padding: 26px 0 18px; }
.wordmark { display: flex; align-items: center; gap: 10px; }
.wordmark .mark {
  width: 40px; height: 40px; border-radius: 13px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 20px;
  box-shadow: 0 6px 16px -6px rgba(228,87,46,.55);
}
.hero .tagline {
  font-family: var(--display); font-weight: 650;
  font-size: 17px; color: var(--accent); margin-top: 14px;
}
.showcase {
  display: block; text-decoration: none; margin: 18px 0 26px;
  background: linear-gradient(135deg, #26201A 0%, #3A2C20 100%);
  color: #FBF7F0; border: none; position: relative; overflow: hidden;
}
.showcase .chip { background: rgba(251,247,240,.14); color: #FBF7F0; }
.showcase h2 { font-family: var(--display); font-weight: 650; font-size: 22px; margin: 10px 0 4px; }
.showcase p { color: rgba(251,247,240,.75); font-size: 14.5px; }
.showcase .play-pill {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 9px 16px; border-radius: 99px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 14.5px;
}
.section-label {
  font-size: 12.5px; font-weight: 750; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); margin: 22px 0 10px;
}
.rubric-card {
  display: block; text-decoration: none; margin-bottom: 12px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.rubric-card:active { transform: scale(.985); }
.rubric-card h3 { font-family: var(--display); font-weight: 650; font-size: 19px; margin: 8px 0 3px; }
.rubric-card .meta { font-size: 13px; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge {
  font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums;
  padding: 2px 8px; border-radius: 7px;
  background: var(--l3-soft); color: var(--l3);
}
.badge.unverified { background: #F1EDE4; color: var(--muted); }
footer { margin-top: 36px; font-size: 13px; color: var(--muted); text-align: center; }
footer a { color: var(--accent); font-weight: 600; text-decoration: none; }
.demo-note {
  margin-top: 26px; padding: 12px 14px; border-radius: 12px;
  background: #F4EEE3; font-size: 13px; color: var(--muted); text-align: center;
}

/* ---------- rubric view ---------- */
.rubric-head { margin-bottom: 18px; }
.rubric-head .titleline { min-height: 1.2em; }
.version-line { font-size: 13px; color: var(--muted); margin-top: 8px; }
.version-line .evolved { color: var(--l4); font-weight: 650; }
.forge-btn {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 10px 18px; border-radius: 99px;
  border: none; background: var(--ink); color: var(--bg);
  font-weight: 700; font-size: 14.5px; cursor: pointer;
  box-shadow: 0 8px 20px -10px rgba(33,29,22,.5);
}
.forge-btn:active { transform: scale(.97); }
.criterion { margin-bottom: 14px; overflow: hidden; }
.criterion.hidden-pre { opacity: 0; transform: translateY(16px); }
.criterion.reveal { animation: rise .42s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
.crit-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.crit-top h3 { font-family: var(--display); font-weight: 650; font-size: 19px; }
.weight { font-size: 13px; font-weight: 750; color: var(--accent); white-space: nowrap; }
.weight-bar { height: 5px; border-radius: 99px; background: var(--line); margin: 10px 0 12px; overflow: hidden; }
.weight-bar > i {
  display: block; height: 100%; border-radius: 99px; background: var(--accent);
  width: 0; transition: width .7s cubic-bezier(.2,.7,.3,1) .15s;
}
.std-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 650; padding: 4px 10px; border-radius: 8px;
  background: var(--l3-soft); color: var(--l3); margin: 0 6px 8px 0;
  transform: scale(.6); opacity: 0;
}
.criterion.reveal .std-badge { animation: pop .35s cubic-bezier(.2,.9,.3,1.3) .35s forwards; }
@keyframes pop { to { transform: scale(1); opacity: 1; } }
.std-badge .check { font-size: 11px; }
.std-statement { font-size: 13px; color: var(--muted); margin: 2px 0 12px; }
.levels { display: grid; gap: 7px; margin-top: 4px; }
.level-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.level-chip {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 9px;
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
}
.level-chip.l4 { background: var(--l4-soft); color: var(--l4); }
.level-chip.l3 { background: var(--l3-soft); color: var(--l3); }
.level-chip.l2 { background: var(--l2-soft); color: var(--l2); }
.level-chip.l1 { background: var(--l1-soft); color: var(--l1); }
.level-row p { color: #3D372E; }
.level-row .lab { font-weight: 700; margin-right: 4px; }
.voice-prompt {
  margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: var(--accent-soft); font-size: 14px; color: #8A3A1F;
}
.voice-prompt .vp-label {
  display: flex; gap: 6px; align-items: center;
  font-size: 11.5px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 5px;
}
.teacher-notes { margin-top: 22px; }
.teacher-notes h2, .md h1, .md h2 { font-family: var(--display); font-weight: 650; font-size: 19px; margin: 16px 0 8px; }
.md p, .md li { font-size: 14.5px; color: #3D372E; margin-bottom: 8px; }
.md ol, .md ul { padding-left: 22px; }
.md em { color: var(--muted); }

/* ---------- feedback view ---------- */
.fb-head h1 { font-family: var(--display); font-weight: 800; font-size: clamp(26px, 7vw, 34px); line-height: 1.12; margin: 8px 0 4px; }
.fb-head .meta { font-size: 14px; color: var(--muted); }
.fb-head .meta a { color: var(--accent); font-weight: 600; text-decoration: none; }
.overall-card {
  margin: 18px 0 8px; background: linear-gradient(135deg, #26201A, #3A2C20);
  color: #FBF7F0; border: none;
}
.overall-card .note, .score-card .note { font-size: 14.5px; margin-top: 10px; }
.overall-card .note { color: rgba(251,247,240,.82); }
.player { display: flex; align-items: center; gap: 12px; }
.play-btn {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%;
  border: none; cursor: pointer; display: grid; place-items: center;
  background: var(--accent); color: #fff;
  box-shadow: 0 8px 20px -8px rgba(228,87,46,.6);
  transition: transform .12s ease;
}
.play-btn:active { transform: scale(.93); }
.play-btn svg { width: 20px; height: 20px; }
.player .who { font-weight: 700; font-size: 15px; }
.player .dur { font-size: 12.5px; opacity: .7; font-variant-numeric: tabular-nums; }
.eq { display: inline-flex; align-items: flex-end; gap: 2.5px; height: 16px; margin-left: 8px; }
.eq i { width: 3px; border-radius: 2px; background: currentColor; height: 4px; }
.playing .eq i { animation: eq 0.9s ease-in-out infinite; }
.playing .eq i:nth-child(2) { animation-delay: .15s; } .playing .eq i:nth-child(3) { animation-delay: .3s; }
.playing .eq i:nth-child(4) { animation-delay: .45s; }
@keyframes eq { 0%,100% { height: 4px; } 50% { height: 15px; } }
.progress { height: 4px; border-radius: 99px; background: rgba(127,120,110,.25); margin-top: 12px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; }
.score-card { margin-bottom: 12px; }
.score-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.score-top h3 { font-family: var(--display); font-weight: 650; font-size: 18px; }
.score-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 800; padding: 4px 11px; border-radius: 99px;
}
.score-pill.l4 { background: var(--l4-soft); color: var(--l4); }
.score-pill.l3 { background: var(--l3-soft); color: var(--l3); }
.score-pill.l2 { background: var(--l2-soft); color: var(--l2); }
.score-pill.l1 { background: var(--l1-soft); color: var(--l1); }
.empty-voice {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px dashed var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 13.5px; color: var(--muted);
}
.empty-voice a { color: var(--accent); font-weight: 700; text-decoration: none; }
.total-card { margin-top: 18px; text-align: center; }
.total-card .big {
  font-family: var(--display); font-weight: 800; font-size: 44px;
  color: var(--accent); line-height: 1;
}
.total-card .of { font-size: 14px; color: var(--muted); }
.reply-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 18px; padding: 14px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--accent);
  font-weight: 750; font-size: 15px; text-decoration: none;
}

/* typewriter caret */
.typing::after { content: "▍"; color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

@media (min-width: 640px) {
  #app { padding-top: 36px; }
}
