@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:      #f5f5f4;
  --white:   #ffffff;
  --ink:     #111110;
  --ink2:    #3f3f3c;
  --muted:   #78716c;
  --border:  #e2e2df;
  --border2: #c8c8c2;
  --blue:    #2563eb;
  --blue-dk: #1d4ed8;
  --blue-lt: #eff6ff;
  --green:   #16a34a;
  --grn-lt:  #f0fdf4;
  --amber:   #d97706;
  --amb-lt:  #fffbeb;
  --red:     #dc2626;
  --shadow:  0 1px 3px rgba(0,0,0,.07);
  --shadow2: 0 4px 16px rgba(0,0,0,.09);
  --sans:    'Figtree', system-ui, sans-serif;
  --mono:    'JetBrains Mono', monospace;
  --r:       8px;
  --r2:      12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.65; min-height: 100vh; }

.nav { display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; height: 52px; background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 200; }
.nav-logo { font-family: var(--mono); font-size: .78rem; font-weight: 500; color: var(--ink); text-decoration: none; }
.nav-right { display: flex; gap: 1.25rem; }
.nav-link { font-size: .82rem; color: var(--muted); text-decoration: none; transition: color .15s; }
.nav-link:hover { color: var(--ink); }

.btn-primary { display: inline-flex; align-items: center; gap: .4rem; background: var(--blue); color: var(--white); padding: .65rem 1.4rem; border-radius: var(--r); font-family: var(--sans); font-size: .875rem; font-weight: 600; text-decoration: none; border: none; cursor: pointer; transition: background .15s, transform .1s; }
.btn-primary:hover { background: var(--blue-dk); transform: translateY(-1px); }
.btn-full { width: 100%; justify-content: center; padding: .8rem; margin-top: 1.5rem; }
.btn-secondary { display: inline-flex; align-items: center; gap: .4rem; background: var(--white); color: var(--ink2); padding: .65rem 1.4rem; border-radius: var(--r); font-family: var(--sans); font-size: .875rem; font-weight: 500; text-decoration: none; border: 1.5px solid var(--border2); cursor: pointer; transition: border-color .15s; }
.btn-secondary:hover { border-color: var(--ink); }

.welcome { max-width: 720px; margin: 0 auto; padding: 4rem 2rem; }
.welcome-inner { display: flex; flex-direction: column; gap: 2rem; }
.welcome-lab { font-family: var(--mono); font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.welcome-h1 { font-size: 2.4rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.welcome-text-block { display: flex; flex-direction: column; gap: 1rem; background: var(--white); border: 1.5px solid var(--border); border-radius: var(--r2); padding: 1.75rem; }
.welcome-text-block p { font-size: .9rem; color: var(--ink2); line-height: 1.8; }

.study-intro { max-width: 860px; margin: 0 auto; padding: 3rem 2rem 4rem; }
.si-inner { display: flex; flex-direction: column; gap: 2rem; }
.si-eyebrow { font-family: var(--mono); font-size: .68rem; color: var(--blue); text-transform: uppercase; letter-spacing: .07em; }
.si-h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; }
.si-sub { font-size: .9rem; color: var(--muted); }
.si-grid { display: grid; grid-template-columns: 1fr 260px; gap: 2.5rem; align-items: start; }
@media(max-width:680px){ .si-grid { grid-template-columns: 1fr; } }
.si-text h3 { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink2); margin-bottom: .4rem; margin-top: 1.25rem; }
.si-text h3:first-child { margin-top: 0; }
.si-text p { font-size: .875rem; color: var(--ink2); line-height: 1.75; margin-bottom: .4rem; }
.si-steps { list-style: none; display: flex; flex-direction: column; gap: .35rem; margin-top: .5rem; }
.si-steps li { display: flex; align-items: center; gap: .6rem; font-size: .875rem; color: var(--ink2); }
.si-steps li span { width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: var(--white); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: .68rem; font-weight: 500; flex-shrink: 0; }
.si-aside { display: flex; flex-direction: column; gap: .75rem; }
.si-box { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--r2); padding: 1.1rem; }
.si-box-title { font-family: var(--mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: .7rem; }
.pp-diagram { margin-bottom: .6rem; }
.pp-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.pp-label { font-family: var(--mono); font-size: .65rem; color: var(--muted); width: 38px; flex-shrink: 0; }
.pp-stim { flex: 1; text-align: center; padding: .4rem; border-radius: var(--r); border: 1px solid var(--border); font-size: .72rem; font-weight: 600; }
.pp-con { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.pp-inc { background: #fef2f2; border-color: #fecaca; color: var(--red); }
.pp-arrow { font-family: var(--mono); color: var(--muted); font-size: .85rem; padding-left: 46px; margin-bottom: .25rem; }
.pp-note { font-family: var(--mono); font-size: .65rem; color: var(--muted); line-height: 1.5; margin-top: .4rem; }
.stat-rows { display: flex; flex-direction: column; }
.stat-row { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px solid var(--border); font-size: .8rem; }
.stat-row:last-child { border-bottom: none; }
.stat-row span:first-child { color: var(--muted); }
.stat-row span:last-child { font-family: var(--mono); font-size: .75rem; font-weight: 500; }

.progress-bar { background: var(--white); border-bottom: 1px solid var(--border); padding: 1rem 2rem; }
.progress-inner { max-width: 480px; margin: 0 auto; display: flex; align-items: center; }
.ps { display: flex; flex-direction: column; align-items: center; gap: .3rem; flex-shrink: 0; }
.ps-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--bg); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: .7rem; font-weight: 500; color: var(--muted); transition: all .2s; }
.ps-lbl { font-size: .62rem; color: var(--muted); font-family: var(--mono); white-space: nowrap; }
.ps.done .ps-dot { background: var(--green); border-color: var(--green); color: var(--white); }
.ps.active .ps-dot { background: var(--blue); border-color: var(--blue); color: var(--white); }
.ps.active .ps-lbl { color: var(--blue); font-weight: 500; }
.ps-line { flex: 1; height: 2px; background: var(--border); margin-bottom: 1.2rem; transition: background .2s; }
.ps-line.done { background: var(--green); }

.decision-wrap { max-width: 580px; margin: 2.5rem auto; padding: 0 1.5rem; }
.path-recap { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; margin-bottom: 1.1rem; }
.pr-label { font-family: var(--mono); font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-right: .15rem; }
.pr-chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--white); border: 1px solid var(--border); border-radius: 100px; padding: .12rem .55rem .12rem .3rem; font-size: .76rem; color: var(--ink2); }
.pr-n { width: 17px; height: 17px; border-radius: 50%; background: var(--ink); color: var(--white); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: .58rem; font-weight: 500; flex-shrink: 0; }
.decision-card { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--r2); padding: 2rem; box-shadow: var(--shadow); }
.dc-step { font-family: var(--mono); font-size: .65rem; font-weight: 500; color: var(--blue); text-transform: uppercase; letter-spacing: .07em; margin-bottom: .5rem; }
.dc-q { font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; margin-bottom: .75rem; }
.dc-desc { font-size: .875rem; color: var(--muted); line-height: 1.75; margin-bottom: 1.4rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--border); }
.opts { display: flex; flex-direction: column; gap: .45rem; }
.opt { cursor: pointer; display: block; }
.opt input { display: none; }
.opt-inner { display: flex; align-items: flex-start; gap: .8rem; padding: .85rem 1rem; border: 1.5px solid var(--border); border-radius: var(--r); background: var(--bg); transition: border-color .15s, background .15s; }
.opt:hover .opt-inner { border-color: var(--border2); background: var(--white); }
.opt.selected .opt-inner { border-color: var(--blue); background: var(--blue-lt); }
.opt-circle { width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--border2); flex-shrink: 0; margin-top: 2px; position: relative; transition: border-color .15s; }
.opt-circle::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--blue); transform: scale(0); transition: transform .15s; }
.opt.selected .opt-circle { border-color: var(--blue); }
.opt.selected .opt-circle::after { transform: scale(1); }
.opt-lbl { font-size: .875rem; font-weight: 500; margin-bottom: .15rem; }
.opt-hint { font-size: .76rem; color: var(--muted); font-family: var(--mono); }

.end-wrap { max-width: 860px; margin: 2rem auto 5rem; padding: 0 1.5rem; }
.end-header { margin-bottom: 2rem; }
.end-header h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 1rem; }
.result-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: .6rem; margin-bottom: 1rem; }
.res-sig .rs-block { border-left-color: var(--green); }
.res-ns .rs-block { border-left-color: var(--amber); }
.rs-block { background: var(--white); border: 1px solid var(--border); border-left: 3px solid var(--border2); border-radius: var(--r); padding: .65rem .9rem; }
.rs-label { font-family: var(--mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .2rem; }
.rs-val { font-family: var(--mono); font-size: .95rem; font-weight: 500; color: var(--ink); }
.path-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.pill { background: var(--blue-lt); border: 1px solid #bfdbfe; color: var(--blue); font-family: var(--mono); font-size: .72rem; padding: .2rem .6rem; border-radius: 4px; font-weight: 500; }
.end-section { margin-bottom: 2.5rem; }
.end-section h2 { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink2); margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.end-section h3 { font-size: .875rem; font-weight: 600; color: var(--ink2); margin-bottom: .75rem; margin-top: 1.25rem; }
.path-list { display: flex; flex-direction: column; gap: .4rem; max-width: 560px; }
.path-item { display: flex; gap: .8rem; align-items: flex-start; background: var(--white); border: 1px solid var(--border); border-radius: var(--r); padding: .75rem .9rem; }
.pi-num { width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: var(--white); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: .65rem; font-weight: 500; flex-shrink: 0; margin-top: 1px; }
.pi-q { font-size: .75rem; color: var(--muted); margin-bottom: .15rem; }
.pi-choice { font-size: .875rem; font-weight: 600; }
.orig-compare { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: .6rem; margin-bottom: 1.5rem; }
.oc-block { background: var(--blue-lt); border: 1px solid #bfdbfe; border-radius: var(--r); padding: .65rem .9rem; }
.oc-label { font-family: var(--mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--blue); margin-bottom: .2rem; }
.oc-val { font-family: var(--mono); font-size: .88rem; font-weight: 500; color: #1e3a8a; }
.players-decision-tree { margin-top: 1.25rem; }
.tree-container { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--r2); padding: 1rem; position: relative; overflow: hidden; }
#tree-svg { width: 100%; height: auto; display: block; }
.tree-tip { display: none; position: absolute; background: #1e1e2e; color: #e2e8f0; font-family: var(--mono); font-size: .74rem; line-height: 1.6; padding: .5rem .75rem; border-radius: var(--r); pointer-events: none; z-index: 100; max-width: 200px; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.analytical-var { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--r2); padding: 1.75rem; display: flex; flex-direction: column; gap: 1rem; }
.analytical-var p { font-size: .875rem; color: var(--ink2); line-height: 1.8; }
.end-actions { display: flex; gap: .6rem; flex-wrap: wrap; padding-top: 2rem; border-top: 1px solid var(--border); }

.dataset-info { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--r2); padding: 1.5rem; }
.di-title { font-family: var(--mono); font-size: .65rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 1rem; }
.di-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: .6rem; margin-bottom: .9rem; }
.di-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); padding: .65rem .9rem; }
.di-val { font-family: var(--mono); font-size: 1rem; font-weight: 500; color: var(--blue); margin-bottom: .1rem; }
.di-label { font-size: .72rem; color: var(--muted); line-height: 1.3; }
.di-note { font-size: .78rem; color: var(--muted); font-family: var(--mono); border-top: 1px solid var(--border); padding-top: .75rem; }

.desc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: .6rem; }
.desc-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); padding: .65rem .9rem; }
.desc-val { font-family: var(--mono); font-size: 1rem; font-weight: 500; color: var(--ink); margin-bottom: .1rem; }
.desc-label { font-size: .7rem; color: var(--muted); line-height: 1.3; }

.comparison-table { border: 1.5px solid var(--border); border-radius: var(--r2); overflow: hidden; max-width: 640px; }
.cmp-head { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 0; padding: .5rem 1rem; background: var(--bg); font-family: var(--mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.cmp-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 0; padding: .55rem 1rem; border-top: 1px solid var(--border); font-size: .84rem; align-items: center; }
.cmp-row.cmp-highlight { background: #f0f7ff; font-weight: 600; }
.cmp-label { color: var(--muted); font-size: .82rem; }
.cmp-player { font-family: var(--mono); font-size: .8rem; color: var(--green); font-weight: 500; }
.cmp-orig { font-family: var(--mono); font-size: .8rem; color: var(--blue); font-weight: 500; }

.section-hint { font-size: .82rem; color: var(--muted); margin-bottom: .75rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.btn-expand { font-family: var(--mono); font-size: .72rem; font-weight: 500; color: var(--blue); background: var(--blue-lt); border: 1px solid #bfdbfe; border-radius: var(--r); padding: .25rem .7rem; cursor: pointer; transition: background .15s; }
.btn-expand:hover { background: #dbeafe; }

.tree-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 500; align-items: center; justify-content: center; padding: 1.5rem; }
.tree-modal-inner { background: var(--white); border-radius: var(--r2); width: 100%; max-width: 1100px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.tree-modal-bar { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1.25rem; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: .78rem; font-weight: 500; }
.tree-modal-body { flex: 1; overflow: auto; padding: 1rem; position: relative; }
.tree-modal-body #tree-svg-modal { width: 100%; height: auto; }
.btn-close-modal { font-family: var(--mono); font-size: .72rem; font-weight: 500; color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); padding: .25rem .7rem; cursor: pointer; transition: border-color .15s; }
.btn-close-modal:hover { border-color: var(--ink); color: var(--ink); }

.trial-sequence { display: flex; flex-direction: column; align-items: stretch; gap: 0; margin-bottom: .75rem; }
.ts-step { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); padding: .55rem .75rem; display: flex; align-items: center; gap: .6rem; }
.ts-label { font-family: var(--mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); width: 52px; flex-shrink: 0; }
.ts-stim { font-size: .8rem; color: var(--ink2); line-height: 1.45; }
.ts-eg { font-family: var(--mono); font-size: .68rem; color: var(--muted); }
.ts-arrow { text-align: center; color: var(--border2); font-size: .9rem; padding: .1rem 0; }
