/* The front door. Only loaded by index.html, so nothing here is paid for by a
   reader who arrived straight at a chapter.

   Every value below comes from tokens.css. The hero is the one place that pins
   itself to the dark ground in both themes: it is the marketing surface, it
   carries the same near-black gradient as the social cards and techfabric.com's
   own hero, and a hero that inverted with the theme would stop reading as the
   front of the site. Everything under it follows the reader's theme. */

.hero {
  background:
    radial-gradient(120% 120% at 12% 0%, rgb(179 0 0 / 0.22) 0%, transparent 55%),
    linear-gradient(135deg, #1a0605 0%, #0b0303 42%, #070707 100%);
  color: var(--sg-text);
  border-bottom: 1px solid var(--sg-border);
}

.hero__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--space-9) var(--space-6) var(--space-8);
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  /* The brand crimson is a fill colour; on this ground the tint is the text
     colour, which is the same reason the social cards use it. */
  color: var(--sg-brand-on-dark);
  margin: 0 0 var(--space-5);
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4.25rem);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  color: var(--sg-text);
  max-width: 18ch;
  margin: 0 0 var(--space-5);
}

.hero__lede {
  font-size: var(--text-lg);
  line-height: var(--leading-body);
  color: rgb(255 255 255 / 0.72);
  max-width: 58ch;
  margin: 0 0 var(--space-7);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-7);
  margin: 0;
  padding-top: var(--space-6);
  border-top: 1px solid rgb(255 255 255 / 0.12);
}

.hero__stat dt {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.55);
  margin-bottom: var(--space-2);
}

.hero__stat dd {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-heading);
  color: var(--sg-text);
  margin: 0;
}

/* --- the bands under the hero -------------------------------------------- */

.band {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

/* --surface-sunken and --surface are the same black in the dark theme, so the
   alternating rhythm has to come from the raised token to survive both. */
.band--sunken { background: var(--surface-raised); }

.band__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

.band__inner--narrow { max-width: calc(var(--measure) + var(--space-8)); }

.band__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--space-4);
}

.band__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-heading);
  color: var(--ink);
  max-width: 24ch;
  margin: 0 0 var(--space-5);
}

.band__lede {
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--ink-muted);
  max-width: var(--measure);
  margin: 0 0 var(--space-5);
}

/* --- two readers ---------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-7);
}

.split__side {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.band--sunken .split__side { background: var(--surface); }

.split__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-subheading);
  color: var(--ink);
  margin: 0 0 var(--space-4);
}

.split__side p {
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--ink-muted);
  margin: 0;
}

/* --- the parts ------------------------------------------------------------ */

.parts {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: var(--space-5);
  margin: var(--space-7) 0 0;
  padding: 0;
  /* Cards size to their own chapter list. Without this they stretch to the
     tallest card in the row, which leaves a part with four chapters sitting
     under a column of empty card. */
  align-items: start;
}

.parts__part {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.parts__number {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.14em;
  color: var(--accent);
  margin: 0 0 var(--space-2);
}

.parts__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-subheading);
  color: var(--ink);
  margin: 0 0 var(--space-1);
}

.parts__count {
  font-size: var(--text-sm);
  color: var(--ink-faint);
  margin: 0 0 var(--space-4);
}

.parts__chapters {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.parts__chapters a {
  font-size: var(--text-base);
  line-height: var(--leading-snug);
  color: var(--ink-muted);
  text-decoration: none;
}

.parts__chapters a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- the routes ----------------------------------------------------------- */

.routes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-7);
}

.route {
  border-left: 2px solid var(--border-strong);
  padding-left: var(--space-5);
}

.route__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-subheading);
  color: var(--ink);
  margin: 0 0 var(--space-3);
}

.route__body {
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--ink-muted);
  margin: 0 0 var(--space-4);
}

.route__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
}

.route__links a {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.route__links a:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 45rem) {
  .hero__inner { padding: var(--space-8) var(--space-5) var(--space-7); }
  .band__inner { padding: var(--space-7) var(--space-5); }
  .hero__stats { gap: var(--space-5); }
}
