:root {
  color-scheme: dark;
  /* Forever Field Guide palette, shared by convention with the tier guide. */
  --bg: #101313;
  --ink: #f1eadc;
  --dim: #b3b4a9;
  --panel: #1a1e1d;
  --line: #373e37;
  --gold: #e5bc79;
  --header: #171a18;
  --banner-edge: #625242;
  --banner-base: #191a16;
  --banner-shade: #161714;
  --banner-title: #fff3db;
  --banner-text: #e6dcc9;
  --banner-accent: #f1c78a;
  --serif: "Palatino Linotype", Palatino, Georgia, serif;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--gold); text-underline-offset: .22em; }
a:hover { color: var(--banner-title); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.wrap { width: min(1180px, 93%); margin-inline: auto; }
.site-header { border-bottom:1px solid var(--line); background:#171a18; font:16px/1.55 system-ui,sans-serif; }
.site-header nav { max-width:1240px; padding:0 30px; margin:auto; display:flex; align-items:center; justify-content:space-between; min-height:66px; }
.site-header a { text-decoration:none; }
.site-header a:hover { text-decoration:underline; }
.brand { color:var(--ink); font:600 22px Georgia,serif; display:flex; align-items:center; gap:12px; }
.brand-mascot { display:block; width:48px; height:48px; object-fit:contain; flex:none; }
.desktop-links { display:flex; gap:26px; }
.desktop-links a { color:var(--dim); font-size:.94rem; }
main.wrap:has(> .hero) { width:100%; max-width:1240px; padding-inline:30px; }
.hero { position:relative; font:16px/1.55 system-ui,sans-serif; }
.hero h1 { font-family:Georgia,serif; line-height:1.1; font-weight:500; }
.hero small { font-weight:650; }
.hero {
  display: grid;
  align-items: center;
  min-height: clamp(220px, 23vw, 285px);
  margin: 24px 0;
  padding: 36px clamp(24px, 4vw, 56px);
  border: 1px solid #625242;
  border-radius: 8px;
  background: linear-gradient(90deg, #101713ba, #10171345 40%, transparent 60%), url("first-aid-camp.webp") center 72% / cover no-repeat, #191a16;
}
.hero small {display:flex;align-items:center;gap:10px;text-transform:uppercase;color:#f1c78a;font-size:.73rem;letter-spacing:.16em}
.hero small::before {content:"";width:26px;height:1px;background:#d6a666}
.hero h1 {margin:10px 0 12px;color:#fff3db;font-size:clamp(38px, 5vw, 65px);letter-spacing:-.04em;text-shadow:0 2px 8px #14120f}
.hero .intro {max-width:38ch;color:#e6dcc9;line-height:1.5;text-wrap:pretty}
.kicker, dt { font: 700 .71rem/1.5 "Segoe UI", system-ui, sans-serif; letter-spacing: .09em; text-transform: uppercase; }
.kicker { color: var(--banner-accent); }

h1, h2, h3 { font-family: var(--serif); color: var(--ink); }
h1 { color: var(--banner-title); margin: 0; font-size: clamp(3.1rem, 6.3vw, 5.4rem); font-weight: 500; line-height: 1; letter-spacing: -.045em; }
.hero .intro { margin:0; }

section { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; margin-bottom: 20px; overflow: hidden; scroll-margin-top: 12px; }
.sectionhead { padding: 16px 20px; }
.sectionhead h2, .item-preview h2 { font-size: clamp(1.45rem, 3vw, 1.85rem); line-height: 1.15; margin: 0; font-weight: 500; }
.sectionhead p, .effect { color: var(--dim); font-size: .91rem; margin: 5px 0 0; }
.matrix-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.matrix-head a { font-size: .87rem; white-space: nowrap; }
.category-filter { display: none; }
.grid-scroll { overflow-x: auto; scrollbar-color: var(--banner-edge) var(--panel); }
table { width: 100%; min-width: 730px; table-layout: fixed; border-spacing: 0; }
th, td { text-align: left; border-top: 1px solid var(--line); }
thead th { padding: 12px 16px; color: var(--ink); background: var(--header); font-size: .9rem; font-weight: 600; }
th:first-child { position: sticky; left: 0; z-index: 1; width: 130px; background: var(--header); border-right: 1px solid var(--line); }
tbody th { padding: 12px; color: var(--gold); text-align: center; font-size: .92rem; font-weight: 600; font-variant-numeric: tabular-nums; }
tbody th small { display: block; margin-top: 2px; font-size: .74rem; font-weight: 400; color: var(--dim); }
td { padding: 5px 8px; vertical-align: middle; }
td + td { border-left: 1px solid color-mix(in srgb, var(--line) 46%, transparent); }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--ink) 2%, var(--panel)); }
.recipe { text-decoration: none; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 49px; padding: 6px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.recipe:hover, .recipe:focus-visible { background: var(--header); color: var(--gold); }
.item-icon { display: block; flex-shrink: 0; object-fit: cover; border-radius: 5px; border: 1px solid var(--banner-edge); box-shadow: 0 1px 3px #0006; }
.recipe-text { display: grid; gap: 3px; min-width: 0; line-height: 1.25; }
.recipe-name { font-size: .9rem; font-weight: 600; }
.manual-market, .recipe small.manual-price { color: var(--gold); font-size: .76rem; font-variant-numeric: tabular-nums; }
.manual-market { text-decoration: none; }
.manual-market:hover, .manual-market:focus-visible { text-decoration: underline; }
.priced-recipe > .manual-market { display: inline-block; margin: 0 4px 7px 50px; }
.recipe small { display: block; font-size: .75rem; font-weight: 400; color: var(--dim); font-variant-numeric: tabular-nums; }
.item-preview > .item-icon, .item-sheet > .item-icon { float: left; margin: 0 12px 9px 0; }
.item-preview .effect, .item-sheet .effect { clear: both; }
.recipe-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 4px 14px; padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.camp-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.item-preview { pointer-events: none; position: fixed; z-index: 20; width: min(335px, calc(100vw - 12px)); max-height: calc(100vh - 12px); overflow: auto; padding: 16px; color: var(--ink); background: rgba(14,17,25,.96); border: 1px solid var(--banner-edge); border-radius: 6px; box-shadow: 0 8px 25px #0007; }
.item-preview .kicker, .item-sheet .kicker { margin: 0 0 5px; }
.item-preview h2 { font-size: 1.25rem; color: var(--banner-title); }
.item-preview ul, .item-sheet ul { margin: 0; padding: 0; list-style: none; }
.item-preview li b, .item-sheet li b { font-weight: 500; color: var(--gold); }
.recipe-document { display: block; color: var(--ink); font-weight: 600; }
.recipe-source { display: block; margin-top: .35rem; }
.source-type { display: inline-block; margin-right: .25rem; padding: 0 .38rem; border: 1px solid var(--line); border-radius: 4px; color: var(--gold); font-size: .76rem; font-weight: 600; }
.item-page { max-width: 760px; margin-block: clamp(25px, 5vw, 65px); }
.back { display: inline-block; font-size: .9rem; }
.item-sheet { margin: 16px 0; padding: clamp(18px, 4vw, 34px); border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.item-sheet > .item-icon { width: 56px; height: 56px; }
.item-sheet h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); line-height: 1.1; }
.item-sheet .effect { padding-top: 8px; color: var(--ink); }
.item-sheet dl { margin-top: 18px; border-top: 1px solid var(--line); }
.training-grid { display: grid; grid-template-columns: 1fr 1fr; border-block: 1px solid var(--line); }
.training-grid article { padding: 16px 24px; }
.training-grid article + article { border-left: 1px solid var(--line); }
.training-grid h3 { margin: 0; font-size: 1.35rem; }
dl { margin: 0; } dt { margin: 14px 0 2px; color: var(--dim); }
dd { margin: 0; font-size: .92rem; }
footer { padding:24px; color:#93998e; text-align:center; font:.8rem/1.55 system-ui,sans-serif; }
.privacy-notice { max-width:48rem; margin:1rem auto; text-align:left; line-height:1.6; }
.privacy-notice summary { width:fit-content; margin:auto; cursor:pointer; }
.privacy-notice p { margin:0; color:var(--dim); }
.privacy-notice a { text-decoration:none; }
.privacy-notice a:hover { text-decoration:underline; }

.skip { position: absolute; top: -80px; z-index: 4; background: var(--panel); padding: 8px; }
.skip:focus { top: 0; }

@media (max-width: 920px) {
  .category-filter:not([hidden]) { display: flex; gap: 10px; align-items: center; padding: 0 15px 12px; font-size: .85rem; color: var(--dim); }
  select { min-height: 36px; max-width: 100%; padding: 3px 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--header); color: var(--ink); font: inherit; }
  table.filtered { min-width: 0; }
  .recipe { gap: 8px; }
}
@media (max-width: 640px) {
  .kicker { font-size:.65rem; margin:0 0 7px; }
  .sectionhead, .training-grid article { padding: 15px; }
  .matrix-head { align-items: start; } .matrix-head a { font-size: .78rem; }
  th:first-child { width: 104px; } td { padding-inline: 4px; }
  .recipe-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); padding: 8px; }
  .camp-list { grid-template-columns: 1fr; }
  .training-grid { grid-template-columns: 1fr; }
  .training-grid article + article { border-left: 0; border-top: 1px solid var(--line); }

}

.mobile-menu{display:none}

@media (max-width:840px) {
  html{scroll-padding-top:62px}
  .site-header{position:sticky;top:0;z-index:20}
  .skip:focus{position:fixed;top:5px;z-index:21}
  .site-header nav{min-height:52px;gap:8px}
  .site-header .desktop-links{display:none}
  .mobile-menu{display:block;position:relative}
  .mobile-menu summary{display:flex;align-items:center;gap:10px;min-height:44px;padding:0 8px;color:var(--gold);cursor:pointer}
  .mobile-menu summary::-webkit-details-marker{display:none}
  .mobile-menu summary::after{content:"";width:7px;height:7px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:translateY(-2px) rotate(45deg)}
  .mobile-menu[open] summary::after{transform:translateY(2px) rotate(225deg)}
  .mobile-menu ul{position:absolute;right:0;top:100%;z-index:1;width:min(17rem,calc(100vw - 28px));max-height:calc(100dvh - 62px);overflow:auto;overscroll-behavior:contain;margin:0;padding:5px;list-style:none;border:1px solid #635b45;border-radius:6px;background:#1a201c;box-shadow:0 9px 25px #0009}
  .mobile-menu a{display:flex;align-items:center;min-height:44px;padding:7px 12px;color:var(--ink);border-radius:3px}
  .mobile-menu a:focus-visible,.mobile-menu a:hover{background:#2b322c}
  .mobile-menu li:last-child { border-top: 1px solid var(--line); }
}
@media (max-width:600px) {
  .hero {
    min-height:0;
    margin:16px 0;
    padding:0;
    overflow:hidden;
    background:#161a17;
  }
  .hero::before {
    content:"";
    height:clamp(148px, 39vw, 200px);
    background:url("first-aid-camp.webp") 76% 62% / cover no-repeat;
  }
  .hero-copy {
    padding:16px 18px 20px;
  }
  .hero h1 {font-size:clamp(34px,8.8vw,46px);margin:7px 0}
  .hero p {font-size:.93rem;max-width:34ch}
}
@media (max-width:600px) {
  .site-header nav, main.wrap:has(> .hero) { padding-inline:14px; }
  .brand { font-size:18px; gap:6px; }
  .brand-mascot { width:34px; height:38px; }
}
