/* =============================================================================
   TAC 348: Making Smart Devices — theme tokens
   Source of truth for the approved visual direction ("hybrid", page teal, warm paper).

   Conventions
   - Every value is a resolved hex/rgba, not a color-mix(), so it can be copied
     into SCSS variables or any build step without browser-support concerns.
   - [APPROVED]  = shown in the reviewed mockups and signed off.
   - [PROPOSED]  = derived by the designer for states/contexts the mockups did not
                   show (hover, focus, visited, disabled, mobile). Verify in context.
   - Names are semantic (what the color is FOR), not descriptive (what it looks like).
   - Nothing here depends on a specific theme, framework or class naming.
   ============================================================================= */

:root {

  /* ---- Brand primitives (reference these only from the semantic layer below) ---- */
  --brand-teal:        #07687A;  /* [APPROVED] "page teal" */
  --brand-teal-deep:   #04343D;  /* [APPROVED] teal at 50% toward black */
  --brand-lamp:        #FFA95C;  /* [APPROVED] "lamp orange" accent */
  --brand-oxide:       #9F2B14;  /* [APPROVED] heritage red echo; the only red */
  --brand-ink:         #14262C;  /* [APPROVED] teal-leaning near-black */
  --brand-paper:       #F5F1EA;  /* [APPROVED] warm page paper */
  --brand-white:       #FFFFFF;

  /* ---- Surfaces / backgrounds ---- */
  --color-background:            #F5F1EA;  /* [APPROVED] page background */
  --color-surface:               #FFFFFF;  /* [APPROVED] masthead, cards, panels, tables, sidebar */
  --color-surface-wash:          #E0E5E0;  /* [APPROVED] "Past Projects" band: teal 9% over paper */
  --color-surface-tint:          #E6F0F2;  /* [APPROVED] zebra table rows: teal 10% over white */
  --color-surface-selected:      #D2E4E7;  /* [APPROVED] active Key Topics row, inline code bg: teal 18% over white */
  --color-surface-inverse:       #04343D;  /* [APPROVED] hero base, title band, footer, code, table header */
  --color-surface-brand:         #07687A;  /* [APPROVED] sidebar/"Key Topics" header, section rules */

  /* ---- Text ---- */
  --color-text:                  #14262C;  /* [APPROVED] body and headings */
  --color-text-muted:            #4A5C61;  /* [APPROVED] card descriptions, captions */
  --color-text-inverse:          #FFFFFF;  /* [APPROVED] on teal / deep teal / oxide */
  --color-text-inverse-muted:    #C9E3E8;  /* [APPROVED] footer fine print on deep teal */
  --color-text-on-accent:        #14262C;  /* [APPROVED] label on lamp-orange buttons */

  /* ---- Links ---- */
  --color-link:                  #9F2B14;  /* [APPROVED] links and card titles on light surfaces */
  --color-link-hover:            #7A1F0E;  /* [PROPOSED] */
  --color-link-active:           #7A1F0E;  /* [PROPOSED] */
  --color-link-visited:          #9F2B14;  /* [PROPOSED] keep same as link; add underline for distinction */
  --color-link-inverse:          #FFA95C;  /* [APPROVED] links on deep teal (footer) */
  --color-link-inverse-hover:    #FFFFFF;  /* [PROPOSED] */
  --link-decoration:             underline; /* [PROPOSED] links in running text are underlined */

  /* ---- Accent / interactive ---- */
  --color-accent:                #FFA95C;  /* [APPROVED] buttons, rules on dark, markers, copy button */
  --color-accent-hover:          #FF9B3D;  /* [PROPOSED] primary button hover */
  --color-accent-active:         #F58A24;  /* [PROPOSED] primary button pressed */
  --color-heritage:              #9F2B14;  /* [APPROVED] wordmark, top stripe, menu button */
  --color-heritage-hover:        #7A1F0E;  /* [PROPOSED] menu button hover */

  /* ---- Focus ---- */
  --color-focus-ring:            #07687A;  /* [PROPOSED] on light surfaces (5.7:1 on paper) */
  --color-focus-ring-inverse:    #FFA95C;  /* [PROPOSED] on deep teal / hero (7.1:1) */
  --focus-ring-width:            3px;      /* [PROPOSED] */
  --focus-ring-offset:           2px;      /* [PROPOSED] */

  /* ---- Borders and rules ---- */
  --color-border:                #D8D4CE;  /* [APPROVED] hairlines: paper 88% + black 12% (derives from paper) */
  --color-border-strong:         #07687A;  /* [APPROVED] section rules, panel left border */
  --color-border-heading-subtle: #07687A1F; /* Subheading rule: teal at 1F alpha */
  --color-border-accent:         #FFA95C;  /* [APPROVED] card top border, code-box edge, table header rule */
  --color-border-heritage:       #9F2B14;  /* [APPROVED] top stripe, footer top border */
  --color-border-field:          #5F7378;  /* [PROPOSED] form fields: 5.0:1 on white, 4.4:1 on paper (3:1 UI rule) */
  --rule-h2:                     4px;      /* [APPROVED] */
  --rule-h3:                     1px;      /* Rob's later approval for subheadings */
  --rule-card-top:               4px;      /* [APPROVED] */
  --rule-panel-left:             4px;      /* [APPROVED] */
  --stripe-top-height:           8px;      /* [APPROVED] */
  --footer-top-border:           6px;      /* [APPROVED] */

  /* ---- Code ---- */
  --color-code-background:       #04343D;  /* [APPROVED] */
  --color-code-text:             #E6F4F6;  /* [APPROVED] */
  --color-code-edge:             #FFA95C;  /* [APPROVED] 4px left edge of code boxes */
  --color-code-copy-background:  #FFA95C;  /* [APPROVED] copy button */
  --color-code-copy-icon:        #14262C;  /* [APPROVED] */
  --color-code-copy-hover:       #FF9B3D;  /* [PROPOSED] */
  --color-code-inline-background: #D2E4E7; /* [APPROVED] inline code on light surfaces */
  --color-code-inline-text:      #14262C;  /* [APPROVED] */
  --color-code-comment:          #B8B0A5;  /* [APPROVED] */
  --color-code-keyword:          #FFA95C;  /* lamp orange */
  --color-code-string:           #B9E5C7;  /* light teal-green */
  --color-code-number:           #FFE08A;  /* light lamp yellow */
  --color-code-function:         #FFC4B6;  /* light oxide tint */

  /* ---- Table ---- */
  --color-table-header-background: #04343D; /* [APPROVED] */
  --color-table-header-text:       #FFFFFF; /* [APPROVED] */
  --color-table-header-rule:       #FFA95C; /* [APPROVED] 4px rule under header row */
  --color-table-row-border:        #D8D4CE; /* [APPROVED] */
  --color-table-row-alt:           #E6F0F2; /* [APPROVED] even rows */

  /* ---- Masthead / navigation ---- */
  --color-nav-background:        #FFFFFF;  /* [APPROVED] */
  --color-nav-wordmark:          #9F2B14;  /* [APPROVED] */
  --color-nav-text:              #14262C;  /* [APPROVED] */
  --color-nav-text-hover:        #07687A;  /* [PROPOSED] with 3px teal underline */
  --color-nav-current-indicator: #07687A;  /* [PROPOSED] lamp is too faint on white for this */
  --color-nav-menu-button:       #9F2B14;  /* [APPROVED] mobile/collapsed menu button */
  --color-nav-menu-button-icon:  #FFFFFF;  /* [APPROVED] */

  /* ---- Hero ---- */
  --color-hero-base:             #04343D;  /* [APPROVED] */
  --hero-overlay: linear-gradient(90deg,   /* [APPROVED] over the photo strip; text sits on the left */
      rgba(4, 52, 61, 0.94) 0%,
      rgba(4, 52, 61, 0.72) 55%,
      rgba(7, 104, 122, 0.40) 100%);
  --hero-overlay-vertical: linear-gradient(180deg, /* [PROPOSED] narrow screens: text over the full width */
      rgba(4, 52, 61, 0.92) 0%,
      rgba(4, 52, 61, 0.82) 60%,
      rgba(7, 104, 122, 0.55) 100%);
  --hero-overlay-active: var(--hero-overlay);
  --color-hero-baseline:         #FFA95C;  /* [APPROVED] 6px line at the hero's bottom edge */

  /* ---- Cards, panels, sidebar ---- */
  --color-card-background:       #FFFFFF;  /* [APPROVED] */
  --color-card-title:            #9F2B14;  /* [APPROVED] */
  --color-card-text:             #4A5C61;  /* [APPROVED] */
  --color-panel-background:      #FFFFFF;  /* [APPROVED] */
  --color-sidebar-header-background: #07687A; /* [APPROVED] "Key Topics" header */
  --color-sidebar-header-text:   #FFFFFF;  /* [APPROVED] */
  --color-sidebar-header-rule:   #FFA95C;  /* [APPROVED] 4px under the header + bookmark icon */
  --color-sidebar-row-border:    #D8D4CE;  /* [APPROVED] */
  --color-sidebar-row-selected:  #D2E4E7;  /* [APPROVED] */
  --color-sidebar-dot:           #9DB9BF;  /* [APPROVED] inactive row dot (decorative) */
  --color-sidebar-dot-selected:  #07687A;  /* [APPROVED] */

  /* ---- Elevation ---- */
  --shadow-card:  0 0 0 1px rgba(20, 38, 44, 0.07), 0 3px 10px rgba(20, 38, 44, 0.24); /* [APPROVED] */
  --shadow-panel: 0 0 0 1px rgba(20, 38, 44, 0.07), 0 3px 10px rgba(20, 38, 44, 0.20); /* [APPROVED] */

  /* ---- Footer ---- */
  --color-footer-background:     #04343D;  /* [APPROVED] */
  --color-footer-text:           #FFFFFF;  /* [APPROVED] */
  --color-footer-text-muted:     #C9E3E8;  /* [APPROVED] */
  --color-footer-link:           #FFA95C;  /* [APPROVED] */
  --color-footer-link-hover:     #FFFFFF;  /* [PROPOSED] */

  /* ---- Disabled and status (not in mockups) ---- */
  --color-disabled-background:   #E4E1DB;  /* [PROPOSED] */
  --color-disabled-text:         #6B7A7E;  /* [PROPOSED] not subject to contrast rules, but keep legible */
  --color-selection-background:  #FFA95C;  /* [PROPOSED] ::selection */
  --color-selection-text:        #14262C;  /* [PROPOSED] */

  /* ---- Typography ---- */
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular,
    Menlo, Consolas, monospace;
  --font-size-hero-title:   2.125rem;
  --font-size-h1:           1.47rem;
  --font-size-h2:           1.125rem;
  --font-size-h3:           1rem;
  --font-size-body:         1rem;
  --font-size-body-lead:    1.11rem;
  --font-size-nav:          .94rem;
  --font-size-code:         .89rem;
  --line-height-body:       1.5;
  --font-weight-strong:     700;
  --marp-background-image-max-height: 700px;
}

html { font-size: 16px; }
@media (min-width: 768px) { html { font-size: 17px; } }
@media (min-width: 1024px) { html { font-size: 18px; } }

body, h1, h2, h3, h4, h5, h6,
button, input, select, textarea, table,
.masthead__inner-wrap, .btn, .page__lead, .page__meta,
.page__content dt, .page__content dd,
.toc, .nav__title, .nav__sub-title,
.page__footer-copyright, .page__footer-follow li,
.notice, .notice--primary, .notice--info, .notice--warning,
.notice--success, .notice--danger,
.archive__item-title, .sidebar h2, .sidebar h3, .sidebar h4,
.sidebar h5, .sidebar h6, .sidebar p, .sidebar li {
  font-family: var(--font-sans);
}
tt, code, kbd, samp, pre, div.highlighter-rouge, figure.highlight {
  font-family: var(--font-mono);
}
body { font-size: var(--font-size-body); }
body:not(.home-refresh) .page__content > p { max-width: 75ch; }
h1, h2 { font-weight: 700; }
h3, .greedy-nav, .home-quick-links strong, .past-project-card__title { font-weight: 600; }
.greedy-nav .site-title { font-weight: 700; }
.page__content h1 { font-size: var(--font-size-h1); }
.page__content h2 { font-size: var(--font-size-h2); }
.page__content h3 { font-size: var(--font-size-h3); }
.page__content :not(pre) > code, div.highlighter-rouge, figure.highlight {
  font-size: var(--font-size-code);
}

/* [PROPOSED] Respect forced-colors and keep the focus ring visible everywhere. */
@media (forced-colors: active) {
  :root { --color-focus-ring: Highlight; --color-focus-ring-inverse: Highlight; }
}

/* Site mappings over the Minimal Mistakes base. */
html, body { background: var(--color-background); color: var(--color-text); }
body { background-color: var(--color-background) !important; }
::selection { background: var(--color-selection-background); color: var(--color-selection-text); }
h1, h2, h3, h4, h5, h6 { color: var(--color-text); }
.page__content h1 { padding-bottom: .3em; border-bottom: var(--rule-h2) solid var(--color-border-strong); }
.page__content h2 { border-bottom: var(--rule-h2) solid var(--color-border-strong); }
.page__content h3 { padding-bottom: .2em; border-bottom: var(--rule-h3) solid var(--color-border-heading-subtle); }
.page__content li::marker { color: var(--color-border-strong); }
hr { border-top-color: var(--color-border); }

a, a:visited, .page__content a:not(.btn) { color: var(--color-link); }
a:hover, a:active, .page__content a:not(.btn):hover { color: var(--color-link-hover); }
.page__content p a:not(.btn), .page__content li a:not(.btn), .page__content td a:not(.btn) {
  text-decoration: var(--link-decoration);
}
:where(a, button, input, select, textarea):focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus-ring) !important;
  outline-offset: var(--focus-ring-offset);
}
input, textarea, select { color: var(--color-text); border-color: var(--color-border-field); }
.search-content { background: var(--color-background); }
.search-content .search-input { color: var(--color-text); }

.masthead {
  background: var(--color-nav-background) !important;
  border-top: var(--stripe-top-height) solid var(--color-border-heritage);
  border-bottom: 1px solid var(--color-border);
  box-shadow: none;
}
.masthead__inner-wrap { padding-top: .55rem; padding-bottom: .55rem; }
@media (min-width: 1280px) {
  .masthead__inner-wrap {
    max-width: 1440px;
    padding-left: 3rem;
    padding-right: 3rem;
  }
}
.greedy-nav, .greedy-nav .hidden-links { background: var(--color-nav-background) !important; }
.greedy-nav .visible-links a {
  margin-left: .85rem;
  margin-right: .85rem;
  font-size: var(--font-size-nav);
}
.greedy-nav .site-title, .greedy-nav .site-title:visited {
  color: var(--color-nav-wordmark) !important;
  text-decoration: none !important;
}
.greedy-nav .site-title::before { display: none !important; }
.greedy-nav .visible-links a, .greedy-nav .hidden-links a, .search__toggle {
  color: var(--color-nav-text) !important;
}
.greedy-nav .visible-links a:hover, .greedy-nav .visible-links a[aria-current="page"],
.greedy-nav .hidden-links a:hover, .greedy-nav .hidden-links a[aria-current="page"],
.search__toggle:hover { color: var(--color-nav-text-hover) !important; }
.greedy-nav .visible-links a::before {
  height: 3px;
  background: var(--color-nav-current-indicator) !important;
}
.greedy-nav .hidden-links { border-color: var(--color-border); }
.greedy-nav .hidden-links a[aria-current="page"] { border-left-color: var(--color-nav-current-indicator); }
.greedy-nav .hidden-links .masthead__menu-item a:hover {
  background: var(--color-surface-tint) !important;
}
.greedy-nav__toggle, .greedy-nav__toggle:hover, .greedy-nav__toggle:focus {
  width: 44px;
  height: 44px;
  background: var(--color-nav-menu-button) !important;
}
.greedy-nav__toggle:hover, .greedy-nav__toggle:focus {
  background: var(--color-heritage-hover) !important;
}
.greedy-nav__toggle .navicon, .greedy-nav__toggle .navicon::before,
.greedy-nav__toggle .navicon::after,
.greedy-nav__toggle:hover .navicon, .greedy-nav__toggle:hover .navicon::before,
.greedy-nav__toggle:hover .navicon::after {
  background: var(--color-nav-menu-button-icon) !important;
}

.btn, .btn:visited, .btn--primary, .btn--light-outline,
.home-refresh .page__hero--overlay .btn {
  color: var(--color-text-on-accent) !important;
  background: var(--color-accent) !important;
  border-color: var(--color-accent) !important;
  text-decoration: none !important;
}
.btn:hover, .btn--primary:hover, .btn--light-outline:hover,
.home-refresh .page__hero--overlay .btn:hover {
  color: var(--color-text-on-accent) !important;
  background: var(--color-accent-hover) !important;
}
.btn:active { background: var(--color-accent-active) !important; }
.btn--disabled, .btn:disabled {
  color: var(--color-disabled-text) !important;
  background: var(--color-disabled-background) !important;
}

.home-refresh .page__hero--overlay {
  background-color: var(--color-hero-base);
  border-bottom: 6px solid var(--color-hero-baseline);
  margin-bottom: 0;
}
.home-refresh .page__hero--overlay .page__title,
.home-refresh .page__hero--overlay .page__lead { color: var(--color-text-inverse); }
.home-refresh .page__hero--overlay .page__title {
  font-size: var(--font-size-hero-title);
  line-height: 1.1;
}
.home-refresh .page__hero--overlay .btn {
  box-shadow: none !important;
  text-shadow: none !important;
}
.home-hero__toggle {
  min-height: 44px;
  color: var(--color-text-inverse);
  background: var(--color-surface-inverse);
  border-color: var(--color-text-inverse);
}
.home-hero__toggle[hidden] { display: none !important; }
.home-hero__toggle:hover { color: var(--color-text-inverse); background: var(--brand-teal); }
.home-hero__toggle:focus { outline: var(--focus-ring-width) solid var(--color-focus-ring-inverse); }
.home-hero__toggle:focus-visible, .home-refresh .page__hero--overlay a:focus-visible {
  outline-color: var(--color-focus-ring-inverse) !important;
}

/* Match the approved home composition without changing its content or grid items. */
/* Full-bleed surfaces use the scrollbar-excluding root width. */
html { container-type: inline-size; }
.home-refresh #main { max-width: 1032px; }
.home-refresh #main > .page {
  float: none;
  width: 100%;
  padding-right: 0;
}
.home-refresh .page__inner-wrap { margin-top: 0; }
.home-refresh .page__content > p:first-child {
  position: relative;
  isolation: isolate;
  max-width: 1000px;
  margin: 0 auto 2.75rem;
  padding: 2rem 0;
  font-size: var(--font-size-body-lead);
  line-height: 1.55;
}
.home-refresh .page__content > p:first-child::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  width: 100cqi;
  transform: translateX(-50%);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
@media (min-width: 701px) {
  .home-refresh .page__hero--overlay {
    min-height: 440px;
    height: 440px;
    padding: 0;
    align-items: center;
  }
  .home-refresh .page__hero--overlay .wrapper { padding-bottom: 0; }
  .home-refresh .page__hero--overlay .page__title { max-width: 760px; }
  .home-refresh .page__hero--overlay .page__lead {
    max-width: 760px;
    font-size: var(--font-size-body-lead);
    line-height: 1.55;
  }
  .home-refresh .page__hero--overlay .btn--large {
    padding: .55rem .85rem;
    font-size: 17px;
    line-height: 1.4;
  }
}

.home-quick-links a, .home-link-groups section, .past-project-card {
  background: var(--color-card-background);
  border-color: var(--color-border);
  border-radius: 0;
  box-shadow: var(--shadow-card);
}
.home-quick-links { gap: 1.5rem; }
.home-quick-links a {
  min-height: 112px;
  padding: 1rem 1.5rem;
  border-top: var(--rule-card-top) solid var(--color-border-accent);
}
@media (min-width: 701px) {
  .home-quick-links a { height: 112px; min-height: 0; box-sizing: border-box; }
}
.home-quick-links strong, .past-project-card__title { color: var(--color-card-title); }
.home-quick-links strong { font-size: 1.17rem; }
.home-quick-links span, .past-projects .page__content > p:first-child {
  color: var(--color-card-text);
}
.home-quick-links span { font-size: .89rem; }
.home-quick-links a:hover, .home-quick-links a:focus-visible,
.past-project-card:hover, .past-project-card:focus-visible {
  box-shadow: var(--shadow-card);
}
.past-project-card:focus { outline-color: var(--color-focus-ring); }
.home-link-groups section {
  background: var(--color-panel-background);
  border-left: var(--rule-panel-left) solid var(--color-border-strong);
  box-shadow: var(--shadow-panel);
}
.home-link-groups h3 { border-bottom: 0; padding-bottom: 0; }
.home-link-groups ul { list-style-type: square; }
.home-link-groups li::marker { color: var(--color-accent); }
.home-refresh .page__content h2 { border-bottom: var(--rule-h2) solid var(--color-border-strong); }
body.past-projects { background: var(--color-surface-wash) !important; }
.past-project-card__image { background: var(--color-surface-tint); }

/* Wide pages have no left sidebar; keep their full content width without the theme's empty column. */
.layout--single.wide #main { max-width: 1172px; }
.layout--single.wide #main > .page {
  float: none;
  width: 100%;
  padding-right: 0;
}
.layout--single.wide .sidebar__right:not(:has(.toc__menu)) { display: none; }
.past-project-grid { max-width: 936px; }

/* Give ordinary content pages the same article/right-sidebar composition as lectures. */
.layout--single:not(.home-refresh):not(.lecture-theme):not(.wide) #main {
  max-width: 1172px;
}
@media (min-width: 1024px) {
  .layout--single:not(.home-refresh):not(.lecture-theme):not(.wide) #main > .page {
    float: none;
    width: 100%;
    padding-right: 0;
  }
  .layout--single:not(.home-refresh):not(.lecture-theme):not(.wide) #main:not(:has(.sidebar__right)) > .page {
    max-width: 800px;
    margin-inline: auto;
  }
  .layout--single:not(.home-refresh):not(.lecture-theme):not(.wide) #main:has(.sidebar__right) > .page {
    width: calc(100% - 224px);
  }
  .layout--single:not(.home-refresh):not(.lecture-theme):not(.wide) .sidebar__right {
    width: 200px;
    margin-right: -224px;
    padding-left: 0;
  }
}
@media (min-width: 1280px) {
  .layout--single:not(.home-refresh):not(.lecture-theme):not(.wide) #main:has(.sidebar__right) > .page {
    width: calc(100% - 356px);
  }
  .layout--single:not(.home-refresh):not(.lecture-theme):not(.wide) .sidebar__right {
    width: 300px;
    margin-right: -356px;
  }
}

/* The shared band sits inside #main so its inner edge follows the page grid. */
#main > .page-band {
  position: relative;
  width: 100vw;
  width: 100cqi;
  margin-left: calc(50% - 50vw);
  margin-left: calc(50% - 50cqi);
  color: #fff;
  background-color: #04343D;
  background-image:
    radial-gradient(circle at 96% 115%, rgba(255, 169, 92, .30) 0%, rgba(255, 169, 92, 0) 45%),
    linear-gradient(100deg, #04343D 0%, #07687A 100%);
}
.page-band__inner {
  box-sizing: border-box;
  max-width: 1172px;
  margin-inline: auto;
  padding: 32px 1em 30px;
}
.page-band__parent {
  margin-bottom: 10px;
}
.page-band__parent a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #C9E3E8;
  font-size: .83rem;
  text-decoration: none;
}
.page-band__parent a::before { content: "‹"; margin-right: .4em; }
.page-band__parent a:hover { color: #fff; text-decoration: underline; }
.page-band__parent a:focus-visible {
  outline: 2px solid #FFA95C !important;
  outline-offset: 2px;
}
.page-band__title {
  max-width: 100%;
  margin: 0;
  color: #fff;
  font-size: var(--font-size-h1);
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.page-band__rule {
  display: block;
  width: 96px;
  height: 4px;
  margin-top: 12px;
  background: #FFA95C;
}
#main > .page-band ~ .page .page__inner-wrap { margin-top: 0; }
#main > .page-band ~ .page .page__content { padding-top: 2rem; }
@media (min-width: 1024px) {
  .layout--single:not(.wide) #main:not(:has(.sidebar__right)) > .page-band .page-band__inner {
    max-width: 800px;
    padding-inline: 0;
  }
}
@media (max-width: 700px) {
  .page-band__inner { padding: 20px 1em 18px; }
  .page-band__parent a { font-size: .94rem; }
  .page-band__title { font-size: 1.7rem; line-height: 1.15; }
  .home-refresh .page__hero--overlay .page__title { font-size: 2.125rem; }
}

/* Keep the approved lecture article and Key Topics composition. */
.lecture-theme #main { max-width: 1172px; }
.lecture-theme .page__inner-wrap { margin-top: 0; }
.lecture-theme .page__content li::marker { color: var(--color-border-strong); }
@media (min-width: 1024px) {
  .lecture-theme #main > .page {
    float: none;
    width: calc(100% - 224px);
    padding-right: 0;
  }
  .lecture-theme .sidebar__right {
    width: 200px;
    margin-right: -224px;
    padding-left: 0;
  }
}
@media (min-width: 1280px) {
  .lecture-theme #main > .page { width: calc(100% - 356px); }
  .lecture-theme .sidebar__right {
    width: 300px;
    margin-right: -356px;
  }
}
@media (max-width: 700px) {
  .home-refresh .page__content > p:first-child {
    padding: 2rem 0;
    font-size: 17px;
  }
}

/* Keep table semantics while allowing genuinely wide tables to scroll locally. */
.table-scroll { max-width: 100%; overflow-x: auto; }
.table-scroll:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus-ring) !important;
  outline-offset: var(--focus-ring-offset);
}
.page__content table {
  display: table;
  width: auto;
  max-width: 100%;
  min-width: min-content;
  overflow: visible;
  background: var(--color-surface);
  box-shadow: var(--shadow-panel);
}
.page__content thead {
  color: var(--color-table-header-text);
  background: var(--color-table-header-background) !important;
  border-bottom: 4px solid var(--color-table-header-rule);
}
.page__content thead th { color: var(--color-table-header-text); }
.page__content tbody tr:nth-child(even) { background: var(--color-table-row-alt); }
.page__content td { border-bottom-color: var(--color-table-row-border); }
.page__content table code { color: var(--color-code-inline-text); }
.page__content a:not(.btn) { overflow-wrap: anywhere; }

/* Jekyll renders Marp background directives as inline images; cap only tall ones here. */
.page__content img[alt="bg"], .page__content img[alt^="bg "] {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: var(--marp-background-image-max-height);
}

p > code, a > code, li > code, figcaption > code, td > code {
  color: var(--color-code-inline-text);
  background: var(--color-code-inline-background);
}
div.highlighter-rouge, figure.highlight {
  color: var(--color-code-text);
  background: var(--color-code-background);
  border-left: 4px solid var(--color-code-edge);
}
div.highlighter-rouge .highlight, figure.highlight .highlight,
div.highlighter-rouge pre, figure.highlight pre {
  color: var(--color-code-text);
  background: transparent;
}
div.highlighter-rouge .highlight :is(.k, .kc, .kd, .kn, .kp, .kr, .kt, .cp),
figure.highlight .highlight :is(.k, .kc, .kd, .kn, .kp, .kr, .kt, .cp) {
  color: var(--color-code-keyword);
}
div.highlighter-rouge .highlight :is(.s, .s1, .s2, .sb, .sc, .sd, .se, .sh, .si, .sr, .ss, .cpf),
figure.highlight .highlight :is(.s, .s1, .s2, .sb, .sc, .sd, .se, .sh, .si, .sr, .ss, .cpf) {
  color: var(--color-code-string);
}
div.highlighter-rouge .highlight :is(.m, .mi, .mf, .mh, .mo, .il),
figure.highlight .highlight :is(.m, .mi, .mf, .mh, .mo, .il) {
  color: var(--color-code-number);
}
div.highlighter-rouge .highlight :is(.nf, .fm, .nl, .na),
figure.highlight .highlight :is(.nf, .fm, .nl, .na) {
  color: var(--color-code-function);
}
div.highlighter-rouge .highlight :is(.c, .cm, .c1, .cs),
figure.highlight .highlight :is(.c, .cm, .c1, .cs) {
  color: var(--color-code-comment);
}
div.highlighter-rouge pre.highlight .btn, figure.highlight pre.highlight .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  padding: 6px;
  color: var(--color-code-copy-icon) !important;
  background: var(--color-code-copy-background) !important;
}
div.highlighter-rouge pre.highlight .btn i,
figure.highlight pre.highlight .btn i {
  font-size: 16px;
  line-height: 1;
  color: var(--color-code-copy-icon) !important;
}
div.highlighter-rouge pre.highlight .btn:hover, figure.highlight pre.highlight .btn:hover {
  background: var(--color-code-copy-hover) !important;
}
div.highlighter-rouge pre.highlight .btn:focus-visible,
figure.highlight pre.highlight .btn:focus-visible {
  outline-color: var(--color-focus-ring-inverse) !important;
}

.toc {
  color: var(--color-text);
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-panel);
}
.toc .nav__title {
  color: var(--color-sidebar-header-text) !important;
  background: var(--color-sidebar-header-background) !important;
  border-bottom: 4px solid var(--color-sidebar-header-rule);
}
.toc .nav__title .fa-bookmark { color: var(--color-sidebar-header-rule); }
.page__content .toc__menu a {
  color: var(--color-text);
  border-bottom-color: var(--color-sidebar-row-border);
}
.page__content .toc__menu li a { text-decoration: none; }
.toc__menu a::before {
  content: "";
  display: inline-block;
  width: .45em;
  height: .45em;
  margin-right: .5em;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--color-sidebar-dot);
}
.page__content .toc__menu a:hover {
  color: var(--color-nav-text-hover);
  background: var(--color-surface-tint);
}
.toc .active > a, .toc .active > a:visited {
  color: var(--color-text) !important;
  background: var(--color-sidebar-row-selected);
}
.toc .active > a::before { background: var(--color-sidebar-dot-selected); }

.page__footer {
  color: var(--color-footer-text) !important;
  background: var(--color-footer-background);
  border-top: var(--footer-top-border) solid var(--color-border-heritage);
}
.page__footer p, .page__footer-license, .page__footer-copyright {
  color: var(--color-footer-text-muted);
}
.page__footer a, .page__footer a:visited, .page__footer-license a {
  color: var(--color-footer-link) !important;
}
.page__footer a:hover, .page__footer a:focus-visible {
  color: var(--color-footer-link-hover) !important;
}
.page__footer a:focus-visible { outline-color: var(--color-focus-ring-inverse) !important; }

@media (max-width: 700px) {
  :root { --hero-overlay-active: var(--hero-overlay-vertical); }
  .home-refresh .page__hero--overlay .btn { display: block; min-height: 48px; }
  .home-hero__toggle {
    right: .75rem;
    bottom: .75rem;
    left: auto;
    transform: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
  }
  .home-quick-links { gap: .65rem; }
  .home-quick-links a { min-height: 0; padding: .9rem 1rem; }
  .table-scroll--wide table {
    width: max-content;
    max-width: none;
  }
}

/* Approved Variant A: compact IBM Plex type and spacing for course content. */
:root {
  --course-space-1: .25rem;
  --course-space-2: .5rem;
  --course-space-3: .75rem;
  --course-space-4: 1rem;
  --course-space-6: 1.5rem;
  --course-space-8: 2rem;
  --prose-measure: 64ch;
}

/* Preserve deliberate state changes without animating text reflow. */
html :is(b, i, strong, em, blockquote, p, q, span, figure, img,
  h1, h2, header, input, a, tr, td, form button,
  input[type="submit"], .btn, #goog-wm-sb, .highlight,
  .archive__item-teaser) {
  transition-property: color, background-color, border-color, opacity, transform, box-shadow;
}

html body { line-height: 1.5; }
html .page__content :is(h1, h2, h3) { line-height: 1.2; }
html .page__content h1 { margin: 0 0 var(--course-space-4); }
html .page__content h2 {
  margin: var(--course-space-6) 0 var(--course-space-3);
  padding-bottom: .35em;
}
html .page__content h3 {
  margin: 1.25rem 0 var(--course-space-2);
  padding-bottom: .15em;
}
html .page__content > h1:first-child,
html .page__content > .sidebar__right + h1 { margin-top: 0; }
html .page__content p {
  margin-bottom: .875rem;
  line-height: 1.5;
}
html body:not(.home-refresh) .page__content > p:not(:has(img, picture, iframe, video)) {
  max-width: min(100%, var(--prose-measure));
}
html .page__content :is(ul, ol) { margin-top: 0; margin-bottom: .875rem; }
html .page__content :is(ul, ol) li { margin-bottom: .25rem; line-height: 1.5; }
html .page__content > :is(figure, .table-scroll, div.highlighter-rouge) {
  margin-top: var(--course-space-6);
  margin-bottom: var(--course-space-6);
}
html #main > .page-band ~ .page .page__content { padding-top: var(--course-space-6); }

html .page-band__inner {
  min-height: 104.25px;
  padding-block: 7px;
}
html .page-band__parent { position: relative; top: -8px; margin-bottom: 2px; }
html .page-band__parent a { font-size: 15px; }
html .page-band__title { font-size: 1.4rem; line-height: 1.1; }
html .page-band__rule { margin-top: 3px; }
html .page-band__inner:not(:has(.page-band__parent)) {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* Raise the parent and title together while leaving more room above the rule. */
html .page-band__inner:has(.page-band__parent) .page-band__title {
  position: relative;
  top: -16px;
}
html .page-band__inner:has(.page-band__parent) .page-band__rule {
  position: relative;
  top: -8px;
}
/* Category index titles occupy the same vertical position as child titles. */
html .page-band__inner:not(:has(.page-band__parent)) .page-band__title {
  position: relative;
  top: 5px;
}
html .page-band__inner:not(:has(.page-band__parent)) .page-band__rule {
  position: relative;
  top: 13px;
}

html .home-refresh .page__hero--overlay .page__title {
  font-size: var(--font-size-hero-title);
  line-height: 1.08;
  margin-bottom: var(--course-space-4);
}
html .home-refresh .page__hero--overlay .page__lead {
  line-height: 1.5;
  margin-top: 0;
  margin-bottom: var(--course-space-6);
}
html .home-refresh .page__content > p:first-child {
  padding-block: var(--course-space-6);
  margin-bottom: var(--course-space-8);
  line-height: 1.5;
}
html .home-refresh .page__content h2 {
  margin-top: var(--course-space-6);
  padding-bottom: .35em;
}
html .home-quick-links a { padding: var(--course-space-4) 1.25rem; }
html .home-quick-links strong,
html .past-project-card__title { font-size: 1.125rem; line-height: 1.35; }
html .home-quick-links span { font-size: .9375rem; line-height: 1.45; }
html .home-link-groups section { padding: var(--course-space-4) 1.25rem; }

/* Keep the compact Quick Links and Key Topics rows from the final review. */
html .toc .nav__title { font-size: .75rem; line-height: 1.2; }
html .toc__menu,
html .toc__menu li,
html .toc__menu a { font-size: .75rem; line-height: 1.5; }
html .page__content .toc__menu,
html .page__content .toc__menu :is(ul, ol),
html .page__content .toc__menu li { margin-block: 0; }
html .toc__menu a { min-height: 0; padding-block: .25rem; box-sizing: border-box; }

html .page__content table { font-size: 15px; line-height: 1.4; }
html .page__content :is(th, td) { padding: var(--course-space-2) var(--course-space-3); }
html .page__content :is(div.highlighter-rouge, figure.highlight) {
  font-size: .86rem;
  line-height: 1.5;
}
html .page__content :not(pre) > code { overflow-wrap: anywhere; white-space: normal; }
html .page__footer { margin-top: var(--course-space-8); }
html .page__footer footer { margin-top: var(--course-space-6); padding-bottom: var(--course-space-6); }
html .page__footer-follow li,
html .page__footer-copyright { font-size: 14px; }

@media (min-width: 701px) and (max-width: 767px) {
  :root { --font-size-hero-title: 2.7rem; }
  html .home-refresh .page__hero--overlay .page__lead { font-size: 1.12rem; }
}
@media (min-width: 768px) {
  html body { font-size: .889rem; }
  :root {
    --font-size-h1: 1.59rem;
    --font-size-h2: 1.28rem;
    --font-size-h3: 1.06rem;
    --font-size-hero-title: 2.7rem;
  }
  html .page-band__title { font-size: 1.8rem; }
  html .home-refresh .page__hero--overlay .page__lead { font-size: 1.12rem; }
}
@media (min-width: 1024px) {
  :root {
    --font-size-h1: 1.5rem;
    --font-size-h2: 1.22rem;
    --font-size-h3: 1rem;
    --font-size-hero-title: 3.11rem;
  }
  html .page-band__inner { padding-block: 8px; }
  html .page-band__title { font-size: 1.78rem; }
  html .page-band__inner:not(:has(.page-band__parent)) .page-band__title { top: 7px; }
  html .page-band__inner:not(:has(.page-band__parent)) .page-band__rule { top: 15px; }
  html .toc__menu,
  html .toc__menu li,
  html .toc__menu a { font-size: .6875rem; }
}
@media (max-width: 767px) {
  html .page-band__inner { min-height: 92px; }
  html .page-band__inner:not(:has(.page-band__parent)) .page-band__title { top: 7px; }
  html .page-band__inner:not(:has(.page-band__parent)) .page-band__rule { top: 15px; }
}
@media (max-width: 700px) {
  html .page__content table { font-size: 14px; }
  html .page__content :is(th, td) { padding: .375rem var(--course-space-2); }
  html .page__content :is(div.highlighter-rouge, figure.highlight) { font-size: .875rem; }
  html .home-quick-links a { padding: .875rem var(--course-space-4); }
  html .home-refresh .page__hero--overlay .page__lead { font-size: 1.125rem; }
  html .home-refresh .page__content > p:first-child { font-size: 17px; }
  html div.highlighter-rouge pre.highlight .btn,
  html figure.highlight pre.highlight .btn { min-width: 44px; min-height: 44px; }
}
@media (forced-colors: active) {
  #main > .page-band, .page-band__title, .page-band__parent a, .page-band__rule {
    transition: none !important;
  }
  :where(a, button, input, select, textarea):focus-visible {
    outline-color: Highlight !important;
  }
  #main > .page-band {
    color: CanvasText;
    background: Canvas;
    border-block: 1px solid CanvasText;
  }
  .page-band__title, .page-band__parent a, .page-band__parent a:hover {
    color: CanvasText;
  }
  .page-band__rule { background: none; border-top: 4px solid CanvasText; }
  .page-band__parent a:focus-visible { outline-color: Highlight !important; }
}
@media print {
  #main > .page-band, .page-band__title, .page-band__parent a, .page-band__rule {
    transition: none !important;
  }
  #main > .page-band { color: #14262C !important; background: #fff !important; }
  .page-band__title, .page-band__parent a { color: #14262C !important; }
  .page-band__rule { background: #14262C !important; }
  body { color: var(--color-text) !important; background: var(--color-background) !important; }
  .masthead { border-top-color: var(--color-border-heritage) !important; }
  .greedy-nav .site-title, .greedy-nav .visible-links a, .search__toggle {
    color: var(--color-nav-wordmark) !important;
  }
  .greedy-nav__toggle { background: var(--color-nav-menu-button) !important; }
  .page__content thead { color: var(--color-table-header-text) !important; background: var(--color-table-header-background) !important; }
  .page__footer { color: var(--color-footer-text) !important; background: var(--color-footer-background) !important; }
  .page__footer a, .page__footer-license a { color: var(--color-footer-link) !important; }
}
