/* tedderland.com — an engineering portfolio with an editorial spine. */

:root {
  --ink: #10182b;
  --ink-2: #18243e;
  --ink-3: #263653;
  --paper: #f5f3ed;
  --paper-2: #ece9e1;
  --surface: #fffefa;
  --white: #ffffff;
  --text: #172033;
  --text-soft: #4f596d;
  --muted: #737b8b;
  --rule: #dcd8cf;
  --lime: #c5f467;
  --lime-deep: #83aa2d;
  --blue: #536ee8;
  --blue-deep: #334bc3;
  --coral: #ef725d;
  --code: #0c1425;
  --measure: 68ch;
  --measure-fixed: 44rem;
  --shell: 1180px;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 30px;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "Liberation Mono", Menlo, monospace;
  --shadow-sm: 0 2px 8px rgba(16, 24, 43, 0.07);
  --shadow: 0 20px 60px rgba(16, 24, 43, 0.13);
}

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

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

#work, #books, #downloads { scroll-margin-top: 88px; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 2%, rgba(83, 110, 232, 0.10), transparent 24rem),
    var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--lime); color: var(--ink); }
img, svg { max-width: 100%; }

a {
  color: var(--blue-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover { color: var(--blue); }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  background: var(--lime);
  color: var(--ink);
  font-weight: 800;
  transform: translateY(-150%);
  transition: transform 0.15s ease;
}

.skip-link:focus { transform: translateY(0); }

/* Header */

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  padding: 0 24px;
  border-bottom: 1px solid rgba(16, 24, 43, 0.09);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

.header-inner {
  width: min(100%, var(--shell));
  min-height: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.brand:hover { color: var(--ink); text-decoration: none; }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: -0.08em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}

.site-header nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-header nav a {
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.site-header nav a:hover { color: var(--ink); }

.proj-name {
  padding-left: 18px;
  border-left: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

/* Global layout and type */

.shell {
  width: min(100%, calc(var(--shell) + 48px));
  margin: 0 auto;
  padding: 0 24px 32px;
}

h1, h2, h3 {
  margin-top: 0;
  color: var(--ink);
  font-weight: 780;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

p { margin: 0 0 1.25rem; }

.eyebrow,
.section-kicker,
.project-kicker,
.book-label,
.book-number {
  margin: 0 0 14px;
  color: var(--blue-deep);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.58fr);
  column-gap: 72px;
  align-items: end;
  margin-bottom: 36px;
}

.section-heading .section-kicker { grid-column: 1 / -1; }

.section-heading h2 {
  margin: 0;
  max-width: 700px;
  font-size: clamp(2.15rem, 4.6vw, 4rem);
}

.section-heading > p:last-child {
  margin: 0 0 5px;
  color: var(--text-soft);
  font-size: 0.98rem;
  line-height: 1.65;
}

.section-heading.compact h2 { font-size: clamp(2rem, 4vw, 3.25rem); }

/* Landing hero */

.hero {
  position: relative;
  min-height: 670px;
  padding: clamp(72px, 10vw, 128px) 0 80px;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(330px, 0.72fr);
  gap: clamp(48px, 7vw, 96px);
  align-items: center;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 200px;
  height: 200px;
  top: 10%;
  right: 31%;
  background-image: radial-gradient(circle, rgba(83, 110, 232, 0.28) 1.5px, transparent 1.5px);
  background-size: 17px 17px;
  mask-image: linear-gradient(to bottom right, #000, transparent 72%);
}

.hero .eyebrow span { color: var(--muted); padding: 0 0.45em; }

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(3.25rem, 7.2vw, 6.8rem);
  line-height: 0.96;
  letter-spacing: -0.072em;
}

.hero h1 > span {
  display: block;
  width: fit-content;
  margin-bottom: 0.12em;
  color: var(--blue-deep);
  font-size: 0.28em;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-transform: uppercase;
}

.hero-lede {
  max-width: 700px;
  margin: 28px 0 0;
  color: var(--text-soft);
  font-size: clamp(1.08rem, 1.8vw, 1.28rem);
  line-height: 1.6;
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 26px;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 11px 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 0.88rem;
  font-weight: 780;
  line-height: 1.25;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(16, 24, 43, 0.16);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px);
  background: var(--ink-2);
  color: var(--white);
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(16, 24, 43, 0.2);
}

.text-link {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 780;
  text-decoration: none;
}

.text-link:hover { color: var(--blue-deep); }

.capability-line {
  list-style: none;
  margin: 50px 0 0;
  padding: 21px 0 0;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
}

.capability-line li {
  position: relative;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.capability-line li:not(:last-child)::after {
  content: "+";
  position: absolute;
  right: -17px;
  color: var(--blue);
}

.hero-spotlight {
  position: relative;
  min-height: 470px;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(145deg, var(--ink-2), var(--code));
  background-size: 28px 28px, 28px 28px, auto;
  color: var(--white);
  text-decoration: none;
  box-shadow: var(--shadow);
  transform: rotate(1.4deg);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-spotlight::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -80px;
  bottom: -90px;
  border: 48px solid rgba(197, 244, 103, 0.16);
  border-radius: 50%;
}

.hero-spotlight:hover {
  color: var(--white);
  text-decoration: none;
  transform: rotate(0) translateY(-6px);
  box-shadow: 0 28px 72px rgba(16, 24, 43, 0.2);
}

.spotlight-top {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #cdd5e4;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 5px rgba(197, 244, 103, 0.12);
}

.spotlight-code {
  margin: 76px 0 8px;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.hero-spotlight > strong {
  color: var(--white);
  font-size: clamp(3.2rem, 6vw, 5rem);
  letter-spacing: -0.07em;
  line-height: 1;
}

.spotlight-copy {
  max-width: 28ch;
  margin-top: 16px;
  color: #cdd5e4;
  font-size: 0.96rem;
  line-height: 1.55;
}

.spotlight-meta {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.spotlight-meta span {
  padding: 5px 9px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  color: #dce2ed;
  font-family: var(--mono);
  font-size: 0.62rem;
}

.spotlight-link {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  color: var(--lime);
  font-size: 0.82rem;
  font-weight: 800;
}

/* About */

.about {
  padding: 110px 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.62fr);
  gap: 72px;
}

.about > .section-heading { display: block; margin-bottom: 0; }

.about .bio {
  display: grid;
  gap: 20px;
}

.about .bio p {
  margin: 0;
  color: var(--text-soft);
  font-size: 1.03rem;
}

/* Selected work */

.featured {
  position: relative;
  margin: 0 -24px;
  padding: clamp(64px, 8vw, 96px) 48px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--ink);
  color: var(--white);
}

.featured::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 85% 0%, rgba(83, 110, 232, 0.35), transparent 35%);
}

.section-heading.on-dark { position: relative; z-index: 1; }
.section-heading.on-dark .section-kicker { color: var(--lime); }
.section-heading.on-dark h2 { color: var(--white); }
.section-heading.on-dark > p:last-child { color: #b8c1d2; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.feature-cards {
  position: relative;
  z-index: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.card {
  position: relative;
  min-height: 260px;
  padding: 28px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(83, 110, 232, 0.45);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 18px 38px rgba(16, 24, 43, 0.12);
}

.card h3 {
  padding-right: 34px;
  margin: 0 0 12px;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.card p {
  margin: 0 0 22px;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.58;
}

.card-arrow {
  position: absolute;
  top: 25px;
  right: 26px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 0.78rem;
  transition: transform 0.2s ease, background 0.2s ease;
}

.card:hover .card-arrow { transform: rotate(45deg); background: var(--lime); }

.lang {
  width: fit-content;
  margin-top: auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e8ebf9;
  color: var(--blue-deep);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.card.feature {
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border-color: rgba(255,255,255,0.12);
  background: #17233b;
  color: var(--white);
  box-shadow: none;
}

.card.feature:hover { border-color: rgba(197, 244, 103, 0.7); color: var(--white); }

.feature-visual,
.card.feature > .shot {
  position: relative;
  height: 220px;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  border-radius: 0;
  background:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
    var(--ink-2);
  background-size: 24px 24px;
}

.feature-cards .card:nth-child(2) .feature-visual { background-color: #1a2b36; }
.feature-cards .card:nth-child(3) .feature-visual { background-color: #2c2140; }
.feature-cards .card:nth-child(4) .feature-visual { background-color: #30251f; }

.feature-visual::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  top: 72px;
  right: 42px;
  border: 30px solid rgba(197, 244, 103, 0.15);
  border-radius: 50%;
}

.visual-path {
  position: absolute;
  top: 22px;
  left: 24px;
  color: #aeb8ca;
  font-family: var(--mono);
  font-size: 0.66rem;
}

.feature-visual strong {
  position: absolute;
  left: 25px;
  bottom: -28px;
  color: rgba(255,255,255,0.12);
  font-size: 10rem;
  line-height: 1;
  letter-spacing: -0.1em;
}

.visual-mark {
  position: absolute;
  z-index: 1;
  right: 32px;
  bottom: 22px;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 1.4rem;
}

.card.feature > .shot img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.feature-body {
  position: relative;
  min-height: 245px;
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.feature-body .card-arrow { background: rgba(255,255,255,0.1); color: var(--white); }
.card.feature:hover .card-arrow { background: var(--lime); color: var(--ink); }
.feature-body h3 { color: var(--white); font-size: 1.45rem; }
.feature-body p { color: #bcc6d6; font-size: 0.95rem; }
.feature-body .lang { background: rgba(197,244,103,0.12); color: var(--lime); }

/* Books on the landing page */

.books { padding: 120px 0; }

.book-shelf {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.book-card {
  min-height: 330px;
  padding: 26px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-card:hover {
  transform: translateY(-5px);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.book-cover,
.mini-cover {
  position: relative;
  aspect-ratio: 1050 / 1295;
  overflow: hidden;
  display: block;
  background: #042b42;
  box-shadow: -8px 12px 24px rgba(16,24,43,0.18);
}

.book-cover img,
.mini-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.book-info { display: flex; flex-direction: column; min-width: 0; }
.book-info .book-number { color: var(--muted); }
.book-info > strong { color: var(--ink); font-size: 1.2rem; line-height: 1.25; }
.book-info > span:not(.book-number):not(.book-link) { margin-top: 12px; color: var(--text-soft); font-size: 0.9rem; line-height: 1.55; }
.book-info .book-link { margin-top: 22px; color: var(--blue-deep); font-size: 0.78rem; font-weight: 800; }

/* Directory */

.directory { padding: 0 0 100px; }
.directory .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Project pages */

.project { padding-top: 38px; }

.project-hero {
  position: relative;
  margin-bottom: 58px;
  padding: clamp(38px, 6vw, 68px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    var(--ink);
  background-size: 30px 30px;
  color: var(--white);
  box-shadow: var(--shadow);
}

.project-hero::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  top: -210px;
  right: -80px;
  border: 60px solid rgba(197,244,103,0.13);
  border-radius: 50%;
}

.project-title-block { position: relative; z-index: 1; }
.project-kicker { color: var(--lime); }

.project-hero h1 {
  max-width: 930px;
  margin: 0 0 18px;
  color: var(--white);
  font-size: clamp(3.1rem, 7vw, 6.3rem);
  line-height: 0.96;
}

.project .tagline {
  max-width: 760px;
  margin: 0;
  color: #c5cedc;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.55;
}

.project .banner {
  position: relative;
  z-index: 1;
  margin: 44px 0 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255,255,255,0.06);
}

.project .banner img { width: 100%; height: auto; display: block; border-radius: 10px; }

.project > .shot {
  margin: -18px 0 56px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.project > .shot img { width: 100%; height: auto; display: block; }

.project .body > p,
.project .body > ul,
.project .body > ol,
.project .body > blockquote,
.project .body > .callout,
.project .body > .note,
.project .body > .out { max-width: var(--measure); }

.project .body > h2,
.project .body > h3 { max-width: var(--measure-fixed); }

.project .body h2,
.downloads h2,
.book-showcase > h2 {
  margin: 76px 0 24px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: clamp(1.9rem, 3.7vw, 2.75rem);
}

.project .body > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.project .body h3 {
  margin: 44px 0 14px;
  font-size: 1.28rem;
  letter-spacing: -0.025em;
}

.project .body p { margin: 0 0 22px; }

.lede {
  color: var(--ink) !important;
  font-size: 1.16rem;
  line-height: 1.65;
}

.project .body ul,
.project .body ol { padding-left: 1.35rem; }

.project .body li { margin-bottom: 10px; }

.stats {
  list-style: none;
  max-width: none !important;
  margin: 38px 0 54px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stats li {
  min-height: 190px;
  margin: 0 !important;
  padding: 25px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.stats b {
  display: block;
  margin-bottom: 12px;
  color: var(--blue-deep);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 820;
  letter-spacing: -0.06em;
  line-height: 1;
}

.stats span { color: var(--text-soft); font-size: 0.84rem; line-height: 1.5; }

pre {
  position: relative;
  margin: 28px 0;
  padding: 24px 26px;
  border: 1px solid #263753;
  border-radius: var(--radius);
  overflow-x: auto;
  background: var(--code);
  color: #dce6f5;
  box-shadow: var(--shadow-sm);
  font-size: 0.86rem;
  line-height: 1.68;
  tab-size: 4;
}

pre::before {
  content: "";
  display: block;
  width: 42px;
  height: 8px;
  margin-bottom: 18px;
  background: radial-gradient(circle, var(--coral) 3px, transparent 4px) 0 0 / 14px 8px repeat-x;
}

pre code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: var(--mono);
  font-size: inherit;
  white-space: pre;
}

code {
  padding: 0.14em 0.38em;
  border: 1px solid #d8dae5;
  border-radius: 5px;
  background: #ebeef7;
  color: #243775;
  font-family: var(--mono);
  font-size: 0.85em;
  overflow-wrap: break-word;
}

.out {
  margin: -12px 0 30px !important;
  padding: 14px 18px;
  border-left: 3px solid var(--lime-deep);
  background: rgba(197,244,103,0.13);
  color: var(--text-soft);
  font-size: 0.92rem;
}

.callout,
.edition-note {
  margin: 30px 0;
  padding: 24px 26px;
  border: 1px solid #cfd6f8;
  border-radius: var(--radius);
  background: #eef1ff;
}

.callout p:last-child,
.edition-note p:last-child { margin-bottom: 0; }

.note, .muted { color: var(--muted); font-size: 0.92rem; }

.chart-demo {
  margin: 30px 0;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow-x: auto;
  background: var(--surface);
}

.chart-demo svg { display: block; width: 100%; height: auto; }

table {
  width: 100%;
  margin: 28px 0;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  font-size: 0.9rem;
}

th, td { padding: 12px 14px; border-bottom: 1px solid var(--rule); text-align: left; }
th { color: var(--ink); font-weight: 780; }

/* Project-page books */

.book-showcase {
  max-width: none;
  margin: 86px 0 0;
  padding: clamp(34px, 5vw, 56px);
  border-radius: var(--radius-lg);
  background: var(--paper-2);
}

.book-showcase > .section-kicker { color: var(--blue-deep); }

.book-showcase > h2 {
  max-width: 820px !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: 0 !important;
  font-size: clamp(2.1rem, 4.7vw, 3.8rem) !important;
}

.book-intro { max-width: 720px !important; color: var(--text-soft); font-size: 1.04rem; }

.book-grid {
  margin-top: 38px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.book-volume {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 22px;
  background: var(--surface);
}

.book-volume .mini-cover { width: 116px; }
.book-volume h3 { margin: 0 0 12px !important; font-size: 1.23rem !important; }
.book-volume p { margin: 0 0 14px !important; font-size: 0.88rem; line-height: 1.55; }
.book-volume .book-label { margin-bottom: 7px !important; color: var(--blue-deep); font-size: 0.62rem; }
.book-facts { color: var(--muted); font-family: var(--mono); font-size: 0.68rem !important; }
.book-actions { display: flex; flex-wrap: wrap; gap: 8px 15px; }
.book-actions a { font-size: 0.75rem; font-weight: 780; }

.book-showcase .edition-note {
  margin: 20px 0 0;
  background: var(--surface);
  border-color: var(--rule);
}

/* Downloads */

.download-cta {
  margin: 28px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.btn-download {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--ink);
  box-shadow: none;
}

.btn-download:hover { border-color: #d4ff7e; background: #d4ff7e; color: var(--ink); }

.btn-download-alt {
  border-color: rgba(255,255,255,0.28);
  background: transparent;
  color: var(--white);
}

.btn-download-alt:hover { border-color: var(--white); background: rgba(255,255,255,0.08); }

.download-cta-note {
  flex-basis: 100%;
  margin-top: 2px;
  color: #aeb8c8;
  font-size: 0.78rem;
}

.download-cta-note a { color: var(--white); }
.downloads { margin-top: 82px; }
.downloads h2 { max-width: var(--measure-fixed); }
.download-list { list-style: none; max-width: 850px; margin: 22px 0; padding: 0; }

.download-list li {
  margin-bottom: 10px;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.download-list li > a { font-family: var(--mono); font-size: 0.84rem; font-weight: 700; overflow-wrap: anywhere; }
.dl-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 0.82rem; }
.dl-sum { display: block; margin-top: 7px; color: var(--muted); font-family: var(--mono); font-size: 0.7rem; word-break: break-all; }

.project-close {
  margin: 54px 0 0;
  padding: 38px;
  border-radius: var(--radius);
  background: var(--ink);
}

.project-close:empty { display: none; }
.project-close:not(:has(.repo-link)) { display: none; }
.repo-link { margin: 0; }
.project-close .btn { border-color: var(--lime); background: var(--lime); color: var(--ink); box-shadow: none; }

/* Documentation rail */

.with-aside.has-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 56px;
  align-items: start;
}

.with-aside.has-aside > .body { grid-column: 1; min-width: 0; }

.doc-index {
  grid-column: 2;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 116px);
  padding: 24px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.doc-index h2 {
  margin: 0 0 18px;
  padding: 0 0 12px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.doc-index h3 {
  margin: 22px 0 8px;
  color: var(--ink);
  font-size: 0.76rem;
  letter-spacing: 0;
}

.doc-index h3:first-of-type { margin-top: 0; }
.doc-index ul { list-style: none; margin: 0; padding: 0; }
.doc-index li { margin: 0 0 11px; line-height: 1.35; }
.doc-index a { display: block; color: var(--text); font-size: 0.82rem; font-weight: 730; text-decoration: none; }
.doc-index a:hover { color: var(--blue-deep); }
.doc-index a span { display: block; margin-top: 3px; color: var(--muted); font-size: 0.7rem; font-weight: 450; }

/* Footer */

.site-footer {
  margin-top: 72px;
  padding: 0 24px;
  background: var(--ink);
  color: #aeb8c8;
}

.footer-inner {
  width: min(100%, var(--shell));
  min-height: 150px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-inner p { margin: 0; font-size: 0.82rem; }
.footer-inner nav { margin-left: auto; display: flex; gap: 24px; }
.footer-inner a { color: var(--white); font-size: 0.8rem; font-weight: 700; text-decoration: none; }
.footer-inner a:hover { color: var(--lime); }

/* Responsive */

@media (max-width: 980px) {
  .hero { min-height: 0; grid-template-columns: 1fr; padding-top: 78px; }
  .hero-copy { max-width: 820px; }
  .hero-spotlight { width: min(100%, 600px); min-height: 410px; transform: none; }
  .about { padding: 86px 0; grid-template-columns: 1fr; gap: 34px; }
  .section-heading { grid-template-columns: 1fr; gap: 18px; }
  .section-heading > p:last-child { max-width: 620px; }
  .about .bio { max-width: 760px; }
  .featured { margin: 0; padding: 64px 28px; }
  .directory .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-shelf, .book-grid { grid-template-columns: 1fr; }
  .with-aside.has-aside { display: block; }
  .doc-index { position: static; max-width: var(--measure-fixed); max-height: none; margin-top: 60px; }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .site-header { padding: 0 16px; }
  .header-inner { min-height: 62px; }
  .site-header nav { gap: 14px; }
  .site-header nav a { font-size: 0.72rem; }
  .brand > span:last-child, .proj-name { display: none; }
  .shell { padding-left: 16px; padding-right: 16px; }
  .hero { padding: 54px 0 64px; gap: 42px; }
  .hero h1 { font-size: clamp(3rem, 15vw, 4.5rem); }
  .hero::before { display: none; }
  .capability-line { gap: 8px 18px; }
  .capability-line li:not(:last-child)::after { right: -12px; }
  .hero-spotlight { min-height: 390px; padding: 26px; }
  .spotlight-code { margin-top: 60px; }
  .about { padding: 72px 0; }
  .featured { margin: 0 -16px; border-radius: 0; padding: 60px 16px; }
  .feature-cards, .directory .cards { grid-template-columns: 1fr; }
  .feature-visual, .card.feature > .shot { height: 185px; }
  .books { padding: 82px 0; }
  .book-card { grid-template-columns: 104px minmax(0, 1fr); gap: 20px; padding: 18px; }
  .book-info > strong { font-size: 1rem; }
  .book-info > span:not(.book-number):not(.book-link) { font-size: 0.8rem; }
  .project { padding-top: 22px; }
  .project-hero { margin: 0 -16px 46px; padding: 42px 20px; border-radius: 0; }
  .project-hero h1 { font-size: clamp(2.8rem, 15vw, 4.4rem); }
  .project .banner { margin-top: 32px; padding: 7px; }
  .stats { grid-template-columns: 1fr; }
  .stats li { min-height: 0; }
  pre { margin-left: -6px; margin-right: -6px; padding: 20px 18px; border-radius: 12px; font-size: 0.8rem; }
  .book-showcase { margin-left: -16px; margin-right: -16px; padding: 34px 16px; border-radius: 0; }
  .book-volume { grid-template-columns: 86px minmax(0, 1fr); gap: 16px; padding: 16px; }
  .book-volume .mini-cover { width: 86px; }
  .download-cta { align-items: stretch; flex-direction: column; }
  .btn-download { width: 100%; }
  .download-cta-note { margin-top: 7px; }
  .footer-inner { min-height: 170px; flex-direction: column; align-items: flex-start; justify-content: center; }
  .footer-inner nav { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .hero-actions, .download-cta, .doc-index, .project-close { display: none !important; }
  .shell { width: 100%; padding: 0; }
  .project-hero, pre { color: #000; background: #f3f3f3; box-shadow: none; }
  .project-hero h1, pre code { color: #000; }
  a { color: #000; text-decoration: underline; }
}
