/* enhance2.css — Phase A of the "construction drawings" direction (art direction: Claude Opus via Abacus; built by Sonnet).
   Loaded after enhance.css. Fonts are self-hosted (fonts.css). All motion is gated by html.motion. */
:root {
  --sans: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --paper: #0a2b55; --paper-deep: #071f40; --ink: #eef4ff; --mark: #ffd36b; --ok: #6fe3c9;
}
:root[data-theme="white"] { --paper: #f2eee3; --paper-deep: #e8e2d2; --ink: #10335f; --mark: #b8311c; --ok: #0b6b57; }

/* typography: one family for both scripts, mono for dimensions, strip, prices and buttons */
body { font-family: var(--sans); font-weight: 300; font-size: 17px; line-height: 1.65; }
b, strong { font-weight: 700; }
h1, h2, h3, .step b { font-family: var(--sans); font-weight: 700; }
.h1-top { font-family: var(--sans); font-weight: 700; font-size: clamp(3rem, 9vw, 8.5rem); line-height: .9; letter-spacing: -.03em; }
.h1-sub, .kicker, .btn, .chip, .strip .k, .strip .v, .strip button, .label, .pn, .pct, .lvl, .price { font-family: var(--mono); }
.kicker { font-weight: 500; letter-spacing: .08em; }
.h1-sub, .btn { letter-spacing: .08em; }
[lang="ar"] .h1-top, [lang="ar"] .h1-sub, [lang="ar"] .kicker, [lang="ar"] .btn, [lang="ar"] h2, [lang="ar"] h3 { letter-spacing: 0; }
[lang="ar"] .h1-top { line-height: 1.1; }

/* focus: clear, in the accent ink */
:focus-visible { outline: 2px solid var(--mark); outline-offset: 3px; }

/* buttons: a dimension line with end ticks draws in under the button */
.btn { position: relative; }
.btn::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -9px; height: 7px; pointer-events: none; opacity: 0;
  background:
    linear-gradient(currentColor, currentColor) 0 50% / 100% 1px no-repeat,
    linear-gradient(currentColor, currentColor) 0 0 / 1px 100% no-repeat,
    linear-gradient(currentColor, currentColor) 100% 0 / 1px 100% no-repeat;
  color: var(--mark);
}
@media (prefers-reduced-motion: no-preference) {
  html.motion .btn::after { transform: scaleX(.2); transform-origin: center; transition: transform .22s ease-out, opacity .22s ease-out; }
  html.motion .btn:hover::after, html.motion .btn:focus-visible::after { opacity: 1; transform: scaleX(1); }
}
html:not(.motion) .btn:hover::after, html:not(.motion) .btn:focus-visible::after { opacity: 1; }

/* hero: a cutting plane A–A sweeps across the sheet, the headline is revealed behind it */
.hero { position: relative; }
.hero::after {
  content: "A"; position: absolute; inset-block: 0; inset-inline-start: 0; width: 1px; background: var(--mark); opacity: 0; pointer-events: none;
  font: 700 11px/1 var(--mono); color: var(--mark); padding-block-start: 8px; text-indent: 6px;
}
@keyframes fx-plane { 0% { inset-inline-start: 0; opacity: 0; } 8% { opacity: .85; } 92% { opacity: .85; } 100% { inset-inline-start: 100%; opacity: 0; } }
@keyframes fx-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes fx-wipe-rtl { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
html.motion .hero::after { animation: fx-plane 1.2s cubic-bezier(.2, .7, .2, 1) .1s both; }
html.motion .h1-top { animation: fx-wipe 1s cubic-bezier(.2, .7, .2, 1) .15s both; }
[dir="rtl"].motion .h1-top, html.motion[dir="rtl"] .h1-top { animation-name: fx-wipe-rtl; }

/* title strip: the sheet number flips like a split-flap; a visited sheet reads CHECKED */
.flipper b { display: inline-block; }
@keyframes fx-flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
html.motion .flipper b.flip { animation: fx-flip .28s steps(6) 1; }
.sheetcell.checked .v::after { content: "  ✓ CHECKED"; color: var(--ok); font: 700 10px/1 var(--mono); letter-spacing: .08em; }
@media (max-width: 760px) { .sheetcell.checked .v::after { content: " ✓"; } }

/* animated pseudo-elements must never create sideways scroll (clip keeps sticky pins working) */
html, body { overflow-x: clip; }
.hero { overflow-x: clip; }
