:root {
  --ink: #182528;
  --paper: #f7f0df;
  --paper-deep: #e8deca;
  --blue: #0849b8;
  --yellow: #ffd31a;
  --orange: #b8320d;
  --mint: #bfe5d5;
  --line: rgba(24, 37, 40, .22);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --body: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { background: #d8cfbd; color: var(--ink); }

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(24, 37, 40, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 37, 40, .035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  font-family: var(--body);
  line-height: 1.55;
}

a { color: inherit; }
button { font: inherit; }
img, svg { display: block; max-width: 100%; }

.page-noise {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

.site-shell { width: min(1420px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 19px; font-weight: 800; letter-spacing: -.04em; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 50%; font: 500 13px var(--mono); box-shadow: 4px 4px 0 var(--ink); }
.header-note, .eyebrow, .section-number, .meta-line, .viewer-label { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 30px; }
.header-note { margin: 0; }
.site-nav { display: flex; align-items: center; gap: 5px; }
.site-nav a { padding: 8px 11px; text-decoration: none; font: 500 12px var(--mono); text-transform: uppercase; border: 1px solid transparent; }
.site-nav a:hover { color: var(--blue); }
.site-nav a[aria-current="page"] { color: white; background: var(--blue); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }

.home-hero {
  min-height: 530px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 72px 4vw 62px;
  border-bottom: 2px solid var(--ink);
  overflow: hidden;
}

.home-hero::before { content: ""; position: absolute; width: 360px; height: 360px; right: 15%; top: 70px; border: 2px solid var(--ink); border-radius: 50%; opacity: .12; }
.hero-copy { position: relative; z-index: 1; max-width: 900px; }
.eyebrow { margin: 0 0 20px; color: var(--blue); }
.home-hero h1, .project-hero h1, .not-found h1 { margin: 0; font-size: clamp(58px, 8vw, 126px); line-height: .86; letter-spacing: -.08em; font-weight: 800; }
.home-hero h1 em { color: var(--blue); font-style: normal; }
.hero-intro { max-width: 650px; margin: 34px 0 0; font-size: clamp(18px, 2vw, 25px); line-height: 1.45; font-weight: 600; }
.hero-stamp { position: relative; z-index: 1; width: 180px; height: 180px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--paper); background: var(--orange); border: 2px solid var(--ink); border-radius: 50%; transform: rotate(7deg); box-shadow: 9px 9px 0 var(--ink); }
.hero-stamp strong { font-size: 64px; line-height: 1; letter-spacing: -.08em; }
.hero-stamp span { font: 500 12px/1.35 var(--mono); }
.spark-line { position: absolute; right: -40px; bottom: 35px; display: flex; align-items: center; transform: rotate(-8deg); }
.spark-line span { width: 120px; height: 9px; background: var(--blue); }
.spark-line i { width: 54px; height: 54px; border: 9px solid var(--blue); border-radius: 50%; }

.catalog { padding: 80px 0 100px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 35px; }
.section-heading h2, .paper-panel h2, .note-panel h2 { margin: 6px 0 0; font-size: clamp(30px, 4vw, 58px); line-height: 1; letter-spacing: -.06em; }
.section-heading > p { max-width: 430px; margin: 0; font-size: 15px; }
.section-number { margin: 0; color: var(--blue); }

.circuit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.circuit-card { position: relative; display: grid; grid-template-columns: 47% 1fr; min-height: 390px; overflow: hidden; color: var(--ink); text-decoration: none; background: rgba(255, 252, 242, .8); border: 2px solid var(--ink); box-shadow: 7px 7px 0 var(--ink); transition: transform .2s ease, box-shadow .2s ease; }
.circuit-card:hover { transform: translate(-3px, -3px); box-shadow: 11px 11px 0 var(--blue); }
.circuit-card.is-featured { grid-column: 1 / -1; grid-template-columns: 55% 1fr; min-height: 500px; }
.circuit-card[hidden] { display: none; }
.card-index { position: absolute; z-index: 2; top: 13px; left: 13px; display: grid; place-items: center; width: 42px; height: 42px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 50%; font: 500 12px var(--mono); }
.card-diagram { display: grid; place-items: center; min-width: 0; padding: 30px; background: var(--mint); border-right: 2px solid var(--ink); }
.card-diagram img { width: 100%; height: 100%; max-height: 440px; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(24, 37, 40, .12)); }
.card-copy { display: flex; flex-direction: column; padding: 28px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 7px; }
.meta-line span { padding: 5px 8px; border: 1px solid var(--ink); }
.card-copy h2 { margin: auto 0 14px; font-size: clamp(28px, 3vw, 48px); line-height: .98; letter-spacing: -.06em; }
.card-copy p { margin: 0 0 28px; color: #435156; }
.card-footer { display: flex; justify-content: space-between; padding-top: 18px; border-top: 1px solid var(--line); font: 500 12px var(--mono); text-transform: uppercase; }
.card-footer strong { color: var(--blue); }

.catalog-filter { display: grid; grid-template-columns: minmax(220px, 1.2fr) minmax(160px, .5fr) minmax(360px, 2fr) auto; gap: 14px; align-items: end; margin: 0 0 28px; padding: 18px; background: rgba(255, 252, 242, .92); border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); }
.catalog-filter label, .filter-topics { display: grid; gap: 7px; }
.catalog-filter label > span, .filter-topics > span { font: 500 10px var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.catalog-filter input, .catalog-filter select { width: 100%; height: 42px; padding: 0 12px; color: var(--ink); background: white; border: 1px solid var(--ink); border-radius: 0; font: 500 12px var(--mono); }
.catalog-filter input:focus, .catalog-filter select:focus { outline: 3px solid var(--yellow); outline-offset: 1px; }
.filter-topics > div { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-topics a, .filter-status button { min-height: 42px; padding: 8px 11px; cursor: pointer; color: var(--ink); background: white; border: 1px solid var(--ink); font: 500 10px var(--mono); text-transform: uppercase; }
.filter-topics a { display: inline-flex; align-items: center; text-decoration: none; }
.filter-topics a[aria-pressed="true"] { color: white; background: var(--blue); box-shadow: 3px 3px 0 var(--ink); }
.filter-status { min-width: 112px; display: grid; justify-items: end; gap: 5px; }
.filter-status output { font: 500 10px var(--mono); white-space: nowrap; text-transform: uppercase; }
.filter-status button { min-height: auto; padding: 5px 0; color: var(--blue); background: transparent; border: 0; text-decoration: underline; }
.catalog-empty { margin-top: 24px; padding: 60px 24px; text-align: center; background: var(--paper-deep); border: 2px dashed var(--ink); }
.catalog-empty[hidden] { display: none; }
.catalog-empty strong { font-size: 28px; }
.catalog-empty p { margin: 8px 0 0; }

footer { min-height: 100px; display: flex; justify-content: space-between; align-items: center; border-top: 2px solid var(--ink); font: 500 12px var(--mono); text-transform: uppercase; }
footer a { text-decoration: none; }

.breadcrumb { display: flex; gap: 10px; padding: 22px 0; font: 500 12px var(--mono); text-transform: uppercase; }
.breadcrumb a { color: var(--blue); }
.project-hero { display: grid; grid-template-columns: 1fr auto; gap: 50px; align-items: end; padding: 60px 4vw 55px; border: 2px solid var(--ink); background: var(--yellow); }
.project-hero h1 { max-width: 980px; font-size: clamp(52px, 7vw, 110px); }
.project-hero > div > p:last-child { max-width: 720px; margin: 27px 0 0; font-size: 20px; font-weight: 600; }
.project-facts { display: grid; grid-template-columns: repeat(2, 110px); margin: 0; border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); }
.project-facts div { padding: 14px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.project-facts dt { font: 500 10px var(--mono); text-transform: uppercase; }
.project-facts dd { margin: 4px 0 0; font-size: 18px; font-weight: 800; }
.related-projects { margin-top: 90px; padding-top: 55px; border-top: 2px solid var(--ink); }
.related-project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.category-hero { padding: clamp(45px, 8vw, 95px) 4vw; color: white; background: var(--blue); border: 2px solid var(--ink); }
.category-hero .eyebrow { color: var(--yellow); }
.category-hero h1 { max-width: 1050px; margin: 0; font-size: clamp(52px, 8vw, 112px); line-height: .9; letter-spacing: -.075em; }
.category-hero > p:last-child { max-width: 760px; margin: 28px 0 0; font-size: 20px; }
.category-projects { padding: 70px 0 100px; }

.viewer { margin-top: 26px; border: 2px solid var(--ink); background: #fffdf5; box-shadow: 9px 9px 0 var(--ink); }
.viewer-topline { min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 10px 16px; border-bottom: 2px solid var(--ink); }
.viewer-title { font: 500 12px var(--mono); letter-spacing: .08em; }
.diagram-stage { display: grid; place-items: center; min-height: 540px; padding: 35px; background: var(--mint); }
.final-diagram { width: min(100%, 1050px); animation: diagram-in .3s ease-out; }
.final-diagram figure { margin: 0; }
.final-diagram img { width: 100%; max-height: 650px; object-fit: contain; filter: drop-shadow(0 15px 20px rgba(24, 37, 40, .17)); }
.final-diagram figcaption { margin-top: 16px; text-align: center; font: 500 11px var(--mono); }
.learning-strip { display: grid; grid-template-columns: 190px 1fr; gap: 22px; margin-top: 26px; padding: 22px 26px; color: white; background: var(--ink); border: 2px solid var(--ink); }
.learning-strip strong { color: var(--yellow); font: 500 12px var(--mono); text-transform: uppercase; }
.learning-strip ul { margin: 0; padding-left: 20px; }
.learning-strip li + li { margin-top: 8px; }

.content-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 72px; }
.paper-panel, .note-panel { border: 2px solid var(--ink); background: rgba(255, 252, 242, .9); padding: clamp(24px, 4vw, 55px); }
.parts-list { list-style: none; margin: 35px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.parts-list li { display: grid; grid-template-columns: 52px 1fr; align-items: center; min-height: 76px; border-bottom: 1px solid var(--line); }
.part-quantity { font: 500 13px var(--mono); }
.parts-list strong, .parts-list small { display: block; }
.parts-list small { margin-top: 4px; color: #647176; font: 500 10px var(--mono); text-transform: uppercase; }
.explanation-panel { background: var(--blue); color: white; }
.explanation-panel .section-number { color: var(--yellow); }
.explanation-panel > p:not(.section-number) { max-width: 650px; font-size: 18px; }
.explanation-panel .topic-deep-link a { color: var(--yellow); font-weight: 800; }
.build-steps { display: grid; gap: 16px; margin: 32px 0 0; padding: 0; list-style: none; }
.build-steps li { display: grid; grid-template-columns: 42px 1fr; gap: 14px; align-items: start; }
.build-steps span { display: grid; place-items: center; width: 38px; height: 38px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 50%; font: 500 12px var(--mono); }
.build-steps p { margin: 5px 0 0; }
.test-panel { background: var(--mint); }
.test-panel dl { margin: 30px 0 0; border-top: 2px solid var(--ink); }
.test-panel dl div { padding: 20px 0; border-bottom: 1px solid var(--line); }
.test-panel dt { color: var(--blue); font: 500 11px var(--mono); text-transform: uppercase; }
.test-panel dd { margin: 8px 0 0; font-size: 18px; font-weight: 700; }
.principle-note { margin-top: 40px; padding: 20px; color: var(--ink); background: var(--yellow); border: 2px solid var(--ink); transform: rotate(-1deg); }
.principle-note span, .principle-note strong { display: block; }
.principle-note span { font: 500 10px var(--mono); }
.principle-note strong { margin-top: 8px; font-size: 21px; }
.secondary-content { margin-top: 26px; margin-bottom: 90px; }
.note-panel ul { padding-left: 20px; }
.note-panel li { margin: 12px 0; }
.safety-panel { background: var(--orange); color: white; }
.safety-panel .section-number { color: var(--yellow); }
.faq-section { margin: 0 0 90px; padding: clamp(28px, 5vw, 58px); background: rgba(255, 252, 242, .92); border: 2px solid var(--ink); }
.faq-section h2 { margin: 7px 0 30px; font-size: clamp(34px, 5vw, 64px); line-height: 1; letter-spacing: -.06em; }
.faq-section details { border-top: 1px solid var(--ink); }
.faq-section details:last-child { border-bottom: 1px solid var(--ink); }
.faq-section summary { padding: 20px 0; cursor: pointer; font-size: 18px; font-weight: 800; }
.faq-section details p { max-width: 850px; margin: -6px 0 22px; }

.not-found { min-height: 70vh; display: grid; align-content: center; justify-items: start; padding: 10vw; }
.not-found h1 { max-width: 900px; }
.not-found > p:not(.eyebrow) { font-size: 20px; }
.button-link { display: inline-block; margin-top: 20px; padding: 13px 18px; color: white; background: var(--blue); border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); text-decoration: none; font-weight: 800; }

.parts-hero { min-height: 430px; display: grid; grid-template-columns: 1fr auto; gap: 60px; align-items: center; padding: 64px 4vw; color: white; background: var(--blue); border: 2px solid var(--ink); }
.parts-hero .eyebrow { color: var(--yellow); }
.parts-hero h1 { margin: 0; font-size: clamp(54px, 7vw, 104px); line-height: .87; letter-spacing: -.08em; }
.parts-hero h1 em { color: var(--yellow); font-style: normal; }
.parts-hero > div > p:last-child { max-width: 720px; margin: 28px 0 0; font-size: 18px; }
.parts-total { width: 190px; height: 190px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--ink); background: var(--yellow); border: 2px solid var(--ink); border-radius: 50%; box-shadow: 9px 9px 0 var(--ink); transform: rotate(5deg); }
.parts-total strong { font-size: 55px; line-height: 1; letter-spacing: -.07em; }
.parts-total span { font: 500 11px/1.4 var(--mono); }
.category-index { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 28px 0 0; border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); }
.category-index a { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 15px; text-decoration: none; background: rgba(255, 252, 242, .9); border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); font: 500 11px var(--mono); text-transform: uppercase; }
.category-index a:hover { color: white; background: var(--orange); }
.category-index strong { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 5px; color: var(--ink); background: var(--yellow); border: 1px solid var(--ink); border-radius: 50%; }
.parts-catalog { padding: 34px 0 100px; }
.part-category { padding: 58px 0 24px; scroll-margin-top: 20px; }
.part-category + .part-category { border-top: 2px solid var(--ink); }
.part-category-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px; }
.part-category-heading h2 { margin: 5px 0 0; font-size: clamp(36px, 5vw, 68px); line-height: .95; letter-spacing: -.065em; }
.part-category-heading > span { padding: 7px 10px; border: 1px solid var(--ink); font: 500 11px var(--mono); text-transform: uppercase; }
.part-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; }
.part-card { min-width: 0; background: rgba(255, 252, 242, .92); border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); }
.part-artwork { height: 240px; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--mint); border-bottom: 2px solid var(--ink); overflow: hidden; }
.part-artwork img { width: auto; height: auto; max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; object-position: center; filter: drop-shadow(0 8px 9px rgba(24, 37, 40, .16)); }
.part-card-copy { padding: 18px; }
.part-ref { min-height: 18px; margin: 0; color: var(--blue); font: 500 11px var(--mono); text-transform: uppercase; }
.part-card h3 { margin: 8px 0 10px; font-size: 21px; line-height: 1.1; letter-spacing: -.035em; }
.part-card-copy > p:not(.part-ref) { min-height: 62px; margin: 0; color: #526064; font-size: 12px; }
.part-card dl { display: grid; grid-template-columns: 1fr 1fr; margin: 16px 0 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.part-card dl div { padding: 9px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.part-card dt { color: #657176; font: 500 9px var(--mono); text-transform: uppercase; }
.part-card dd { margin: 3px 0 0; font-size: 14px; font-weight: 800; }

/* Protected circuit administration */
.admin-shell { width: min(1500px, calc(100% - 40px)); margin: 0 auto; }
.admin-header { min-height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--ink); }
.admin-header > div { display: flex; align-items: center; gap: 18px; }
.admin-kicker { font: 500 11px var(--mono); letter-spacing: .1em; }
.admin-logout, .admin-pagination button, .admin-login button { cursor: pointer; border: 2px solid var(--ink); font: 500 11px var(--mono); text-transform: uppercase; }
.admin-logout { padding: 9px 12px; color: white; background: var(--orange); }
.admin-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 34px; }
.admin-sidebar { position: sticky; top: 0; align-self: start; min-height: calc(100vh - 88px); padding: 58px 20px 40px 0; border-right: 2px solid var(--ink); }
.admin-sidebar > p { margin: 0 0 16px; color: #657176; font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.admin-sidebar nav { display: grid; gap: 8px; }
.admin-sidebar a { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 9px; min-height: 48px; padding: 9px 11px; border: 2px solid transparent; text-decoration: none; font-size: 13px; font-weight: 800; }
.admin-sidebar a span { color: #657176; font: 500 10px var(--mono); }
.admin-sidebar a:hover { color: var(--blue); }
.admin-sidebar a[aria-current="page"] { color: white; background: var(--blue); border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.admin-sidebar a[aria-current="page"] span { color: var(--yellow); }
.admin-main { padding: 58px 0 100px; }
.admin-login { width: min(620px, 100%); margin: 7vh auto 0; padding: clamp(28px, 5vw, 60px); background: rgba(255, 252, 242, .95); border: 2px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); }
.admin-login h1, .admin-titlebar h1 { margin: 8px 0 0; font-size: clamp(44px, 7vw, 86px); line-height: .9; letter-spacing: -.07em; }
.admin-login > p:not(.section-number, .admin-error) { margin: 22px 0 30px; color: #4d5b5f; }
.admin-login form { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.admin-login label { display: grid; gap: 8px; }
.admin-login label span { font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.admin-login input { width: 100%; height: 48px; padding: 0 14px; background: white; border: 2px solid var(--ink); font: 500 13px var(--mono); }
.admin-login input:focus { outline: 4px solid var(--yellow); outline-offset: 1px; }
.admin-login button { height: 48px; padding: 0 20px; color: white; background: var(--blue); box-shadow: 4px 4px 0 var(--ink); }
.admin-error { margin: 20px 0 0; padding: 12px 14px; color: #741d09; background: #ffd7c8; border: 1px solid #741d09; font: 500 12px var(--mono); }
.admin-titlebar { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.admin-titlebar > p { margin: 0; font: 500 12px var(--mono); text-transform: uppercase; }
.admin-list-tools { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: -10px 0 30px; padding-bottom: 16px; border-bottom: 2px solid var(--ink); }
.admin-publish-filter { display: flex; gap: 8px; }
.admin-publish-filter button { min-width: 130px; padding: 11px 18px; cursor: pointer; color: var(--ink); background: #fffdf5; border: 2px solid var(--ink); font: 500 11px var(--mono); }
.admin-publish-filter button[aria-selected="true"] { color: white; background: var(--blue); box-shadow: 4px 4px 0 var(--ink); }
.admin-publish-filter button:disabled { cursor: wait; opacity: .6; }
.admin-batch-tools { display: flex; align-items: center; gap: 13px; }
.admin-batch-tools span { color: #566367; font: 500 10px var(--mono); }
.admin-batch-tools button { min-height: 43px; padding: 9px 15px; cursor: pointer; color: white; background: var(--orange); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font: 500 10px var(--mono); text-transform: uppercase; }
.admin-batch-tools button:disabled { cursor: wait; opacity: .55; box-shadow: none; }
.admin-loading, .admin-empty { padding: 40px; text-align: center; background: var(--paper-deep); border: 2px dashed var(--ink); font: 500 12px var(--mono); text-transform: uppercase; }
.admin-circuit-list { display: grid; gap: 22px; }
.admin-circuit-card { background: rgba(255, 252, 242, .95); border: 2px solid var(--ink); box-shadow: 7px 7px 0 var(--ink); }
.admin-circuit-card > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 24px; cursor: pointer; list-style: none; }
.admin-circuit-card > summary::-webkit-details-marker { display: none; }
.admin-circuit-card > summary::before { content: "+"; grid-row: 1; align-self: start; display: grid; place-items: center; width: 34px; height: 34px; color: white; background: var(--blue); border: 2px solid var(--ink); font: 500 20px var(--mono); }
.admin-circuit-card[open] > summary::before { content: "−"; background: var(--orange); }
.admin-circuit-heading { grid-column: 1; display: grid; padding-left: 50px; margin-top: -34px; }
.admin-circuit-heading strong { font-size: clamp(25px, 3vw, 42px); line-height: 1; letter-spacing: -.045em; }
.admin-circuit-heading small { max-width: 780px; margin-top: 10px; color: #536166; font-size: 13px; }
.admin-circuit-slug { margin-bottom: 7px; color: var(--blue); font: 500 10px var(--mono); text-transform: uppercase; }
.admin-circuit-meta { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; }
.admin-circuit-meta > span { padding: 6px 9px; border: 1px solid var(--ink); font: 500 10px var(--mono); text-transform: uppercase; white-space: nowrap; }
.admin-circuit-meta .admin-status-published { color: white; background: #14724b; }
.admin-circuit-meta .admin-status-draft { background: var(--yellow); }
.admin-circuit-meta .admin-status-archived { color: white; background: #687276; }
.admin-preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 20px; background: #fffdf5; border-top: 2px solid var(--ink); }
.admin-preview-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; color: #566367; font: 500 10px var(--mono); }
.admin-preview-status a { padding: 5px 8px; color: white; background: #14724b; border: 1px solid var(--ink); text-decoration: none; text-transform: uppercase; }
.admin-generate-button { flex: 0 0 auto; min-height: 40px; padding: 8px 13px; cursor: pointer; color: white; background: var(--blue); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font: 500 10px var(--mono); text-transform: uppercase; }
.admin-generate-button:disabled { cursor: wait; opacity: .65; box-shadow: none; }
.admin-final-diagram { position: relative; display: grid; place-items: center; min-height: 420px; padding: clamp(18px, 4vw, 48px); background: var(--mint); border-top: 2px solid var(--ink); overflow: hidden; }
.admin-preview-media { width: 100%; display: grid; place-items: center; }
.admin-preview-media > img { width: min(100%, 1080px); max-height: 620px; object-fit: contain; filter: drop-shadow(0 12px 16px rgba(24, 37, 40, .17)); }
.admin-draft-svg { width: min(100%, 1080px); }
.admin-draft-svg svg { width: 100%; max-height: 620px; filter: drop-shadow(0 12px 16px rgba(24, 37, 40, .17)); }
.admin-format-tabs { position: absolute; z-index: 2; top: 16px; left: 16px; display: flex; gap: 5px; }
.admin-format-tabs button { min-width: 58px; padding: 7px 10px; cursor: pointer; color: var(--ink); background: #fffdf5; border: 2px solid var(--ink); font: 500 10px var(--mono); letter-spacing: .08em; }
.admin-format-tabs button[aria-selected="true"] { color: white; background: var(--blue); box-shadow: 3px 3px 0 var(--ink); }
.admin-format-tabs button:disabled { cursor: not-allowed; opacity: .4; }
.admin-svg-source[hidden] { display: none; }
.admin-pagination { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 42px; }
.admin-pagination button { min-width: 120px; padding: 11px 14px; background: white; box-shadow: 3px 3px 0 var(--ink); }
.admin-pagination button:disabled { cursor: not-allowed; opacity: .4; box-shadow: none; }
.admin-pagination span { min-width: 110px; text-align: center; font: 500 11px var(--mono); }
.admin-parts-dashboard { min-width: 0; }
.admin-parts-dashboard .parts-hero { min-height: 360px; }

@keyframes diagram-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 900px) {
  .home-hero { min-height: auto; grid-template-columns: 1fr; padding: 65px 0; }
  .hero-stamp { width: 140px; height: 140px; margin: 50px 0 0 auto; }
  .hero-stamp strong { font-size: 50px; }
  .circuit-grid, .content-layout { grid-template-columns: 1fr; }
  .circuit-card, .circuit-card.is-featured { grid-column: auto; grid-template-columns: 1fr; }
  .card-diagram { min-height: 320px; border-right: 0; border-bottom: 2px solid var(--ink); }
  .project-hero { grid-template-columns: 1fr; }
  .project-facts { width: max-content; }
  .catalog-filter { grid-template-columns: 1fr 1fr; }
  .filter-topics, .filter-status { grid-column: 1 / -1; }
  .filter-status { justify-items: start; grid-template-columns: 1fr auto; align-items: center; }
  .parts-hero { grid-template-columns: 1fr; }
  .parts-total { margin-left: auto; }
  .category-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .part-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 580px) {
  .site-shell { width: min(100% - 22px, 1420px); }
  .header-note { display: none; }
  .header-actions { gap: 0; }
  .site-nav a { padding: 7px; font-size: 10px; }
  .home-hero h1, .project-hero h1 { font-size: 50px; }
  .section-heading { align-items: start; flex-direction: column; }
  .catalog-filter { grid-template-columns: 1fr; }
  .filter-topics, .filter-status { grid-column: auto; }
  .filter-status { grid-template-columns: 1fr auto; }
  .circuit-card { box-shadow: 5px 5px 0 var(--ink); }
  .project-hero { padding: 35px 20px; }
  .project-facts { grid-template-columns: repeat(2, 1fr); width: 100%; }
  .learning-strip { grid-template-columns: 1fr; }
  .viewer-topline { align-items: start; flex-direction: column; }
  .diagram-stage { min-height: 340px; padding: 12px; }
  .parts-list li { grid-template-columns: 42px 1fr; }
  footer { align-items: start; flex-direction: column; justify-content: center; gap: 10px; }
  .parts-hero { min-height: auto; padding: 42px 20px; }
  .parts-hero h1 { font-size: 50px; }
  .parts-total { width: 145px; height: 145px; }
  .parts-total strong { font-size: 42px; }
  .category-index, .part-card-grid { grid-template-columns: 1fr; }
  .part-artwork { height: 250px; }
  .admin-shell { width: min(100% - 22px, 1500px); }
  .admin-header .admin-kicker { display: none; }
  .admin-main { padding-top: 34px; }
  .admin-layout { grid-template-columns: 1fr; gap: 0; }
  .admin-sidebar { position: static; min-height: 0; padding: 18px 0; border-right: 0; border-bottom: 2px solid var(--ink); }
  .admin-sidebar > p { display: none; }
  .admin-sidebar nav { grid-template-columns: 1fr 1fr; }
  .admin-login form { grid-template-columns: 1fr; }
  .admin-titlebar { align-items: start; flex-direction: column; }
  .admin-list-tools { align-items: stretch; flex-direction: column; }
  .admin-publish-filter button { flex: 1; min-width: 0; }
  .admin-batch-tools { justify-content: space-between; }
  .admin-circuit-card > summary { grid-template-columns: 1fr; }
  .admin-circuit-meta { justify-content: start; padding-left: 50px; }
  .admin-preview-toolbar { align-items: stretch; flex-direction: column; }
  .admin-preview-status { min-height: 28px; }
  .admin-final-diagram { min-height: 240px; padding: 10px; }
  .admin-pagination { gap: 8px; }
  .admin-pagination button { min-width: 0; }
}

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