/* Chaos Lab — shared styles
   Clean neutral base + per-band accent colors.
   Set an accent by adding a band class to <body>, e.g. <body class="band-explorer">. */

:root {
  /* neutral palette */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #1c2430;
  --muted: #5d6b7a;
  --faint: #8b97a4;
  --border: #e6e9ee;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --radius: 16px;
  --radius-sm: 10px;

  /* per-band accents */
  --explorer: #ef6c3a;      /* warm coral */
  --investigator: #0f9d8f;  /* teal */
  --scientist: #4f56d6;     /* indigo */
  --predict: #9237c9;       /* violet */

  /* default accent (home / neutral) */
  --accent: #3a4252;
  --accent-soft: #eef0f5;

  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.band-explorer     { --accent: var(--explorer);     --accent-soft: #fdeee7; }
.band-investigator { --accent: var(--investigator); --accent-soft: #e3f5f2; }
.band-scientist    { --accent: var(--scientist);    --accent-soft: #ebecfb; }
.band-predict      { --accent: var(--predict);      --accent-soft: #f3e8fa; }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- top bar ---------- */
.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-size: 1.05rem;
}
.brand:hover { text-decoration: none; }
.brand .dot {
  width: 22px; height: 22px; border-radius: 7px;
  background: conic-gradient(from 210deg, var(--explorer), var(--investigator), var(--scientist), var(--predict), var(--explorer));
}
.crumbs { color: var(--faint); font-size: 0.92rem; margin-left: auto; }
.crumbs a { color: var(--muted); }

/* ---------- hero ---------- */
.hero { padding: 56px 0 26px; }
.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.hero p { font-size: 1.12rem; color: var(--muted); max-width: 60ch; margin: 0; }
.kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 16px;
}

/* ---------- band sections ---------- */
.band { padding: 30px 0; }
.band-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.band-head h2 { font-size: 1.45rem; letter-spacing: -0.01em; margin: 0; }
.band-tag {
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: #fff; padding: 3px 9px; border-radius: 999px;
}
.band-question { color: var(--muted); margin: 2px 0 18px; font-size: 1.02rem; }

/* ---------- cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--card-accent, var(--accent));
}
a.card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d7dbe2; }
.card h3 { margin: 0 0 6px; font-size: 1.08rem; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 0.93rem; }
.card.soon { opacity: 0.62; }
.pill {
  position: absolute; top: 14px; right: 14px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
}
.pill.live { color: var(--accent); background: var(--accent-soft); }
.pill.coming { color: var(--faint); background: #f0f2f5; }

/* ---------- tool page layout ---------- */
.tool-head { padding: 34px 0 8px; }
.tool-head h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); letter-spacing: -0.02em; margin: 0 0 8px; }
.tool-head .lead { font-size: 1.08rem; color: var(--muted); max-width: 62ch; margin: 0; }

.stage {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 22px;
  align-items: start;
  margin: 24px 0;
}
@media (max-width: 760px) { .stage { grid-template-columns: 1fr; } }

.canvas-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  overflow: hidden;
}
canvas { display: block; width: 100%; height: auto; border-radius: 10px; background: #fbfcfd; touch-action: none; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
.panel h3 { margin: 0 0 14px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }

/* controls */
.ctrl { margin-bottom: 16px; }
.ctrl label { display: flex; justify-content: space-between; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
.ctrl label .val { color: var(--accent); font-variant-numeric: tabular-nums; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px;
  background: var(--accent-soft); outline: none; margin: 4px 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.2); border: 2px solid #fff;
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 2px solid #fff;
}

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
button.btn {
  font: inherit; font-weight: 600; font-size: 0.95rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  padding: 10px 14px; border-radius: var(--radius-sm); cursor: pointer; flex: 1;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.05s ease;
}
button.btn:hover { border-color: #cfd5dd; background: #fafbfc; }
button.btn:active { transform: translateY(1px); }
button.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.btn.primary:hover { filter: brightness(1.05); background: var(--accent); }

.toggle { display: flex; align-items: center; gap: 9px; font-size: 0.92rem; font-weight: 600; cursor: pointer; user-select: none; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* explainer blocks */
.notes { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 14px 0 50px; }
@media (max-width: 760px) { .notes { grid-template-columns: 1fr; } }
.note {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.note h3 { margin: 0 0 8px; font-size: 1.05rem; }
.note.accent { border-left: 4px solid var(--accent); }
.note p { margin: 0 0 10px; color: var(--muted); }
.note p:last-child { margin-bottom: 0; }
.note .label { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }

/* footer */
.foot { border-top: 1px solid var(--border); padding: 28px 0; color: var(--faint); font-size: 0.88rem; margin-top: 30px; background: var(--surface); }
.foot a { color: var(--muted); }
