/* ==========================================================================
   IXD415 — Design for Emerging Technology · docs2
   The old-book edition. Garamond Premier, cream paper, black ink.
   Conventions borrowed from pre-1800 title pages: centered axis, true
   small caps, italic for emphasis, rules and ornaments, dotted leaders,
   manicules, old-style figures. No gradients. Obviously.
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */

:root {
  --paper:     #fcfbf9;
  --paper-alt: #efe8d8;
  --ink:       #1d1a14;
  --ink-soft:  #4d4739;
  --muted:     #8a8272;
  --rule:      #d8cfba;
  --rule-hard: #1d1a14;
  --red:       #8f2b1e;   /* rubrication — the printer's red */

  --serif: "garamond-premier-pro", "Garamond Premier Pro", Garamond,
           "EB Garamond", "Iowan Old Style", Georgia, serif;
  --serif-display: "garamond-premier-pro-display", "garamond-premier-pro",
           "Garamond Premier Pro", Garamond, "EB Garamond", Georgia, serif;

  --measure: 36rem;
  --stack: clamp(3.5rem, 8vw, 6rem);
}

/* --- Reset ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 2rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.2875rem;               /* Garamond runs small; set generously */
  line-height: 1.5;
  font-weight: 400;
  font-feature-settings: "onum" 1, "liga" 1, "kern" 1;  /* old-style figures everywhere */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }

/* --- Small-caps helper (the workhorse of this whole design) ---------------- */

.sc, .eyebrow, .row__key, .session__n, .week__n, .hw__label,
.card__n, .card__go, .nav a, .wordmark, .phase__t, h1, h2 {
  font-variant-caps: small-caps;
  font-feature-settings: "smcp" 1, "onum" 1, "kern" 1;
  text-transform: lowercase;   /* feed true small caps lowercase letters */
}

/* --- Skip link / focus ----------------------------------------------------- */

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: .75rem 1rem; z-index: 100; }
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* --- Layout: one centered column, like a page ------------------------------ */

.wrap {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2.5rem);
}

main { display: block; }
section + section { margin-top: var(--stack); }

/* --- Masthead: a running head, not an app bar ------------------------------ */

.masthead {
  border-bottom: 3px double var(--rule-hard);
  background: var(--paper);
}

.masthead__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding-block: 1.1rem .9rem;
  text-align: center;
}

.wordmark {
  color: var(--ink);
  text-decoration: none;
  font-size: 1.0625rem;
  letter-spacing: .18em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: .1rem 0;
  font-size: .9375rem;
  letter-spacing: .12em;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: .1rem .15rem;
}
.nav a:hover { color: var(--red); }
.nav a[aria-current="page"] { color: var(--red); }

/* fleuron separators between nav items */
.nav a + a::before {
  content: "❧";
  color: var(--muted);
  font-variant-caps: normal;
  letter-spacing: 0;
  margin: 0 .75rem;
  font-size: .8em;
}

/* --- Meta strip: the imprint line ------------------------------------------ */

.meta {
  padding-block: 1rem;
  border-bottom: 1px solid var(--rule);
  font-style: italic;
  font-size: 1.0625rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: .5em;
  text-align: center;
}
.meta a { color: inherit; }

/* interpuncts between imprint items */
.meta span + span::before {
  content: "·";
  font-style: normal;
  color: var(--muted);
  margin-right: .5em;
}

/* --- The title page --------------------------------------------------------- */

.hero {
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2rem, 5vw, 3.5rem);
  text-align: center;
}

.emblem {
  display: block;
  margin: 0 auto clamp(1.75rem, 4vw, 2.75rem);
  width: clamp(150px, 34vw, 180px);
  mix-blend-mode: multiply;   /* engraving sits *in* the paper, no white box */
}

h1, .h1 {
  font-family: var(--serif-display);
  font-size: clamp(2.25rem, 6.5vw, 3.75rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: .12em;
  margin: 0;
  text-wrap: balance;
}

/* rules above and below the title, like a proper title page */
.hero h1 { padding-block: 1.5rem; position: relative; }
.hero h1::before, .hero h1::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(16rem, 60%);
  border-top: 1px solid var(--rule-hard);
}
.hero h1::before { top: 0; }
.hero h1::after { bottom: 0; }

.dek {
  font-size: clamp(1.1875rem, 2.6vw, 1.5rem);
  font-style: italic;
  line-height: 1.45;
  color: var(--ink);
  margin: 1.5rem auto 0;
  max-width: 34ch;
  text-wrap: balance;
}

/* the BEING A … construction: small caps carrying italic emphasis */
.dek em, .lede em { font-style: italic; }
.dek .sc { font-style: normal; letter-spacing: .08em; }

/* --- Section heads: centered, ruled, rubricated ----------------------------- */

.section-head {
  text-align: center;
  border-top: 3px double var(--rule-hard);
  padding-top: 1.75rem;
  margin-bottom: 2.25rem;
}

.eyebrow {
  display: block;
  font-size: .9375rem;
  letter-spacing: .22em;
  color: var(--red);
  margin: 0 0 .5rem;
}
.eyebrow--ink { color: var(--red); }  /* rubricate them all */

h2 {
  font-family: var(--serif-display);
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: .1em;
  margin: 0;
  text-wrap: balance;
}

h3 {
  font-size: 1.375rem;
  font-weight: 600;
  font-style: italic;
  line-height: 1.25;
  letter-spacing: .01em;
  margin: 2.25rem 0 .65rem;
}

h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1.75rem 0 .5rem;
}

/* --- Prose ------------------------------------------------------------------ */

.prose, .prose--wide { max-width: var(--measure); margin-inline: auto; }

p { margin: 0 0 1.1em; }
li { margin-bottom: .5em; }

.lede {
  font-size: clamp(1.3125rem, 2.4vw, 1.5rem);
  line-height: 1.45;
}

/* drop cap on the opening paragraph of a page */
.lede::first-letter {
  font-family: var(--serif-display);
  float: left;
  font-size: 3.4em;
  line-height: .78;
  padding: .06em .12em 0 0;
  color: var(--red);
}

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: .16em; }
a:hover { color: var(--red); }

strong, b { font-weight: 600; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.4rem; }
ul { list-style: none; padding-left: 1.5rem; }
ul li { position: relative; }
ul li::before {
  content: "¶";
  position: absolute;
  left: -1.5rem;
  color: var(--muted);
  font-size: .85em;
  top: .15em;
}
ol li::marker { color: var(--red); font-feature-settings: "onum" 1; }

/* hr becomes a centered fleuron */
hr {
  border: 0;
  margin: var(--stack) auto;
  text-align: center;
}
hr::after {
  content: "❧";
  color: var(--muted);
  font-size: 1.4rem;
}

.rule-hard { border: 0; border-top: 3px double var(--rule-hard); margin: 0 0 2rem; }

blockquote {
  margin: 2.25rem auto;
  padding: 0 1.5rem;
  max-width: 32rem;
  font-style: italic;
  font-size: 1.3125rem;
  line-height: 1.45;
  text-align: center;
  border: 0;
}
blockquote::before {
  content: "⁂";
  display: block;
  font-style: normal;
  color: var(--red);
  margin-bottom: .75rem;
  letter-spacing: .35em;
  margin-left: .35em;
}
blockquote p:last-child { margin-bottom: 0; }

code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: .78em;
  background: var(--paper-alt);
  padding: .12em .4em;
  border-radius: 2px;
}

/* --- Definition rows: margin headings, like a ledger ------------------------ */

.rows { border-top: 1px solid var(--rule); max-width: 60rem; margin-inline: auto; }

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: .4rem 1.75rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.row__key {
  font-size: 1rem;
  letter-spacing: .14em;
  color: var(--red);
  padding-top: .15em;
  line-height: 1.35;
}

.row__val > :last-child { margin-bottom: 0; }

@media (min-width: 48rem) {
  .row { grid-template-columns: 11rem 1fr; }
  .row__key { text-align: right; }
}

/* --- Cards: bookseller's advertisements ------------------------------------- */

.cards {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

@media (min-width: 44rem) {
  .cards { grid-template-columns: 1fr 1fr; }
}

.card {
  border: 1px solid var(--rule-hard);
  outline: 1px solid var(--rule-hard);
  outline-offset: 3px;                 /* double-ruled box, printer style */
  background: var(--paper);
  padding: 2rem 1.5rem 1.75rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .65rem;
  margin: 3px;
}
.card:hover { background: var(--paper-alt); color: inherit; }

.card__n {
  font-size: .9375rem;
  letter-spacing: .2em;
  color: var(--red);
}

.card__t {
  font-family: var(--serif-display);
  font-size: clamp(1.5rem, 3.2vw, 1.875rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: .06em;
  font-variant-caps: small-caps;
  font-feature-settings: "smcp" 1;
  text-transform: lowercase;
}

.card__d { color: var(--ink-soft); font-size: 1.0625rem; line-height: 1.45; margin: 0; font-style: italic; }

.card__go {
  margin-top: auto;
  padding-top: 1rem;
  font-size: .9375rem;
  letter-spacing: .14em;
  color: var(--muted);
}
.card:hover .card__go { color: var(--red); }

/* --- Schedule: a table of contents with dotted leaders ----------------------- */

.schedule {
  max-width: 34rem;
  margin: 2rem auto 0;
}

.week {
  display: flex;
  align-items: baseline;
  gap: .6em;
  padding: .45rem 0;
}

.week__n {
  font-size: 1.0625rem;
  letter-spacing: .1em;
  color: var(--ink);
  white-space: nowrap;
}

.leader {
  flex: 1;
  min-width: 2rem;
  align-self: baseline;
  height: .9em;
  background-image: radial-gradient(circle at center, var(--muted) 1.2px, transparent 1.6px);
  background-size: 13px 4px;
  background-repeat: repeat-x;
  background-position: left bottom 1px;
}

.week__d {
  font-size: 1.125rem;
  text-align: right;
  white-space: nowrap;
}

.week__note {
  display: block;
  font-size: .9375rem;
  font-style: italic;
  color: var(--muted);
  white-space: normal;
}

.week--off .week__d { color: var(--muted); }
.week--final { border-top: 1px solid var(--rule-hard); margin-top: .5rem; padding-top: .8rem; }
.week--final .week__n, .week--final .week__d { color: var(--red); }

/* --- Sessions: chapters ------------------------------------------------------ */

.sessions { margin-top: 2rem; max-width: 40rem; margin-inline: auto; }

.phase {
  margin-top: 3.25rem;
  text-align: center;
}
.phase:first-child { margin-top: 0; }

.phase__t {
  font-size: 1.0625rem;
  letter-spacing: .18em;
  margin: 0;
  color: var(--red);
}
.phase__t::before, .phase__t::after {
  content: "—";
  color: var(--muted);
  margin: 0 .6em;
  letter-spacing: 0;
}

.session {
  padding: 2.25rem 0;
  border-bottom: 1px solid var(--rule);
}
.session:last-child { border-bottom: 0; }

.session__n {
  display: block;
  text-align: center;
  font-size: 1rem;
  letter-spacing: .22em;
  color: var(--red);
  margin-bottom: .3rem;
}

.session__t {
  text-align: center;
  font-family: var(--serif-display);
  font-size: 1.625rem;
  font-weight: 500;
  font-style: normal;
  line-height: 1.2;
  letter-spacing: .02em;
  margin: 0 0 1.25rem;
}

.session ul { margin-bottom: 0; }

/* --- Homework: the manicule points the way ----------------------------------- */

.hw {
  margin: 1.4rem 0 0;
  padding: 1.1rem 1.25rem 1rem;
  background: var(--paper-alt);
}

.hw + .hw { margin-top: .8rem; }

.hw__label {
  font-size: .9375rem;
  letter-spacing: .18em;
  color: var(--red);
  display: block;
  margin-bottom: .3rem;
}
.hw__label::before {
  content: "☞";
  font-variant-caps: normal;
  letter-spacing: 0;
  margin-right: .5em;
}

.hw p { margin-bottom: 0; }
.hw p + p { margin-top: .6em; }

/* --- Notes ------------------------------------------------------------------- */

.note {
  background: var(--paper-alt);
  padding: 1.5rem 1.5rem 1.25rem;
  margin: 2rem auto;
  max-width: var(--measure);
  font-size: 1.0625rem;
}
.note > :last-child { margin-bottom: 0; }

.note--tk { background: transparent; border: 1px dashed var(--red); }

/* --- Link lists: a bibliography ---------------------------------------------- */

.linklist {
  list-style: none;
  padding: 0;
  max-width: var(--measure);
  margin-inline: auto;
}
.linklist li {
  margin: 0 0 1rem;
  padding: 0 0 0 1.5rem;
  text-indent: -1.5rem;   /* hanging indent, bibliography style */
}
.linklist li::before { content: none; }
.linklist a { font-weight: 500; }
.linklist .sub {
  display: block;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.0625rem;
  text-indent: 0;
  padding-left: 0;
}

/* --- Footer: the colophon ----------------------------------------------------- */

.foot {
  margin-top: var(--stack);
  border-top: 3px double var(--rule-hard);
  padding-block: 2rem 3.5rem;
  font-size: 1rem;
  font-style: italic;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  text-align: center;
}
.foot a { color: inherit; }
.foot::before {
  content: "❧";
  font-style: normal;
  color: var(--muted);
  font-size: 1.25rem;
  margin-bottom: .5rem;
}

/* --- Utilities ----------------------------------------------------------------- */

.u-muted { color: var(--muted); }
.mono-num { font-feature-settings: "onum" 1; }

@media print {
  .masthead .nav, .skip { display: none; }
  body { background: #fff; color: #000; font-size: 11.5pt; }
  .session { break-inside: avoid; }
  .emblem { width: 160px; }
}
