/* Craig Stanley Studio — Instructional Design Foundations
   Brand: red box, mono, paper, ink. Tom Sachs / Van Neistat lineage.
   Type-led. No icons. Bold blocks. Hand-marked feel. */

:root {
  --paper: #f4efe6;
  --paper-2: #ebe4d6;
  --ink: #111111;
  --ink-2: #2a2a2a;
  --rule: #1a1a1a;
  --red: #d8341b;
  --red-deep: #a8260f;
  --ok: #2e6a3f;
  --warn: #9a6b00;
  --muted: #6b6258;
  --serif: 'Fraunces', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&family=Fraunces:opsz,wght@9..144,400;9..144,700;9..144,900&display=swap');

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  font-size: 17px;
}

/* Paper texture via subtle noise gradient */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(0,0,0,0.025), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(0,0,0,0.02), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Layout ---------- */
.app {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  background: var(--ink);
  color: var(--paper);
  padding: 28px 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--rule);
}

.brand {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 10px;
  margin-bottom: 18px;
}

.sidebar h1 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 28px;
  line-height: 1.05;
  margin: 0 0 6px;
  color: var(--paper);
}

.sidebar .sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c7bfb1;
  margin-bottom: 22px;
}

.nav {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid #333;
}

.nav li a {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid #333;
  color: var(--paper);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
}

.nav li a .num {
  color: var(--red);
  margin-right: 8px;
}

.nav li a:hover, .nav li a.active {
  color: var(--red);
}

.main {
  padding: 56px 72px 96px;
  max-width: 880px;
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .main { padding: 32px 24px 64px; }
}

/* ---------- Type ---------- */
h1.lesson {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 52px;
  line-height: 1;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.lesson-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}

h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.15;
  margin: 48px 0 14px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
}

h3 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 18px;
  margin: 28px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

p { margin: 0 0 14px; font-size: 17px; }

strong { font-weight: 700; }

a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }

ul, ol { padding-left: 22px; margin: 0 0 16px; }
li { margin-bottom: 6px; }

/* ---------- Blocks (Rise-style) ---------- */

/* Red box marker — the signature */
.redbox {
  background: var(--red);
  color: #fff;
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 8px;
  margin-bottom: 10px;
}

/* Block: main text — default paragraph block */

/* Block: reflection / note taking */
.reflect {
  background: #fff8e0;
  border-left: 6px solid var(--warn);
  padding: 20px 22px;
  margin: 22px 0;
  font-size: 18px;
}
.reflect .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--warn);
  margin-bottom: 8px;
}

/* Block: teaching tip */
.tip {
  background: #e9f1e7;
  border-left: 6px solid var(--ok);
  padding: 20px 22px;
  margin: 22px 0;
}
.tip .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ok);
  margin-bottom: 8px;
}

/* Block: quote */
.quote {
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.3;
  padding: 24px 0;
  margin: 28px 0;
  font-style: italic;
}
.quote .attr {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-style: normal;
  color: var(--muted);
  margin-top: 12px;
}

/* Block: accordion */
.accordion {
  margin: 22px 0;
  border-top: 1px solid var(--ink);
}
.accordion details {
  border-bottom: 1px solid var(--ink);
  padding: 14px 0;
}
.accordion summary {
  cursor: pointer;
  font-weight: 700;
  font-family: var(--sans);
  font-size: 17px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.accordion summary::after {
  content: "+";
  font-family: var(--mono);
  font-weight: 700;
  color: var(--red);
  font-size: 22px;
}
.accordion details[open] summary::after { content: "−"; }
.accordion .body {
  padding-top: 10px;
  color: var(--ink-2);
}

/* Block: flashcards */
.flashdeck {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 22px 0;
}
.flash {
  perspective: 1000px;
  height: 200px;
  cursor: pointer;
}
.flash-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}
.flash.flipped .flash-inner { transform: rotateY(180deg); }
.flash-front, .flash-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--sans);
}
.flash-front {
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 18px;
}
.flash-back {
  background: var(--paper-2);
  color: var(--ink);
  transform: rotateY(180deg);
  font-size: 15px;
  line-height: 1.45;
}

/* Block: tabs */
.tabs { margin: 22px 0; }
.tab-buttons {
  display: flex;
  border-bottom: 2px solid var(--ink);
}
.tab-button {
  background: none;
  border: none;
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--ink-2);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.tab-button.active {
  color: var(--red);
  border-bottom-color: var(--red);
}
.tab-panel { display: none; padding: 18px 0; }
.tab-panel.active { display: block; }

/* Block: process / numbered steps */
.process { margin: 22px 0; counter-reset: step; }
.process .step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--ink);
}
.process .step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 24px;
  color: var(--red);
}
.process .step h4 {
  font-family: var(--sans);
  font-weight: 700;
  margin: 0 0 4px;
  font-size: 17px;
}
.process .step p { margin: 0; color: var(--ink-2); }

/* Block: knowledge check */
.kc {
  background: var(--paper-2);
  border: 2px solid var(--ink);
  padding: 24px 26px;
  margin: 28px 0;
}
.kc .kc-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 8px;
}
.kc h4 {
  font-family: var(--serif);
  font-size: 22px;
  margin: 0 0 16px;
}
.kc .opts { display: flex; flex-direction: column; gap: 8px; }
.kc .opt {
  display: block;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--ink);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 16px;
  text-align: left;
}
.kc .opt:hover { background: #f7f0e1; }
.kc .opt.correct { background: #d2e7c8; border-color: var(--ok); }
.kc .opt.wrong { background: #f4cbc2; border-color: var(--red-deep); }
.kc .feedback {
  margin-top: 14px;
  padding: 14px;
  background: #fff;
  border-left: 4px solid var(--red);
  display: none;
}
.kc .feedback.show { display: block; }

/* Block: continue divider */
.continue {
  text-align: center;
  margin: 36px 0;
}
.continue::before {
  content: "—— CONTINUE ——";
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--muted);
}

/* Block: stat / pull-quote */
.stat {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  background: var(--ink);
  color: var(--paper);
  padding: 28px;
  margin: 28px 0;
}
.stat .num {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 72px;
  line-height: 1;
  color: var(--red);
}
.stat .label {
  font-family: var(--sans);
  font-size: 16px;
}

/* End-of-Unit */
.eou {
  border: 2px solid var(--ink);
  padding: 28px;
  margin: 36px 0 12px;
}
.eou h3 {
  margin-top: 0;
  font-family: var(--serif);
  font-size: 24px;
  text-transform: none;
  letter-spacing: 0;
}
.eou ul { margin: 8px 0 0; }

/* Progress bar */
.progress {
  height: 4px;
  background: var(--paper-2);
  position: sticky;
  top: 0;
  z-index: 10;
}
.progress .bar {
  height: 100%;
  background: var(--red);
  width: 0%;
  transition: width 0.3s;
}

/* Footer */
.foot {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* Print */
@media print {
  .sidebar, .progress { display: none; }
  .main { padding: 0; max-width: 100%; }
  body::before { display: none; }
}
