/* Trainora — the notebook.
   One stylesheet. Warm paper, ruled hairlines, green ink.
   The signature element is .logbook: a two-column day|session grid on hairline rules. */

:root {
  --paper:      #fcfbf7;
  --paper-deep: #f5f2e9;
  --rule:       #e6e1d5;
  --rule-firm:  #d3cbb8;
  --ink:        #23211c;
  --ink-soft:   #5d5849;
  --ink-faint:  #8b8471;
  /* The app's own accent, generated from palette.json into AccentColor.colorset. */
  --green:      #0b6b5f;
  --green-deep: #085249;
  --olive:      #6b7148;
  --terracotta: #a45a3c;
  --measure:    38rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #16150f;
    --paper-deep: #1d1c15;
    --rule:       #32302a;
    --rule-firm:  #45423a;
    --ink:        #eae5d8;
    --ink-soft:   #b6b0a0;
    --ink-faint:  #8a8474;
    --green:      #2fa795;
    --green-deep: #4dc4b1;
    --olive:      #a3aa76;
    --terracotta: #d08a68;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.sheet {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- the running head ------------------------------------------------ */

.head {
  border-bottom: 1px solid var(--rule-firm);
  padding: 34px 0 10px;
  margin-bottom: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.head .mark {
  font-family: ui-serif, Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-size: 1rem;
  color: var(--green);
  text-decoration: none;
}
.head .mark:hover { text-decoration: underline; }

.head .folio {
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-left: auto;
}

/* ---- text ------------------------------------------------------------ */

h1 {
  font-weight: 600;
  font-size: 1.9rem;
  line-height: 1.25;
  letter-spacing: -0.012em;
  margin: 0 0 1.1rem;
  max-width: 26ch;
}

h2 {
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.35;
  margin: 3rem 0 0.9rem;
}

h3 {
  font-weight: 600;
  font-size: 1.0625rem;
  margin: 2rem 0 0.4rem;
}

p { margin: 0 0 1.15rem; }

.lead {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 2rem;
}

a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--green-deep); }

strong { font-weight: 600; }

em.note {
  display: block;
  font-style: italic;
  color: var(--ink-soft);
  border-left: 2px solid var(--rule-firm);
  padding-left: 14px;
  margin: 0 0 1.15rem;
}

code, .fig {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  color: var(--green-deep);
}

hr.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

/* small uppercase label — the only sans-serif in the place */
.label {
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: block;
  margin: 2.6rem 0 0.7rem;
}

ul, ol { margin: 0 0 1.15rem; padding-left: 1.3rem; }
li { margin-bottom: 0.5rem; }

/* ---- the ruled logbook row — the signature ---------------------------- */

.logbook {
  border-top: 1px solid var(--rule-firm);
  border-bottom: 1px solid var(--rule-firm);
  margin: 1.6rem 0 2rem;
}

.logbook .row {
  display: grid;
  grid-template-columns: 5.25rem 1fr;
  gap: 0 1.1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
}
.logbook .row:first-child { border-top: 0; }

.logbook .k {
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 0.42rem;
  line-height: 1.5;
}

.logbook .v { line-height: 1.6; }
.logbook .v b { font-weight: 600; display: block; }
.logbook .v span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  margin-top: 0.15rem;
}
.logbook .v span + span { margin-top: 0.35rem; }

.logbook.tight .row { padding: 0.6rem 0; }

/* week caption above a logbook */
.weekmark {
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  display: block;
  margin: 2.4rem 0 0.2rem;
}

/* ---- tags ------------------------------------------------------------ */

.tag {
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 0.08em 0.42em;
  margin-left: 0.5em;
  vertical-align: 0.14em;
  white-space: nowrap;
  color: var(--ink-faint);
}
.tag.key   { color: var(--terracotta); }
.tag.long  { color: var(--olive); }
.tag.easy  { color: var(--ink-faint); }
.tag.rest  { color: var(--ink-faint); font-style: italic; }

/* ---- an aside on paper ----------------------------------------------- */

.slip {
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--green);
  padding: 1.1rem 1.2rem 0.1rem;
  margin: 2rem 0;
}
.slip p:last-child { margin-bottom: 1.1rem; }
.slip .label { margin-top: 0; }

/* ---- a plain definition run ------------------------------------------ */

dl.gloss { margin: 1.4rem 0 2rem; }
dl.gloss dt {
  font-weight: 600;
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
}
dl.gloss dt:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
dl.gloss dd { margin: 0.2rem 0 0; color: var(--ink-soft); }

/* ---- figures --------------------------------------------------------- */

figure { margin: 2rem 0; }
figure img {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  border: 1px solid var(--rule-firm);
  border-radius: 10px;
  background: #fff;
}
figcaption {
  font-size: 0.875rem;
  color: var(--ink-faint);
  margin-top: 0.7rem;
  line-height: 1.6;
}

/* a drawn, not photographed, diagram of the two curves */
.curves {
  border: 1px solid var(--rule);
  background: var(--paper-deep);
  padding: 1rem;
  margin: 2rem 0;
}
.curves svg { display: block; width: 100%; height: auto; }

/* ---- the foot: prose links, logbook style ---------------------------- */

.foot {
  border-top: 1px solid var(--rule-firm);
  margin-top: 4rem;
  padding: 1.8rem 0 3.5rem;
  color: var(--ink-soft);
}
.foot p { margin-bottom: 0.9rem; }
.foot .next { color: var(--ink); }
.foot .colophon {
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  border-top: 1px solid var(--rule);
  padding-top: 1.1rem;
  margin-top: 1.6rem;
  margin-bottom: 0;
}

/* ---- the index on the front page ------------------------------------- */

ol.contents { list-style: none; padding: 0; margin: 1.4rem 0 2rem; border-top: 1px solid var(--rule-firm); }
ol.contents li {
  border-bottom: 1px solid var(--rule);
  padding: 0.7rem 0;
  margin: 0;
  display: grid;
  grid-template-columns: 5.25rem 1fr;
  gap: 0 1.1rem;
}
ol.contents .n {
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 0.32rem;
}
ol.contents .d { display: block; color: var(--ink-soft); font-size: 0.9375rem; }

@media (max-width: 460px) {
  body { font-size: 16.5px; }
  h1 { font-size: 1.65rem; }
  .sheet { padding: 0 16px; }
  .logbook .row, ol.contents li { grid-template-columns: 4rem 1fr; gap: 0 0.8rem; }
  .logbook .k, ol.contents .n { font-size: 0.625rem; letter-spacing: 0.08em; }
}
