/* Shared look of the Skill Graph labs. Tokens and type follow the viewer (../index.html):
   dark panels, Nunito for UI, EB Garamond for headlines, a red accent dot. */
:root {
  --bg: #0A0C14; --panel: rgba(14, 17, 28, .78); --stroke: rgba(130, 145, 190, .16); --stroke2: rgba(130, 145, 190, .35);
  --hover: rgba(130, 145, 190, .10); --ink: #EDEFF7; --soft: #D3D9E8; --body: #C6CDE0; --mut: #98A0B8; --faint: #646C84;
  --red: #FF3B30; --ok: #3ddc97; --wip: #f5c84c;
  --serif: 'EB Garamond', Georgia, serif; --sans: 'Nunito', ui-rounded, ui-sans-serif, system-ui, sans-serif;
  --glow: rgba(60, 110, 200, .32); --accent: #4ea8ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; color: var(--ink); background: var(--bg); }
body { font: 500 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; transition: background .8s;
  background: radial-gradient(55% 55% at 62% 42%, var(--glow), transparent 70%), radial-gradient(110% 85% at 50% 115%, rgba(45, 60, 120, .2), transparent 55%); }
button, input, select { font: inherit; color: inherit; }
b, strong { font-weight: 800; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.card { background: var(--panel); border: 1px solid var(--stroke); border-radius: 20px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* top bar */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 18px 26px 10px 30px;
  background: linear-gradient(var(--bg) 88%, rgba(10, 12, 20, 0)); }
#brand { font: 900 24px/1 var(--sans); letter-spacing: -.035em; text-transform: uppercase; margin-right: auto; color: #fff;
  text-decoration: none; white-space: nowrap; }
#brand i { font-style: normal; color: var(--red); }
#brand small { display: block; font: 700 10.5px/1.2 var(--sans); letter-spacing: .14em; color: var(--mut); margin-top: 4px; }
.seg { display: flex; padding: 3px; border-radius: 999px; }
#views { flex-wrap: wrap; justify-content: center; border-radius: 22px; }
.seg button { background: none; border: 0; color: var(--mut); padding: 6px 13px; border-radius: 999px; cursor: pointer;
  font-size: 13px; font-weight: 800; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--red); color: #fff; }
.seg a { color: var(--mut); padding: 6px 13px; border-radius: 999px; text-decoration: none; font-size: 13px; font-weight: 700; white-space: nowrap; }
.seg a:hover { color: var(--ink); }
.seg a.on { background: rgba(130, 145, 190, .18); color: var(--ink); }
#langs button.on { background: rgba(130, 145, 190, .22); }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; font-size: 16px; padding: 0; }

/* layout: hero + state card on the left, the scene and its controls on the right, a gauge on the far right */
.lab { display: grid; gap: 18px 22px; padding: 6px 26px 22px 30px; min-height: calc(100vh - 72px);
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr) 64px;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: 'hero stage gauge' 'state stage gauge' 'state ctrl gauge'; }
#hero { grid-area: hero; padding-top: 18px; }
#hero h1 { font: 500 clamp(40px, 4.6vw, 66px)/1.03 var(--serif); margin: 0 0 16px; color: #fff; text-wrap: balance; }
#hero h1 i { font-style: normal; color: var(--red); }
#hero p { margin: 0 0 3px; font-size: 13.5px; color: var(--mut); }
#hero p b { color: #fff; font-weight: 800; }
#stage { grid-area: stage; position: relative; min-height: 340px; }
#stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#overlay { position: absolute; inset: 0; pointer-events: none; }
#overlay > * { pointer-events: auto; }
#overlay > .tip, #overlay > .tag { pointer-events: none; } /* labels never swallow taps on the canvas */

#state { grid-area: state; align-self: end; padding: 20px 22px 18px; }
#state .head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
#state .emo { font-size: 26px; line-height: 1; }
#state h2 { font: 500 26px/1.1 var(--serif); margin: 0; color: #fff; }
#state .lead { margin: 0 0 8px; font-weight: 800; color: var(--ink); font-size: 13.5px; }
#state .body { margin: 0; color: var(--mut); font-size: 13px; line-height: 1.6; }
#state .extra:empty { display: none; }
#state .extra { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--stroke); font-size: 12.5px; color: var(--soft); }

#ctrl { grid-area: ctrl; padding: 18px 20px 16px; }
.readout { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.readout .val { font: 900 34px/1 var(--sans); letter-spacing: -.02em; color: #fff; }
.readout .sub { color: var(--mut); font-size: 13px; }
.readout .pill { margin-left: auto; padding: 7px 14px; border-radius: 999px; font-weight: 800; font-size: 13px; color: #fff;
  background: var(--accent); box-shadow: 0 0 22px var(--glow); transition: background .4s; }
input[type=range].big { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; cursor: pointer; margin: 0; }
input[type=range].big::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: var(--track, linear-gradient(90deg, #3b82f6, #ef4444)); }
input[type=range].big::-moz-range-track { height: 8px; border-radius: 999px; background: var(--track, linear-gradient(90deg, #3b82f6, #ef4444)); }
input[type=range].big::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
input[type=range].big::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.ends { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--mut); margin: 2px 4px 12px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--stroke);
  background: rgba(20, 24, 38, .6); color: var(--soft); font-size: 12.5px; font-weight: 800; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s; }
.chip:hover { background: rgba(130, 145, 190, .16); }
.chip.on { background: #fff; color: var(--bg); border-color: #fff; }
.chip[hidden], [hidden] { display: none !important; }
.chip.secret { border-style: dashed; color: var(--mut); }
.chip.secret.open { border-style: solid; border-color: var(--wip); color: var(--wip); }
.chip.secret.open.on { background: var(--wip); color: var(--bg); }
.row2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.row2 .lbl { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 700; margin-right: 2px; }
.seg.small { flex-wrap: wrap; border-radius: 18px; max-width: 100%; }
.seg.small button { padding: 4px 11px; font-size: 12.5px; }
.seg.small button.on { background: rgba(130, 145, 190, .25); }

/* vertical gauge, like the thermometer in a water lab */
#gauge { grid-area: gauge; position: relative; margin: 30px 0 10px; }
#gauge .tube { position: absolute; right: 18px; top: 0; bottom: 0; width: 14px; border-radius: 999px; background: rgba(130, 145, 190, .14); }
#gauge .fill { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 999px; background: var(--accent);
  box-shadow: 0 0 18px var(--glow); transition: height .25s, background .4s; }
#gauge .knob { position: absolute; right: 11px; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(10, 12, 20, .8), 0 0 22px var(--glow); transition: top .25s, background .4s; }
#gauge .tick { position: absolute; right: 38px; transform: translateY(-50%); font-size: 10.5px; color: var(--faint); white-space: nowrap;
  font-weight: 700; }
#gauge .tick::after { content: ''; display: inline-block; width: 7px; height: 1px; background: var(--faint); margin-left: 5px; vertical-align: middle; }
#gauge .cap { position: absolute; right: 0; top: -24px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint);
  font-weight: 700; white-space: nowrap; }

/* footer: where this lab sits in the graph */
.foot { padding: 4px 30px 30px; color: var(--faint); font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.foot b { color: var(--mut); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: 10.5px; }
.foot a { color: var(--soft); text-decoration: none; border-bottom: 1px solid var(--stroke2); }
.foot a:hover { color: #fff; border-color: #fff; }
.foot .lic { flex-basis: 100%; font-size: 11px; }
.foot .lic a.contrib { color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: inherit; border-bottom: 0; }

/* secret lab: a 3-question challenge unlocks the two extreme experiments */
#secret { position: fixed; inset: 0; z-index: 30; display: none; place-items: center; background: rgba(5, 7, 12, .72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 16px; }
#secret.open { display: grid; }
#secret .box { width: min(460px, 100%); padding: 28px 26px 24px; text-align: center; background: rgba(16, 19, 30, .97); }
#secret .kick { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--mut); font-weight: 800; }
#secret h3 { font: 500 27px/1.15 var(--serif); margin: 10px 0 18px; color: #fff; text-wrap: balance; }
#secret .locks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
#secret .lock { border: 1px solid var(--stroke2); border-radius: 14px; padding: 14px 10px; }
#secret .lock .e { font-size: 28px; }
#secret .lock .t { font-weight: 800; margin-top: 6px; font-size: 13px; }
#secret .lock .d { font-size: 11.5px; color: var(--mut); margin-top: 2px; }
#secret p { color: var(--mut); margin: 0 0 16px; font-size: 13px; }
#secret p b { color: #fff; }
#secret .opts { display: grid; gap: 8px; margin-bottom: 14px; }
#secret .opt { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--stroke2); background: rgba(130, 145, 190, .08);
  cursor: pointer; font-weight: 800; transition: background .15s; text-wrap: balance; }
#secret .opt:hover { background: rgba(130, 145, 190, .18); }
#secret .opt.bad { border-color: var(--red); background: rgba(255, 59, 48, .14); animation: shake .35s; }
#secret .opt.good { border-color: var(--ok); background: rgba(61, 220, 151, .16); }
#secret .dots { display: flex; justify-content: center; gap: 6px; }
#secret .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
#secret .dots i.on { background: var(--red); }
#secret .hint { min-height: 20px; font-size: 12.5px; color: var(--wip); margin: -4px 0 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 999px; border: 1px solid #fff;
  background: #fff; color: var(--bg); font-weight: 800; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--mut); border-color: var(--stroke2); }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* tablets: the gauge goes, the stage keeps its width */
@media (max-width: 1100px) {
  .lab { grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); grid-template-areas: 'hero stage' 'state stage' 'state ctrl'; }
  #gauge { display: none; }
}
/* phones: one column; the scene comes right after the headline */
@media (max-width: 760px) {
  .bar { padding: 12px 16px 8px; gap: 6px; flex-wrap: wrap; }
  #brand { font-size: 19px; }
  #brand small { display: none; }
  #views { order: 5; flex-basis: 100%; justify-content: center; }
  .seg button { padding: 5px 10px; font-size: 12.5px; }
  .seg a { padding: 5px 10px; font-size: 12.5px; }
  .iconbtn { width: 34px; height: 34px; }
  .lab { display: flex; flex-direction: column; gap: 14px; padding: 4px 16px 18px; min-height: 0; }
  #hero { padding-top: 6px; }
  #state { align-self: stretch; }
  #hero h1 { font-size: 38px; margin-bottom: 10px; }
  #stage { height: min(78vw, 440px); min-height: 0; }
  .readout .val { font-size: 28px; }
  #secret .box { padding: 22px 16px 18px; }
  .foot { padding: 4px 16px 24px; }
}
