/* Coffey Labs Swag: the coffeylabs.org drawing set, on every page and
   every shelf. Loaded after styles.css.
   Fonts (SIL Open Font License, static/fonts/OFL-*.txt): Barlow, Barlow
   Condensed and IBM Plex Mono. */
@font-face { font-family: "Barlow"; src: url("/fonts/barlow-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/barlow-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/barlow-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/barlow-latin-600-normal.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); font-weight: 700 800; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }

/* ---- The frame: whiteprint, and blueprint in dark mode -------------------- */
:root {
  --bg: #F2F0E9; --surface: #FBFAF5; --text: #11305E; --muted: #3F5576; --faint: #5A6A84;
  --line: rgba(17, 48, 94, .22); --rule: rgba(17, 48, 94, .7);
  --accent: #1A5FB4; --accent-text: #FFFFFF; --accent-soft: rgba(26, 95, 180, .09);
  --band: #0E3D78; --band-text: #EEF4FF; --red: #C0322A;
  --grid-a: rgba(26, 95, 180, .055); --grid-b: rgba(26, 95, 180, .11);
  --photo: #E7E5DC;
  --radius: 3px;
  --font: "Barlow", system-ui, sans-serif;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --head: var(--cond);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B2A52; --surface: #0F3361; --text: #EAF2FF; --muted: #B6CBE8; --faint: #93AED3;
    --line: rgba(234, 242, 255, .22); --rule: rgba(234, 242, 255, .72);
    --accent: #9AD0FF; --accent-text: #0B2A52; --accent-soft: rgba(154, 208, 255, .12);
    --band: #F2F0E9; --band-text: #11305E; --red: #FF8274;
    --grid-a: rgba(150, 200, 255, .07); --grid-b: rgba(150, 200, 255, .14);
    --photo: #D9E3F0;
  }
}
:root[data-theme="dark"] {
  --bg: #0B2A52; --surface: #0F3361; --text: #EAF2FF; --muted: #B6CBE8; --faint: #93AED3;
  --line: rgba(234, 242, 255, .22); --rule: rgba(234, 242, 255, .72);
  --accent: #9AD0FF; --accent-text: #0B2A52; --accent-soft: rgba(154, 208, 255, .12);
  --band: #F2F0E9; --band-text: #11305E; --red: #FF8274;
  --grid-a: rgba(150, 200, 255, .07); --grid-b: rgba(150, 200, 255, .14);
  --photo: #D9E3F0;
}

/* Graph paper: a fine grid and a coarse one. */
body {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-b) 1px, transparent 1px), linear-gradient(90deg, var(--grid-b) 1px, transparent 1px),
    linear-gradient(var(--grid-a) 1px, transparent 1px), linear-gradient(90deg, var(--grid-a) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  font-size: 17px;
}
.wrap { width: min(1180px, 100% - 32px); }
h1, h2, h3 { font-family: var(--head); font-weight: 700; letter-spacing: .005em; }
.eyebrow, .sheet-no { font: 500 .74rem/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.lede { color: var(--muted); }

/* Buttons are drawn, not pillowed. */
.btn { border-radius: var(--radius); border: 1.5px solid var(--rule); background: transparent; color: var(--text); font: 600 1rem/1.2 var(--font); padding: 11px 20px; }
.btn.primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn:hover { filter: none; box-shadow: 3px 3px 0 var(--accent-soft), 3px 3px 0 1.5px var(--rule); }

/* ---- Header: a title block over a rail of sheets ---------------------------- */
.top { background: var(--bg); border-bottom: 1.5px solid var(--rule); box-shadow: 0 3px 0 -1.5px var(--bg), 0 4px 0 -1.5px var(--line); }
.top-in { min-height: 62px; gap: 14px; }
.brand { gap: 10px; }
.brand-mark { width: 36px; height: 36px; display: block; }
.brand-name { font: 700 1.35rem/1 var(--cond); letter-spacing: .01em; color: var(--text); }
.brand-name span { font-weight: 600; color: var(--muted); border-left: 1.5px solid var(--rule); padding-left: 8px; margin-left: 2px; }
#site-nav a { border-radius: var(--radius); font-weight: 500; color: var(--muted); }
#site-nav a[aria-current="page"], #site-nav a.active { background: none; color: var(--text); box-shadow: inset 0 -2px 0 var(--text); }
/* The print switch, as on coffeylabs.org: half whiteprint, half blueprint. */
.print { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--rule); border-radius: var(--radius); background: none; color: var(--text); padding: 5px 10px; cursor: pointer; }
.print i { width: 20px; height: 20px; border: 1.5px solid var(--text); border-radius: 50%; background: linear-gradient(90deg, #F2F0E9 50%, #0B2A52 50%); transition: transform .5s cubic-bezier(.5, -0.4, .3, 1.4); }
:root[data-theme="dark"] .print i { transform: rotate(180deg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .print i { transform: rotate(180deg); } }
@media (prefers-reduced-motion: reduce) { .print i { transition: none; } }
.print span { font: 500 .66rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.print:hover { background: var(--accent-soft); }
@media (max-width: 560px) { .print span { display: none; } }
.cart-link { font-weight: 600; color: var(--text); border: 1.5px solid var(--rule); border-radius: var(--radius); padding: 6px 10px; }
.cart-link [data-cart-count] { background: var(--red); color: #fff; border-radius: 2px; }

.rail { border-top: 1px solid var(--line); }
.rail-in { list-style: none; display: flex; gap: 0; margin-block: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.rail-in li { flex: 0 0 auto; }
.rail a { display: flex; align-items: baseline; gap: 7px; padding: 8px 14px 9px; color: var(--muted); text-decoration: none; font-weight: 500; border-right: 1px solid var(--line); white-space: nowrap; }
.rail li:first-child a { border-left: 1px solid var(--line); }
.rail a small { font: 500 .68rem var(--font-mono); letter-spacing: .08em; color: var(--faint); }
.rail a::before { content: ""; width: 7px; height: 7px; align-self: center; border: 1.5px solid var(--text); border-radius: 1px; }
.rail a:hover, .rail a[aria-current] { color: var(--text); background: var(--accent-soft); }
.rail a[aria-current] { box-shadow: inset 0 -3px 0 var(--text); }
.rail a[aria-current]::before { background: var(--text); }

/* ---- Hero: sheet S-00 ------------------------------------------------------ */
.hero { position: relative; border-bottom: 1.5px solid var(--rule); }
.hero h1 { font-size: clamp(3rem, 10vw, 6.5rem); line-height: .92; text-transform: uppercase; max-width: 12ch; letter-spacing: -.005em; }
.hero h1::after { /* a dimension line under the title */
  content: ""; display: block; height: 10px; margin-top: 18px; max-width: 420px;
  border-left: 1.5px solid var(--red); border-right: 1.5px solid var(--red);
  background: linear-gradient(var(--red), var(--red)) center / 100% 1.5px no-repeat;
}
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---- Products everywhere --------------------------------------------------- */
:is(.shop-grid, .product-photos) :is(.shop-photo, .product-photo, .product-photo-main) { background: var(--photo); }
.shop-card a { gap: 8px; }
.shop-card strong { font-weight: 600; }
.shop-price { font-family: var(--font-mono); font-size: .9rem; }
.product-price { font-family: var(--font-mono); font-weight: 500; }
.variant span { border-radius: var(--radius); font-family: var(--font-mono); }
.shelf-summary { color: var(--muted); max-width: 60ch; }

/* ---- A shelf on the home page ---------------------------------------------- */
.shelf-block { position: relative; border-bottom: 1.5px solid var(--rule); }
.shelf-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; margin-bottom: 22px; }
.shelf-mark { width: 44px; height: 44px; display: block; }
.shelf-head:not(:has(.shelf-mark)) { grid-template-columns: minmax(0, 1fr) auto; }
.shelf-title h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.shelf-title .sheet-no { margin: 0 0 2px; }
.shelf-head .shelf-summary { margin: 4px 0 0; }
.shelf-head .more { white-space: nowrap; }
@media (max-width: 640px) {
  .shelf-head { grid-template-columns: auto minmax(0, 1fr); }
  .shelf-head .more { grid-column: 1 / -1; }
}

/* ---- The sheet index (/tags/) ---------------------------------------------- */
.shelf-index { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.shelf-index a { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 4px 14px; padding: 18px; height: 100%; text-decoration: none; color: var(--text); background: var(--bg); border: 1.5px solid var(--line); border-radius: var(--radius); }
.shelf-index a > :not(img, .shelf-glyph) { grid-column: 2; }
.shelf-index img, .shelf-glyph { grid-row: 1 / span 4; width: 48px; height: 48px; }
.shelf-glyph { display: grid; place-items: center; font: 700 .9rem var(--font-mono); color: var(--accent); border: 1.5px solid var(--accent); border-radius: 4px; }
.shelf-index strong { font: 700 1.5rem/1.1 var(--head); }
.shelf-index .shelf-summary { font-size: .95rem; }
.shelf-index .shelf-count { font: .78rem var(--font-mono); color: var(--muted); }
.shelf-index a:hover { border-color: var(--accent); }

/* ---- Footer ---------------------------------------------------------------- */
.foot { border-top: 1.5px solid var(--rule); background: var(--bg); }
.foot .foot-note { font: .74rem/1.5 var(--font-mono); color: var(--faint); padding: 0 0 22px; margin: 0 auto; }

/* A zone strip down the side of every shelf, as on the drawing set. */
.shelf-block::before {
  content: "A\A\A B\A\A C\A\A D"; white-space: pre; position: absolute; left: 6px; top: 40px;
  font: 500 .66rem/1.2 var(--font-mono); color: var(--faint); letter-spacing: .1em;
}
@media (max-width: 1240px) { .shelf-block::before { display: none; } }

/* ---- plain ------------------------------------------------------------------
   The plain look coffeylabs.org, git.coffeylabs.org and the forum wear: a
   slate dark print instead of the cyanotype, plain UI type, a quiet header,
   no graph paper or zone strips, and buttons that don't jump. The hero's
   lettering and dimension line stay, as the drawings do on coffeylabs.org.
   Last in the file so it wins over the drawing-set rules above. */
:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --head: var(--font);
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161D; --surface: #161C24; --text: #E6EAF0; --muted: #B4BCC8; --faint: #8C96A4;
    --line: rgba(230, 234, 240, .13); --rule: rgba(230, 234, 240, .28);
    --accent-text: #11161D; --photo: #D9E3F0;
  }
}
:root[data-theme="dark"] {
  --bg: #11161D; --surface: #161C24; --text: #E6EAF0; --muted: #B4BCC8; --faint: #8C96A4;
  --line: rgba(230, 234, 240, .13); --rule: rgba(230, 234, 240, .28);
  --accent-text: #11161D; --photo: #D9E3F0;
}
.print i { background: linear-gradient(90deg, #F2F0E9 50%, #11161D 50%); }

body { background-image: none; }
.shelf-block::before { display: none; }
h1, h2, h3 { letter-spacing: -.01em; }
.hero h1 { font-family: var(--cond); letter-spacing: -.005em; }

/* a quiet header: one hairline, the name in plain type, no PRINT label or
   sheet numbers on the rail */
.top { border-bottom: 1px solid var(--line); box-shadow: none; }
.brand-name { font: 600 1.15rem/1 var(--font); }
.brand-name span { font-weight: 500; border-left-width: 1px; }
.print, .cart-link { border-width: 1px; border-color: var(--line); }
.print span, .rail a small { display: none; }
.rail a::before { display: none; }
.rail a[aria-current] { box-shadow: inset 0 -2px 0 var(--accent); }
.cart-link [data-cart-count] { border-radius: 999px; }

/* buttons: the primary one in link blue, and nothing jumps on hover */
.btn { border-width: 1px; border-color: var(--line); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn:hover { box-shadow: none; filter: brightness(1.08); }
.btn:not(.primary):hover { background: var(--accent-soft); filter: none; }

.shelf-block, .hero, .foot { border-color: var(--line); border-width: 1px; }
.shelf-index a { border-width: 1px; border-radius: 10px; }
.shelf-glyph { border-width: 1px; }
