/* lecture.css: the theory lectures' shared reading styles (taken from
   Lecture II), plus the figures of Lecture III below */
    * { margin: 0; padding: 0; box-sizing: border-box; }
    body {
      min-height: 100vh;
      background: linear-gradient(180deg, #06080f, #0b0e1c 55%, #0d1020);
      font-family: 'Figtree', sans-serif;
      color: #f0eadc;
      padding-bottom: 6rem;
    }
    nav {
      position: fixed; top: 0; left: 0; right: 0; z-index: 10;
      display: flex; justify-content: space-between; align-items: center;
      padding: 1rem 1.4rem;
      background: rgba(6, 8, 15, 0.55);
      backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    }
    nav img { height: 20px; filter: invert(1) brightness(1.7); opacity: 0.8; }
    nav .links { display: flex; gap: 0.5rem; }
    nav .back {
      font-size: 0.72rem; font-weight: 500; letter-spacing: 0.06em;
      color: rgba(240, 234, 220, 0.75); text-decoration: none;
      border: 1px solid rgba(240, 234, 220, 0.2); border-radius: 99px; padding: 0.4rem 0.95rem;
    }
    main { max-width: 720px; margin: 0 auto; padding: 6.4rem 1.2rem 0; }
    .lab { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(224, 185, 106, 0.8); }
    h1 {
      font-family: 'Gentium Plus', Georgia, serif; font-weight: 400;
      font-size: clamp(2rem, 6vw, 2.9rem); letter-spacing: 0.01em; line-height: 1.12;
      color: #f2ead8; margin: 0.5rem 0 0.9rem; text-wrap: balance;
    }
    .byline { font-size: 0.8rem; color: rgba(240, 234, 220, 0.45); margin-bottom: 1.6rem; }
    .byline a { color: rgba(224, 185, 106, 0.8); text-decoration: none; }
    /* the section map, as on the first lecture: a sidebar on wide screens,
       a sliding strip under the nav on small ones, the current section lit */
    .toc {
      position: fixed; left: 18px; top: 50%; transform: translateY(-50%);
      z-index: 40; max-width: 190px; display: none;
    }
    @media (min-width: 1150px) { .toc { display: block; } }
    .toc a {
      display: block; padding: 0.2rem 0 0.2rem 0.75rem;
      font-size: 0.72rem; letter-spacing: 0.04em; line-height: 1.35;
      color: rgba(240, 234, 220, 0.38); text-decoration: none;
      border-left: 1px solid rgba(200, 205, 240, 0.14);
      transition: color 0.2s ease, border-color 0.2s ease;
    }
    .toc a:hover { color: rgba(240, 234, 220, 0.78); }
    .toc a.on { color: #e0b96a; border-left-color: rgba(224, 185, 106, 0.85); }
    .tocbar {
      position: fixed; top: 62px; left: 0; right: 0; z-index: 9;
      display: flex; gap: 0.4rem; overflow-x: auto;
      -webkit-overflow-scrolling: touch; scrollbar-width: none;
      padding: 0.45rem 1rem 0.55rem;
      background: rgba(6, 8, 15, 0.6);
      -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
      border-bottom: 1px solid rgba(200, 205, 240, 0.08);
    }
    .tocbar::-webkit-scrollbar { display: none; }
    .tocbar a {
      flex: 0 0 auto; padding: 0.26rem 0.75rem; border-radius: 999px;
      font-size: 0.72rem; letter-spacing: 0.05em; white-space: nowrap;
      color: rgba(240, 234, 220, 0.45); text-decoration: none;
      border: 1px solid rgba(200, 205, 240, 0.14);
    }
    .tocbar a.on { color: #e0b96a; border-color: rgba(224, 185, 106, 0.65); }
    @media (min-width: 1150px) { .tocbar { display: none; } }
    @media (max-width: 1149.9px) { main { padding-top: 8.6rem; } h2 { scroll-margin-top: 7.4rem; } }
    .top-door { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin: 0 0 2.4rem; }
    .top-door a {
      font: 600 0.66rem 'Figtree', sans-serif; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none;
      color: #0d0f18; background: #e0b96a; border-radius: 999px; padding: 0.55rem 1.1rem;
      box-shadow: 0 6px 22px rgba(224, 185, 106, 0.22);
    }
    .top-door span { font-size: 0.78rem; color: rgba(240, 234, 220, 0.45); }
    h2 {
      font-family: 'Gentium Plus', Georgia, serif; font-weight: 400; font-size: 1.7rem; line-height: 1.2;
      color: #f2ead8; margin: 3rem 0 1rem; padding-top: 1.6rem; border-top: 1px solid rgba(240, 234, 220, 0.1);
      scroll-margin-top: 5rem; text-wrap: balance;
    }
    h3 {
      font-family: 'Gentium Plus', Georgia, serif; font-weight: 400; font-style: italic; font-size: 1.2rem;
      color: rgba(240, 234, 220, 0.9); margin: 1.9rem 0 0.6rem;
    }
    p { font-size: 0.93rem; line-height: 1.72; color: rgba(240, 234, 220, 0.72); margin-bottom: 0.9rem; text-wrap: pretty; }
    p b, li b { color: rgba(240, 234, 220, 0.92); font-weight: 600; }
    a { color: #e0b96a; }
    ul, ol { margin: 0 0 1rem 1.2rem; }
    li { font-size: 0.93rem; line-height: 1.7; color: rgba(240, 234, 220, 0.72); margin-bottom: 0.45rem; text-wrap: pretty; }
    code { font-family: 'IBM Plex Mono', Menlo, monospace; font-size: 0.86em; color: rgba(240, 234, 220, 0.85); }
    pre {
      font-family: 'IBM Plex Mono', Menlo, monospace; font-size: 0.72rem; line-height: 1.5;
      color: rgba(240, 234, 220, 0.78); background: rgba(6, 8, 15, 0.55);
      border: 1px solid rgba(240, 234, 220, 0.09); border-radius: 10px;
      padding: 0.9rem 1.1rem; margin: 1rem 0 1.3rem; overflow-x: auto; white-space: pre;
    }
    pre.eq { text-align: center; color: #e0b96a; font-size: 0.82rem; background: transparent; border: 0; padding: 0.3rem 0; white-space: pre-wrap; }
    .tw { overflow-x: auto; margin: 0.6rem 0 1.3rem; }
    table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
    @media (max-width: 560px) { table { font-size: 0.74rem; } td, th { padding-right: 0.45rem; } }
    th { text-align: left; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.58rem;
         color: rgba(224, 185, 106, 0.75); padding: 0.4rem 0.6rem 0.4rem 0; border-bottom: 1px solid rgba(240, 234, 220, 0.14); vertical-align: bottom; }
    td { padding: 0.5rem 0.6rem 0.5rem 0; border-bottom: 1px solid rgba(240, 234, 220, 0.06); color: rgba(240, 234, 220, 0.68); vertical-align: top; line-height: 1.5; }
    td:first-child { color: rgba(240, 234, 220, 0.88); }
    sup.ref { font-size: 0.62em; line-height: 0; vertical-align: super; margin-left: 0.12em; letter-spacing: 0.02em; }
    sup.ref a { color: rgba(224, 185, 106, 0.85); text-decoration: none; }
    sup.ref a:hover { text-decoration: underline; }
    ol.refs { margin: 0 0 0 1.4rem; }
    ol.refs li { font-size: 0.8rem; line-height: 1.6; color: rgba(240, 234, 220, 0.62); margin-bottom: 0.55rem; padding-left: 0.2rem; scroll-margin-top: 7.5rem; }
    ol.refs li:target { color: rgba(240, 234, 220, 0.92); }
    ol.refs a { color: #e0b96a; text-decoration: none; word-break: break-all; }
    ol.refs a:hover { text-decoration: underline; }
    .doors { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid rgba(240, 234, 220, 0.1); }
    .doors a {
      font: 600 0.66rem 'Figtree', sans-serif; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none;
      color: #e0b96a; border: 1px solid rgba(224, 185, 106, 0.45); border-radius: 999px; padding: 0.55rem 1.1rem;
    }
  

/* ---- Lecture III: the lede and the figures ---- */
.lede { font-family: 'Gentium Plus', Georgia, serif; font-size: 1.12rem; line-height: 1.6; color: rgba(240, 234, 220, 0.86); margin-bottom: 1.4rem; }
.fig {
  margin: 1.8rem 0 2.2rem; padding: 1.1rem 1.1rem 0.9rem;
  border: 1px solid rgba(240, 234, 220, 0.1); border-radius: 16px;
  background: rgba(10, 13, 26, 0.55);
}
.fig.wide { margin-left: -1.2rem; margin-right: -1.2rem; border-radius: 0; border-left: 0; border-right: 0; }
@media (min-width: 900px) { .fig.wide { margin-left: -6rem; margin-right: -6rem; border-radius: 16px; border: 1px solid rgba(240, 234, 220, 0.1); } }
.fig figcaption { font-size: 0.8rem; line-height: 1.55; color: rgba(240, 234, 220, 0.5); margin-top: 0.8rem; font-style: italic; }
.fig svg { display: block; width: 100%; max-width: 440px; height: auto; margin: 0 auto; touch-action: manipulation; }
.fig canvas#solids { display: block; width: 100%; max-width: 440px; aspect-ratio: 1 / 1; margin: 0.4rem auto 0; touch-action: none; cursor: grab; }
.fig canvas#solids:active { cursor: grabbing; }
.figread { font-size: 0.86rem; line-height: 1.6; color: rgba(240, 234, 220, 0.78); text-align: center; min-height: 2.8em; margin: 0.5rem auto 0; max-width: 34rem; }
.figread b { color: #e0b96a; font-weight: 600; }
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center; }
.chips.small { margin-top: 0.4rem; }
.chip {
  font: 500 0.74rem 'Figtree', sans-serif; letter-spacing: 0.04em; cursor: pointer;
  color: rgba(240, 234, 220, 0.6); background: none;
  border: 1px solid rgba(200, 205, 240, 0.22); border-radius: 999px; padding: 0.34rem 0.85rem;
}
.chip.on, .chip[aria-pressed="true"] { color: #e0b96a; border-color: rgba(224, 185, 106, 0.65); background: rgba(224, 185, 106, 0.08); }
.chip:focus-visible, .pt button:focus-visible { outline: 2px solid #e0b96a; outline-offset: 2px; }

/* the periodic table */
.pt-scroll { overflow-x: auto; margin-top: 0.9rem; -webkit-overflow-scrolling: touch; }
.pt { display: grid; grid-template-columns: 1.1rem repeat(18, minmax(1.9rem, 1fr)); gap: 2px; min-width: 620px; }
.pt .rl { font-size: 0.56rem; color: rgba(240, 234, 220, 0.35); display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.pt .gap { grid-column: 1 / -1; height: 0.55rem; }
.pt button {
  aspect-ratio: 1 / 1.08; min-width: 0; padding: 0; border: 1px solid transparent; border-radius: 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-family: 'Figtree', sans-serif; color: #0d0f18; transition: opacity 0.2s ease, transform 0.15s ease;
}
.pt button b { font-size: 0.74rem; font-weight: 700; line-height: 1; }
.pt button i { font-style: normal; font-size: 0.48rem; line-height: 1; opacity: 0.7; font-variant-numeric: tabular-nums; }
.pt button.dim { opacity: 0.18; }
.pt button.sel { border-color: #f2ead8; transform: scale(1.12); position: relative; z-index: 2; }
.pt button.triad { box-shadow: inset 0 0 0 2px rgba(240, 234, 220, 0.85); }
.pt-legend { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; justify-content: center; margin-top: 0.8rem; font-size: 0.72rem; color: rgba(240, 234, 220, 0.66); }
.pt-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.pt-legend i { width: 0.7rem; height: 0.7rem; border-radius: 3px; display: inline-block; }
.pt-detail { margin-top: 0.9rem; min-height: 4.6rem; display: flex; gap: 1rem; align-items: center; justify-content: center; text-align: left; }
.pt-detail .big { font-family: 'Gentium Plus', Georgia, serif; font-size: 2.6rem; line-height: 1; color: #f2ead8; min-width: 3.2rem; text-align: center; }
.pt-detail .meta { font-size: 0.82rem; line-height: 1.55; color: rgba(240, 234, 220, 0.72); max-width: 26rem; }
.pt-detail .meta b { color: #f2ead8; font-weight: 600; }
.pt-hint { font-size: 0.82rem; color: rgba(240, 234, 220, 0.45); }
@media (prefers-reduced-motion: reduce) { .pt button { transition: none; } }

/* a published image of the table, on its own light ground */
.pt-img { background: #f4f1ea; border-radius: 10px; padding: 0.6rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pt-img img { display: block; width: 100%; min-width: 680px; height: auto; }
.fig .credit { display: block; margin-top: 0.4rem; font-style: normal; font-size: 0.72rem; color: rgba(240, 234, 220, 0.42); }
.fig .credit a { color: rgba(224, 185, 106, 0.8); text-decoration: none; }
