/* Cullwise — panel-CMS layout, modernised. Dark skin.
 *
 * Structurally IDENTICAL to the Small Anvil site: same shell, masthead, nav
 * strip, breadcrumbs, sidebar panels, caption bars, row lists. Same class
 * vocabulary. Only the skin differs — change one, consider the other.
 *
 * The palette is the app's "Light Table" system, so the site and the
 * application read as one product. Dark only, on purpose: the app deleted its
 * light palette deliberately, and a bright marketing page in front of a dark
 * application is a bait-and-switch.
 *
 * Gold is what Cullwise thinks. Bone is what the photographer decided. That
 * distinction is load-bearing in the app; it holds here too — gold marks
 * captions and the app's own claims, bone marks the reader's actions.
 *
 * Written from scratch; no PHP-Fusion CSS (it is AGPL).
 */

:root {
  --desk:      #08080A;   /* the ground the shell sits on */
  --shell:     #131318;
  --panel:     #1B1B1E;
  --panel-alt: #232327;
  --cap:       #26262B;
  --cap-ink:   #ECE3D0;
  --nav:       #0E0E12;
  --edge:      #34343A;
  --edge-soft: #2A2A2F;
  --ink:       #ECE3D0;   /* bone */
  --ink-soft:  #A7A296;
  --ink-faint: #7C7870;
  --gold:      #C6A24E;
  --gold-lo:   #B08E36;
  --table:     #131318;

  --font: Verdana, Geneva, "DejaVu Sans", Tahoma, sans-serif;
  /* DIN Condensed ships with macOS, which is most of this audience — it is a
   * Mac-only product. Everyone else gets a condensed fallback rather than a
   * webfont request.
   * TODO: self-host a licensed condensed face before launch. Never hotlink a
   * font CDN. */
  --display: "DIN Condensed", "DIN Alternate", "Oswald", "Arial Narrow",
             "Roboto Condensed", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 22px 16px 44px;
  background: var(--desk);
  color: var(--ink);
  font: 400 15px/1.62 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); }
a:hover { color: #DFC077; }

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 50%; top: 6px; transform: translateX(-50%); z-index: 10;
  background: var(--gold); color: #131318; padding: 8px 14px;
}

/* ---------- the shell ---------- */

.shell {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--shell);
  border: 1px solid var(--edge);
  box-shadow: 0 6px 22px rgba(0,0,0,.5);
}

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--edge);
}

.lockup { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }

.mark { width: 38px; height: 38px; flex: none; display: block; }

.wordmark {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
}

/* CULL = bone, WISE = gold — emphasis on the value, not the act. */
.wordmark b { color: var(--ink); font-weight: 700; }
.wordmark i { color: var(--gold); font-weight: 700; font-style: normal; }

.masthead .tagline {
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 0.34em;
  text-transform: lowercase;
  color: var(--ink-faint);
  margin: 0;
  text-align: right;
}

/* ---------- nav strip ---------- */

.navbar {
  display: flex;
  flex-wrap: wrap;
  background: var(--nav);
  border-bottom: 1px solid var(--edge);
}

.navbar a {
  padding: 9px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  border-right: 1px solid rgba(255,255,255,.07);
}

.navbar a:hover { background: rgba(255,255,255,.06); color: var(--ink); }

.navbar a.current { background: var(--gold); color: #131318; }

/* ---------- breadcrumbs ---------- */

.crumbs {
  padding: 6px 20px;
  background: var(--panel-alt);
  border-bottom: 1px solid var(--edge-soft);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}

.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ---------- layout ---------- */

.layout {
  display: grid;
  /* Sidebar renders left but comes AFTER main in the DOM, so screen readers
   * and phones get the content first. */
  grid-template-columns: 218px minmax(0, 1fr);
  grid-template-areas: "side main";
  gap: 18px;
  padding: 18px 20px 22px;
  align-items: start;
}

.main { grid-area: main; min-width: 0; }
.side { grid-area: side; }

/* ---------- the panel ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--edge);
  margin-bottom: 18px;
}

.panel:last-child { margin-bottom: 0; }

.panel > .cap {
  /* The caption is an <h2> for document outline, so it inherits heading
   * margins — which show as a gap between the panel edge and the bar. */
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  background: var(--cap);
  color: var(--cap-ink);
  border-bottom: 1px solid var(--edge);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel > .cap .cap-note {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  text-transform: none;
}

.panel > .body { padding: 15px 16px; }
.panel > .body > :first-child { margin-top: 0; }
.panel > .body > :last-child { margin-bottom: 0; }

.panel.tight > .body { padding: 0; }

/* Used once per page at most, for the thing the page is actually about. */
.panel.feature > .cap { background: var(--gold); color: #131318; border-bottom-color: var(--gold-lo); }
.panel.feature > .cap .cap-note { color: rgba(19,19,24,.7); }

/* ---------- content typography inside panels ---------- */

.main h1 {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
  margin: 0 0 14px;
}

/* Scoped to .body so it can never reach a caption bar. */
.main .body h2 {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.25;
  margin: 24px 0 8px;
}

.main p { margin: 0 0 12px; max-width: 68ch; }
.main ul, .main ol { margin: 0 0 12px; padding-left: 22px; max-width: 68ch; }
.main li { margin-bottom: 5px; }

.lede { font-size: 16px; color: var(--ink); }

/* Prose measure is for prose only — structural elements span the full panel.
 * Two classes deep on purpose: `.main ul` is (0,1,1) and beats a bare
 * `.rows` (0,1,0) no matter where it sits in the file. */
.panel .rows,
.panel .itemfoot,
.panel .spec {
  max-width: none;
  margin: 0;
  padding-left: 0;
}

/* ---------- row lists ---------- */

.rows { list-style: none; }

.rows > li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--edge-soft);
}

.rows > li:nth-child(even) { background: var(--panel-alt); }
.rows > li:last-child { border-bottom: none; }

.rows .row-main { min-width: 0; flex: 1 1 260px; }
.rows .row-main strong { display: block; font-size: 15px; margin-bottom: 3px; color: var(--ink); }
.rows .row-main span { color: var(--ink-soft); font-size: 13px; }
.rows .row-side { flex: none; font-size: 12px; color: var(--ink-faint); }

/* Numbered rows — the step list. */
.rows.numbered > li { align-items: flex-start; }

.rows .num {
  flex: none;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-family: var(--display);
  font-size: 17px;
  margin-right: 12px;
}

/* ---------- key/value table ---------- */

.spec { width: 100%; border-collapse: collapse; font-size: 13px; }

.spec th, .spec td {
  text-align: left;
  padding: 8px 16px;
  border-bottom: 1px solid var(--edge-soft);
  vertical-align: top;
}

.spec tr:last-child th, .spec tr:last-child td { border-bottom: none; }
.spec tr:nth-child(even) { background: var(--panel-alt); }

.spec th {
  width: 34%;
  font-weight: 400;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.spec td { color: var(--ink); }

/* ---------- sidebar ---------- */

.side .panel { margin-bottom: 16px; }
.side .body { font-size: 13px; color: var(--ink-soft); }
.side .spec { font-size: 12px; }
.side .spec th, .side .spec td { padding: 6px 12px; }
.side .spec th { width: 46%; }
.side .panel > .cap { font-size: 14px; }

.plist { list-style: none; margin: 0; padding: 0; }
.plist li { border-bottom: 1px solid var(--edge-soft); }
.plist li:last-child { border-bottom: none; }

.plist a {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
}

.plist a::before { content: "\00BB"; color: var(--gold); margin-right: 7px; }
.plist a:hover { background: var(--panel-alt); color: var(--ink); }
.plist a.current { background: var(--panel-alt); color: var(--ink); font-weight: 700; }

/* ---------- item footer strip ---------- */

.itemfoot {
  padding: 7px 16px;
  background: var(--panel-alt);
  border-top: 1px solid var(--edge-soft);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
}

.itemfoot a { color: var(--ink-soft); }

/* ---------- buttons + tags ---------- */

.btn {
  display: inline-block;
  padding: 9px 18px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  background: var(--panel-alt);
  border: 1px solid var(--edge);
}

.btn:hover { background: #2C2C31; color: var(--ink); border-color: #45454C; }

/* Bone = the reader's own action, per the app's colour rule. */
.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #131318;
}

.btn.primary:hover { background: #FFF6E4; border-color: #FFF6E4; color: #131318; }

.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 6px;
  border: 1px solid currentColor;
  color: var(--gold);
  white-space: nowrap;
}

.tag.quiet { color: var(--ink-faint); }

/* ---------- footer ---------- */

.foot {
  padding: 12px 20px;
  background: var(--panel-alt);
  border-top: 1px solid var(--edge);
  font-size: 11px;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.foot p { margin: 0; }
.foot a { color: var(--ink-soft); }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  body { padding: 0 0 28px; }
  .shell { border-left: none; border-right: none; }
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main" "side";
    padding: 14px;
    gap: 14px;
  }
  .masthead { padding: 14px; }
  .masthead .tagline { text-align: left; letter-spacing: 0.2em; }
  .navbar a { flex: 1 1 auto; text-align: center; padding: 10px 10px; }
  .main h1 { font-size: 32px; }
}
