/* Catalog page: the brochure as a book. Pages are paper on the dark studio, and the pages are the controls. */
.cat-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: var(--space-2) 0; margin: var(--space-6) 0 var(--space-5); position: sticky; top: var(--header-h); z-index: 8; background: var(--color-bg); }
.cat-tabs a { flex: none; text-decoration: none; padding-inline: 12px; min-height: 44px; display: inline-flex; align-items: center; }
.cat-tabs a[aria-current="true"] { border-color: var(--color-accent); color: var(--color-accent); background: rgb(0 168 234 / .06); }
.book-shell { position: relative; }

/* Without JS (and in print): pages in a simple grid. */
.book { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: var(--space-4); }
.leaf::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; mix-blend-mode: multiply; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.leaf { --pad: clamp(1.25rem, .8rem + 1.6vw, 2.25rem); container-type: inline-size; background: #f6f8f9; color: var(--color-paper-ink); border-radius: 6px; padding: var(--pad); font-size: .875rem; line-height: 1.5; box-shadow: 0 30px 60px -24px rgb(0 0 0 / .9); position: relative; overflow: hidden; }
.leaf a { color: var(--color-primary); }
.leaf header { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); border-bottom: 1px solid #d7dde1; padding-bottom: var(--space-3); margin-bottom: var(--space-4); }
.leaf header span { font: 500 10px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--color-primary); }
.leaf header b { font: 500 11px/1 var(--font-mono); letter-spacing: .06em; color: #55626b; }
.leaf h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); letter-spacing: -.02em; margin: 0 0 var(--space-2); color: var(--color-paper-ink); }
.leaf h3 { font-family: var(--font-body); font-stretch: 100%; font-size: .9375rem; font-weight: 700; letter-spacing: 0; margin: var(--space-4) 0 var(--space-1); }
.leaf p { margin: 0 0 var(--space-3); color: #3d4950; }
.leaf .intro { color: #55626b; max-width: 46ch; }
.leaf ul { margin: 0; padding: 0; list-style: none; }
.leaf .two { columns: 2; column-gap: var(--space-5); }
.leaf .two li, .leaf .list li { break-inside: avoid; padding: 5px 0; border-bottom: 1px solid #e3e8eb; }
.leaf .list li b { font-weight: 600; }
.leaf .list li span { display: block; color: #55626b; font-size: .8125rem; }
.leaf .foot { position: absolute; left: var(--pad); right: var(--pad); bottom: 14px; display: flex; justify-content: space-between; gap: var(--space-3); font: 500 10px var(--font-mono); letter-spacing: .1em; color: #5d6a72; text-transform: uppercase; }
.leaf .cta, .leaf .call { margin-top: var(--space-5); }
.leaf .note { margin-top: var(--space-6); font-size: .75rem; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; margin-top: var(--space-3); }
.swatch { font-size: .75rem; line-height: 1.3; color: #3d4950; }
.swatch i { display: block; aspect-ratio: 1.3; border-radius: 6px; background: var(--c, #fff); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .1), 0 6px 12px -8px rgb(0 0 0 / .5); margin-bottom: 5px; position: relative; overflow: hidden; }
.swatch i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgb(255 255 255 / var(--gloss, 0)) 45%, transparent 60%); }
.swatches.dense i { aspect-ratio: 1.75; }
.sw-metal { --gloss: .6; }
.sw-clear { --c: repeating-conic-gradient(#e3e8eb 0 25%, #fff 0 50%) 0 0 / 10px 10px; }
.sw-kraft { --c: radial-gradient(circle at 30% 40%, #a47b4a 0 1px, transparent 1.5px) 0 0 / 6px 6px, #b88f5c; }
.sw-holo { --c: conic-gradient(from 30deg, #ff9adf, #9ad6ff, #b6ffb0, #fff59a, #ffb08a, #ff9adf); --gloss: .7; }
.sw-holo.cracked { --c: repeating-linear-gradient(60deg, rgb(255 255 255 / .55) 0 2px, transparent 2px 9px), repeating-linear-gradient(-30deg, rgb(255 255 255 / .4) 0 1px, transparent 1px 11px), conic-gradient(from 30deg, #ff9adf, #9ad6ff, #b6ffb0, #fff59a, #ffb08a, #ff9adf); }
.sw-holo.sparkle { --c: radial-gradient(circle, #fff 0 1px, transparent 1.5px) 0 0 / 7px 7px, conic-gradient(from 30deg, #ff9adf, #9ad6ff, #b6ffb0, #fff59a, #ffb08a, #ff9adf); }
.sw-holo.plaid { --c: repeating-linear-gradient(0deg, rgb(255 255 255 / .35) 0 3px, transparent 3px 10px), repeating-linear-gradient(90deg, rgb(255 255 255 / .35) 0 3px, transparent 3px 10px), conic-gradient(from 30deg, #ff9adf, #9ad6ff, #b6ffb0, #fff59a, #ffb08a, #ff9adf); }
.sw-holo.spin { --c: repeating-conic-gradient(from 0deg at 50% 50%, #ff9adf 0 15deg, #9ad6ff 15deg 30deg, #b6ffb0 30deg 45deg, #fff59a 45deg 60deg); }
.sw-void { --c: repeating-linear-gradient(-45deg, #dfe5e9 0 6px, #f4f6f7 6px 12px); }
.sw-check { --c: repeating-conic-gradient(#c9d1d6 0 25%, #f4f6f7 0 50%) 0 0 / 8px 8px; }
.sw-reflect { --c: radial-gradient(circle, #fff 0 1px, #dfe5e9 1.5px) 0 0 / 4px 4px; --gloss: .8; }

.shapes { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin: var(--space-4) 0; }
.shapes figure { margin: 0; text-align: center; font-size: .75rem; color: #3d4950; }
.shapes svg { display: block; height: 64px; width: 100%; margin: 0 auto 8px; overflow: visible; }

.spec-table { width: 100%; border-collapse: collapse; font-size: .8125rem; margin-top: var(--space-3); }
.spec-table th { text-align: left; font: 500 9px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: #55626b; padding: 6px 8px 6px 0; border-bottom: 1px solid #c9d1d6; }
.spec-table td { padding: 8px 8px 8px 0; border-bottom: 1px solid #e3e8eb; vertical-align: top; }
.spec-table td:first-child { font-family: var(--font-mono); font-weight: 600; color: var(--color-primary); white-space: nowrap; }
.terms dt { font-weight: 700; margin-top: var(--space-3); }
.terms dd { margin: 2px 0 0; color: #3d4950; }

.sample { margin: var(--space-5) 0 0; }
.sample svg { width: 100%; height: auto; }
.sample figcaption { font: 500 10px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: #55626b; margin-top: 6px; }

/* Photos: a framed print on the page. `--pos` picks the crop. */
.leaf .photo, .leaf .band { position: relative; overflow: hidden; margin: 0; border-radius: 4px; background: #dfe4e7; box-shadow: 0 0 0 1px rgb(20 25 29 / .08), 0 10px 18px -14px rgb(20 25 29 / .5); }
.leaf .photo { aspect-ratio: 4 / 3; }
.leaf .band { aspect-ratio: 2 / 1; margin-top: var(--space-5); }
.leaf .photo img, .leaf .band img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: var(--pos, 50% 50%); }

/* Industry pages: two industries a page, each with two small photos side by side and its label types. */
.leaf .ind-block + .ind-block { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid #d5dce0; }
.leaf .ind-block h2 { font-size: clamp(1.125rem, .9rem + .8cqi, 1.5rem); }
.leaf .ind-block .intro { margin-bottom: 0; }
.leaf .ind-block .duo { margin-top: var(--space-3); }
.leaf .ind-block .duo .photo { aspect-ratio: 2 / 1; }
.leaf .ind-block .duo .photo img { object-position: 50% 30%; }
.leaf .ind-block .duo.one { max-width: none; }
.leaf .ind-block .duo.one .photo { aspect-ratio: 4 / 1; }
.leaf .ind-block .duo.one { grid-template-columns: minmax(0, 1fr); }
.leaf .ind-block .kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: var(--space-2); font-size: .75rem; }
.leaf .ind-block .kinds li { padding: 4px 0; line-height: 1.35; }
@media (max-width: 520px) { .leaf .ind-block .kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.leaf .duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: var(--space-4); }
.leaf .duo.one { grid-template-columns: minmax(0, 1fr); max-width: 72%; }
.leaf .duo .photo { aspect-ratio: 4 / 3; background: #0b0f12; }
.leaf .kinds { list-style: none; padding: 0; margin: var(--space-4) 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-4); font-size: .8125rem; }
.leaf .kinds li { padding: 7px 0; border-top: 1px solid #e3e8eb; display: flex; gap: 8px; }
.leaf .kinds li::before { content: "\2014"; color: var(--color-primary); }
.leaf .band { background: #0b0f12; }

/* Specimens: small label art stuck on a strip of liner, a little crooked, like samples on a sheet. */
.specimens { --sh: clamp(44px, 15cqi, 72px); display: flex; flex-wrap: wrap; justify-content: space-evenly; align-items: center; gap: 12px 18px; margin-top: var(--space-4); padding: 14px 18px; border-radius: 6px; background: #e6ebee; box-shadow: inset 0 0 0 1px rgb(20 25 29 / .05); }
.specimens img { flex: none; width: auto; height: calc(var(--sh) * var(--k, 1)); border: 3px solid #fff; border-radius: 3px; background: #fff; transform: rotate(var(--r, -1.6deg)); box-shadow: 0 1px 1px rgb(20 25 29 / .16), 0 8px 12px -8px rgb(20 25 29 / .6); }
.specimens img:nth-child(2n) { --r: 1.4deg; }
.specimens img:nth-child(3n) { --r: -.7deg; }
.specimens .round { border-radius: 50%; }
.specimens .soft { border-radius: 12px; }

/* Unwind chart */
.unwind { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }
.unwind svg { width: 100%; height: auto; background: #fff; border-radius: 8px; box-shadow: inset 0 0 0 1px #e3e8eb; }
.unwind .pick { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.unwind .pick button { min-height: 44px; border-radius: 8px; border: 1px solid #c9d1d6; background: #fff; font: 600 .875rem var(--font-mono); color: #3d4950; cursor: pointer; }
.unwind .pick button[aria-pressed="true"] { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.unwind .pick button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.unwind .glyph { transition: transform var(--dur-2) var(--ease-out); transform-box: fill-box; transform-origin: center; }

/* JS book */
.book[data-ready] { display: block; position: relative; height: clamp(520px, calc(100vh - var(--header-h) - 120px), 800px); aspect-ratio: 1.5; width: auto; max-width: 100%; perspective: 2400px; margin-inline: auto; touch-action: pan-y pinch-zoom; }
/* Each page is its own scroll box, so it needs pan-y too, or the browser takes a sideways swipe for itself. */
.book[data-ready] .leaf { font-size: .875rem; touch-action: pan-y pinch-zoom; }
.book[data-ready] .list li { padding: 4px 0; }
.book[data-ready] .terms dt { margin-top: var(--space-2); }
.book[data-ready]::before { content: ""; position: absolute; left: 50%; top: 2%; bottom: 2%; width: 2px; transform: translateX(-1px); background: linear-gradient(180deg, transparent, rgb(0 0 0 / .4), transparent); z-index: 4; pointer-events: none; }
.book[data-ready] .store { display: none; }
.book[data-ready] .slot, .book[data-ready] .turn { position: absolute; top: 0; bottom: 0; width: 50%; }
.book[data-ready] .slot-l { left: 0; }
.book[data-ready] .slot-r { right: 0; }
.book[data-ready] .slot .leaf, .book[data-ready] .turn .leaf { height: 100%; border-radius: 0; overflow: auto; scrollbar-width: thin; }
.book[data-ready] .turn { right: 0; transform-style: preserve-3d; transform-origin: left center; z-index: 5; }
.book[data-ready] .turn.back-turn { right: auto; left: 0; transform-origin: right center; }
.turn .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.turn .back { transform: rotateY(180deg); }
.turn .face::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgb(0 0 0 / var(--shade, 0)), transparent 40%); }
.book .empty { height: 100%; border-radius: 10px 2px 2px 10px; background: radial-gradient(60% 60% at 50% 50%, #0f1418, #0b0f12); border: 1px solid var(--color-line); display: grid; place-items: center; color: var(--color-ink-faint); }
.book .empty img { width: 40%; opacity: .9; }

/* Turn zones: the outer edge of each page is a button. At rest the corner is dog-eared; hovering the page
   lifts it a little, hovering or focusing the edge lifts it more and shows the arrow. */
.book .edge { display: none; }
.book[data-ready] .edge { --c: 26px; display: block; position: absolute; top: 0; bottom: 0; z-index: 6; width: 48px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: var(--color-primary); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: opacity var(--dur-1); }
.book[data-ready] .edge[hidden] { display: none; }
.book[data-ready] .edge-prev { left: 0; }
.book[data-ready] .edge-next { right: 0; }
.book[data-ready] .edge::before { content: ""; position: absolute; inset: 0; opacity: .55; pointer-events: none; transition: opacity var(--dur-2) var(--ease-out); }
.book[data-ready] .edge-prev::before { border-radius: 10px 0 0 10px; background: linear-gradient(90deg, rgb(20 25 29 / .07), transparent); }
.book[data-ready] .edge-next::before { border-radius: 0 10px 10px 0; background: linear-gradient(270deg, rgb(20 25 29 / .07), transparent); }
.book[data-ready] .curl { position: absolute; bottom: 0; width: var(--c); height: var(--c); transition: width var(--dur-2) var(--ease-out), height var(--dur-2) var(--ease-out); }
.book[data-ready] .edge-next .curl { right: 0; border-top-left-radius: 4px; background: linear-gradient(to bottom right, #fdfefe 8%, #d5dce0 49.4%, var(--color-bg) 50.6%); filter: drop-shadow(-2px -2px 3px rgb(20 25 29 / .2)); }
.book[data-ready] .edge-prev .curl { left: 0; border-top-right-radius: 4px; background: linear-gradient(to bottom left, #fdfefe 8%, #d5dce0 49.4%, var(--color-bg) 50.6%); filter: drop-shadow(2px -2px 3px rgb(20 25 29 / .2)); }
.book[data-ready] .curl svg { position: absolute; top: 13%; width: 38%; height: 38%; opacity: .7; transition: opacity var(--dur-1); }
.book[data-ready] .edge-next .curl svg { left: 13%; }
.book[data-ready] .edge-prev .curl svg { right: 13%; }
.book[data-ready]:has(.slot-r:hover) .edge-next, .book[data-ready]:has(.slot-l:hover) .edge-prev { --c: 22px; }
.book[data-ready] .edge:hover, .book[data-ready] .edge:focus-visible { --c: 42px; }
.book[data-ready] .edge:hover::before, .book[data-ready] .edge:focus-visible::before, .book[data-ready] .edge:hover .curl svg, .book[data-ready] .edge:focus-visible .curl svg { opacity: 1; }
.book[data-ready] .edge:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -6px; border-radius: 12px; }
.book[data-turning] .edge { opacity: 0; pointer-events: none; }
/* A chevron halfway down each outer edge says "click here to turn". */
.book[data-ready] .edge::after { content: ""; position: absolute; top: 50%; width: 11px; height: 11px; border: solid currentColor; border-width: 2px 2px 0 0; opacity: .5; transition: opacity var(--dur-1), transform var(--dur-2) var(--ease-out); }
.book[data-ready] .edge-next::after { right: 17px; transform: translateY(-50%) rotate(45deg); }
.book[data-ready] .edge-prev::after { left: 17px; transform: translateY(-50%) rotate(-135deg); }
.book[data-ready] .edge:hover::after, .book[data-ready] .edge:focus-visible::after { opacity: 1; }
.book[data-ready] .edge-next:hover::after { transform: translate(3px, -50%) rotate(45deg); }
.book[data-ready] .edge-prev:hover::after { transform: translate(-3px, -50%) rotate(-135deg); }
@media (max-width: 900px) { .book[data-ready] .edge::after { content: none; } }
@media (hover: none) {
  .book[data-ready] .edge { --c: 28px; }
  .book[data-ready] .curl svg { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .book[data-ready] .edge, .book[data-ready] .edge::before, .book[data-ready] .curl, .book[data-ready] .curl svg { transition: none; }
}

/* Two-page spreads. A page keeps its side's look in the slot and while it turns (forward turn: front = old
   right page, back = new left page; back turn: the other way round). The outer margin is wide enough to
   hold the edge button, and pages with a photo let it take the room that's left. */
@media (min-width: 901px) {
  .book[data-ready] :is(.slot-l, .turn:not(.back-turn) .back, .turn.back-turn .front) .leaf { border-radius: 10px 2px 2px 10px; background: linear-gradient(90deg, #f3f5f6 92%, #dfe4e7); padding-left: max(52px, calc(var(--pad) + 16px)); }
  .book[data-ready] :is(.slot-r, .turn:not(.back-turn) .front, .turn.back-turn .back) .leaf { border-radius: 2px 10px 10px 2px; background: linear-gradient(90deg, #dfe4e7, #f6f8f9 8%); padding-right: max(52px, calc(var(--pad) + 16px)); }
  .book[data-ready] :is(.slot-l, .turn:not(.back-turn) .back, .turn.back-turn .front) .leaf .foot { left: max(52px, calc(var(--pad) + 16px)); }
  .book[data-ready] :is(.slot-r, .turn:not(.back-turn) .front, .turn.back-turn .back) .leaf .foot { right: max(52px, calc(var(--pad) + 16px)); }
  .book[data-ready] .leaf.media { display: flex; flex-direction: column; padding-bottom: 44px; }
  .book[data-ready] .leaf.media > * { flex-shrink: 0; }
  .book[data-ready] .leaf.media > :is(.photo, .band) { flex: 1 1 0; min-height: 120px; aspect-ratio: auto; }
  .book[data-ready] .leaf.media > .band { max-height: 280px; }
  .book[data-ready] .leaf.media > p + h3 { margin-top: var(--space-1); }
  .book[data-ready] .leaf.tight [data-opt] { display: none; }
}

@media (max-width: 900px) {
  .book[data-ready] { aspect-ratio: auto; height: auto; width: 100%; perspective: 1600px; }
  .book[data-ready]::before { display: none; }
  .book[data-ready] .slot-l { display: none; }
  .book[data-ready] .slot-r { position: relative; width: 100%; }
  .book[data-ready] .slot-r .leaf { height: auto; min-height: 70vh; }
  .book[data-ready] :is(.slot-r, .turn .face) .leaf { border-radius: 8px; padding-bottom: 4rem; }
  /* An industry page's photo grows to fill the page. */
  .book[data-ready] .leaf.ind { display: flex; flex-direction: column; }
  .book[data-ready] .leaf.ind > * { flex-shrink: 0; }
  .book[data-ready] .leaf.ind > .duo { flex: none; }
  .book[data-ready] .turn { width: 100%; }
  /* One page at a time: the edge buttons are the two bottom corners, clear of the text. */
  .book[data-ready] .edge { top: auto; bottom: 0; width: 56px; height: 56px; }
  .book[data-ready] .edge-prev::before { border-radius: 0 0 0 8px; }
  .book[data-ready] .edge-next::before { border-radius: 0 0 8px 0; }
  .book[data-ready] .leaf .foot { left: 64px; right: 64px; justify-content: center; }
  .book[data-ready] .leaf .foot span:first-child { display: none; }
  .leaf .two { columns: 1; }
  .shapes { grid-template-columns: repeat(2, 1fr); }
}
@media print {
  .cat-tabs, .book .edge { display: none !important; }
  .book { display: block !important; }
  .leaf { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; margin-bottom: 12px; }
}
