/* Inner pages: a page head (title, one line, three numbers, the plane small on the right), then the page's own report. */
.phead { padding: 64px 0 0; }
.pgrid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 48px; align-items: center; }
.phead h1 { font: 800 clamp(56px, 6.4vw, 96px)/.95 var(--display); letter-spacing: -.03em; margin: 0 0 16px; }
.phead .sub { font-size: 20px; color: var(--ink-2); margin: 0 0 32px; max-width: 620px; }
/* hairlines as pseudo-elements: the cells are columns of the page, not boxes */
.tri { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.tri::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1.5px; background: var(--ink); }
.tri div { position: relative; padding: 20px 16px 8px 0; }
.tri div + div { padding-left: 20px; }
.tri div + div::before { content: ""; position: absolute; left: 0; top: 20px; bottom: 0; width: 1px; background: var(--line); }
.tri dt { font: 600 16px/1.3 var(--text); color: var(--ink-3); margin-bottom: 10px; }
.tri dd { margin: 0; font: 800 clamp(26px, 2.5vw, 40px)/1 var(--display); letter-spacing: -.02em; white-space: nowrap; }
.pobj { position: relative; height: 380px; }
.pobj::before { content: ""; position: absolute; inset: 6% 10%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.95), rgba(255,255,255,0)); }
.pobj canvas { position: absolute; left: 0; top: 0; }

.tag { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.tag i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); flex: none; }
.tag.y i { background: var(--yellow); }
.cross { display: inline-block; vertical-align: middle; }
.lostw { display: inline-flex; align-items: center; gap: 12px; }

/* debriefs */
.meter { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 24px 32px; }
.meter .label { white-space: nowrap; }
.meter b.v { font: 800 28px/1 var(--display); white-space: nowrap; }
.dlist { display: grid; gap: 24px; }
.dcard { border: 1.5px solid var(--ink); background: rgba(251,252,253,.94); }
.dcard.new { animation: dropin 1.2s cubic-bezier(.2,.7,.2,1); }
@keyframes dropin { 0% { transform: translateY(-16px); box-shadow: 0 0 0 6px rgba(255,194,26,.7); opacity: 0; } 40% { opacity: 1; } 100% { box-shadow: 0 0 0 0 rgba(255,194,26,0); } }
.dtop { display: grid; grid-template-columns: auto repeat(4, minmax(0, 1fr)); gap: 24px; align-items: end; padding: 32px; position: relative; }
.dtop::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); }
.dtop h3 { font: 800 32px/1 var(--display); margin: 0; white-space: nowrap; }
.dtop dt { font: 600 16px/1.3 var(--text); color: var(--ink-3); }
.dtop dd { margin: 4px 0 0; font-weight: 700; font-size: 20px; white-space: nowrap; }
.dcard .tbl th { position: static; }
.dcard .inner { padding: 8px 32px 24px; }
.dline { position: relative; display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 16px 32px 20px; font-size: 16px; color: var(--ink-2); }
.dline::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); }

/* trenches */
.tboard { position: relative; border: 1.5px solid var(--ink); background: rgba(251,252,253,.9); padding: 24px; }
.tboard canvas { display: block; width: 100%; }
.tkey { display: flex; flex-wrap: wrap; gap: 8px 32px; margin-top: 16px; font-size: 16px; color: var(--ink-2); }
.tkey span { display: inline-flex; align-items: center; gap: 8px; }
.tkey i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.tkey i.e { background: none; border: 1.5px dashed var(--dash); }
.tkey i.y { background: var(--yellow); }
.quiz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.quiz .pobj { height: 360px; }
.choices { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.choices button.on, .choices button.on:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.answer { min-height: 120px; font-size: 18px; color: var(--ink-2); }
.answer b { color: var(--ink); }
.answer.show { animation: fadein .6s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }

/* rules */
.rgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.rule { border: 1.5px solid var(--ink); background: rgba(251,252,253,.94); padding: 28px 32px; scroll-margin-top: calc(var(--bar) + 24px); }
.rule h3 { font: 800 26px/1.1 var(--display); margin: 0 0 12px; }
.rule p { margin: 0 0 12px; color: var(--ink-2); }
.rule p:last-child { margin-bottom: 0; }
.rule .f { display: block; padding: 12px 20px; background: var(--ground-lo); font-weight: 600; color: var(--ink); margin: 12px 0; }
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; border: 1.5px solid var(--ink); background: rgba(251,252,253,.94); padding: 32px; }
.calc label { display: block; font-weight: 600; font-size: 16px; margin: 0 0 8px; }
.calc .field { margin-bottom: 20px; }
.calc input[type="number"] { width: 100%; height: 52px; padding: 0 16px; border: 1.5px solid var(--ink); background: #fff; font: 600 19px var(--text); font-variant-numeric: tabular-nums; }
.calc input[type="range"] { width: 100%; accent-color: var(--ink); }
.calc .out { position: relative; padding-top: 16px; display: grid; gap: 8px; }
.calc .out::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1.5px; background: var(--ink); }
.calc .out div { display: flex; justify-content: space-between; gap: 16px; font-size: 17px; }
.calc .out b { font: 800 30px/1 var(--display); }
.calc .pobj { height: 340px; }
.calc .hint { font-size: 16px; color: var(--ink-3); margin: 12px 0 0; }

/* 404 */
.lost .phead { padding-top: 48px; }
.lost .pobj { height: 460px; }
.lost .acts { display: flex; gap: 16px; flex-wrap: wrap; }

@media (max-width: 1024px) {
  .pgrid, .quiz, .calc, .rgrid { grid-template-columns: 1fr; }
  .pobj, .quiz .pobj, .calc .pobj { height: 320px; }
  .lost .pobj { height: 340px; }
  .dtop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dtop h3 { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .phead { padding-top: 40px; }
  .phead h1 { font-size: clamp(48px, 14vw, 64px); }
  .phead .sub { font-size: 18px; }
  .tri { grid-template-columns: 1fr; }
  .tri div, .tri div + div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 0; }
  .tri div + div::before { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 1px; }
  .tri dt { margin: 0; }
  .tri dd { font-size: 26px; }
  .dtop dd { white-space: normal; font-size: 18px; }
  .pobj, .quiz .pobj, .calc .pobj { height: 280px; }
  .meter { grid-template-columns: 1fr; gap: 12px; }
  .calc { padding: 24px; }
  .calc .out b { font-size: 24px; }
  .rule { padding: 24px; }
  .rule h3 { font-size: 24px; }
  .dtop h3 { font-size: 24px; }
  .tbl thead { display: none; }
  .tbl tr { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; }
  .tbl tr::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); }
  .tbl td { height: auto; padding: 0; border: 0; }
  .tbl td[data-l]::before { content: attr(data-l) ": "; color: var(--ink-3); font-size: 16px; }
  .tbl td.r { text-align: left; }
  .dcard .inner { padding: 8px 24px 24px; }
  .dtop, .dline { padding-left: 24px; padding-right: 24px; }
}
.rule.lit { animation: rulelit 1.6s ease-out; }
@keyframes rulelit { 0% { box-shadow: 0 0 0 5px rgba(255,194,26,.65); } 100% { box-shadow: 0 0 0 0 rgba(255,194,26,0); } }
/* the squadron's formation and the four-number head */
.tri.wide { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 980px; }
.phead > .wrap > .sub { max-width: 760px; }
.fbox { position: relative; height: 560px; }
.fbox canvas { position: absolute; left: 0; top: 0; }
@media (max-width: 640px) { .tri.wide { grid-template-columns: 1fr; } }

/* debriefs: a stack of report sheets, the newest on top */
.memos { position: relative; height: 440px; overflow: clip; overflow-clip-margin: 20px; }
.memos .sh, .sheet { position: absolute; inset: 0 24px 0 24px; background: var(--paper); border: 1.5px solid var(--ink); }
.memos .s1 { transform: translate(6px, 6px) rotate(1deg); } .memos .s2 { transform: translate(12px, 10px) rotate(-1.4deg); } .memos .s3 { transform: translate(-8px, 12px) rotate(2deg); }
.memos .s4 { transform: translate(16px, 16px) rotate(-2.4deg); } .memos .s5 { transform: translate(-12px, 18px) rotate(2.8deg); }
.memos .sh { background: var(--ground-hi); border-color: var(--dash); }
.sheet { transform: rotate(-1.6deg); padding: 24px 32px; display: flex; flex-direction: column; box-shadow: 0 10px 24px rgba(19,35,58,.08); }
.sheet header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.sheet header b { font: 800 30px/1 var(--display); letter-spacing: -.01em; }
.sheet header span { font-size: 16px; color: var(--ink-3); }
.sheet .sbox { position: relative; flex: 1; min-height: 0; margin: 12px 0; }
.sheet .sbox canvas { position: absolute; left: 0; top: 0; }
.sheet dl { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding-top: 12px; }
.sheet dl::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); }
.sheet dt { font-size: 16px; color: var(--ink-3); }
.sheet dd { margin: 2px 0 0; font-weight: 700; font-size: 17px; white-space: nowrap; }
.sheet.out { animation: sheetout .42s cubic-bezier(.5,0,.9,.5) forwards; }
.sheet.in { animation: sheetin .5s cubic-bezier(.2,.7,.2,1); }
@keyframes sheetout { to { transform: translate(110%, -24px) rotate(8deg); opacity: 0; } }
@keyframes sheetin { from { transform: translate(-30px, 40px) rotate(-6deg); opacity: 0; } }
.sheet .stamp.big { right: 32px; top: 64px; }
.sheet .stamp.big.stay { animation: slap .5s cubic-bezier(.3,1.6,.5,1) both; }
.dtop h3 { display: flex; align-items: center; gap: 16px; }
.dtop .play { height: 40px; min-height: 40px; padding: 0 18px; font-size: 16px; }
@media (max-width: 1024px) { .memos { height: 420px; max-width: 560px; } }
@media (max-width: 640px) { .memos { height: 400px; } .memos .sh, .sheet { inset: 0 8px; } .sheet { padding: 20px 24px; } .meter b.v { font-size: 24px; white-space: normal; } .dtop h3 { padding-left: 2px; } .sheet dl { grid-template-columns: 1fr; gap: 4px; } .sheet dl div { display: flex; justify-content: space-between; } .sheet header b { font-size: 22px; } }
/* trenches: the chart first */
.sec.tfirst { padding-top: 40px; }
.tbox { position: relative; height: 320px; }
.tbox canvas { position: absolute; left: 0; top: 0; }
.tfirst .tri { margin-top: 32px; }
.lede.after { margin: 24px 0 0; }
.answer.right b { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: .3em; text-underline-offset: -.12em; text-decoration-skip-ink: none; }
/* rules: the card you point at and its part of the plane */
.rgrid .rule { transition: box-shadow .25s, transform .25s; }
.rgrid .rule.on { box-shadow: 0 0 0 4px rgba(255,194,26,.55); }
.calc .cap { margin: 8px 0 0; font-size: 16px; font-weight: 600; color: #8A6400; }
.calc .out b.bump, .calc .out span.bump { animation: flip .6s cubic-bezier(.2,.7,.2,1); display: inline-block; }
.dlist:empty { min-height: 900px; }

/* rules: each card as tall as its text; the debrief sum on two whole lines */
.rgrid { align-items: start; }
.rule .f .fl { display: block; white-space: nowrap; }

/* the four events: two columns, 24 px between every card, both columns end on one line (the last card of the shorter
   column grows, its text stays at the top); one column on a phone in reading order */
.rgrid { display: flex; gap: 24px; align-items: stretch; }
.rcol { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.rcol > .rule:last-child { flex-grow: 1; }
@media (max-width: 1024px) {
  .rgrid { flex-direction: column; }
  .rcol { display: contents; }
  #takeoff { order: 1; } #flak { order: 2; } #lost { order: 3; } #debrief { order: 4; } #fuel { order: 5; } #keeper { order: 6; }
}
@media (max-width: 400px) { .rule .f .fl { white-space: normal; } }
