/* ============================================================================
   WallaceWay 2026 redesign — "The Professor's Study", on white like the book.
   Loaded AFTER /styles.css on redesigned pages (body.ww2), so every figure
   width, practice-* behaviour and lesson-image rule in styles.css still
   applies. This file changes chrome and typography only; it never sets a
   figure's width.
   ========================================================================== */

:root {
  --ww2-ink:     #14213d;   /* body text, titles                         */
  --ww2-ink-2:   #3d4659;   /* secondary text                            */
  --ww2-muted:   #5b6472;   /* labels, captions                          */
  --ww2-blue:    #2e5c99;   /* the book's blue, one step deeper (6.6:1)  */
  --ww2-blue-dk: #234a7d;   /* hover                                     */
  --ww2-line:    #e3e6eb;   /* hairlines                                 */
  --ww2-wash:    #f5f7fa;   /* the one off-white surface (sidebar cards) */

  --ww2-display: "Fraunces", Georgia, "Times New Roman", serif;
  --ww2-read:    "Source Serif 4", Georgia, "Times New Roman", serif;
  --ww2-ui:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  --ww2-col:     860px;     /* = styles.css .page-content max-width, so    */
                            /* figures render at exactly today's size      */
  --ww2-header:  72px;
}

body.ww2 { background: #fff; color: var(--ww2-ink); font-family: var(--ww2-ui); }
html:has(body.ww2) { scroll-padding-top: calc(var(--ww2-header) + 16px); }

.ww2 a { color: var(--ww2-blue); }
.ww2 :focus-visible { outline: 3px solid var(--ww2-blue); outline-offset: 2px; border-radius: 3px; }

.ww2-skip { position: absolute; left: -9999px; }
.ww2-skip:focus { left: 16px; top: 12px; z-index: 100; background: #fff; padding: 8px 12px; }

/* ---------------------------------------------------------------- progress */
.ww2-progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 60; pointer-events: none; }
.ww2-progress span { display: block; height: 100%; width: 0; background: var(--ww2-blue); }

/* ------------------------------------------------------------------ header */
.ww2-header {
  position: sticky; top: 0; z-index: 50;
  background: #fff; border-bottom: 1px solid var(--ww2-line);
}
.ww2-header__inner {
  max-width: 1360px; margin: 0 auto; height: var(--ww2-header);
  display: flex; align-items: center; gap: 28px; padding: 0 28px;
}
.ww2-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ww2-ink) !important; flex: none; }
/* .ww-brand__* (the WALLACEWAY wordmark) is styled in styles.css. */

.ww2-nav { display: flex; align-items: center; gap: clamp(14px, 1.8vw, 28px); margin-left: auto; }
.ww2-nav a { font: 600 13px var(--ww2-ui); color: var(--ww2-ink-2); text-decoration: none; padding: 6px 0; }
.ww2-nav a:hover { color: var(--ww2-blue); }
.ww2-nav a[aria-current="page"] { color: var(--ww2-blue); box-shadow: 0 2px 0 var(--ww2-blue); }

.ww2-search { display: flex; align-items: center; gap: 8px; border-left: 1px solid var(--ww2-line); padding-left: 20px; }
.ww2-search input {
  width: 150px; border: 0; background: transparent; outline: 0;
  font: 13px var(--ww2-ui); color: var(--ww2-ink);
}
.ww2-search input::placeholder { color: var(--ww2-muted); }
.ww2-search button { border: 0; background: none; padding: 4px; color: var(--ww2-muted); cursor: pointer; display: grid; }
.ww2-search svg { width: 16px; height: 16px; }

.ww2-menu-btn { display: none; margin-left: auto; border: 1px solid var(--ww2-line); background: #fff; border-radius: 6px; padding: 7px 10px; font: 600 13px var(--ww2-ui); color: var(--ww2-ink); cursor: pointer; }

/* ------------------------------------------------------------------ layout */
.ww2-layout {
  max-width: 1360px; margin: 0 auto; padding: 0 28px;
  display: grid;
  grid-template-columns: 220px minmax(0, var(--ww2-col)) 210px;
  gap: 44px; justify-content: center; align-items: start;
}
.ww2-sticky { position: sticky; top: calc(var(--ww2-header) + 28px); max-height: calc(100vh - var(--ww2-header) - 56px); overflow: auto; padding-bottom: 20px; }
.ww2-left, .ww2-right { padding-top: 40px; }

.ww2-eyebrow { margin: 0 0 14px; font: 700 10.5px var(--ww2-ui); letter-spacing: 0.13em; text-transform: uppercase; color: var(--ww2-muted); }

.ww2-toc { display: flex; flex-direction: column; gap: 12px; }
.ww2-toc a { font: 13px/1.4 var(--ww2-ui); color: var(--ww2-ink-2); text-decoration: none; border-left: 2px solid transparent; padding-left: 10px; margin-left: -12px; }
.ww2-toc a:hover { color: var(--ww2-blue); }
.ww2-toc a.is-active { color: var(--ww2-blue); border-left-color: var(--ww2-blue); font-weight: 600; }

.ww2-rule { height: 1px; background: var(--ww2-line); margin: 28px 0 24px; }

.ww2-chapter { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.ww2-chapter li { font: 13px/1.4 var(--ww2-ui); color: var(--ww2-ink-2); display: flex; gap: 6px; align-items: baseline; }
.ww2-chapter a { color: inherit; text-decoration: none; }
.ww2-chapter a:hover { color: var(--ww2-blue); }
.ww2-chapter [aria-current="page"] { color: var(--ww2-blue); font-weight: 600; }
.ww2-chapter .ww2-done { color: #15803d; font-weight: 700; }

/* ------------------------------------------------------------ article col */
.ww2-col { min-width: 0; padding-bottom: 96px; }
.ww2-crumbs { padding: 36px 24px 0; font: 12px var(--ww2-ui); color: var(--ww2-muted); display: flex; flex-wrap: wrap; gap: 8px; }
.ww2-crumbs a { text-decoration: none; }
.ww2-hops { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.ww2-hop { font-weight: 600; max-width: 24ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ww2-crumbs a:hover { text-decoration: underline; }

/* .page-content keeps its 860px max-width and padding from styles.css so
   the text and figure column is unchanged; only type and colour change. */
.ww2-col .page-content {
  margin: 0; padding-top: 18px;
  font: 19px/1.72 var(--ww2-read); color: var(--ww2-ink);
  hyphens: auto;
}
.ww2-col .page-content p,
.ww2-col .page-content li { font-size: 19px; line-height: 1.72; }

/* Section headings: the book's numbered heads, in the book's blue. */
.ww2-col .page-content h2 {
  font: 600 29px/1.25 var(--ww2-display); color: var(--ww2-blue);
  border: 0; margin: 52px 0 18px; padding: 0;
  display: block; position: relative; padding-right: 34px; hyphens: manual; text-align: left;
}
/* The page's real title (the old banner's h1), now visible. */
.ww2-title {
  font: 600 clamp(40px, 4.4vw, 56px)/1.1 var(--ww2-display); color: var(--ww2-ink);
  margin: 10px 24px 0; padding-bottom: 26px; border-bottom: 1px solid var(--ww2-line);
  overflow-wrap: anywhere; text-wrap: balance;
}
/* When the text opens by repeating the title, ww2.js tucks the echo out of sight. */
.ww2-col .page-content > h2.ww2-echo {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Video thumbnails, "Want more practice?" notes: the old banner content, carried over verbatim. */
.ww2-media { margin: 24px 24px 0; display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.ww2-media .site-hero__media-group { display: contents; }
.ww2-media .site-hero__media { margin: 0; flex: 0 1 300px; max-width: 300px; }
.ww2-media .site-hero__media-link { display: grid; grid-template-columns: 1fr; text-decoration: none; color: var(--ww2-ink); }
.ww2-media .site-hero__media img {
  grid-area: 1 / 1; display: block; width: 100%; max-width: 100%; height: auto; margin: 0; padding: 0;
  background: #fff; border: 1px solid var(--ww2-line); border-radius: 4px; box-shadow: 0 4px 16px rgba(20, 33, 61, 0.12);
}
.ww2-media .site-hero__media-link::after {
  content: ""; grid-area: 1 / 1; place-self: center; width: 54px; height: 54px; border-radius: 50%;
  background: rgba(35, 74, 125, 0.92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5.5v13l11-6.5z'/%3E%3C/svg%3E") 55% 50% / 26px no-repeat;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); transition: transform 0.15s ease;
}
.ww2-media .site-hero__media-link:hover::after { transform: scale(1.08); }
.ww2-media .site-hero__media-link:hover img { transform: none; }
.ww2-media .site-hero__caption { grid-area: 2 / 1; margin: 8px 0 0; font: 700 13px/1.35 var(--ww2-ui); color: var(--ww2-blue); letter-spacing: 0.01em; }
.ww2-media > p { flex: 1 0 100%; margin: 0; font: 15px/1.5 var(--ww2-ui); color: var(--ww2-muted); text-align: left; }
.ww2-media > p.site-hero__caption { font-weight: 700; color: var(--ww2-blue); }
.ww2-media > p a { color: var(--ww2-blue); font-weight: 600; text-decoration: underline; }
@media (max-width: 640px) {
  .ww2-title, .ww2-media { margin-left: 16px; margin-right: 16px; }
  .ww2-media { gap: 14px; }
  .ww2-media .site-hero__media { flex: 0 1 calc(50% - 7px); max-width: calc(50% - 7px); }
  .ww2-media .site-hero__media-link::after { width: 40px; height: 40px; background-size: 20px; }
  .ww2-media .site-hero__caption { font-size: 12px; }
}
.ww2-col .page-content h3 { font: 600 22px/1.3 var(--ww2-display); color: var(--ww2-blue); }

/* Section link button added by ww2.js — never part of the text. */
.ww2-h-tools { display: inline-flex; gap: 2px; position: absolute; right: 0; top: 0.12em; opacity: 0.35; transition: opacity 0.15s; }
.ww2-col .page-content h2:hover .ww2-h-tools,
.ww2-h-tools:focus-within { opacity: 1; }
.ww2-h-tools button {
  border: 0; background: none; cursor: pointer; padding: 6px; border-radius: 4px;
  color: var(--ww2-blue); display: grid; place-items: center;
}
.ww2-h-tools button:hover { background: var(--ww2-wash); }
.ww2-h-tools svg { width: 17px; height: 17px; }
.ww2-h-tools .ww2-copied { font: 600 11px var(--ww2-ui); padding: 0 4px; align-self: center; }

/* "Important Point:" — the textbook's own lead-in. */
.ww2 .callout-label { color: var(--ww2-blue); font-family: var(--ww2-ui); font-size: 0.86em; font-weight: 700; letter-spacing: 0.01em; }
.ww2-col .page-content p:has(> .callout-label:first-child) {
  border-left: 3px solid var(--ww2-blue); padding: 4px 0 4px 18px; margin: 28px 0;
}

/* Figures sit straight on the page, like print. Widths come from styles.css. */
.ww2 figure.lesson-image img { background: transparent; border-radius: 0; }

/* Practice problems: the book's blue-framed box, white inside. */
.ww2 .practice-section {
  background: #fff; border: 4px solid var(--ww2-blue); border-radius: 4px;
  padding: 26px 28px; margin: 36px 0;
}
.ww2 .practice-section p { font-family: var(--ww2-read); }
.ww2 .practice-toggle {
  font: 600 13px var(--ww2-ui); color: var(--ww2-blue);
  border: 1.5px solid var(--ww2-blue); border-radius: 999px; padding: 5px 14px 5px 8px;
}
.ww2 .practice-toggle:hover { background: var(--ww2-wash); }
.ww2 .practice-toggle-input:focus-visible ~ .practice-toggle { outline: 3px solid var(--ww2-blue); outline-offset: 2px; }
.ww2 .practice-toggle-input:checked ~ .practice-toggle .practice-toggle-track { background: var(--ww2-blue); }

/* The old in-page chapter list is replaced by the sidebar + pager. */
.ww2 .page-content .chapter-nav { display: none; }

/* -------------------------------------------------------- end-of-lesson */
.ww2-end { padding: 0 24px; }
.ww2-tools { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 34px; }
.ww2-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: 600 14px var(--ww2-ui); border-radius: 6px; padding: 11px 18px;
  border: 1.5px solid var(--ww2-blue); background: var(--ww2-blue); color: #fff; text-decoration: none;
}
.ww2-btn:hover { background: var(--ww2-blue-dk); border-color: var(--ww2-blue-dk); }
.ww2-btn--ghost { background: #fff; color: var(--ww2-blue); }
.ww2 a.ww2-btn { color: #fff; text-decoration: none; }
.ww2 a.ww2-btn--ghost { color: var(--ww2-blue); }
.ww2 a.ww2-btn:hover { color: #fff; }
.ww2 a.ww2-btn--ghost:hover { color: var(--ww2-blue-dk); }
.ww2-btn--ghost:hover { background: var(--ww2-wash); }
.ww2-btn[aria-pressed="true"] { background: #fff; color: #15803d; border-color: #15803d; }
.ww2-btn svg { width: 16px; height: 16px; }

.ww2-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ww2-pager a {
  display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; text-decoration: none;
  border: 1px solid var(--ww2-line); border-radius: 6px; color: var(--ww2-ink);
  font: 600 17px/1.3 var(--ww2-display);
}
.ww2-pager a:hover { border-color: var(--ww2-blue); }
.ww2-pager small { font: 700 10.5px var(--ww2-ui); letter-spacing: 0.12em; color: var(--ww2-muted); text-transform: uppercase; }
.ww2-pager .ww2-next { text-align: right; grid-column: 2; }

/* ------------------------------------------------------------ right rail */
.ww2-card { border-top: 2px solid var(--ww2-blue); padding: 18px 0 0; margin-bottom: 34px; }
.ww2-card--quiet { border-top-color: var(--ww2-line); }
.ww2-card h3 { font: 600 19px/1.25 var(--ww2-display); margin: 0 0 6px; color: var(--ww2-ink); }
.ww2-card p { font: 13.5px/1.5 var(--ww2-ui); color: var(--ww2-muted); margin: 0 0 12px; }
.ww2-card a { font: 700 13px var(--ww2-ui); text-decoration: none; }
.ww2-card a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ footer */
.ww2 .site-footer {
  background: #fff; color: var(--ww2-muted); border-top: 1px solid var(--ww2-line);
  font: 13px var(--ww2-ui); padding: 36px 28px; text-align: center;
}
.ww2 .site-footer a { color: var(--ww2-blue); }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1340px) {
  .ww2-layout { grid-template-columns: 210px minmax(0, var(--ww2-col)); }
  .ww2-right { grid-column: 2; padding-top: 0; }
  .ww2-right .ww2-sticky { position: static; max-height: none; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 0 24px; }
}
@media (max-width: 1080px) {
  .ww2-layout { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; }
  .ww2-left { padding: 20px 24px 0; }
  .ww2-left .ww2-sticky { position: static; max-height: none; }
  .ww2-left details { border: 1px solid var(--ww2-line); border-radius: 6px; padding: 12px 16px; }
  .ww2-left summary { cursor: pointer; font: 600 14px var(--ww2-ui); }
  .ww2-right { grid-column: 1; }
  .ww2-nav, .ww2-search { display: none; }
  .ww2-menu-btn { display: inline-block; }
  .ww2-header.is-open .ww2-nav {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    position: absolute; top: var(--ww2-header); left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--ww2-line); padding: 8px 24px 16px;
  }
  .ww2-header.is-open .ww2-nav a { padding: 12px 0; border-bottom: 1px solid var(--ww2-line); box-shadow: none; }
}
@media (min-width: 1081px) {
  .ww2-left details > summary { display: none; }
}
@media (max-width: 640px) {
  .ww2-header__inner { padding: 0 16px; gap: 12px; }
  .ww2-left { padding: 16px 16px 0; }
  .ww2-crumbs, .ww2-end { padding-left: 16px; padding-right: 16px; }
  .ww2-col .page-content { padding-left: 16px; padding-right: 16px; }
  .ww2-col .page-content p, .ww2-col .page-content li { font-size: 18px; }
  .ww2-col .page-content h2 { font-size: 24px; }
  .ww2 .practice-section { padding: 18px 16px; }
  .ww2-pager { grid-template-columns: 1fr; }
  .ww2-pager .ww2-next { grid-column: 1; }
  .ww2-right .ww2-sticky { grid-template-columns: 1fr; padding: 0 16px; }
}

/* ------------------------------------------------------------------- print */
@media print {
  .ww2-header, .ww2-progress, .ww2-left, .ww2-right, .ww2-end, .ww2-crumbs, .ww2-h-tools, .site-footer { display: none !important; }
  .ww2-layout { display: block; padding: 0; }
  .ww2 .page-content { max-width: none; padding: 0; font-size: 12pt; }
}

/* Problem 2: "Show answers" fills the table's own cells, so the extra picture
   of the finished table that styles.css reveals below it is redundant. */
.ww2 #reveal-ex2 ~ .practice-reveal { display: none !important; }


/* ======================================================================
   Simple pages: Topics, Shop, App, AI Assistant, All Lessons
   ====================================================================== */
.ww2-wrap { max-width: 1000px; margin: 0 auto; padding: 0 28px 96px; }
.ww2-pagehead { padding: 56px 0 8px; }
.ww2-pagetitle {
  font: 600 clamp(38px, 4.4vw, 54px)/1.1 var(--ww2-display); color: var(--ww2-ink);
  margin: 0 0 26px; padding-bottom: 24px; border-bottom: 1px solid var(--ww2-line);
}
.ww2-simple .page-content {
  max-width: none; margin: 0; padding: 12px 0 0;
  font: 18px/1.65 var(--ww2-read); color: var(--ww2-ink); hyphens: manual;
}
.ww2-simple .page-content p { text-align: left; font-size: 18px; }
.ww2-simple .page-content h1,
.ww2-simple .page-content h2 { font-family: var(--ww2-display); color: var(--ww2-blue); }
.ww2-simple .page-content .shop-page-title,
.ww2-simple .page-content .shop-preview__title { text-align: left; font-weight: 600; }
.ww2-simple .page-content .shop-page-title {
  font-size: clamp(38px, 4.4vw, 54px); line-height: 1.1; color: var(--ww2-ink);
  margin: 44px 0 26px; padding-bottom: 24px; border-bottom: 1px solid var(--ww2-line);
}
.ww2-simple .page-content .shop-preview__title { font-size: 28px; margin: 56px 0 20px; }

/* buttons across the simple pages: the book's blue */
.ww2 a.cta-button, .ww2 a.shop-textbook__buy-button, .ww2 a.shop-preview__link {
  background: var(--ww2-blue); color: #fff; border-radius: 6px; font: 600 14px var(--ww2-ui);
  text-decoration: none; border: 0;
}
.ww2 a.cta-button:hover, .ww2 a.shop-textbook__buy-button:hover, .ww2 a.shop-preview__link:hover { background: var(--ww2-blue-dk); color: #fff; }

/* ---- Topics: a clean white contents list ---- */
.ww2-simple .topics-page { max-width: none; }
.ww2-simple .topics-page .topics-page__intro { font: 14px/1.5 var(--ww2-ui); color: var(--ww2-muted); margin: 0 0 18px; text-align: left; }
.ww2-simple .topics-page .chapter-group {
  background: #fff; border: 0; border-top: 1px solid var(--ww2-line); border-radius: 0; box-shadow: none; margin: 0;
}
.ww2-simple .topics-page .chapter-group:last-of-type { border-bottom: 1px solid var(--ww2-line); }
.ww2-simple .topics-page .chapter-group[open] { background: #fff; }
.ww2-simple .topics-page .chapter-summary { min-height: 64px; padding: 14px 4px; gap: 20px; align-items: center; }
.ww2-simple .topics-page .chapter-summary:hover { background: var(--ww2-wash); }
.ww2-simple .topics-page .chapter-summary__num {
  background: none; color: var(--ww2-blue); width: 36px; min-width: 36px; padding: 0; white-space: nowrap; height: auto; border-radius: 0;
  font: 600 18px/1 var(--ww2-display); display: block; text-align: left; flex: none;
}
.ww2-simple .topics-page .chapter-summary h2 { font: 600 24px/1.25 var(--ww2-display); color: var(--ww2-ink); margin: 0; flex: 1; border: 0; padding: 0; }
.ww2-simple .topics-page .chapter-chevron { color: var(--ww2-blue); }
.ww2-simple .topics-page .chapter-group > ul { padding: 4px 4px 22px 56px; }
.ww2-simple .topics-page .chapter-group li { font: 16px/1.5 var(--ww2-ui); }
.ww2-simple .topics-page .chapter-group a { color: var(--ww2-ink-2); text-decoration: none; }
.ww2-simple .topics-page .chapter-group a:hover { color: var(--ww2-blue); text-decoration: underline; }

/* ---- Shop + App: white, with a framed book card ---- */
.ww2-simple .shop-textbook {
  background: #fff; border: 1px solid var(--ww2-line); border-radius: 8px; padding: 36px; gap: 40px; box-shadow: none;
}
.ww2-simple .shop-textbook__cover img { box-shadow: 0 6px 24px rgba(20,33,61,0.18); border-radius: 2px; }
.ww2-simple .shop-textbook__info { color: var(--ww2-ink); }
.ww2-simple .shop-textbook__info > p { font-size: 19px; text-align: left; }
.ww2-simple .shop-textbook__buy { background: var(--ww2-wash); border: 1px solid var(--ww2-line); border-radius: 8px; box-shadow: none; }
.ww2-simple .shop-textbook__buy-title { font: 600 20px var(--ww2-display); color: var(--ww2-ink); }
.ww2-simple .shop-textbook__buy-author { font: 14px var(--ww2-ui); font-style: normal; color: var(--ww2-muted); }
.ww2-simple .shop-preview__card { background: #fff; border: 1px solid var(--ww2-line); border-radius: 8px; box-shadow: none; }
.ww2-simple .shop-preview__card h3 { font: 600 20px var(--ww2-display); color: var(--ww2-blue); }
.ww2-simple .shop-preview__card p { font: 14px/1.5 var(--ww2-ui); text-align: left; }

/* ---- AI assistant ---- */
.ww2-simple .chat-widget { border-color: var(--ww2-line); box-shadow: none; }
.ww2-simple .chat-widget__header { background: var(--ww2-blue); }

/* ---- footer: contact form stays; it just wears the new colours ---- */
.ww2 .site-footer { background: #fff; border-top: 1px solid var(--ww2-line); color: var(--ww2-ink-2); text-align: left; padding: 40px 28px; font-family: var(--ww2-ui); }
.ww2 .site-footer p { color: var(--ww2-ink-2); font-size: 14px; }
.ww2 .site-footer__inner { max-width: 1000px; margin: 0 auto; }
.ww2 .site-footer a { color: var(--ww2-blue); }
.ww2 .contact-section__title { color: var(--ww2-blue); font: 600 15px var(--ww2-ui); }
.ww2 .contact-form__field label { color: var(--ww2-ink-2); font-family: var(--ww2-ui); }

@media (max-width: 640px) {
  .ww2-wrap { padding: 0 16px 72px; }
  .ww2-simple .shop-textbook { padding: 20px; }
  .ww2-simple .topics-page .chapter-group > ul { padding-left: 24px; }
  .ww2-simple .topics-page .chapter-summary h2 { font-size: 20px; }
}

/* ======================================================================
   Home
   ====================================================================== */
.ww2-home { --ww2-hand: "Caveat", "Segoe Script", cursive; }
.ww2-home #ww2-text { max-width: 1240px; margin: 0 auto; padding: 0 28px; }

.ww2-hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; padding: 64px 0 56px; }
.ww2-eyebrow-rule { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; font: 700 11px var(--ww2-ui); letter-spacing: 0.14em; color: var(--ww2-blue); }
.ww2-eyebrow-rule::before { content: ""; width: 28px; height: 1px; background: var(--ww2-blue); }
.ww2-hero h1 { font: 600 clamp(44px, 5.2vw, 72px)/1.08 var(--ww2-display); color: var(--ww2-ink); margin: 0; }
.ww2-hand { font: 600 clamp(38px, 4vw, 54px)/1.1 var(--ww2-hand); color: var(--ww2-blue); margin: 10px 0 0; transform: rotate(-1.5deg); transform-origin: left; }
.ww2-hero__sub { font: 20px/1.5 var(--ww2-read); color: var(--ww2-ink-2); margin: 26px 0 30px; }
.ww2-hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.ww2-hero__photos { position: relative; padding-bottom: 36px; }
.ww2-hero__main { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.ww2-hero__inset {
  position: absolute; left: -28px; bottom: 0; width: 34%; max-width: 190px; height: auto; aspect-ratio: 1; object-fit: cover;
  border: 6px solid #fff; border-radius: 4px; box-shadow: 0 8px 28px rgba(20, 33, 61, 0.22);
}

.ww2-about { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 64px; align-items: center; padding: 72px 0; border-top: 1px solid var(--ww2-line); }
.ww2-about img { width: 100%; height: auto; border-radius: 4px; display: block; }
.ww2-about h2 { font: 600 clamp(32px, 3.4vw, 46px)/1.15 var(--ww2-display); color: var(--ww2-ink); margin: 0 0 22px; border: 0; padding: 0; }
.ww2-about p { font: 19px/1.7 var(--ww2-read); color: var(--ww2-ink-2); margin: 0 0 18px; text-align: left; }
.ww2-about__ready { font: 600 28px var(--ww2-display) !important; color: var(--ww2-blue) !important; margin: 26px 0 16px !important; }

.ww2-ways { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 8px 0 72px; }
.ww2-way { display: flex; flex-direction: column; gap: 10px; padding: 26px 24px; border: 1px solid var(--ww2-line); border-top: 3px solid var(--ww2-blue); border-radius: 4px; text-decoration: none; color: var(--ww2-ink); }
.ww2-way:hover { border-color: var(--ww2-blue); box-shadow: 0 6px 20px rgba(20, 33, 61, 0.08); }
.ww2-way h3 { font: 600 22px/1.2 var(--ww2-display); margin: 0; color: var(--ww2-ink); }
.ww2-way p { font: 15px/1.55 var(--ww2-ui); color: var(--ww2-muted); margin: 0; text-align: left; }
.ww2-way span { margin-top: auto; padding-top: 6px; font: 700 13px var(--ww2-ui); color: var(--ww2-blue); }

.ww2-chapters { padding: 0 0 72px; }
.ww2-chapters h2 { font: 600 clamp(30px, 3.2vw, 42px)/1.15 var(--ww2-display); color: var(--ww2-ink); margin: 0 0 26px; padding-bottom: 20px; border-bottom: 1px solid var(--ww2-line); }
.ww2-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0; border-left: 1px solid var(--ww2-line); }
.ww2-tile { display: flex; gap: 14px; align-items: baseline; padding: 15px 16px; border-right: 1px solid var(--ww2-line); border-bottom: 1px solid var(--ww2-line); text-decoration: none; color: var(--ww2-ink); font: 600 16px/1.3 var(--ww2-display); }
.ww2-tile span { color: var(--ww2-blue); font: 600 15px var(--ww2-display); min-width: 1.6em; }
.ww2-tile:hover { background: var(--ww2-wash); color: var(--ww2-blue); }

/* Testimonials (the original block): three quiet pull quotes */
.ww2-home .page-content { max-width: 1240px; margin: 0 auto; padding: 0 28px 88px; font-family: var(--ww2-read); }
.ww2-home .testimonials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; padding: 40px 0; border-top: 1px solid var(--ww2-line); }
.ww2-home .testimonial { border: 0; border-top: 2px solid var(--ww2-blue); padding: 18px 0 0; text-align: left; }
.ww2-home .testimonial__quote { font: italic 18px/1.65 var(--ww2-read); color: var(--ww2-ink); }
.ww2-home .testimonial__name { font: 700 12px var(--ww2-ui); color: var(--ww2-muted); letter-spacing: 0.04em; }
.ww2-home .cta-row { text-align: center; }
.ww2-home .cta-button--large { padding: 14px 26px; font-size: 16px; }

@media (max-width: 1080px) {
  .ww2-hero, .ww2-about { grid-template-columns: 1fr; gap: 36px; }
  .ww2-hero__photos { max-width: 640px; }
  .ww2-hero__inset { left: 12px; }
  .ww2-ways { grid-template-columns: 1fr 1fr; }
  .ww2-home .testimonials { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ww2-home #ww2-text, .ww2-home .page-content { padding-left: 16px; padding-right: 16px; }
  .ww2-hero { padding: 36px 0 36px; }
  .ww2-ways { grid-template-columns: 1fr; }
  .ww2-about { padding: 44px 0; }
}

/* Home: "Continue where you left off" (shown by ww2.js for returning readers) */
.ww2-continue { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  margin: 0 0 8px; padding: 22px 28px; border: 1px solid var(--ww2-line); border-left: 4px solid var(--ww2-blue); border-radius: 4px; background: var(--ww2-wash); }
.ww2-continue[hidden] { display: none; }
.ww2-continue .ww2-eyebrow { margin: 0 0 4px; color: var(--ww2-blue); }
.ww2-continue__label { font: 600 24px/1.25 var(--ww2-display); color: var(--ww2-ink); margin: 0; }
.ww2-continue__note { font: 14px var(--ww2-ui); color: var(--ww2-muted); margin: 4px 0 0; text-align: left; }
.ww2-continue__note a { font-weight: 600; }

/* A wide exercise (e.g. a matching row) scrolls inside its own box on a phone
   instead of pushing the whole page sideways. */
.ww2 .practice-section { overflow-x: auto; }

/* Phones: slim Previous / Next bar at the bottom of the screen (built by ww2.js) */
.ww2-bar { display: none; }
@media (max-width: 640px) {
  .ww2-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    background: #fff; border-top: 1px solid var(--ww2-line); box-shadow: 0 -4px 16px rgba(20, 33, 61, 0.08);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .ww2-bar a, .ww2-bar__gap { flex: 1 1 50%; min-width: 0; }
  .ww2-bar a { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; text-decoration: none; color: var(--ww2-ink); }
  .ww2-bar a + a, .ww2-bar__gap + a { border-left: 1px solid var(--ww2-line); }
  .ww2-bar small { font: 700 10.5px var(--ww2-ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ww2-blue); }
  .ww2-bar span { font: 600 14px/1.25 var(--ww2-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ww2-bar__next { text-align: right; }
  .ww2-has-bar { padding-bottom: 66px; }
}
@media print { .ww2-bar { display: none !important; } }

/* Long unbreakable chemistry names in a heading ("Oxymercuration/Demercuration")
   must be allowed to wrap on a phone. */
.ww2-col .page-content h2 { overflow-wrap: anywhere; min-width: 0; }
.ww2-col .page-content h2 > :not(.ww2-h-tools) { min-width: 0; }

/* Phones: the fixed bottom bar replaces the top links and the end-of-lesson pager. */
@media (max-width: 640px) {
  .ww2-hops, .ww2-pager { display: none; }
}


/* Topics: Organic 1 / Organic 2 headings */
.ww2-simple .topics-page .ww2-semester {
  font: 600 clamp(28px, 3vw, 38px)/1.15 var(--ww2-display); color: var(--ww2-ink);
  margin: 44px 0 0; padding-bottom: 12px; border-bottom: 2px solid var(--ww2-blue);
  scroll-margin-top: calc(var(--ww2-header) + 16px);
}
.ww2-simple .topics-page .ww2-semester--first { margin-top: 18px; }
.ww2-semester small { font: 600 15px var(--ww2-ui); color: var(--ww2-muted); margin-left: 10px; }
.ww2-simple .topics-page .ww2-semester-jump { font: 14px var(--ww2-ui); color: var(--ww2-muted); margin: -6px 0 0; }
.ww2-semester-jump a { font-weight: 600; }


/* Video marker (Topics): an outline camera in the book's blue, replacing the emoji */
.ww2-vid {
  display: inline-block; width: 1.15em; height: 1.15em; margin-left: 0.35em; vertical-align: -0.22em;
  background-color: var(--ww2-blue);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272.2%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5%27/%3E%3Crect x=%272%27 y=%276%27 width=%2714%27 height=%2712%27 rx=%272%27/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272.2%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5%27/%3E%3Crect x=%272%27 y=%276%27 width=%2714%27 height=%2712%27 rx=%272%27/%3E%3C/svg%3E") center / contain no-repeat;
}
.topics-page__intro .ww2-vid { margin: 0 0.15em; }

/* 404: the page's own h1 sits inside <main>, so it gets the page-title look here. */
.ww2-simple .page-content > h1:first-child {
  font: 600 clamp(38px, 4.4vw, 54px)/1.1 var(--ww2-display); color: var(--ww2-ink);
  margin: 44px 0 26px; padding-bottom: 24px; border-bottom: 1px solid var(--ww2-line);
}
.ww2-simple .page-content > ul { font: 18px/1.7 var(--ww2-read); }
.ww2-simple .page-content > ul a { font-weight: 600; }
.ww2-simple .page-content .cta-row { text-align: left; margin-top: 28px; }

/* In-text cross-references to the lesson that teaches the idea (added by scripts/apply-xlinks.py). */
.ww2-col .page-content a.xref {
  color: var(--ww2-blue); text-decoration: underline; text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(46, 92, 153, 0.45); text-underline-offset: 3px;
}
.ww2-col .page-content a.xref:hover { text-decoration-color: currentColor; background: var(--ww2-wash); }


/* ---- "Back to ..." bar: only after following an in-text cross-link -------------------- */
.ww2-back {
  position: sticky; top: var(--ww2-header); z-index: 45;
  display: flex; align-items: center; gap: 8px; margin: 0 24px; padding: 8px 12px;
  background: var(--ww2-wash); border: 1px solid var(--ww2-line); border-top: 0; border-radius: 0 0 6px 6px;
  font: 600 13px var(--ww2-ui);
}
.ww2-back__link { flex: 1 1 auto; min-width: 0; color: var(--ww2-blue); text-decoration: none; display: flex; gap: 0.35em; }
.ww2-back__link:hover { text-decoration: underline; }
.ww2-back__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ww2-back__x { flex: none; border: 0; background: none; color: var(--ww2-muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 4px 6px; border-radius: 4px; }
.ww2-back__x:hover { background: #fff; color: var(--ww2-ink); }
/* must out-rank html:has(body.ww2) { scroll-padding-top } above, so the bar never covers the section we land on */
html:has(body.ww2.ww2-has-back) { scroll-padding-top: calc(var(--ww2-header) + 64px); }
@media (max-width: 640px) { .ww2-back { margin: 0 16px; } }
@media print { .ww2-back { display: none !important; } }

/* ---- Landing highlight: the section a link, the contents list or a shared URL jumps to --------- */
/* ww2.js adds .ww2-landed once the page has settled and removes it ~3s later. A highlighter-yellow
   wash that holds, then fades. With "reduce motion" on it is a plain wash that simply disappears. */
@keyframes ww2-land {
  0%, 55% { background-color: rgba(255, 224, 102, 0.62); box-shadow: 0 0 0 7px rgba(255, 224, 102, 0.62); }
  100%    { background-color: rgba(255, 224, 102, 0);    box-shadow: 0 0 0 7px rgba(255, 224, 102, 0); }
}
.ww2-landed { animation: ww2-land 3s ease-out both; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  .ww2-landed { animation: none; background-color: rgba(255, 224, 102, 0.5); box-shadow: 0 0 0 7px rgba(255, 224, 102, 0.5); }
}

/* Subscripts and superscripts in headings: the browser default leaves them nearly full size in a big heading. */
.ww2 h1 sub, .ww2 h2 sub, .ww2 h3 sub, .ww2 h4 sub,
.ww2 h1 sup, .ww2 h2 sup, .ww2 h3 sup, .ww2 h4 sup { font-size: .62em; line-height: 0; }
.ww2 h1 sub, .ww2 h2 sub, .ww2 h3 sub, .ww2 h4 sub { vertical-align: -.22em; }
.ww2 h1 sup, .ww2 h2 sup, .ww2 h3 sup, .ww2 h4 sup { vertical-align: .55em; }
