/* Vestibular illusions article: static figures, worked example and the
 * inner-ear simulator. Shares tokens with home.css / article.css. The
 * attitude dials stay dark in both themes, like a real instrument panel. */
:root { --vi-fluid: #2f7fb8; --vi-gel: #e8c66a; --vi-green: #1f7a4d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --vi-fluid: #6fb2e4; --vi-gel: #c9a54a; --vi-green: #5fc493; } }
:root[data-theme="dark"] { --vi-fluid: #6fb2e4; --vi-gel: #c9a54a; --vi-green: #5fc493; }

/* Static figures */
.prose .fig.vi-fig svg.ve { width: 100%; max-width: 760px; height: auto; margin: 0 auto; display: block; }
.ve text { font-family: var(--mono); }
.ve-h { font: 700 12px var(--mono); fill: var(--ink); letter-spacing: 0.04em; }
.ve-s { font: 500 12px var(--mono); fill: var(--ink-soft); }
.ve-s.ve-k, .ve-s2.ve-k, .ve-k { fill: var(--magenta); font-weight: 600; }
.ve-sym { font: 700 15px var(--mono); fill: var(--magenta); }
.ve-to { fill: none; stroke: var(--ink); stroke-width: 15; stroke-linecap: round; }
.ve-ti { fill: none; stroke: color-mix(in srgb, var(--vi-fluid) 35%, var(--card)); stroke-width: 11; stroke-linecap: round; }
.ve-coo { fill: none; stroke: var(--ink); stroke-width: 12; stroke-linejoin: round; stroke-linecap: round; }
.ve-coi { fill: none; stroke: var(--paper-2); stroke-width: 8; stroke-linejoin: round; stroke-linecap: round; }
.ve-ti.co { stroke: var(--paper-2); }
.ve-amp { fill: color-mix(in srgb, var(--vi-fluid) 35%, var(--card)); stroke: var(--ink); stroke-width: 2; }
.ve-cupl { stroke: var(--vi-gel); stroke-width: 3.5; stroke-linecap: round; }
.ve-vest { fill: color-mix(in srgb, var(--vi-fluid) 22%, var(--card)); stroke: var(--ink); stroke-width: 2; }
.ve-oto { fill: color-mix(in srgb, var(--vi-gel) 30%, var(--card)); stroke: var(--ink-soft); stroke-width: 1.4; }
.ve-mac { fill: none; stroke: var(--magenta); stroke-width: 2.5; stroke-linecap: round; }
.ve-nv { fill: none; stroke: #c98a12; stroke-width: 3; stroke-linecap: round; }
.ve-ld { stroke: var(--ink-soft); stroke-width: 1; }
.ve-box { fill: var(--card); stroke: var(--rule); stroke-width: 1.4; }
.ve-wall { fill: none; stroke: var(--ink); stroke-width: 2.2; }
.ve-fl { fill: color-mix(in srgb, var(--vi-fluid) 22%, var(--card)); }
.ve-cr { fill: var(--paper-2); stroke: var(--ink); stroke-width: 1.4; }
.ve-cup { fill: color-mix(in srgb, var(--vi-gel) 55%, var(--card)); stroke: #a07a1a; stroke-width: 1.4; }
.ve-hc { fill: none; stroke: var(--magenta); stroke-width: 1.6; stroke-linecap: round; }
.ve-mv { stroke: var(--magenta); stroke-width: 2.4; }
.ve-fa { stroke: var(--blue); stroke-width: 2.4; }
.ve-ah { fill: var(--blue); }
.ve-ahm { fill: var(--magenta); }
.ve-base { fill: var(--paper-2); stroke: var(--ink); stroke-width: 1.4; }
.ve-gel { fill: color-mix(in srgb, var(--vi-gel) 30%, var(--card)); stroke: var(--ink-soft); stroke-width: 1.2; }
.ve-cry { fill: var(--card); stroke: var(--ink); stroke-width: 1.2; }
.ve-grid { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 4; }
.ve-axis { stroke: var(--ink-soft); stroke-width: 1.2; }
.ve-real { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linejoin: round; }
.ve-felt { fill: none; stroke: var(--magenta); stroke-width: 3; stroke-dasharray: 7 5; stroke-linejoin: round; }
.ve-dash { stroke: var(--ink-soft); stroke-width: 1.2; stroke-dasharray: 4 4; }
.ve-vg, .ve-va { stroke: var(--blue); stroke-width: 3; }
.ve-vr { stroke: var(--magenta); stroke-width: 3.4; }
.ve-arc { fill: none; stroke: var(--magenta); stroke-width: 1.6; }
.ve-dot { fill: var(--ink); }
.ve-pl path, .ve-pf path { fill: var(--paper-2); stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.ve-pf path { fill: none; stroke: var(--magenta); stroke-dasharray: 6 4; }

/* Worked example: one step per line, the "=" signs in one column */
.vi-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); }
.vi-calc .row { display: grid; grid-template-columns: 4.4em 1.2em minmax(0, 1fr); align-items: baseline; }
.vi-calc .row > span:nth-child(1) { white-space: nowrap; }
.vi-calc .row > span:nth-child(1) { text-align: right; padding-right: 0.3em; }
.vi-calc .row > span:nth-child(2) { text-align: center; }
.vi-calc .row b { font-weight: 600; }
.vi-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); }
.vi-calc .key p { margin: 0; font-size: 15px; }
.vi-calc .key p + p { margin-top: 3px; }

/* Widget */
.widget.vi { grid-template-columns: 1fr; gap: 14px; }
.vi-tabs button { font-size: 15px; }
.vi-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; background: #1b2733; border-radius: 14px; padding: 14px 10px 10px; }
.vi-inst { margin: 0; min-width: 0; text-align: center; }
.vi-dial { display: block; width: 100%; max-width: 200px; height: auto; margin: 0 auto; }
.vi-inst figcaption { margin-top: 6px; font: 500 12px/1.35 var(--mono); color: #b9c4d0; }
.vi-inst figcaption b { display: block; font: 600 15px var(--mono); color: #f2efe6; }
.vi-bezel { fill: #0b1118; stroke: #3a4756; stroke-width: 2; }
.vi-sky { fill: #3f7fc0; }
.vi-gnd { fill: #8a5a2b; }
.vi-hz { stroke: #f2efe6; stroke-width: 1.6; }
.vi-pl { stroke: #f2efe6; stroke-width: 1; }
.vi-tk { stroke: #e9edf2; stroke-width: 1.6; }
.vi-idx { fill: #e9edf2; }
.vi-ptrp { fill: #f0a830; }
.vi-ac { fill: none; stroke: #f0a830; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.vi-acd { fill: #f0a830; }
.vi-dial.feel .vi-sky { fill: #6a5aa0; }
.vi-dial.feel .vi-gnd { fill: #5d4a7a; }
.vi-meter, .vi-chart { display: grid; gap: 4px; }
.vi-meter { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; }
.vi-meter .vi-ml { grid-column: 1 / -1; }
.vi-meter b { font: 600 14px var(--mono); color: var(--ink); min-width: 6.5em; text-align: right; }
.vi-ml { font-size: 14px; color: var(--ink-soft); }
.vi-bar { width: 100%; height: 30px; display: block; }
.vi-bar-bg { fill: var(--paper-2); stroke: var(--rule); }
.vi-bar-th { fill: color-mix(in srgb, var(--ink-soft) 25%, transparent); }
.vi-bar-0 { stroke: var(--ink-soft); stroke-width: 1.4; }
.vi-bar-v { fill: var(--ink-soft); }
.vi-bar-v.on { fill: var(--magenta); }
.vi-acc { margin: 0; font: 600 15px var(--mono); color: var(--ink); }
.vi-ch { width: 100%; height: 110px; display: block; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; }
.vi-ch-0 { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.vi-ch-r { fill: none; stroke: var(--blue); stroke-width: 2.4; vector-effect: non-scaling-stroke; }
.vi-ch-f { fill: none; stroke: var(--magenta); stroke-width: 2.4; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.vi-ax { font: 500 12px var(--mono); color: var(--ink-soft); }
.w-note.vi-say { font-size: 16px; line-height: 1.5; padding: 10px 12px; border-radius: 10px; border-left: 4px solid var(--vi-green); background: color-mix(in srgb, var(--vi-green) 9%, transparent); color: var(--ink); min-height: 4.6em; }
.w-note.vi-say.warn { color: var(--ink); font-weight: 500; border-left-color: var(--magenta); background: color-mix(in srgb, var(--magenta) 8%, transparent); }
.vi-ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.vi-group { display: grid; gap: 6px; align-content: start; }
.vi-lbl { font-size: 15px; color: var(--ink-soft); }
.vi-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.vi-seg button, .vi-btn { font: 600 14px var(--body); padding: 7px 12px; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; text-align: left; }
.vi-seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.vi-seg button:focus-visible, .vi-btn:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
.vi-btns { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.vi-btn[data-act="feel"], .vi-btn[data-act="head"] { border-color: var(--magenta); }
.w-note.vi-note { font-size: 13px; }
[hidden] { display: none !important; }

@media (max-width: 720px) {
  .vi-ctl { grid-template-columns: 1fr; }
  .vi-panel { gap: 4px; padding: 10px 4px 8px; }
  .vi-inst figcaption { font-size: 11px; }
  .vi-inst figcaption b { font-size: 13px; }
  .vi-calc { font-size: 13.5px; padding: 12px; }
}
.ve-s2 { font: 500 11px var(--mono); fill: var(--ink-soft); }
