/* Interactive Field Guides · VALIANT — library styles
   Colors: Vanderbilt gold #CFAE70 (sampled from the official mark) and black. */

:root{
  --gold:#CFAE70; --gold-deep:#B49248;
  --bg:#FBFAF7; --surface:#FFFFFF; --surface-2:#F4F0E6;
  --ink:#141414; --muted:#5C574D; --line:#E6E1D6;
  --gold-ink:#7A5F28;            /* gold for text on light backgrounds (AA) */
  --bronze:#8A6D2F;
  --on-gold:#141414;
  --danger:#B4432F;
  --shadow:0 18px 40px -22px rgba(0,0,0,.35);
  --t-students:var(--gold); --t-researchers:var(--ink); --t-public:var(--bronze);
  --sans:"Archivo",system-ui,sans-serif; --mono:"IBM Plex Mono",ui-monospace,monospace;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#0D0D0D; --surface:#161513; --surface-2:#1E1C19;
    --ink:#F4F1EA; --muted:#A9A397; --line:#2C2925;
    --gold-ink:#CFAE70; --bronze:#E3CF9F; --danger:#E0846F;
    --shadow:0 18px 40px -22px rgba(0,0,0,.9);
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#0D0D0D; --surface:#161513; --surface-2:#1E1C19;
  --ink:#F4F1EA; --muted:#A9A397; --line:#2C2925;
  --gold-ink:#CFAE70; --bronze:#E3CF9F; --danger:#E0846F;
  --shadow:0 18px 40px -22px rgba(0,0,0,.9);
  color-scheme:dark;
}

*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--bg);color:var(--ink);font-family:var(--sans);-webkit-font-smoothing:antialiased;transition:background .3s,color .3s}
img{display:block;max-width:100%}
button{font:inherit;cursor:pointer;color:inherit}
a{color:inherit}
:focus-visible{outline:3px solid var(--gold);outline-offset:2px;border-radius:4px}
.wrap{max-width:1240px;margin:0 auto;padding:0 clamp(28px,6vw,64px)}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip{position:absolute;left:-999px;top:8px;background:var(--gold);color:var(--on-gold);padding:8px 12px;border-radius:8px;z-index:100;font-weight:700}
.skip:focus{left:8px}

/* Logo swap between light and dark */
.logo-dark{display:none}
@media (prefers-color-scheme:dark){ :root:not([data-theme="light"]) .logo-light{display:none} :root:not([data-theme="light"]) .logo-dark{display:block} }
:root[data-theme="dark"] .logo-light{display:none}
:root[data-theme="dark"] .logo-dark{display:block}

/* ---------- Header ---------- */
header.site{position:sticky;top:0;z-index:20;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.hbar{display:flex;align-items:center;gap:20px;height:68px}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none;margin-right:auto;min-width:0}
.brand img{width:40px;height:auto;flex:none}
/* Wordmark: "Interactive" in Fraunces italic (echoes Vanderbilt's serif), "Field Guides" in the VALIANT grotesk;
   the VALIANT · VANDERBILT line is letter-justified to the exact width of the line above. */
.wm{display:inline-grid;line-height:1}
.wm-1{font-size:21px;font-weight:800;letter-spacing:-.015em;white-space:nowrap}
.wm-1 em{font-family:"Fraunces",Georgia,serif;font-style:italic;font-weight:650;font-size:1.14em;letter-spacing:-.01em;color:var(--gold-ink);margin-right:.04em}
.wm-2{display:flex;justify-content:space-between;font-size:12.5px;font-weight:800;margin-top:5px;color:var(--ink)}
.wm-2 .d{color:var(--gold)}
.hnav{display:flex;gap:4px;align-items:center}
.hnav a,.hnav button{background:none;border:0;text-decoration:none;font-weight:600;font-size:14px;padding:8px 12px;border-radius:8px;white-space:nowrap}
.hnav a:hover,.hnav button:hover{background:var(--surface-2)}
.count{display:inline-grid;place-items:center;min-width:22px;height:22px;border-radius:99px;background:var(--gold);color:var(--on-gold);font-size:12px;font-weight:800;margin-left:6px;padding:0 6px}
.mode{display:flex;border:1px solid var(--line);border-radius:99px;padding:3px;gap:2px;flex:none}
.mode button{border:0;background:none;border-radius:99px;width:32px;height:28px;display:grid;place-items:center;padding:0}
.mode button svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.mode button[aria-pressed="true"]{background:var(--ink);color:var(--bg)}

/* ---------- Hero ---------- */
.hero{display:grid;grid-template-columns:1fr 1.05fr;gap:24px;align-items:center;padding-top:36px;padding-bottom:18px}
.eyebrow{font-family:var(--mono);font-size:12px;letter-spacing:.12em;color:var(--gold-ink)}
h1{font-size:clamp(40px,5.4vw,74px);line-height:.96;letter-spacing:-.035em;font-weight:900;margin:14px 0 18px}
h1 .g{color:var(--gold-ink)}
.lede{font-size:18px;line-height:1.55;color:var(--muted);max-width:40ch;margin:0 0 26px}
.tpick{display:grid;gap:10px;max-width:460px}
.tbtn{display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:center;text-align:left;background:var(--surface);border:1.5px solid var(--line);border-radius:14px;padding:14px 16px;transition:border-color .2s,transform .2s,box-shadow .2s}
.tbtn:hover{transform:translateX(3px)}
.tbtn[aria-pressed="true"]{border-color:var(--tc);box-shadow:inset 4px 0 0 var(--tc),var(--shadow)}
.tbtn b{display:block;font-size:17px}
.tbtn small{display:block;color:var(--muted);font-size:13.5px;margin-top:2px}
.tbtn .n{font-family:var(--mono);font-size:12px;color:var(--muted);white-space:nowrap}
.marker{width:18px;height:18px;flex:none}
.tall{background:none;border:0;font-weight:700;font-size:14px;text-decoration:underline;text-underline-offset:4px;justify-self:start;padding:4px 0;color:var(--muted)}

/* ---------- Knot map ---------- */
.map{position:relative}
.map svg{width:100%;height:auto;display:block;overflow:hidden}
.traj{fill:none;stroke-linecap:round;transition:opacity .35s,stroke-width .35s}
.traj.dim{opacity:.18}
.node{cursor:pointer;outline:none}
.node text{font-size:22px;font-weight:700;fill:var(--ink)}
.node .sub{font-size:15px;font-weight:500;fill:var(--muted);letter-spacing:.04em}
.node.dim{opacity:.22}
.node .shape{transform-box:fill-box;transform-origin:center;transition:transform .25s}
.node:hover .shape,.node:focus-visible .shape{transform:scale(1.3)}
.node .shape.earned{fill:var(--gold)}
.node.soon{cursor:default}
.node.soon text{fill:var(--muted);font-weight:500;font-style:italic}
.tlabel{font-size:17px;font-weight:800;letter-spacing:.2em;text-transform:uppercase}
.thlabel{font-size:14px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;fill:var(--muted)}
/* Motion: gaps travel outward along every strand; a dashed ring counter-rotates around the knot. */
.flow{fill:none;stroke:var(--bg);stroke-width:2.5;stroke-linecap:round;stroke-dasharray:1 22;animation:flow 3s linear infinite;pointer-events:none;transition:opacity .35s}
.flow.dim{opacity:.15}
@keyframes flow{to{stroke-dashoffset:-23}}
.ring{transform-box:view-box;transform-origin:300px 300px;animation:spin 140s linear infinite reverse}
@keyframes spin{to{transform:rotate(360deg)}}

/* ---------- Now showing ---------- */
.now{margin:12px 0 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);position:relative}
.now .in{display:grid;grid-template-columns:210px 1fr auto;gap:28px;align-items:center;padding-top:22px;padding-bottom:22px;min-height:96px}
.now .lab{font-size:12px;letter-spacing:.18em;text-transform:uppercase;color:var(--muted)}
.now .lab b{display:flex;gap:8px;align-items:center;margin-top:6px;color:var(--ink);letter-spacing:.04em;font-size:14px;text-transform:none}
.now h3{font-size:clamp(24px,3vw,36px);margin:0 0 4px;letter-spacing:-.02em;line-height:1.1}
.now h3 a{text-decoration:none}
.now h3 a:hover{text-decoration:underline;text-decoration-color:var(--gold);text-underline-offset:6px}
.now p{margin:0;color:var(--muted)}
.ctrls{display:flex;gap:8px}
.ctrls button{width:42px;height:42px;border-radius:50%;border:1px solid var(--line);background:var(--surface);font-size:17px}
.ctrls button:hover{border-color:var(--gold)}
.timer{position:absolute;left:0;bottom:-1px;height:2px;width:100%;background:var(--gold);transform-origin:left;transform:scaleX(0)}
.timer.run{animation:timer var(--rot,8s) linear both}
@keyframes timer{to{transform:scaleX(1)}}
.fade{animation:fade .45s ease both}
@keyframes fade{from{opacity:0;transform:translateY(6px)}}

/* ---------- Guide cards ---------- */
section.guides{padding-top:48px;padding-bottom:20px}  /* vertical only: .wrap owns the side margins */
.shead{display:flex;justify-content:space-between;align-items:end;gap:20px;margin-bottom:20px;flex-wrap:wrap}
.shead h2{font-size:34px;letter-spacing:-.02em;margin:0;display:flex;align-items:center;gap:12px}
.shead p{margin:6px 0 0;color:var(--muted);max-width:60ch}
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(270px,100%),1fr));gap:16px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:20px;display:flex;flex-direction:column;gap:10px;position:relative;overflow:hidden;animation:fade .4s ease both}
.card::before{content:"";position:absolute;inset:0 0 auto 0;height:4px;background:linear-gradient(90deg,var(--c1),var(--c2,var(--c1)))}
.card .top{display:flex;justify-content:space-between;align-items:start}
.card .ico{width:38px;height:38px;color:var(--gold-ink)}
.card h3{margin:2px 0 0;font-size:21px;letter-spacing:-.01em}
.card h3 a{text-decoration:none}
.card h3 a::after{content:"";position:absolute;inset:0}          /* whole card opens the guide */
.card p{margin:0;color:var(--muted);font-size:14.5px;line-height:1.5}
.tags{display:flex;gap:6px;flex-wrap:wrap}
.tag{display:inline-flex;gap:6px;align-items:center;font-size:12px;font-weight:700;border:1px solid var(--line);border-radius:99px;padding:3px 9px 3px 6px}
.tag .marker{width:12px;height:12px}
.status{font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;border-radius:99px;padding:3px 8px;background:var(--surface-2);color:var(--muted)}
.card .foot{margin-top:auto;display:flex;justify-content:space-between;align-items:center;gap:10px;padding-top:12px;border-top:1px dashed var(--line)}
.card .foot .btn{position:relative;z-index:1}                   /* above the card link */
.card .meta{font-family:var(--mono);font-size:11.5px;color:var(--muted)}
.btn{white-space:nowrap;border:0;border-radius:10px;padding:9px 13px;font-weight:800;font-size:13.5px;background:var(--ink);color:var(--bg);text-decoration:none;display:inline-block}
.btn.gold{background:var(--gold);color:var(--on-gold)}
.btn:disabled{opacity:.4;cursor:not-allowed}
.btn.ghost{background:transparent;color:var(--ink);box-shadow:inset 0 0 0 1.5px var(--line)}
.mini-badge{width:58px;height:58px;flex:none}
.thread-head{margin:30px 0 12px;padding-top:16px;border-top:1px solid var(--line)}
.thread-head h3{margin:0;font-size:20px;letter-spacing:-.01em}
.thread-head p{margin:4px 0 0;color:var(--muted);font-size:14.5px}
.empty{border:2px dashed var(--line);border-radius:16px;padding:36px 24px;text-align:center;color:var(--muted)}
.empty b{display:block;color:var(--ink);font-size:20px;margin-bottom:6px}

/* ---------- How badges work ---------- */
section.how{padding-top:40px;padding-bottom:56px}
.how h2{font-size:34px;letter-spacing:-.02em;margin:0 0 8px}
.how-grid{display:grid;grid-template-columns:1.1fr 2fr;gap:36px;align-items:start}
.how-grid > div > p{color:var(--muted);margin:0;line-height:1.55}
.steps{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;counter-reset:s}
.step{background:var(--surface-2);border-radius:16px;padding:18px}
.step::before{counter-increment:s;content:counter(s);display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--gold);color:var(--on-gold);font-weight:900;margin-bottom:10px}
.step b{display:block;font-size:16px;margin-bottom:4px}
.step p{margin:0;color:var(--muted);font-size:14px;line-height:1.5}
.shelf{display:flex;gap:14px;flex-wrap:wrap;margin-top:18px}
.shelf .slot{width:84px;text-align:center;font-size:11.5px;color:var(--muted)}
.shelf .slot svg{width:84px;height:84px}

/* ---------- Badge gallery ---------- */
section.gallery{padding-top:8px;padding-bottom:60px}
.gstat{font-size:15px;color:var(--muted)}
.gstat b{font-size:28px;color:var(--ink);font-weight:900;margin-right:4px}
.gal-h{font-size:13px;letter-spacing:.16em;text-transform:uppercase;color:var(--muted);margin:26px 0 12px}
.gal{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(210px,100%),1fr));gap:14px}
.gtile{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:18px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px}
.gtile svg{width:120px;height:120px}
.gtile.on{border-color:var(--gold)}
.gtile b{font-size:16px}
.gtile p{margin:0;color:var(--muted);font-size:13.5px;line-height:1.45}
.gtile .got{font-size:13px;font-weight:800;color:var(--gold-ink)}
.reqs{display:flex;flex-wrap:wrap;gap:5px;justify-content:center;margin-top:2px}
.reqs .rule{width:100%;font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);font-weight:700}
.req{font-size:12px;font-weight:600;border:1px solid var(--line);border-radius:99px;padding:2px 8px;color:var(--muted)}
.req.ok{border-color:var(--gold);color:var(--ink)}
.prog{width:80%;height:6px;border-radius:99px;background:var(--surface-2);overflow:hidden;margin-top:4px}
.prog i{display:block;height:100%;background:var(--gold)}
.unlock{display:grid;grid-template-columns:72px 1fr;gap:12px;align-items:center;text-align:left;margin-top:14px;padding:12px;border-radius:14px;background:var(--surface-2)}
.unlock svg{width:72px;height:72px}
.unlock b{display:block;font-size:16px}
.unlock p{margin:2px 0 0;color:var(--muted);font-size:13px}

/* ---------- Footer ---------- */
footer{border-top:1px solid var(--line);padding:22px 0 40px}
.share-row{margin-bottom:22px}
.share{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.share-label{font-size:13px;font-weight:700;color:var(--muted);margin-right:6px}
.share a,.share button{display:inline-flex;align-items:center;gap:6px;border:1.5px solid var(--line);background:var(--surface);color:var(--ink);border-radius:99px;padding:6px 12px;font-size:13px;font-weight:700;text-decoration:none;line-height:1.2}
.share a:hover,.share button:hover{border-color:var(--gold)}
.share .sglyph{display:inline-grid;place-items:center;width:18px;height:18px;border-radius:5px;background:var(--ink);color:var(--bg);font-size:10.5px;font-weight:900;font-family:var(--sans)}
.toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,20px);background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:12px;font-size:14px;font-weight:600;max-width:calc(100vw - 40px);opacity:0;pointer-events:none;transition:opacity .25s,transform .25s;z-index:200}
.toast.on{opacity:1;transform:translate(-50%,0)}
.badge-io{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0 4px}
.io-out{font-size:13.5px;font-weight:600;min-height:18px;margin-top:6px}
footer .in{display:flex;justify-content:space-between;align-items:center;gap:20px;flex-wrap:wrap}
footer img{height:56px;width:auto}
footer small{color:var(--muted);font-size:13px;line-height:1.5}

/* ---------- Dialogs ---------- */
dialog{border:0;border-radius:20px;padding:0;width:min(560px,calc(100vw - 48px));max-height:calc(100vh - 40px);background:var(--surface);color:var(--ink);box-shadow:0 30px 80px -20px rgba(0,0,0,.6)}
dialog::backdrop{background:rgba(10,10,10,.55);backdrop-filter:blur(3px)}
.dlg{padding:24px 24px 20px}
.dlg-head{display:flex;justify-content:space-between;align-items:start;gap:12px;margin-bottom:6px}
.dlg-head h2{margin:0;font-size:24px;letter-spacing:-.01em}
.dlg-head .x{border:0;background:var(--surface-2);border-radius:50%;width:34px;height:34px;font-size:18px;flex:none}
.dlg .sub{color:var(--muted);margin:0 0 16px;font-size:14px}
.q{border:1px solid var(--line);border-radius:14px;padding:14px;margin:0 0 12px}
.q legend{font-weight:700;padding:0 4px;font-size:15px;line-height:1.4}
.q label{display:flex;gap:10px;align-items:start;padding:7px 8px;border-radius:8px;font-size:14.5px;cursor:pointer}
.q label:hover{background:var(--surface-2)}
.q input{accent-color:var(--gold-deep);margin-top:3px}
.q.wrong{border-color:var(--danger)}
.q.right{border-color:var(--gold)}
.q .why{font-size:13px;color:var(--muted);margin:6px 8px 0;display:none}
.q.wrong .why,.q.right .why{display:block}
.dlg-foot{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-top:6px}
.score{font-size:13.5px;color:var(--muted)}
.earn{text-align:center;padding:6px 0 2px}
.earn svg.big{width:170px;height:170px;margin:0 auto;display:block;animation:pop .7s cubic-bezier(.3,1.6,.5,1) both}
@keyframes pop{from{transform:scale(.3) rotate(-30deg);opacity:0}}
.codebox{display:flex;gap:8px;margin:14px 0 6px}
.codebox code{flex:1;background:var(--surface-2);border-radius:10px;padding:11px 12px;font-family:var(--mono);font-size:15px;letter-spacing:.06em;text-align:left;overflow:auto}
.field{display:grid;gap:6px;text-align:left;margin-top:12px}
.field label{font-size:13px;font-weight:700}
.field input{font:inherit;padding:10px 12px;border-radius:10px;border:1.5px solid var(--line);background:var(--bg);color:var(--ink)}
.note{font-size:12.5px;color:var(--muted);text-align:left;margin-top:10px;line-height:1.45}
.bl-row{display:grid;grid-template-columns:64px 1fr;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}
.bl-row svg{width:64px;height:64px}
.bl-row b{display:block}
.bl-row code{font-family:var(--mono);font-size:12.5px;color:var(--gold-ink);word-break:break-all}
.verify-out{font-size:14px;font-weight:700;margin-top:8px;min-height:20px}

/* ---------- Load error ---------- */
.load-error{margin:24px 0;padding:16px;border-radius:12px;border:1.5px solid var(--danger);color:var(--danger);font-weight:600}

/* ---------- Responsive ---------- */
@media (max-width:980px){.hero{grid-template-columns:1fr}.map{max-width:560px;margin:0 auto;width:100%}.how-grid{grid-template-columns:1fr}.now .in{grid-template-columns:1fr;gap:10px}}
@media (max-width:640px){.wrap{padding:0 28px}.hide-sm{display:none}.steps{grid-template-columns:1fr}.hbar{gap:10px}.brand img{width:30px}.brand{gap:8px}.wm-1{font-size:14.5px}.wm-2{font-size:8.5px;margin-top:3px}.hnav button{padding:6px 6px}.mode button[data-mode="system"]{display:none}.mode button{width:28px}}
@media (max-width:400px){.wrap{padding:0 28px}.hbar{gap:6px}.brand img{width:26px}.wm-1{font-size:12.5px}.wm-2{font-size:7.5px}.mode button{width:24px}.count{margin-left:3px}}
@media (max-width:360px){.wrap{padding:0 22px}.wm-1{font-size:11.5px}.wm-2{font-size:7px}}
@media (max-width:320px){.wrap{padding:0 18px}.mode{display:none}}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
