/* RoughMachine's Field Guide — public site. Colors and fonts are the app's (src/looks.css): dark = the default "Control panel" look,
   light = the "Print sheet" look. Fonts are the app's own, served from this site (no outside requests). */
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/barlow-400.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/barlow-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/barlow-condensed-600.woff2) format("woff2"); }
@font-face { font-family: "Share Tech Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/share-tech-mono-400.woff2) format("woff2"); }

:root {
  color-scheme: dark;
  --bg: #0D0F11; --panel: #171A1D; --panel2: #20252A; --border: #3B434C; --text: #E8ECEF; --muted: #A3ADB6;
  --accent: #8FE36B; --on-accent: #0A1A05; --wash: rgba(143, 227, 107, 0.13); --blue: #6BC0EC; --blue-wash: rgba(107, 192, 236, 0.12);
  --red: #FF7A6B; --warn-bg: #2A2411; --warn-border: #6E5C1F; --warn-text: #F4D56A; --logo-bg: #050607;
  --stripe: repeating-linear-gradient(135deg, #151515 0 7px, #F2C230 7px 14px);
  --f-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-mono: "Share Tech Mono", ui-monospace, Menlo, Consolas, monospace;
  font-synthesis: none;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #E7E3D5; --panel: #F6F3E9; --panel2: #ECE7D7; --border: #A9B1BA; --text: #172638; --muted: #4A5868;
    --accent: #1C4F8F; --on-accent: #FFFFFF; --wash: rgba(28, 79, 143, 0.11); --blue: #0E6A6A; --blue-wash: rgba(14, 106, 106, 0.10);
    --red: #A4291F; --warn-bg: #FFF2C2; --warn-border: #8A6A00; --warn-text: #4F3D00; --logo-bg: #F6F3E9;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.55 var(--f-body); overflow-wrap: anywhere; }
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--accent); color: var(--on-accent); padding: 12px 16px; z-index: 10; min-height: 48px; }
.skip:focus { top: 8px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* header */
.top { background: var(--panel); border-bottom: 1px solid var(--border); }
.top .wrap { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 6px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-height: 48px; }
.brand img { width: 44px; height: 44px; display: block; background: var(--logo-bg); }
.brand-name { font: 600 21px/1.1 var(--f-head); letter-spacing: 0.3px; }
.brand-name span { color: var(--accent); }
.tagline { display: block; font: 400 12px/1.3 var(--f-mono); color: var(--muted); letter-spacing: 0.5px; }
nav ul { list-style: none; margin: 0; padding: 0 0 4px; display: flex; flex-wrap: wrap; gap: 4px; }
nav a { display: flex; align-items: center; min-height: 48px; padding: 0 12px; color: var(--muted); font: 600 15px var(--f-body); text-decoration: none; border-bottom: 3px solid transparent; }
nav a:hover { color: var(--text); }
nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

/* type */
main { padding: 20px 0 32px; }
h1, h2, h3 { font-family: var(--f-head); font-weight: 600; letter-spacing: 0.3px; line-height: 1.15; margin: 0 0 10px; }
h1 { font-size: 32px; }
h2 { font-size: 24px; margin-top: 30px; }
h3 { font-size: 19px; margin-top: 18px; }
p { margin: 0 0 12px; }
.lead { font-size: 19px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
ul.list { padding-left: 22px; margin: 0 0 12px; }
ul.list li { margin-bottom: 4px; }
code, .mono { font-family: var(--f-mono); }

/* panels */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 3px; padding: 16px; margin: 0 0 16px; }
.card > :last-child { margin-bottom: 0; }
.cards { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 16px; }
@media (min-width: 620px) { .cards { grid-template-columns: 1fr 1fr; } }
.cards .card { margin: 0; display: flex; flex-direction: column; }
.cards .card p { flex: 1; }
.note { background: var(--blue-wash); border-left: 4px solid var(--blue); padding: 12px 14px; margin: 0 0 16px; }
.warn, .startpt { background: var(--stripe) top left / 100% 5px no-repeat, var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text); border-radius: 3px; padding: 14px 14px 12px; margin: 0 0 16px; }
.startpt { font-weight: 600; }
.warn summary { cursor: pointer; font-weight: 600; min-height: 48px; display: flex; align-items: center; }
.warn p { margin: 6px 0 0; font-size: 14px; }
.beta { border-left: 4px solid var(--accent); }

/* buttons and links that act like buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; background: var(--accent); color: var(--on-accent);
  border: 2px solid var(--accent); border-radius: 2px; font: 600 16px var(--f-body); text-decoration: none; cursor: pointer; }
.btn:hover { color: var(--on-accent); filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { color: var(--text); border-color: var(--accent); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; border: 0; padding: 0; }
.seg button { min-height: 48px; min-width: 48px; padding: 0 14px; background: var(--panel2); color: var(--muted); border: 2px solid var(--border); border-radius: 2px;
  font: 600 15px var(--f-body); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.seg .lbl { width: 100%; font-size: 14px; color: var(--muted); margin-bottom: -2px; }
.unitbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.unitbar .seg { margin: 0; }

/* forms */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 12px; }
label, .lbl { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
input, select { width: 100%; min-height: 48px; background: var(--panel2); color: var(--text); border: 1px solid var(--border); border-radius: 2px; padding: 8px 10px;
  font: 400 17px var(--f-mono); }
select { font-family: var(--f-body); }
input.filled { border-color: var(--accent); }
.field { margin-bottom: 12px; }

/* answers */
.result { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.big { font: 400 34px/1.1 var(--f-mono); color: var(--accent); margin: 0 0 4px; }
.sub { font-size: 14px; color: var(--muted); }
.out { margin: 0 0 12px; }
.kv { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.kv dt { color: var(--muted); font-size: 15px; }
.kv dd { margin: 0; font-family: var(--f-mono); font-size: 16px; }
.kv dd .muted { font-family: var(--f-body); font-size: 14px; }
.kv.given dd { color: var(--accent); }
.hi { color: var(--accent); font-weight: 400; }
.err { color: var(--red); font-weight: 600; }
.src { font-size: 13px; color: var(--muted); }
.steps { font-family: var(--f-mono); font-size: 15px; padding-left: 22px; margin: 0 0 8px; }
.steps li { margin-bottom: 4px; }
.steps b { color: var(--blue); font-weight: 400; }

/* triangle drawing */
.tri { width: 100%; max-width: 420px; display: block; margin: 0 auto 12px; }
.tri .shape { fill: var(--blue-wash); stroke: var(--muted); stroke-width: 1.5; }
.tri .sq { fill: none; stroke: var(--muted); stroke-width: 1; }
.tri text { fill: var(--muted); font: 13px var(--f-mono); }
.tri text.given { fill: var(--accent); }
.tri text.solved { fill: var(--blue); }

/* tables */
.tblwrap { overflow-x: auto; margin: 0 0 12px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td { font-family: var(--f-mono); }
td:first-child { font-family: var(--f-body); }
tr.grp th { color: var(--accent); font: 600 16px var(--f-head); padding-top: 14px; }
table.bolt td:first-child { font-family: var(--f-mono); color: var(--accent); }
.chart td { white-space: nowrap; }
.chart td:first-child { white-space: normal; min-width: 150px; }

/* sources */
ol.sources { padding-left: 22px; font-size: 14px; }
ol.sources li a { display: inline-block; min-height: 48px; padding: 12px 0; }

/* footer */
footer { border-top: 1px solid var(--border); background: var(--panel); font-size: 14px; color: var(--muted); }
footer .wrap { padding-top: 14px; padding-bottom: 20px; }
footer p { margin: 0 0 6px; }
footer a { display: inline-flex; align-items: center; min-height: 48px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
details.card > summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; color: var(--blue); font-size: 16px; margin: 0; }
