/* Hypoxia article: worked examples, tables and the climb widget.
 * Shares tokens with home.css / article.css. */
:root { --hy-sky: #dbe9f6; --hy-mtn: #b9c7b0; --hy-crew: #c77a12; --hy-all: #b0287a; --hy-ok: #1f7a4d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --hy-sky: #1c3550; --hy-mtn: #2f4636; --hy-crew: #f0b050; --hy-all: #e45aa9; --hy-ok: #5fc493; }
}
:root[data-theme="dark"] { --hy-sky: #1c3550; --hy-mtn: #2f4636; --hy-crew: #f0b050; --hy-all: #e45aa9; --hy-ok: #5fc493; }

/* Worked example: one step per line, the "=" signs in one column */
.hy-calc { margin: 1.2em 0 0; padding: 14px 18px; background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--blue); border-radius: 10px; font: 500 15px/1.7 var(--mono); color: var(--ink); }
.hy-calc .row { display: grid; grid-template-columns: 4.6em 1.2em minmax(0, 1fr); align-items: baseline; }
.hy-calc .row > span:nth-child(1) { white-space: nowrap; text-align: right; padding-right: 0.3em; }
.hy-calc .row > span:nth-child(2) { text-align: center; }
.hy-calc .row b { font-weight: 600; }
.hy-calc .gap { height: 0.6em; }
.hy-calc .key { margin: 10px 0 0; padding-top: 8px; border-top: 1px dashed var(--rule); font: 400 15px/1.5 var(--body); color: var(--ink-soft); }
.hy-calc .key p { margin: 0; font-size: 15px; }
.hy-calc .key p + p { margin-top: 3px; }

/* The rule, quoted */
.prose blockquote.hy-law { margin: 1.2em 0 0; padding: 12px 16px; border-left: 4px solid var(--magenta); background: var(--card); border-radius: 0 10px 10px 0; font-size: 16px; color: var(--ink); }
.prose blockquote.hy-law p { margin: 0; }
.prose blockquote.hy-law p + p { margin-top: 6px; }
.prose blockquote.hy-law cite { display: block; margin-top: 8px; font: 500 13px var(--mono); font-style: normal; color: var(--ink-soft); }

/* Tables */
.prose table.hy-tbl td.n, .prose table.hy-tbl th.n { white-space: nowrap; }
.prose tr.crew td { background: color-mix(in srgb, var(--hy-crew) 10%, transparent); }
.prose tr.all td { background: color-mix(in srgb, var(--hy-all) 9%, transparent); }

/* FAQ */
.prose .hy-faq h3 { font-size: 18px; margin: 1.2em 0 0.3em; }
.prose .hy-faq p { margin: 0; }

/* Widget */
.widget.hy-climb { align-items: start; }
.hy-ctl { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: end; }
.hy-range { display: grid; gap: 6px; font-size: 15px; color: var(--ink-soft); }
.hy-range b { font-family: var(--mono); color: var(--ink); }
.hy-range input { width: 100%; accent-color: var(--magenta); }
.hy-play { font: 600 14px var(--body); padding: 8px 16px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; min-width: 6.5em; }
.hy-range input:focus-visible, .hy-play:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
.hy-col svg { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto; }
.hy-sky { fill: var(--hy-sky); }
.hy-mtn { fill: var(--hy-mtn); }
.hy-crew { fill: color-mix(in srgb, var(--hy-crew) 22%, transparent); stroke: var(--hy-crew); stroke-width: 1; stroke-dasharray: 3 3; }
.hy-all { fill: color-mix(in srgb, var(--hy-all) 18%, transparent); stroke: var(--hy-all); stroke-width: 1; stroke-dasharray: 3 3; }
.hy-bt { font: 600 10px var(--mono); fill: var(--hy-crew); }
.hy-bt.all { fill: var(--hy-all); }
.hy-ground { stroke: var(--ink); stroke-width: 2; }
.hy-tick { stroke: var(--ink-soft); stroke-width: 1.2; }
.hy-tt { font: 500 10.5px var(--mono); fill: var(--ink-soft); }
.hy-plane path { fill: var(--ink); }
.hy-prop { stroke: var(--ink); stroke-width: 1.6; }
.hy-lvl { stroke: var(--ink); stroke-width: 1; opacity: 0.45; stroke-dasharray: 2 3; }
.hy-out { grid-column: auto; grid-template-columns: 1fr 1fr; align-self: start; }
.hy-out dd { font-size: 18px; }
.hy-out dd > span[data-o] { display: block; }
.hy-out dd > span.hy-q { font-size: 16px; line-height: 1.25; }
.hy-out dd > span.hy-meter { display: flex; }
.hy-bar { display: block; width: 100%; height: 8px; margin-top: 6px; }
.hy-bar0 { fill: var(--card); }
.hy-bar1 { fill: var(--hy-ok); }
.hy-bar1.low { fill: var(--magenta); }
.hy-meter { display: flex; gap: 3px; margin-top: 6px; }
.hy-meter i { flex: 1; height: 8px; border-radius: 3px; background: var(--card); }
.hy-meter[data-v="0"] i:nth-child(-n+1),
.hy-meter[data-v="1"] i:nth-child(-n+2),
.hy-meter[data-v="2"] i:nth-child(-n+3),
.hy-meter[data-v="3"] i:nth-child(-n+4) { background: var(--hy-ok); }
.hy-meter[data-v="1"] i:nth-child(-n+2) { background: var(--blue); }
.hy-meter[data-v="2"] i:nth-child(-n+3) { background: var(--hy-crew); }
.hy-meter[data-v="3"] i:nth-child(-n+4) { background: var(--magenta); }
.hy-rule { grid-column: 1 / -1; padding: 10px 12px; border-radius: 10px; border-left: 4px solid var(--hy-ok); background: color-mix(in srgb, var(--hy-ok) 8%, transparent); }
.hy-rule[data-rule="crew30"] { border-left-color: var(--hy-crew); background: color-mix(in srgb, var(--hy-crew) 10%, transparent); }
.hy-rule[data-rule="all"] { border-left-color: var(--hy-all); background: color-mix(in srgb, var(--hy-all) 9%, transparent); }
.prose .hy-rule p { margin: 0; font-size: 15px; color: var(--ink); }
.prose .hy-rule p.hy-rule-h { font: 600 12px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.w-note.hy-note { padding: 10px 12px; border-radius: 10px; border-left: 4px solid var(--blue); background: color-mix(in srgb, var(--blue) 8%, transparent); color: var(--ink); }
.w-note.hy-assume { font-size: 13px; }

@media (max-width: 760px) {
  .hy-out { grid-template-columns: 1fr 1fr; }
  .hy-col svg { max-width: 240px; }
  .hy-calc { font-size: 13.5px; padding: 12px; }
  .hy-calc .row { grid-template-columns: 4em 1.1em minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .hy-out { grid-template-columns: 1fr; }
  .hy-ctl { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .prose table.hy-tbl { font-size: 14px; }
  .prose .hy-tbl th { font-size: 10px; letter-spacing: 0; padding: 8px 5px; }
  .prose .hy-tbl td { padding: 8px 5px; }
}
