/* Electric Circuits deck: diagram rules copied from the Year 10 companion
   stylesheet (gcsephy/year10phy/unit01/assets/styles.css) so the shared
   Diagrams helpers draw identically, with sizes adjusted for 1600 × 900 slides. */

.cd { stroke: var(--ink); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.cd .mask { fill: var(--diagram-bg); stroke: none; }
.cd .body rect, .cd .body circle:not(.dot) { fill: var(--diagram-bg); }
.cd .fill { fill: var(--ink); stroke: none; }
.cd .thick { stroke-width: 4.5; }
.cd .dash { stroke-dasharray: 3 4; }
.cd .dot { fill: var(--ink); stroke: none; }
.cd text { fill: var(--ink); stroke: none; font: 700 15px/1 Arial, Helvetica, sans-serif; }
.cd text.meter-letter { font: 900 16px/1 Arial, Helvetica, sans-serif; }
.cd text.note { font-size: 17px; font-weight: 800; fill: #3a4452; }
.cd text.hot { fill: #b44a12; }
.cd text.cool { fill: #1479a8; }
.cd .flow { fill: #d9480f; stroke: none; }
.cd .flow-line { stroke: #d9480f; stroke-width: 2; }
.cd .electron { fill: #1479a8; stroke: none; }
.cd .electron-line { stroke: #1479a8; stroke-width: 2; }
.cd .grid { stroke: rgba(10, 19, 38, .1); stroke-width: 1; }
.cd .axis { stroke-width: 2.2; }
.cd .curve { stroke: #d9480f; stroke-width: 3.2; }
.cd .curve-2 { stroke: #1479a8; stroke-width: 3.2; }
.cd .pt { fill: var(--hi); stroke: var(--ink); stroke-width: 2; }
.cd text.tick { font: 600 15px/1 Arial, Helvetica, sans-serif; fill: #4b5563; }
.cd text.axis-label { font: 800 16px/1 Arial, Helvetica, sans-serif; }
.cd .charge-dot { fill: var(--cyan); stroke: var(--ink); stroke-width: 2; }
/* Moving current arrowheads keep the orange of the fixed ones. */
.cd .charge-dot.flow { fill: #d9480f; stroke: none; }

/* Extra pictures drawn for the deck in the same style */
.cd .e-dot { fill: #4aa3d8; stroke: var(--ink); stroke-width: 1.6; }
.cd .e-minus { stroke: #fff; stroke-width: 2; }
.cd .gate { stroke: #d9480f; stroke-width: 2.4; stroke-dasharray: 6 5; }
.cd .case { fill: #dfe3e8; stroke-width: 3; }
.cd .w-live { stroke: #95582f; stroke-width: 6; }
.cd .w-neutral { stroke: #2876be; stroke-width: 6; }
.cd .w-earth { stroke-width: 6; }
.cd .inner { stroke-width: 2.5; }
.cd .heater { fill: #fdebe1; stroke-width: 2.5; }
.cd .spark { fill: var(--hi); stroke: var(--ink); stroke-width: 1.5; }
/* Static electricity (Mission 9): drawn larger than the circuits, with body-font labels. */
.cd text.sx { font: 700 30px/1 var(--font-body, Arial, sans-serif); fill: var(--ink); }
.cd text.sx.strong { font-weight: 800; }
.cd text.sx.neg { fill: var(--cyan); }
.cd text.sx.pos { fill: var(--hot); }
.cd .q-pos { fill: #e8590c; stroke: none; }
.cd .q-neg { fill: #1c7ed6; stroke: none; }
.cd .q-neutral { fill: #c3cad3; stroke: none; }
.cd .q-shine { fill: #fff; stroke: none; opacity: .35; }
.cd .charge-sign { stroke: #fff; }
.cd .sx-rod { fill: #e7ecf2; stroke-width: 3; }
.cd .sx-cloth { fill: #f3e2b3; stroke-width: 3; }
.cd .sx-thread { stroke-width: 2.5; }
.cd .sx-bar { stroke-width: 7; }
.cd .sx-divider { stroke: var(--card-border); stroke-width: 2; stroke-dasharray: 8 8; }
.cd .sx-force { stroke: var(--hot); stroke-width: 5; }
.cd .sx-force-head { fill: var(--hot); stroke: none; }
.cd .sx-eflow { stroke: var(--cyan); stroke-width: 4; stroke-dasharray: 10 8; }
.cd .sx-eflow-head { fill: var(--cyan); stroke: none; }
.cd .sx-fline { stroke-width: 3; }
.cd .sx-fline.faint { opacity: .55; }
.cd .sx-fline-head { fill: var(--ink); stroke: none; }
.cd .sx-metal { fill: #dfe3e8; stroke-width: 3; }
.cd .sx-column { fill: #f6efe0; stroke-width: 3; }
.cd .sx-zap { stroke: #f59f00; stroke-width: 6; }
.cd .sx-zap-glow { stroke: #ffd43b; stroke-width: 18; opacity: .45; }
[data-theme="dark"] .cd .sx-rod { fill: #2b3340; }
[data-theme="dark"] .cd .sx-cloth { fill: #5c4a26; }
[data-theme="dark"] .cd .sx-metal { fill: #3a424e; }
[data-theme="dark"] .cd .sx-column { fill: #4a4232; }
/* Live deck only: the electrons rise from the cloth, and the balls are charged and swing, on the click. */
@media screen {
  #deck .cd .sx-travel { transition: transform 1.3s cubic-bezier(.3, 0, .3, 1) .15s; }
  #deck .cd:not(:has(.k1.shown)) .sx-travel { transform: translate(var(--fx), var(--fy)); }
  #deck .cd .sx-swing { transform-box: view-box; transition: transform 1.1s cubic-bezier(.3, 0, .3, 1) .3s; }
  #deck .cd:not(:has(.k1.shown)) .sx-swing { transform: rotate(var(--rot)); }
  #deck .cd .sx-charged, #deck .cd .sx-forces { transition: opacity .35s ease; }
  #deck .cd .sx-forces { transition-delay: 1.2s; }
  #deck .cd:not(:has(.k1.shown)) .sx-charged, #deck .cd:not(:has(.k1.shown)) .sx-forces { opacity: 0; transition-delay: 0s; }
  .slide.active .cd .sx-zap-g { animation: sx-zap 2.4s steps(1) infinite; }
}
@keyframes sx-zap { 0%, 30%, 38%, 70%, 74% { opacity: 1; } 32%, 36%, 72%, 100% { opacity: 0; } 85% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #deck .cd .sx-travel, #deck .cd .sx-swing { transition: none; } .slide.active .cd .sx-zap-g { animation: none; } }

.cd text { font-size: 15px; }
.fig > .circuit-figure .cable-key { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 24px; }
.cable-key > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cable-key i { display: inline-block; width: 30px; height: 16px; margin-right: 4px; border: 2px solid var(--ink); border-radius: 8px; }
.cable-key-live { background: #915328; }
.cable-key-neutral { background: #2876be; }
.cable-key-earth { background: repeating-linear-gradient(135deg, #318b47 0 6px, #f7d83b 6px 12px); }
.cable-caption { display: block; margin-top: 6px; font-weight: 500; }

/* Symbol grid */
.fig-html .symbol-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px; margin: 0; }
.symbol-tile { margin: 0; padding: 12px 8px 12px; border: 2px solid var(--ink); background: var(--diagram-bg); text-align: center; box-shadow: 5px 5px 0 rgba(7, 22, 47, .1); }
.symbol-tile svg { display: block; width: 100%; height: 110px; }
.symbol-tile figcaption { margin-top: 8px; font-size: 24px; font-weight: 900; letter-spacing: .03em; text-transform: uppercase; line-height: 1.15; }

/* National Grid route (Diagrams.nationalGrid), scaled up */
.fig-html .circuit-figure { margin: 0; padding: 0; border: 0; background: none; }
.grid-route ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.grid-route > ol { position: relative; }
.grid-route > ol::before { content: ""; position: absolute; z-index: 1; left: 34px; top: 36px; bottom: 36px; width: 5px; background: var(--ink); }
.grid-route .grid-stage { position: relative; margin: 0; padding: 0; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; align-items: center; }
.grid-stage + .grid-stage::after, .grid-band + .grid-stage::after, .grid-band ol > .grid-stage:first-child::after { content: ""; position: absolute; z-index: 2; left: 25px; top: -16px; border-inline: 11px solid transparent; border-top: 13px solid var(--ink); }
.grid-icon { position: relative; z-index: 3; width: 72px; height: 72px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: #fff; }
.grid-icon svg { width: 54px; height: 54px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.grid-icon .coil { stroke: #b8660b; stroke-width: 2.6; }
.grid-icon .bolt { fill: var(--hi); stroke-width: 1.5; }
.grid-stage-up .grid-icon { background: #fff4c7; }
.grid-stage-cables .grid-icon { background: #fdebe1; }
.grid-stage-down .grid-icon { background: #e2f7fb; }
.grid-stage-homes .grid-icon { background: #eaf7d5; }
.grid-text { font-size: 25px; line-height: 1.3; }
.grid-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 3px; }
.grid-head strong { font-size: 22px; letter-spacing: .08em; text-transform: uppercase; }
.grid-pd { padding: 2px 9px; border: 2px solid var(--ink); border-radius: 999px; font: 800 20px/1.3 Arial, Helvetica, sans-serif; white-space: nowrap; }
.grid-pd.pd-low { background: #d7f0b0; }
.grid-pd.pd-mid { background: #ffe89a; }
.grid-pd.pd-high { background: #d9480f; border-color: #d9480f; color: #fff; }
.grid-route .grid-band { position: relative; margin: 2px -10px; padding: 12px 8px 14px; border: 2px dashed #1479a8; border-radius: 16px; background: #e9f7fb; }
.grid-band-tag { display: block; margin: 0 4px 12px 86px; font-size: 22px; font-weight: 700; color: #0f5f85; line-height: 1.2; }
.grid-band-tag strong { margin-right: 6px; font-size: 22px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--navy); }

/* Hero circuit card (companion home page) */
.machine { position: relative; display: grid; place-items: center; height: 640px; }
.circuit-card { width: 540px; padding: 26px; background: var(--paper); color: var(--ink); transform: rotate(2deg); box-shadow: 18px 18px 0 var(--cyan); }
.circuit-card .plot-label { padding-bottom: 12px; border-bottom: 2px solid; font: 900 22px Arial, sans-serif; letter-spacing: .2em; }
.circuit-card svg { display: block; width: 100%; height: auto; margin-top: 16px; background: var(--diagram-bg); }
.circuit-card p { margin: 18px 0 0; font: 900 28px/1.08 var(--display); text-transform: uppercase; letter-spacing: -.04em; }
.machine .stamp.one { left: -24px; right: auto; top: -64px; transform: rotate(-9deg); }
.machine .stamp.two { top: auto; right: -16px; bottom: 80px; transform: rotate(6deg); }
.machine .stamp { right: -16px; top: 40px; border-color: var(--hot); color: var(--hot); }

/* Section card with a diagram */
.case-card .fig { height: 300px; margin-top: 16px; background: var(--diagram-bg); border: 2px solid var(--ink); }
.case-card .fig > .circuit-figure { padding: 10px; }

/* Equation toolkit */
.toolkit { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.tool { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px; border: 2px solid var(--ink); background: var(--card); box-shadow: 6px 6px 0 var(--accent); }
.tool .eq { font: 900 38px/1.05 var(--display); letter-spacing: -.03em; }
.tool .eq.long { font-size: 33px; } /* the widest equation */
.tool .words { font-size: 24px; font-weight: 800; }
.tool .units { font-size: 24px; color: var(--muted); line-height: 1.35; }
.tool .where { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); font: 900 20px Arial, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tool.given { background: #f1edff; }
/* Three across, so each word equation fits on one line at full size. */
.toolkit.three { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, 1fr); gap: 12px; }
.toolkit.three .tool { gap: 4px; padding: 12px 22px; }
.toolkit.three .tool .where { padding-top: 6px; }

/* Two sketch cards side by side */
.sketch-card { display: flex; flex-direction: column; }
.sketch-card .fig { flex: 1; min-height: 0; height: auto; margin: 10px 0 12px; }

/* Mission 2: a length of copper wire with drifting free electrons */
.cd .wire-body { stroke: #6b3514; stroke-width: 2.5; }
.cd .wire-face { fill: #f0b27c; stroke: #6b3514; stroke-width: 2.5; }
.cd .wire-ion { fill: #fbe3c6; stroke: #7a3f18; stroke-width: 1.4; }
.cd .wire-ion-plus { stroke: #7a3f18; stroke-width: 1.6; }
.cd .e-drift { animation: e-drift 14s linear infinite; }
.cd .e-jig { animation: e-jig 1.1s ease-in-out infinite alternate; }
@keyframes e-drift { to { transform: translateX(-380px); } }
@keyframes e-jig { from { transform: translateY(-3px); } to { transform: translateY(3px); } }

/* Mission 4: live lattice simulation (cool vs hot metal) */
.cd .lattice-panel { stroke: none; }
.cd .lattice-edge { fill: none; stroke-width: 2.5; }
.cd .lattice-panel.cool { fill: #e8f4fa; }
.cd .lattice-panel.hot { fill: #fdebe1; }
.cd .lattice-ion { fill: #f7d278; stroke-width: 1.6; transition: fill .15s; }
.cd .lattice-ion.hit { fill: #ff8a3d; }
.cd .lattice-ion-plus { stroke-width: 1.8; }
.cd text.lattice-title { font: 900 17px/1 Arial, Helvetica, sans-serif; letter-spacing: .06em; }
.cd text.lattice-count { font: 800 16px/1 Arial, Helvetica, sans-serif; }

/* The finished earth-fault picture has a melted fuse: no wire through it, a hot tint and a gap. */
.cd .fuse-wire { opacity: 0; }
.cd .fuse-blown { fill: #ffd2c2; stroke: #d9480f; stroke-width: 2.5; }
.cd .fuse-ends { stroke-width: 3; }
.cd .fuse-flash { opacity: 0; transform-box: fill-box; transform-origin: center; }
@keyframes fuse-flash { 0% { opacity: 0; transform: scale(.3); } 25% { opacity: 1; transform: scale(1.6); } 60% { opacity: 1; transform: scale(1.2); } 100% { opacity: 0; transform: scale(1.8); } }
/* The finished earth-fault picture has the live wire broken away from the heater. */
.cd .live-to-heater { opacity: 0; transition: opacity .3s ease; }
/* Mission 8: the earth-fault diagram builds in three clicks. Scoped to the live
   deck on screen, so thumbnails and print keep the finished diagram. */
@media screen {
  #deck .cd .step:not(.shown) { transform: none; }
  #deck .cd:not(:has(.k1.shown)) .live-to-heater { opacity: 1; }
  #deck .cd .k2.shown .flow-line { animation: fault-flow .5s linear infinite; }
  #deck .cd .fault-current, #deck .cd .fuse-wire { transition: opacity .5s ease; }
  /* Once the fuse has melted its wire is gone and the fault current stops. */
  #deck .cd:not(:has(.k3.shown)) .fuse-wire { opacity: 1; }
  #deck .cd .k3.shown .fuse-flash { animation: fuse-flash 1s ease-out both; }
  #deck .cd:has(.k3.shown) .fault-current { opacity: .25; }
  #deck .cd:has(.k3.shown) .flow-line { animation: none; }
}
/* Thumbnails show the built diagram complete. */
.thumb-slide .cd .step:not(.shown) { opacity: 1; transform: none; }
@keyframes fault-flow { to { stroke-dashoffset: -11; } }
@media print { .cd .charge-dot { display: none; } }

.thumb-slide .cd .e-drift, .thumb-slide .cd .e-jig { animation: none; }
@media (prefers-reduced-motion: reduce) { .cd .e-drift, .cd .e-jig, #deck .cd .k2.shown .flow-line, #deck .cd .k3.shown .fuse-flash { animation: none; } }

/* Proportionality sign, drawn because the display fonts have no ∝ glyph */
.prop { display: inline-block; width: .9em; height: .56em; vertical-align: .02em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
h2 .prop { stroke-width: 3.4; }

/* Photo slides. Component pictures are shared with the companion site
   (year10phy/unit01/assets/components/); the others are in images/, each with a credit
   that links to its source. */
.components { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr; gap: 26px 30px; }
.component { display: flex; flex-direction: column; min-height: 0; margin: 0; border: 2px solid var(--ink); background: #f9f7f2; box-shadow: 7px 7px 0 var(--accent); }
.component img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.component figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 9px 16px; border-top: 2px solid var(--ink); background: var(--card); font-size: 24px; }
.component figcaption > b { font: 900 22px Arial, sans-serif; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.component figcaption span b { font-weight: 900; }
.photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; }
.photo { margin: 0; }
.photo img { display: block; width: 100%; height: 430px; object-fit: cover; border: 2px solid var(--ink); box-shadow: 9px 9px 0 var(--accent); }
.photo figcaption { margin-top: 22px; font-size: 26px; line-height: 1.3; }
.photo figcaption b { font-weight: 900; }
.photo .credit { display: block; margin-top: 6px; font-size: 15px; font-weight: 600; color: var(--muted); }
.photo .credit a { color: inherit; }
.plug-split { grid-template-columns: auto 1fr; }
.plug-split .photo img { width: 540px; height: 540px; }
.plug-split .photo figcaption { margin-top: 16px; }
.wires { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.wires li { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 20px; padding: 16px 20px 16px 34px; border: 2px solid var(--ink); background: var(--card); font-size: 30px; line-height: 1.25; position: relative; }
.wires li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 16px; border-right: 2px solid var(--ink); background: var(--wire); }
.wires li > b { font: 900 24px Arial, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.wires span b { font-weight: 900; }
.wires .earth { --wire: repeating-linear-gradient(135deg, #2e9e4f 0 9px, #f2d21b 9px 18px); }
.wires .neutral { --wire: #2f6fd6; }
.wires .live { --wire: #8a4b2a; }

/* ----- news slides (as in the Year 9 decks; Mission 9 story) ----- */
.masthead { display: flex; align-items: center; gap: 22px; padding-bottom: 14px; border-bottom: 6px double var(--ink); }
.masthead .paper-name { font: 900 44px/1 var(--display); letter-spacing: -.05em; text-transform: uppercase; }
.masthead .dateline { margin-left: auto; font: 900 20px Arial, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.masthead .edition { padding: 6px 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--accent); font: 900 20px Arial, sans-serif; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.front { display: grid; grid-template-columns: 690px 1fr; gap: 50px; margin-top: 28px; }
.news-photo { margin: 0; min-height: 0; }
.news-photo img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: cover; border: 2px solid var(--ink); box-shadow: 10px 10px 0 var(--accent); background: #05060c; }
.news-photo figcaption { margin-top: 22px; font-size: 24px; font-weight: 700; line-height: 1.3; }
.news-photo .credit { display: block; margin-top: 5px; font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: none; }
.news-photo .credit a { color: inherit; }
.story { display: flex; flex-direction: column; min-height: 0; }
.story .kicker { align-self: flex-start; margin: 0; padding: 6px 13px; background: var(--ink); color: var(--paper); font: 900 20px Arial, sans-serif; letter-spacing: .2em; text-transform: uppercase; }
.story h2 { margin: 18px 0 20px; font-size: 62px; }
.story .standfirst { margin: 0; font-size: 29px; font-weight: 700; line-height: 1.3; }
.story .follow-up { margin: 22px 0 0; padding: 12px 18px 14px; border-left: 8px solid var(--accent); background: var(--card); font-size: 26px; line-height: 1.3; }
.story .ask { margin: auto 0 0; padding: 14px 20px 16px; border: 2px solid var(--ink); background: var(--accent); font-size: 28px; font-weight: 800; line-height: 1.2; box-shadow: 6px 6px 0 rgba(7, 22, 47, .12); }
.story .follow-up b, .story .ask b { display: block; margin-bottom: 5px; font: 900 20px Arial, sans-serif; letter-spacing: .18em; text-transform: uppercase; }
.story .follow-up b { color: var(--muted); }
/* An engraving on white keeps its whole page in view. */
.news-photo.engraving img { object-fit: contain; background: #fff; }
