:root {
  color-scheme: light;
  --paper: #faf8f1;
  --ink: #1c322b;
  --mute: #555e54;
  --line: #d7d4c6;
  --serif: 'Baskerville', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  font: 100%/1.5 var(--sans);
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: .22em; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
:focus-visible { outline: 3px solid #aa4d25; outline-offset: 4px; }
.skip { position: absolute; left: 1rem; top: -5rem; z-index: 20; background: white; padding: .6rem; }
.skip:focus { top: .5rem; }
.wrap { width: min(1240px, 90%); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); background: #fcfaf4; }
.bar, nav, .repo, .actions, .button, .section-top, .filter-row, #filters, .search, footer { display: flex; align-items: center; }
.bar { min-height: 66px; gap: 2rem; }
.brand { display: inline-flex; }
.brand img { width: 132px; }
nav { margin-left: auto; gap: 2rem; }
nav a, .repo { font-size: .9rem; font-weight: 580; text-decoration: none; }
nav a:hover, footer a:hover { color: #854821; text-decoration: underline; }
.repo { gap: .5rem; border-left: 1px solid var(--line); padding-left: 1.65rem; }
.repo svg { width: 18px; }
.hero { position: relative; overflow: hidden; border-bottom: 1px solid #ccc9b8; background-color: #efefe3; background-image: radial-gradient(ellipse at 75% 55%, #dedfc3 0%, transparent 46%), radial-gradient(#79866d36 .7px, transparent .85px); background-size: auto, 7px 7px; }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.08fr 1fr; align-items: center; gap: 2rem; min-height: 358px; }
.intro { padding-block: 36px; }
.eyebrow, .count, .card-kind, .foil-kind, .card-index { font-family: var(--mono); font-weight: 600; }
.eyebrow { display: flex; align-items: center; gap: .65rem; color: #526654; margin: 0 0 .65rem; font-size: .76rem; letter-spacing: .12em; line-height: 1.4; text-transform: uppercase; }
.rule { height: 1px; width: 26px; background: currentColor; }
h1, h2, h3, p { margin: 0; }
h1, h2, .card-name, .foil-name, .reader-title { font-family: var(--serif); font-weight: 500; }
h1 { font-size: clamp(4.5rem, 6.7vw, 6.5rem); letter-spacing: -.066em; line-height: 1.04; margin-left: -.045em; }
h1 em { color: #415f49; font-weight: 400; }
.lead { font-size: 1.06rem; max-width: 480px; color: #47544a; margin-top: .8rem; line-height: 1.55; }
.actions { gap: .7rem; margin-top: 1.5rem; flex-wrap: wrap; }
.button { justify-content: center; gap: .55rem; min-height: 42px; padding: .55rem 1rem; border: 1px solid; border-radius: 6px; font-size: .9rem; font-weight: 640; text-decoration: none; }
.primary { background: #244b3b; color: #fffcef; border-color: #244b3b; }
.secondary { background: #fbfaf1b5; border-color: #a4ac99; }
.primary:hover { background: #193b2e; }
.secondary:hover { background: #fffdf6; }
.button svg, .search svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.button span { font-size: 1.16rem; line-height: 1; }
.fan { position: relative; min-height: 304px; width: 100%; }
.orbits { position: absolute; width: 100%; height: 100%; color: #868c69; }
#featured { position: absolute; width: 100%; height: 100%; }
.foil { position: absolute; left: 50%; top: 50%; width: 168px; height: 232px; padding: 9px; background: var(--plate); color: var(--metal); border: 1px solid var(--shadow); border-radius: 12px; box-shadow: 0 10px 15px #27332435, inset 0 0 0 3px var(--plate), inset 0 0 0 4px var(--edge); transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(var(--angle)); transition: transform .24s; }
.foil:nth-child(1) { --x: -99px; --y: 10px; --angle: -18deg; }
.foil:nth-child(2) { --x: 105px; --y: 8px; --angle: 17deg; }
.foil:nth-child(3) { --x: 0px; --y: -3px; --angle: -3deg; }
.foil:hover, .foil:focus-visible { transform: translate(-50%, -50%) translate(var(--x), calc(var(--y) - 7px)) rotate(var(--angle)); z-index: 2; }
.foil-inner { display: flex; position: relative; flex-direction: column; justify-content: space-between; align-items: center; height: 100%; overflow: hidden; border: 1px solid var(--edge); border-radius: 4px; padding: 14px 0 10px; background: radial-gradient(ellipse at 44% 34%, var(--light), transparent 76%); }
.foil-name { font-size: 1.95rem; line-height: 1.2; letter-spacing: -.05em; }
.foil-art { width: 139%; }
.foil-art svg, .plate svg.illustration { display: block; width: 100%; }
.foil-kind, .card-kind { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; line-height: 1.3; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; }
.foil-kind::before, .foil-kind::after { content: ''; width: 12px; height: 1px; background: var(--edge); }
.foil-inner::before, .foil-inner::after { content: '✧'; position: absolute; top: 5px; font-size: 13px; }
.foil-inner::before { left: 5px; } .foil-inner::after { right: 5px; }
[data-suit="Discovery"] { --plate: #184e43; --light: #317765; --metal: #eeebbc; --edge: #a6ba8b; --shadow: #163f36; }
[data-suit="Design"] { --plate: #4a355d; --light: #75587e; --metal: #f4debd; --edge: #c1a8ac; --shadow: #392747; }
[data-suit="Planning"] { --plate: #805126; --light: #a6743e; --metal: #fff0bf; --edge: #d1ad76; --shadow: #603b23; }
[data-suit="Engineering"] { --plate: #244563; --light: #486786; --metal: #e7eacb; --edge: #a1b6bb; --shadow: #19324a; }
[data-suit="Verification"] { --plate: #793e37; --light: #9c6254; --metal: #ffe4bb; --edge: #cfa692; --shadow: #622e28; }
.collection { padding-block: 44px 60px; scroll-margin-top: 16px; }
.section-top, .filter-row { justify-content: space-between; gap: 1rem; }
.section-top .eyebrow { margin-bottom: .28rem; }
h2 { font-size: clamp(2.15rem, 3.2vw, 3.15rem); letter-spacing: -.048em; line-height: 1.12; }
.search { align-self: end; gap: .6rem; border: 1px solid #c8c9bc; border-radius: 6px; padding: .55rem .8rem; color: #576153; background: #fffef9; width: min(25vw, 238px); }
.search input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--ink); font-size: .94rem; }
.search:focus-within { outline: 2px solid #537359; }
.search input:focus { outline: none; }
.filter-row { margin: 1.45rem 0 1.4rem; border-block: 1px solid var(--line); padding: .78rem 0; }
#filters { gap: .35rem; flex-wrap: wrap; }
#filters button { background: none; border: 1px solid transparent; border-radius: 30px; padding: .36rem .85rem; font-size: .88rem; font-weight: 560; }
#filters button:hover { border-color: #b6b9a7; }
#filters button[aria-pressed=true] { color: #fffdf2; background: #254c3b; }
.count { font-size: .77rem; color: var(--mute); white-space: nowrap; }
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.35rem; }
.skill-card { --cut: 9px; display: flex; flex-direction: column; text-align: left; width: 100%; padding: 6px; border: 1px solid #b5b7a4; background: #f6f3e7; border-radius: var(--cut); box-shadow: 0 2px 3px #363e2710; transition: transform .18s, box-shadow .18s; }
.skill-card:hover { transform: translateY(-4px); box-shadow: 0 7px 14px #353d271c; }
.plate { position: relative; display: grid; place-items: center; background-color: var(--plate); background-image: radial-gradient(ellipse at 45% 45%, var(--light), transparent 76%); color: var(--metal); border-radius: 4px; isolation: isolate; overflow: hidden; width: 100%; }
.plate::before { content: ''; pointer-events: none; position: absolute; inset: 5px; border: 1px solid var(--edge); opacity: .8; border-radius: 2px; }
.corner { position: absolute; font-size: .85rem; line-height: 1; }
.tl { top: 8px; left: 10px; } .tr { top: 8px; right: 10px; } .bl { bottom: 8px; left: 10px; } .br { bottom: 8px; right: 10px; }
.plate > svg { width: 100%; height: auto; display: block; margin: 6% 0; }
.card-info { display: flex; flex-direction: column; flex: 1; padding: .95rem .7rem .8rem; }
.card-kind { align-self: start; color: var(--plate); font-weight: 700; font-size: .73rem; }
.card-name { font-size: clamp(1.7rem,2.4vw,2.3rem); color: #25372d; letter-spacing: -.055em; line-height: 1.2; margin: .25rem 0 .35rem; }
.card-purpose { font-size: .95rem; color: #4c554d; line-height: 1.5; }
#empty { padding: 2rem 0; } #empty button { background: none; border: none; text-decoration: underline; }
footer { gap: 1.4rem; padding: 1.5rem 0; font-size: .9rem; }
footer span { margin-right: auto; }
@media (max-width: 1050px) { .gallery { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 780px) {
  .wrap { width: 92%; } .bar, nav { gap: 1rem; } .repo { padding-left: 1rem; }
  .hero-inner { gap: 0; grid-template-columns: 1.1fr 1fr; }
  .fan { transform: scale(.8); } .hero h1 { font-size: 4rem; }
  #filters button { padding-inline: .62rem; } .gallery { gap: .85rem; } .filter-row { align-items: start; }
}
@media (max-width: 640px) {
  .bar { flex-wrap: wrap; gap: .5rem .85rem; min-height: 55px; } .brand img { width: 91px; }
  nav { gap: .75rem; } nav a, .repo { font-size: .78rem; } .repo { border: 0; padding: 0; font-size: 0; gap: 0; } .repo svg { width: 20px; }
  .hero-inner { grid-template-columns: 1fr; } .intro { padding: 1.9rem 0 .2rem; }
  .fan { min-height: 208px; transform: none; } #featured { transform: scale(.74); } .orbits { max-height: 215px; }
  .hero h1 { font-size: clamp(3.55rem,13vw,4.6rem); } .lead { max-width: 480px; font-size: 1rem; } .actions { margin-top: 1rem; }
  .section-top { flex-wrap: wrap; gap: .8rem; } .search { width: 100%; }
  .collection { padding-top: 1.8rem; } .gallery { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; }
  .filter-row { flex-wrap: wrap; margin-top: 1rem; gap: .5rem; } .count { margin-left: .55rem; }
  .card-info { padding: .65rem .32rem; } .card-name { font-size: 1.55rem; overflow-wrap: anywhere; }
  .card-purpose { font-size: .9rem; } .card-kind { font-size: .68rem; letter-spacing: .04em; }
  footer { flex-wrap: wrap; gap: .8rem; } footer span { width: 100%; }
}

/* The dialog is the scrollable table surface. The printed frame grows with its contents. */
#reader {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 26px 8px 42px; border: 0; background: transparent;
  overflow-y: auto; overscroll-behavior: contain; color: var(--ink);
}
#reader::backdrop { background: #101914df; backdrop-filter: blur(5px); }
body:has(#reader[open]) { overflow: hidden; }
.close {
  position: fixed; z-index: 4; left: min(calc(50% + 277px), calc(100% - 51px)); top: 24px;
  width: 40px; height: 40px; padding: 0; border: 1px solid #d5cea77a; border-radius: 50%;
  color: #fff6db; background: #172820; font: 400 1.65rem/1 var(--sans);
  box-shadow: 0 3px 12px #0005;
}
.close:hover { background: #3a4b3b; }
.reader-inner {
  --gold: #d6bd82; --parchment: #f9f4e4; --rule: #cec3a7;
  position: relative; isolation: isolate; width: min(100%, 520px); margin-inline: auto;
  border: 3px solid #1e271f; border-radius: 22px; padding: 20px 17px 7px;
  background: radial-gradient(ellipse at 38% 8%, var(--light), transparent 35%),
    repeating-linear-gradient(45deg, transparent 0 3px, #0000000c 3px 4px), var(--plate);
  box-shadow: 0 0 0 1px #b6a373, inset 0 0 0 2px var(--gold), inset 0 0 0 5px var(--shadow),
    inset 0 0 0 6px #ceba83a6, 0 20px 65px #020906a3;
}
.filigree { color: var(--gold); width: 52px; height: 52px; z-index: 2; position: absolute; fill: none; stroke: currentColor; stroke-width: 1.2; pointer-events: none; }
.nw { top: 5px; left: 5px; } .ne { right: 5px; top: 5px; transform: scaleX(-1); }
.sw { bottom: 5px; left: 5px; transform: scaleY(-1); } .se { bottom: 5px; right: 5px; transform: scale(-1); }
.face-top, .face-head, .face-foot { position: relative; color: #fff2ca; }
.face-top { margin-inline: 8px; padding: 0 5px 7px; border-bottom: 1px solid #decfa46f; display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.face-type, .face-code { font-family: var(--mono); font-size: .75rem; }
.face-type { display: flex; align-items: center; gap: .4rem; text-transform: uppercase; font-weight: 650; letter-spacing: .12em; }
.face-type span { font-size: 1rem; line-height: 1; }
.face-head { display: flex; align-items: center; min-height: 111px; padding-inline: 13px 0; }
.reader-title { z-index: 1; max-width: 60%; padding: 10px 0 12px; font-size: clamp(2.35rem, 6vw, 3.65rem); line-height: .96; letter-spacing: -.055em; text-shadow: 0 2px 6px #1122153a; text-wrap: balance; }
.face-art { position: absolute; inset: 0 -3px 0 auto; width: 40%; display: grid; place-items: center; color: var(--metal); overflow: hidden; }
.face-art svg { grid-area: 1/1; display: block; width: 100%; }
.face-art .instrument { width: auto; height: 128%; opacity: .31; stroke: var(--gold); fill: none; stroke-width: .8; }
.card-paper { position: relative; background: var(--parchment); color: #283126; border: 1px solid #3c422e; border-radius: 4px 4px 9px 9px; box-shadow: 0 0 0 2px var(--gold), 0 3px 0 #1e241c66; }
.card-brief { padding: .8rem 1rem .75rem; border-bottom: 3px double var(--rule); background: linear-gradient(110deg, #fcf8ed, #eee4cc); }
.face-purpose { font-family: var(--serif); font-size: clamp(1.23rem, 2.8vw, 1.5rem); line-height: 1.19; letter-spacing: -.018em; }
.result-line { display: flex; align-items: baseline; gap: .58rem; margin-top: .55rem; font-size: .92rem; color: #44503d; line-height: 1.35; }
.result-line strong { color: var(--plate); font: 650 .71rem var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.flow-section { padding: .85rem .75rem .6rem; }
.flow-heading { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: 0 .25rem .55rem; }
.flow-heading h3 { font: 550 1.7rem/1.1 var(--serif); letter-spacing: -.045em; }

.flow-heading > span { font-size: .79rem; color: #5a5d50; }
.mode-picker { display: flex; flex-wrap: wrap; align-items: center; gap: .28rem; border: 0; margin: 0 0 .6rem; padding: 0; }
.mode-picker label { position: relative; cursor: pointer; }
.mode-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mode-picker span { display: block; padding: .32rem .62rem; border: 1px solid #c0b49a; border-radius: 4px; background: #fffcf2; color: #474d40; font: 550 .84rem/1.35 var(--sans); }
.mode-picker input:checked + span { background: var(--plate); border-color: var(--shadow); color: #fffaf0; }
.mode-picker input:focus-visible + span { outline: 3px solid #a34a24; outline-offset: 2px; }
.role-line { margin: 0 .25rem .55rem; color: #375443; font-size: .85rem; line-height: 1.4; }
.role-note { margin: -.25rem .25rem .65rem; color: #50594d; font-size: .85rem; line-height: 1.4; }
.rules dd ul { margin: .35rem 0 0; padding-left: 1.2rem; color: #375443; }
.diagram-board { position: relative; padding: 5px 0; border: 1px solid var(--rule); border-radius: 5px;
  background-color: #f3eddd; background-image: radial-gradient(#8d795c38 .7px, transparent .9px); background-size: 7px 7px; }
.flow-note { position: absolute; z-index: 2; left: 6px; right: 6px; padding: .7rem .85rem; border: 1px solid #c3ae78; background: #223b31; color: #fff9e9; border-radius: 6px; box-shadow: 0 6px 18px #22291f30; }
.flow-note::before { content: ''; position: absolute; top: -5px; left: calc(var(--pin) - 13px); width: 8px; height: 8px; background: #223b31; border: solid #c3ae78; border-width: 1px 0 0 1px; transform: rotate(45deg); }
.flow-note strong { font-size: .96rem; } .flow-note span { margin-left: .5em; font-size: .8rem; color: #d5dabf; }
.flow-note p { margin: .25rem 0 0; font-size: .94rem; line-height: 1.45; }
.rules { margin: 0 .83rem; border-top: 1px solid var(--rule); }
.rules summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 41px; padding: .42rem .2rem; cursor: pointer; font-size: .93rem; font-weight: 600; list-style: none; }
.rules summary::-webkit-details-marker { display: none; }
.rules summary::after { content: '+'; color: var(--plate); font: 1.25rem var(--mono); }
.rules[open] summary::after { content: '−'; }
.rules p, .rules dd { font-size: .95rem; line-height: 1.5; }
.rules p { padding: 0 .2rem .85rem; }
.rules dl { margin: 0 .2rem .9rem; }
.rules dl > div + div { margin-top: .7rem; }
.rules dt { font-weight: 650; } .rules dt span { margin-left: .5rem; color: #5d6455; font: .8rem var(--mono); }
.rules dd { margin: .1rem 0 0; }
.face-foot { display: flex; justify-content: center; align-items: center; gap: .7rem; padding: 8px 20px 4px; }
.face-foot span { color: var(--gold); font-size: .72rem; }
.face-foot a { font: .8rem var(--mono); text-underline-offset: .15em; }
@media (max-width: 650px) {
  #reader { padding: 47px 7px 16px; }
  .close { top: 6px; left: auto; right: max(8px, calc(50% - 259px)); width: 33px; height: 33px; }
}
@media (max-width: 420px) {
  .reader-inner { padding: 15px 9px 5px; border-radius: 16px; }
  .face-head { min-height: 84px; padding-left: 9px; }
  .face-top { padding-inline: 5px; margin-inline: 9px; }
  .face-code { text-align: right; overflow-wrap: anywhere; }
  .face-type, .face-code { font-size: .68rem; }
  .card-brief { padding: .7rem .65rem; }
  .flow-section { padding: .65rem .26rem .4rem; } .flow-heading { padding-inline: .35rem; }
  .result-line { flex-wrap: wrap; column-gap: .4rem; row-gap: 0; }
  .mode-picker span { padding: .35rem .5rem; }
  .flow-heading h3 { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: no-preference) {
  #reader[open] .reader-inner { animation: turn-card .23s ease-out; }
  @keyframes turn-card { from { opacity: .25; transform: translateY(7px) rotate(-.8deg); } }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.hero .intro { padding-block: clamp(2.4rem, 5vw, 4.5rem); }
.hero h1 { font-size: clamp(3.35rem, 5.7vw, 5.8rem); max-width: 13ch; }
.guide-section { padding-block: clamp(2.5rem, 5vw, 4.25rem); border-bottom: 1px solid var(--line); }
.guide-section p:not(.eyebrow) { color: #47544a; line-height: 1.6; margin-top: .9rem; }
.guide-section .section-lead { max-width: 80ch; }
.figure-nav { margin: 1.25rem 0; gap: .6rem 1.5rem; flex-wrap: wrap; }
.figure-nav a { text-decoration: underline; font-weight: 550; text-underline-offset: .25em; }
.field-figure { margin: 0; overflow: hidden; min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: #fbf8f3; }
.figure-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .45rem; padding: .55rem .85rem; border-bottom: 1px solid var(--line); background: #f0efe4; font-size: .87rem; }
.figure-toolbar label { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.figure-toolbar input { accent-color: #244b3b; }
.figure-scroll { overflow-x: auto; }
.figure-scroll object { display: block; width: 100%; height: auto; }
.field-figure:has(.enlarge:checked) object { width: 135%; min-width: 1150px; }
.quickstart, .project-records { background: #efefe5; }
.guide-columns { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: clamp(1.5rem, 5vw, 5rem); }
.guide-columns h2 { text-wrap: balance; }
.guide-section code { font-family: var(--mono); font-size: .91em; }
.hosts { border: 1px solid #b7c1af; border-radius: 7px; background: #fdfcf4; overflow: hidden; }
.hosts details + details { border-top: 1px solid var(--line); }
.hosts summary { cursor: pointer; padding: .8rem 1rem; font-weight: 620; }
.hosts pre { margin: 0; padding: 1rem; overflow-x: auto; background: #203d31; color: #fff7da; line-height: 1.65; }
.map-columns { grid-template-columns: minmax(210px, .39fr) minmax(0, 1fr); gap: clamp(1.25rem, 3vw, 3rem); }
.deck-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.deck-tools .search { align-self: stretch; }
@media (max-width: 760px) {
  .guide-columns { grid-template-columns: minmax(0,1fr); }
  .deck-tools .search { width: min(230px, 42vw); }
  .bar nav { gap: .7rem; }
}
@media (max-width: 640px) {
  .hero .intro { padding: 1.9rem 0 .25rem; }
  .hero h1 { font-size: clamp(3.1rem, 12vw, 4.4rem); }
  .masthead .cookbook-nav { display: none; }
  .deck-tools { width: 100%; }
  .deck-tools .search { flex: 1; min-width: 7rem; }
  .figure-toolbar { padding-inline: .5rem; }
}
