/* HVAC Sports Academy: exercise book and classroom chalkboard */
:root {
  --paper: #fbf8ef;
  --line: #d9e4ee;
  --margin: #e8a7a0;
  --ink: #1f2a24;
  --mut: #5d6a62;
  --chalk: #2c4a3a;
  --chalk2: #3a5d4a;
  --brick: #b5442f;
  --mustard: #e0a100;
  --card: #ffffff;
  --hand: 'Patrick Hand', 'Comic Sans MS', cursive;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font: 18px/1.65 var(--serif);
  background-color: var(--paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, var(--line) 31px 32px);
}
a { color: var(--brick); text-underline-offset: 3px; }
a:hover { color: var(--chalk); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; color: var(--chalk); }
h1 { font-size: clamp(32px, 4.4vw, 50px); margin: 0 0 12px; }
h2 { font-size: 26px; margin: 34px 0 10px; }
h3 { font-size: 21px; margin: 0 0 6px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--mustard); color: var(--ink); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 10px; top: 10px; }

.layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--chalk) 284px, #6b4a2b 284px 290px, transparent 290px); }

/* left syllabus, styled like the inside cover of an exercise book */
.syllabus {
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
  background: var(--chalk); color: #eef1e8; padding: 26px 22px 30px;
  border-right: 6px solid #6b4a2b;
  box-shadow: inset -2px 0 0 rgba(255, 255, 255, .08);
}
.crest { display: block; text-decoration: none; color: #fff; border: 2px dashed rgba(244, 244, 236, .55); border-radius: 6px; padding: 14px 16px; margin-bottom: 18px; }
.crest strong { display: block; font: 700 34px/1 var(--serif); letter-spacing: .12em; }
.crest span { display: block; font: 24px/1.2 var(--hand); color: var(--mustard); }
.crest em { display: block; font: normal 15px/1.3 var(--hand); color: #cfe0d3; margin-top: 6px; }
.crest:hover { color: #fff; border-color: var(--mustard); }
.syl summary { font: 22px var(--hand); color: var(--mustard); cursor: pointer; list-style: none; }
.syl summary::-webkit-details-marker { display: none; }
.syl summary::before { content: '\2630  '; }
.syllabus h2 { font: 700 13px var(--serif); letter-spacing: .16em; text-transform: uppercase; color: #a9c4b0; margin: 18px 0 6px; }
.syllabus ol, .syllabus ul { list-style: none; margin: 0; padding: 0; }
.syllabus li a { display: block; padding: 6px 10px; margin: 2px 0; border-radius: 4px; color: #f4f4ec; text-decoration: none; font: 19px/1.25 var(--hand); }
.syllabus li a span { display: block; font: 600 11px var(--serif); letter-spacing: .14em; text-transform: uppercase; color: #9fd8ff; }
.syllabus li a:hover { background: rgba(255, 255, 255, .08); }
.syllabus li a.here { background: var(--paper); color: var(--chalk); }
.syllabus li a.here span { color: var(--brick); }

/* page column with a red margin line */
.page { position: relative; padding: 36px clamp(18px, 4vw, 56px) 0 clamp(30px, 6vw, 96px); max-width: 1100px; }
.page::before { content: ''; position: absolute; top: 0; bottom: 0; left: clamp(16px, 3.4vw, 60px); width: 2px; background: var(--margin); }

.masthead { padding: 10px 0 18px; }
.masthead.small { padding-bottom: 6px; }
.masthead.small h1 { font-size: clamp(30px, 3.8vw, 44px); }
.eyebrow { font: 20px var(--hand); color: var(--brick); margin: 0 0 4px; }
.dek { font-size: 20px; max-width: 46em; margin: 0 0 16px; }
.button { display: inline-block; font: 22px var(--hand); text-decoration: none; padding: 8px 22px; margin: 4px 8px 4px 0; background: var(--chalk); color: #fff; border-radius: 4px; box-shadow: 4px 4px 0 var(--mustard); }
.button:hover { color: #fff; background: var(--chalk2); }
.button.alt { background: var(--paper); color: var(--chalk); border: 2px solid var(--chalk); box-shadow: 4px 4px 0 var(--line); }

.chalkband { background: var(--chalk); color: #eef1e8; border: 10px solid #6b4a2b; border-radius: 4px; padding: 6px 26px 24px; margin: 26px 0; box-shadow: 0 8px 18px rgba(0, 0, 0, .15); }
.chalkband h2 { color: #fff; font: 32px var(--hand); }
.skills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.skill { border-top: 3px solid var(--mustard); padding-top: 10px; }
.skill h3 { color: var(--mustard); font: 28px var(--hand); }
.skill p { margin: 0 0 8px; font-size: 16px; }
.skill a { color: #9fd8ff; }
.tiny { font-size: 14px !important; color: var(--mut); }
.chalkband .tiny { color: #cfe0d3; }

.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); box-shadow: 3px 3px 0 var(--line); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font: 700 13px var(--serif); text-transform: uppercase; letter-spacing: .1em; color: var(--mut); background: #f3f6f2; }
table.lessons td:first-child { font: 26px var(--hand); color: var(--brick); }
table.lessons td:nth-child(2) a { font-weight: 700; }

.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.cols2 > div > h2:first-child { margin-top: 30px; }

/* drill board */
.board-frame { background: #6b4a2b; padding: 12px; border-radius: 6px; box-shadow: 0 10px 22px rgba(0, 0, 0, .22); margin: 14px 0 10px; }
.board-frame [data-game] { background: var(--chalk); }
.hv-stage { position: relative; width: 100%; aspect-ratio: 8 / 5; background: var(--chalk); }
.hv-canvas { display: block; width: 100%; height: 100%; cursor: crosshair; outline: none; touch-action: none; }
.hv-hud { position: absolute; top: 8px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 10px; pointer-events: none; font: 20px var(--hand); color: #f4f4ec; }
.hv-hud span { background: rgba(0, 0, 0, .25); padding: 0 10px; border-radius: 3px; }
.hv-hud .hv-info:empty { display: none; }
.hv-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; text-align: center; background: rgba(28, 46, 37, .9); color: #f4f4ec; }
.hv-ov-title { font: clamp(30px, 4.6vw, 48px) var(--hand); color: var(--mustard); }
.hv-ov-text { max-width: 32em; font-size: clamp(15px, 1.8vw, 18px); }
.hv-play { font: 24px var(--hand); padding: 8px 30px; background: #f4f4ec; color: var(--chalk); border: 0; border-radius: 4px; box-shadow: 4px 4px 0 var(--mustard); cursor: pointer; }
.hv-play:hover { background: #fff; }
.hv-bar { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 0 0; background: #6b4a2b; }
.hv-btn { font: 17px var(--hand); background: #e9dcc4; color: #3b2a19; border: 0; border-radius: 3px; padding: 3px 14px; cursor: pointer; }
.hv-btn:hover { background: #fff; }
[data-game]:fullscreen { display: flex; flex-direction: column; justify-content: center; align-items: center; background: #1c2e25; padding: 10px; }
[data-game]:fullscreen .hv-stage { margin: 0 auto; }

.medals { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.medals .m { font: 19px var(--hand); padding: 2px 14px; border-radius: 999px; border: 2px solid currentColor; background: var(--card); }
.m.b { color: #9a5b2b; }
.m.s { color: #6c7a84; }
.m.g { color: #a77b00; }
.m.you { color: var(--chalk); margin-left: auto; }
.m.got { background: currentColor; }
.m.got, .m.got * { color: #fff !important; }
.m.b.got { background: #9a5b2b; } .m.s.got { background: #6c7a84; } .m.g.got { background: #a77b00; }

.notepad { background: #fff9c9; padding: 6px 26px 14px; margin: 30px 0; transform: rotate(-.4deg); box-shadow: 0 6px 14px rgba(0, 0, 0, .1); border-top: 26px solid #f3e27a; }
.notepad h2 { font: 30px var(--hand); margin-top: 12px; }
.notepad li { margin-bottom: 6px; }
table.ctl { background: var(--card); border: 1px solid var(--line); }
table.ctl th { width: 38%; font: 19px var(--hand); color: var(--brick); }
.nextlesson { margin: 30px 0 10px; }
.nextlesson a { display: inline-block; font: 24px var(--hand); text-decoration: none; border-bottom: 3px solid var(--mustard); color: var(--chalk); }

/* rulebook */
dl.laws { background: var(--card); border: 1px solid var(--line); padding: 10px 22px; box-shadow: 3px 3px 0 var(--line); }
dl.laws dt { font: 700 19px var(--serif); color: var(--chalk); margin-top: 12px; }
dl.laws dd { margin: 2px 0 12px; padding-left: 14px; border-left: 3px solid var(--mustard); }
.callout { background: #eef5ef; border-left: 6px solid var(--chalk); padding: 12px 18px; }
ul.rbindex { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
ul.rbindex li { background: var(--card); border: 1px solid var(--line); padding: 14px 16px; box-shadow: 3px 3px 0 var(--line); }
ul.rbindex a { font: 24px var(--hand); text-decoration: none; }

.colophon { margin-top: 54px; padding: 18px 0 30px; border-top: 2px solid var(--chalk); font-size: 15px; color: var(--mut); }
.colophon strong { color: var(--chalk); }

@media (max-width: 960px) {
  .skills { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .layout { display: block; background: none; }
  .syllabus { position: static; height: auto; border-right: 0; border-bottom: 6px solid #6b4a2b; padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
  .crest { margin: 0; padding: 6px 10px; border-width: 1px; }
  .crest strong { font-size: 22px; display: inline; }
  .crest span { font-size: 19px; display: inline; margin-left: 6px; }
  .crest em { display: none; }
  .syl { width: auto; }
  .syl[open] { width: 100%; }
  .syl summary { font-size: 20px; padding: 4px 0; }
  .page { padding: 20px 16px 0 26px; }
  .page::before { left: 12px; }
  .cols2 { grid-template-columns: 1fr; gap: 0; }
  body { font-size: 17px; }
  .dek { font-size: 18px; }
  .chalkband { padding: 4px 16px 18px; border-width: 6px; }
  .m.you { margin-left: 0; }
  .board-frame { padding: 6px; margin-left: -10px; margin-right: 0; }
}
@media (max-width: 520px) {
  .skills { grid-template-columns: 1fr; }
  table.lessons th:nth-child(5), table.lessons td:nth-child(5) { display: none; }
}
