/* Imperial Research (imperialresearch.co), 03.11.2026: a chess problem collection for chart reading.
   White problem-book paper, black ink, board greys; imperial purple only for solutions, answers and the primary action.
   Bodoni Moda for headings, Public Sans for text, both self-hosted (latin). */
@font-face { font-family: "Bodoni Moda"; src: url(/assets/fonts/bodoni-moda.woff2) format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url(/assets/fonts/public-sans.woff2) format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url(/assets/fonts/public-sans-italic.woff2) format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
:root {
  --paper: #fbfbfa; --ink: #141414; --ink-2: #3a3a40; --muted: #5f5f67; --sq-l: #f4f3f6; --sq-d: #e6e4ea; --rule: #d6d4da;
  --purple: #4a1f74; --purple-2: #5f2d93; --purple-tint: #f2ecf8;
  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif; --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: #b9b6c0 var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.62 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: lining-nums; }
::selection { background: var(--purple); color: #fff; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
a { color: var(--ink); text-decoration-color: color-mix(in srgb, var(--ink) 40%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:not(.btn):hover { color: var(--purple); }
img, svg { max-width: 100%; height: auto; }
.wrap { width: min(1160px, 100%); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--ink); color: #fff; padding: 8px 12px; }
.skip:focus { left: 8px; }
a.skip:hover { color: #fff; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 4.2vw, 3.05rem); font-weight: 800; }
h2 { font-size: clamp(1.55rem, 3.2vw, 2.05rem); margin-top: 2.4rem; }
h3 { font-size: 1.28rem; margin-top: 1.6rem; }
p, ul, ol { margin: 0 0 1em; }
li { margin: 0 0 .4em; }
strong, b { font-weight: 700; }

/* top bar: wordmark, sections, a double rule underneath like a book's running head */
.top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 94%, transparent); border-bottom: 3px double var(--ink); backdrop-filter: blur(10px); }
.top-in { display: flex; align-items: center; gap: 18px; min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.mark img { width: 26px; height: auto; }
.wm { display: flex; flex-direction: column; line-height: 1; }
.wm-a { font-family: var(--serif); font-weight: 800; font-size: 1.22rem; letter-spacing: .14em; text-transform: uppercase; }
.wm-b { font-size: .7rem; font-weight: 700; letter-spacing: .36em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.nav { display: flex; gap: 4px 22px; flex-wrap: wrap; }
.nav a { text-decoration: none; font-weight: 600; font-size: .95rem; color: var(--ink-2); padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.m-menu { display: none; position: static; }
.m-menu summary { list-style: none; cursor: pointer; padding: .5rem .9rem; border: 1.5px solid var(--ink); font-weight: 700; font-size: .9rem; min-height: 42px; display: flex; align-items: center; }
.m-menu summary::-webkit-details-marker { display: none; }
.m-panel { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 3px double var(--ink); padding: .6rem 20px 1rem; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }
.m-panel a { text-decoration: none; font-weight: 600; padding: .55rem 0; border-bottom: 1px solid var(--rule); }
@media (max-width: 900px) { .nav { display: none; } .m-menu { display: block; } }

/* opening: title and lead; on the home page the study sits beside them */
.hero { padding: clamp(1.8rem, 5vw, 3.4rem) 0 1.6rem; border-bottom: 1px solid var(--rule); }
.hero-text { max-width: 760px; }
.crumbs { font-size: .86rem; color: var(--muted); margin: 0 0 .8rem; }
.crumbs a { color: var(--muted); }
.lead { font-size: clamp(1.08rem, 2vw, 1.24rem); color: var(--ink-2); margin: 0 0 1rem; max-width: 62ch; }
.stamp { font-size: .82rem; color: var(--muted); margin: 0; }
.home .hero-in { display: grid; gap: 28px 48px; align-items: start; }
@media (min-width: 980px) { .home .hero-in { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); } .home .hero-text { padding-top: 1.2rem; } }
.home h1 { font-size: clamp(2.2rem, 5.2vw, 4.4rem); }
.hero-acts { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 1.4rem 0 1rem; }
@media (max-width: 600px) {
  .home .hero { padding-top: 1.3rem; }
  .home .lead { font-size: 1rem; }
  .hero-acts { margin: 1rem 0 .6rem; gap: 8px; }
  .hero-acts .btn { flex: 1 1 0; min-height: 46px; padding: .6rem .7rem; font-size: .92rem; }
  .home .stamp { display: none; }
}

/* buttons: crisp, square, purple only for the main action */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .7rem 1.3rem; background: var(--purple); color: #fff; border: 1.5px solid var(--purple);
  font: 700 .98rem/1.2 var(--sans); text-decoration: none; cursor: pointer; transition: background .15s var(--ease), transform .15s var(--ease); }
.btn:hover { background: var(--purple-2); color: #fff; transform: translateY(-1px); }
.btn-line { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-line:hover { background: var(--ink); color: #fff; }

/* the study: diagram, question, answer keys, solution */
.study { margin: 0; }
.study figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .7rem; margin: 0 0 .7rem; }
.st-no { font-weight: 800; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); border: 1.5px solid var(--ink); padding: .12rem .45rem; }
.st-q { font-family: var(--serif); font-weight: 700; font-size: clamp(1.25rem, 2.4vw, 1.55rem); line-height: 1.2; flex: 1 1 260px; }
.board { display: block; width: 100%; background: var(--paper); }
.st-keys { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: .8rem 0 .4rem; }
.key { width: 52px; height: 52px; border: 1.5px solid var(--ink); background: var(--sq-l); color: var(--ink); font: 800 1.35rem/1 var(--serif); cursor: pointer; transition: background .15s, color .15s, transform .15s var(--ease); }
.key:nth-child(even) { background: var(--sq-d); }
.key:hover { transform: translateY(-2px); }
.key[aria-pressed="true"] { background: var(--ink); color: #fff; }
.study.solved .key.right { background: var(--purple); border-color: var(--purple); color: #fff; }
.study.solved .key.wrong { text-decoration: line-through; background: var(--sq-l); color: var(--muted); border-color: var(--muted); }
.st-hint { font-size: .88rem; color: var(--muted); margin-left: 4px; }
.study.solved .st-hint { display: none; }
.st-sol { border-top: 1px solid var(--rule); margin-top: .6rem; padding-top: .6rem; }
.st-sol summary { cursor: pointer; font-weight: 700; color: var(--ink); list-style: none; padding: .3rem 0; }
.st-sol summary::-webkit-details-marker { display: none; }
.st-sol summary::after { content: ""; display: inline-block; width: .5em; height: .5em; margin-left: .5em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.st-sol[open] summary { display: none; }
.st-sol p { margin: .4rem 0 .6rem; }
.st-sol p b:first-child { color: var(--purple); }
.st-cancel { padding-left: .8rem; border-left: 1px solid var(--purple); }
.st-note { font-size: .78rem; color: var(--muted); margin: .3rem 0 0; }

/* board drawing */
.board .sq-l { fill: var(--sq-l); } .board .sq-d { fill: var(--sq-d); }
.board .coord { font: 600 11px var(--sans); fill: var(--muted); text-anchor: middle; }
.board .cd line { stroke: var(--ink); stroke-width: 1.4; }
.board .cd rect { stroke: var(--ink); stroke-width: 1.4; }
.board .cd.up rect { fill: var(--paper); } .board .cd.dn rect { fill: var(--ink); }
.board .hatch { stroke: var(--ink); stroke-width: 1; opacity: .3; }
.board .zone-edge { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; }
.board .lbl { font: 700 10.5px var(--sans); fill: var(--ink); letter-spacing: .06em; text-transform: uppercase; paint-order: stroke; stroke: var(--paper); stroke-width: 3px; }
.board .lbl.end { text-anchor: end; }
.board .lv line { stroke: var(--ink); stroke-width: 1.3; }
.board .lv-liq line { stroke-dasharray: 2 4; stroke-width: 1.8; }
.board .lv-target line { stroke-dasharray: 9 4; }
.board .lv-cancel line { stroke: var(--purple); stroke-width: 2; stroke-dasharray: 7 4; }
.board .lv-cancel text, .board .lv-entry text { fill: var(--purple); }
.board .lv-entry line { stroke: var(--purple); stroke-width: 2; }
.board .mk circle { fill: var(--paper); stroke: var(--ink); stroke-width: 1.6; }
.board .mk text { font: 800 14px var(--serif); text-anchor: middle; fill: var(--ink); }
.board .ring { fill: none; stroke: var(--purple); stroke-width: 2.6; }
.board .vp { fill: var(--ink); opacity: .18; } .board .vp.poc { opacity: .42; }
.board .frame-o { fill: none; stroke: var(--ink); stroke-width: 2.4; } .board .frame-i { fill: none; stroke: var(--ink); stroke-width: .8; }
.study .sol { opacity: 0; transition: opacity .35s var(--ease); }
.study.solved .sol, .study:has(.st-sol[open]) .sol { opacity: 1; }
.study.solved .mk.right circle { fill: var(--purple); stroke: var(--purple); } .study.solved .mk.right text { fill: #fff; }

/* reading column */
.page { padding-top: 1.8rem; padding-bottom: 3.2rem; }
.page > * { max-width: 72ch; }
.page > .study, .page > .fig, .page > .toc, .page > .ps-grid, .page > .tool, .page > .tbl { max-width: 860px; }
.page p, .page li { color: var(--ink-2); }
.page > .study { margin: 0 0 2rem; }
.fig { margin: 1.4rem 0 1.8rem; }
.fig figcaption { font-size: .92rem; color: var(--ink-2); margin-top: .5rem; }
.rule { border: 3px double var(--ink); padding: 1rem 1.15rem; margin: 1.6rem 0; background: var(--paper); }
.rule p:last-child { margin: 0; }
.rule b:first-child { font-family: var(--serif); font-size: 1.1rem; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps > li { counter-increment: s; position: relative; padding-left: 2.6rem; margin-bottom: .75rem; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: .05rem; width: 1.75rem; height: 1.75rem; border: 1.5px solid var(--ink); font: 800 .95rem/1.6rem var(--serif); text-align: center; }
.tbl { overflow-x: auto; margin: 1.2rem 0 1.6rem; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; vertical-align: top; padding: .65rem .7rem; border-bottom: 1px solid var(--rule); }
thead th { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
tbody th { font-weight: 700; color: var(--ink); }
tbody tr:last-child > * { border-bottom: 0; }

/* the collection: a problem book's contents */
.toc { display: grid; gap: 8px 40px; margin: 1rem 0 2rem; }
@media (min-width: 860px) { .toc { grid-template-columns: 1fr 1fr; } }
.toc-ch h3 { margin: 1.2rem 0 .4rem; padding-bottom: .35rem; border-bottom: 2px solid var(--ink); font-size: 1.15rem; }
.toc ol, .next ul { list-style: none; padding: 0; margin: 0; }
.toc li, .next li { margin: 0; }
.toc a, .next a { display: grid; grid-template-columns: 2.4rem 1fr; gap: 0 .6rem; padding: .6rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.toc a:hover .toc-t, .next a:hover .toc-t { color: var(--purple); text-decoration: underline; text-decoration-color: var(--purple); }
.toc-no { grid-row: span 2; font: 800 1.15rem/1.3 var(--serif); }
.toc-t { font-weight: 700; }
.toc-q { font-size: .88rem; color: var(--muted); }
.next { margin-top: 2.6rem; max-width: 860px !important; }
@media (min-width: 760px) { .next ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; } }

/* where to trade: scoresheet cards */
.ps-grid { display: grid; gap: 16px; margin: 1.2rem 0 2rem; }
@media (min-width: 760px) { .ps-grid { grid-template-columns: 1fr 1fr; } }
.ps { border: 1.5px solid var(--ink); background: var(--paper); padding: 1.1rem 1.15rem 1.15rem; display: flex; flex-direction: column; }
.ps header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-bottom: 3px double var(--ink); padding-bottom: .5rem; margin-bottom: .7rem; }
.ps h3 { margin: 0; font-size: 1.5rem; }
.ps-kind { font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.ps-best { font-weight: 600; color: var(--ink) !important; }
.ps-facts { list-style: none; padding: 0; margin: 0 0 .8rem; }
.ps-facts li { padding: .45rem 0; border-bottom: 1px solid var(--rule); font-size: .93rem; margin: 0; }
.ps-note { font-size: .8rem; color: var(--muted) !important; margin: 0 0 .9rem; }
.ps-cta { margin-top: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.ps-more { font-size: .9rem; font-weight: 600; }

/* tools */
.tool { border: 1.5px solid var(--ink); padding: 1.1rem 1.15rem; margin: 1.2rem 0 2rem; background: var(--paper); }
.tool-grid { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tool label { display: block; font-size: .84rem; font-weight: 700; color: var(--ink); }
.tool input, .tool select { display: block; width: 100%; margin-top: .3rem; min-height: 46px; padding: .55rem .65rem; border: 1.5px solid var(--ink); background: #fff; color: var(--ink); font: 500 1rem var(--sans); border-radius: 0; }
.tool output, .out { display: block; margin-top: 1rem; padding: .9rem 1rem; background: var(--purple-tint); border-left: 1px solid var(--purple); font-variant-numeric: tabular-nums; }
.out b { font-family: var(--serif); font-size: 1.6rem; color: var(--purple); }
.out p { margin: .2rem 0; color: var(--ink) !important; }
.sess-strip { position: relative; margin: 2.2rem 0 .4rem; }
.sess-hours { display: grid; grid-template-columns: repeat(24, 1fr); border: 1.5px solid var(--ink); }
.sess-hours span { height: 18px; border-right: 1px solid var(--rule); background: var(--sq-l); }
.sess-hours span:nth-child(even) { background: var(--sq-d); }
.sess-hours span:last-child { border-right: 0; }
.sess-row { position: relative; height: 30px; margin-top: 6px; border-bottom: 1px solid var(--rule); }
.sess-row .bar { position: absolute; top: 4px; height: 22px; background: var(--ink); color: #fff; font-size: .74rem; font-weight: 700; padding: 0 6px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; }
.sess-row .bar.kz { background: var(--paper); color: var(--ink); border: 1.5px dashed var(--ink); }
.sess-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--purple); }
.sess-now::after { content: attr(data-t); position: absolute; top: -1.6rem; left: 50%; transform: translateX(-50%); font-size: .74rem; font-weight: 800; color: var(--purple); white-space: nowrap; }
.sess-scale { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: 4px; }

/* questions */
.faq { margin-top: 2.6rem; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq details:first-of-type { border-top: 2px solid var(--ink); }
.faq summary { cursor: pointer; list-style: none; position: relative; padding: .9rem 2.4rem .9rem 0; font-weight: 700; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before, .faq summary::after { content: ""; position: absolute; right: .4rem; top: 50%; width: 14px; height: 2px; background: var(--ink); transition: transform .2s var(--ease); }
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0); }
.faq details p { margin: 0 0 1rem; }

/* footer */
.foot { border-top: 3px double var(--ink); padding: 2rem 0 2.6rem; font-size: .9rem; color: var(--muted); }
.foot p { max-width: 82ch; margin: 0 0 .7rem; }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 1.2rem 1.6rem; margin-bottom: 1.6rem; scroll-margin-top: 90px; }
.foot-cols div { display: flex; flex-direction: column; gap: .35rem; }
.foot-h { margin: 0 0 .2rem; font-family: var(--serif); font-weight: 800; font-size: 1rem; color: var(--ink); }
.foot-cols a { color: var(--ink-2); text-decoration: none; }
.foot-cols a:hover { color: var(--purple); text-decoration: underline; }

@media (prefers-reduced-motion: no-preference) {
  .study.solved .ring { animation: ir-ring .5s var(--ease) both; transform-box: fill-box; transform-origin: center; }
  .study.solved .lv-cancel line { stroke-dashoffset: 0; animation: ir-draw .7s var(--ease) both .15s; }
}
@keyframes ir-ring { from { transform: scale(.4); opacity: 0; } }
@keyframes ir-draw { from { stroke-dasharray: 0 600; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .top, .foot, .faq, .next, .btn, .st-keys, .m-menu { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .page > * { max-width: none; }
}
