/* Crew Salary Survey — dark navy / gold, mobile-first, committed single look */
:root {
  --bg-0: #0a1220;
  --surface-1: #101a2e;        /* chart surface — palette validated against this */
  --surface-2: #16233c;
  --surface-3: #1d2c49;
  --line: #24334f;
  --ink: #eef2f8;
  --ink-2: #a9b8d0;
  --ink-3: #7488a8;
  --gold: #e0b458;             /* accent + "you" marker, never a data series */
  --gold-dim: #b28c3e;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --ramp-1: #9ec5f4; --ramp-2: #6da7ec; --ramp-3: #3987e5; --ramp-4: #256abf; --ramp-5: #184f95;
  --good: #199e70;
  --bad: #e66767;
  --radius: 14px;
  --font-display: Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 500px at 85% -10%, #16305c66 0%, transparent 60%),
    radial-gradient(900px 420px at -10% 8%, #0f2a4a55 0%, transparent 55%),
    var(--bg-0);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.55;
  font-size: 16px;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 18px 90px; }
.wrap.wide { max-width: 980px; }

/* ---------- header ---------- */
header.site {
  padding: 26px 0 8px;
  display: flex; align-items: center; gap: 12px;
}
.burgee {
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #17335e, #0e2242);
  border: 1px solid #2c4470;
  display: grid; place-items: center;
}
.burgee svg { display: block; }
.site h1 {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 600; letter-spacing: .4px;
}
.site .sub { font-size: 12.5px; color: var(--ink-3); letter-spacing: .5px; }

.hero {
  margin: 26px 0 6px;
  font-family: var(--font-display);
  font-size: clamp(28px, 6.4vw, 40px);
  line-height: 1.16;
  font-weight: 600;
}
.hero em { font-style: normal; color: var(--gold); }
.lede { color: var(--ink-2); font-size: 16px; margin: 12px 0 4px; max-width: 56ch; }
.lede + .lede { margin-top: 8px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 4px; }
.pill {
  font-size: 12.5px; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px;
}
.pill b { color: var(--gold); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 16px var(--font-body);
  padding: 14px 26px; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: transform .06s ease, filter .15s ease;
  -webkit-tap-highlight-color: transparent;
  min-height: 48px;
}
.btn:active { transform: scale(.985); }
.btn-gold { background: linear-gradient(180deg, #ecc36a, #cfa243); color: #1c1503; }
.btn-gold:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: #3a4f78; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn-row { display: flex; gap: 10px; margin-top: 26px; }
.btn-row .spacer { flex: 1; }

/* ---------- form ---------- */
.progress {
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(180deg, var(--bg-0) 75%, transparent);
  padding: 12px 0 10px;
}
.progress .bar {
  height: 4px; border-radius: 4px; background: var(--surface-3);
  overflow: hidden;
}
.progress .fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 4px; transition: width .35s ease;
}
.progress .steps {
  display: flex; justify-content: space-between;
  font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase;
  color: var(--ink-3); margin-top: 7px;
}
.progress .steps span.on { color: var(--gold); font-weight: 600; }

.section-title {
  font-family: var(--font-display);
  font-size: 26px; margin: 22px 0 4px;
}
.section-blurb { color: var(--ink-2); font-size: 14.5px; margin-bottom: 18px; }

.q { margin: 0 0 22px; }
.q-label { font-weight: 600; font-size: 16.5px; display: block; margin-bottom: 4px; }
.q-label .req { color: var(--gold); margin-left: 3px; }
.q-label .opt { color: var(--ink-3); font-weight: 400; font-size: 13px; margin-left: 6px; }
.q-help { font-size: 13.5px; color: var(--ink-3); margin: 0 0 10px; }
.q.error .q-label { color: var(--bad); }
.q .err-msg { display: none; color: var(--bad); font-size: 13.5px; margin-top: 6px; }
.q.error .err-msg { display: block; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  border-radius: 11px; padding: 11px 15px; font-size: 15px; cursor: pointer;
  transition: all .12s ease; -webkit-tap-highlight-color: transparent;
  min-height: 46px; display: inline-flex; align-items: center;
}
.chip:hover { border-color: #3a5078; }
.chip.on {
  background: #1e3054; border-color: var(--gold-dim); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--gold-dim);
}
.chip.on::before { content: "✓  "; color: var(--gold); font-weight: 700; white-space: pre; }

input[type=number], input[type=text], textarea, select {
  width: 100%; max-width: 340px;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 11px;
  font: 16px var(--font-body); padding: 13px 14px;
  outline: none; min-height: 48px;
}
textarea { max-width: 100%; min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--gold-dim); }
.suffixed { display: flex; align-items: center; gap: 10px; }
.suffixed .suffix { color: var(--ink-3); font-size: 14px; }
.money-row { display: flex; gap: 10px; align-items: center; max-width: 340px; }
.money-row input { flex: 1; }

/* scale (1–5) */
.scale-row { display: flex; gap: 8px; margin-top: 8px; }
.scale-btn {
  flex: 1; aspect-ratio: 1.15; max-width: 74px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  border-radius: 12px; font: 700 19px var(--font-body); cursor: pointer;
  transition: all .12s ease; -webkit-tap-highlight-color: transparent;
}
.scale-btn.on { background: #1e3054; border-color: var(--gold); color: var(--gold); }
.scale-caption { margin-top: 8px; font-size: 13.5px; color: var(--ink-3); min-height: 1.4em; }
.scale-caption b { color: var(--gold); }

.honeypot { position: absolute; left: -6000px; top: -6000px; }

/* ---------- cards / results ---------- */
.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 18px; margin: 14px 0;
}
.card h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 18.5px; margin-bottom: 2px;
}
.card .h-sub { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 18px 0; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 14px;
}
.tile .t-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-3); }
.tile .t-value { font: 600 30px var(--font-display); margin-top: 4px; color: var(--ink); }
.tile .t-value small { font-size: 16px; color: var(--ink-3); }
.tile .t-note { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.tile.hero-tile .t-value { color: var(--gold); }

/* "you" panel */
.you-card {
  border: 1px solid var(--gold-dim);
  background:
    radial-gradient(600px 200px at 90% -30%, #e0b45815, transparent 60%),
    linear-gradient(180deg, #182b47, var(--surface-1));
}
.rank-line {
  display: flex; align-items: baseline; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.rank-line:last-child { border-bottom: none; }
.rank-pct {
  font: 700 24px var(--font-display); color: var(--gold); min-width: 108px;
}
.rank-body { flex: 1; min-width: 200px; font-size: 14.5px; color: var(--ink-2); }
.rank-body b { color: var(--ink); }
.rank-n { font-size: 12px; color: var(--ink-3); }
.delta-up { color: var(--good); font-weight: 600; }
.delta-down { color: var(--bad); font-weight: 600; }
.delta-level { color: var(--ink-2); font-weight: 600; }

/* charts */
.chart { margin-top: 6px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart-scroll { overflow-x: auto; }
.bar-txt { font: 600 12.5px var(--font-body); fill: var(--ink); }
.bar-lbl { font: 12.5px var(--font-body); fill: var(--ink-2); }
.bar-sub { font: 11px var(--font-body); fill: var(--ink-3); }
.gridline { stroke: var(--line); stroke-width: 1; }
.suppress-note { font-size: 12px; color: var(--ink-3); margin-top: 10px; font-style: italic; }

/* legend */
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 4px; font-size: 13px; color: var(--ink-2); }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* data table fallback */
details.tbl { margin-top: 10px; }
details.tbl summary { font-size: 12.5px; color: var(--ink-3); cursor: pointer; }
table.data { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13.5px; }
table.data th, table.data td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
table.data th { color: var(--ink-3); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* tooltip */
#tip {
  position: fixed; z-index: 50; pointer-events: none; display: none;
  background: #060b14f2; border: 1px solid var(--line); color: var(--ink);
  font-size: 13px; padding: 8px 11px; border-radius: 9px; max-width: 260px;
  box-shadow: 0 6px 24px #00000088;
}
#tip .tt-t { font-weight: 600; }
#tip .tt-s { color: var(--ink-2); font-size: 12.5px; }

/* comments */
.comment {
  border-left: 2px solid var(--gold-dim);
  padding: 8px 0 8px 14px; margin: 12px 0; color: var(--ink-2); font-size: 14.5px;
}
.comment .who { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* thanks screen */
.thanks-hero { text-align: center; padding: 40px 0 8px; }
.thanks-hero .big { font: 600 34px var(--font-display); color: var(--gold); }

footer.site {
  margin-top: 50px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-3);
}
footer.site a { color: var(--ink-2); }

.notice { font-size: 13px; color: var(--ink-3); margin-top: 14px; }
.center { text-align: center; }
.muted { color: var(--ink-3); }
@media (max-width: 480px) {
  .rank-pct { min-width: 88px; font-size: 21px; }
  .btn { width: 100%; }
  .btn-row { flex-direction: row; }
  .btn-row .btn { width: auto; flex: 1; }
}

/* --- notify card ("email me when the results are in") --- */
.notify-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
input[type=email] {
  width: 100%; max-width: 340px;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 11px;
  font: 16px var(--font-body); padding: 13px 14px;
  outline: none; min-height: 48px;
}
.notify-row input[type=email] { flex: 1; min-width: 220px; }
