:root {
  --cream: #f8f6f0;
  --warm-white: #ffffff;
  --stone: #e4e0d4;
  --taupe: #c0b89e;
  --charcoal: #1e2820;
  --warm-grey: #5a6855;
  --accent: #4a6845;
  --accent-light: #7a9875;
  --missing: #b5573f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'DM Sans', sans-serif;
  background-color: var(--cream);
  color: var(--charcoal);
  font-weight: 300;
  line-height: 1.7;
}

/* Bumps every rem-based size at once, since phone screens make the smaller
   text (eyebrows, ticks, muted copy) harder to read than on desktop. */
@media (max-width: 640px) {
  html { font-size: 19px; }
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.eyebrow {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

h1, h2, h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  color: var(--charcoal);
  margin: 0 0 1rem;
  line-height: 1.2;
}

h1 { font-size: clamp(2.2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }

em { color: var(--accent); font-style: italic; }

p { color: var(--charcoal); margin: 0 0 1.25rem; }

.muted { color: var(--warm-grey); }

.card {
  background: var(--warm-white);
  border: 1px solid var(--stone);
  border-radius: 10px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--warm-grey);
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 300;
  color: var(--charcoal);
  background: var(--cream);
  border: 1px solid var(--stone);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1.25rem;
}

button, .btn {
  display: inline-block;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--cream);
  background: var(--charcoal);
  border: none;
  border-radius: 6px;
  padding: 0.9rem 1.75rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}

button:hover, .btn:hover { background: var(--accent); }
button:disabled { background: var(--taupe); cursor: not-allowed; }

button.secondary {
  background: transparent;
  color: var(--charcoal);
  border: 1px solid var(--stone);
}
button.secondary:hover { background: var(--stone); color: var(--charcoal); }

.divider {
  height: 1px;
  background: var(--stone);
  margin: 2rem 0;
}

.error {
  color: var(--missing);
  font-size: 0.9rem;
  margin: -0.5rem 0 1.25rem;
}

/* Scale / agreement picker */
.scale {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.scale label {
  flex: 1;
  text-align: center;
  border: 1px solid var(--stone);
  border-radius: 6px;
  padding: 0.75rem 0.25rem;
  cursor: pointer;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--warm-grey);
  transition: all 0.15s ease;
}
.scale input { display: none; }
.scale input:checked + label,
.scale label.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--cream);
}

.statement {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--stone);
}
.statement:last-child { border-bottom: none; }
.statement-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  color: var(--accent);
}
.statement-text {
  font-size: 1.05rem;
  color: var(--charcoal);
  margin: 0.35rem 0 1.25rem;
}

/* Stack graphic — rebuild of the Viewpoint Stack pyramid, shaded by results */
.stack-graphic svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 28px rgba(30, 40, 32, 0.14));
}
.stack-legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--warm-grey);
}
.stack-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
}
.stack-legend .dot.strong { background: var(--accent); }
.stack-legend .dot.developing { background: var(--taupe); }
.stack-legend .dot.missing { background: var(--missing); }

/* Stack gauge visual */
.stack-visual {
  display: grid;
  gap: 1.6rem;
  margin: 0.5rem 0 1.5rem;
}
.layer-row .layer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.layer-row .layer-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  color: var(--charcoal);
}
.layer-row .layer-sub {
  font-size: 0.78rem;
  color: var(--warm-grey);
  display: block;
  margin-top: 0.1rem;
}
.status-pill {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
  color: var(--cream);
}
.status-pill.strong { background: var(--accent); }
.status-pill.developing { background: var(--taupe); color: var(--charcoal); }
.status-pill.missing { background: var(--missing); }

.gauge {
  position: relative;
  height: 52px;
  padding-top: 30px;
}
.gauge-track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: var(--stone);
  overflow: visible;
}
/* Continuous score gradient (not a hard-bucketed fill) — deliberately only used
   here, on the facilitator-only detail gauge. The pyramid graphic stays
   hard-bucketed by design; it's the client-facing view and needs an instant
   read, not nuance. Marker color itself is set inline per-score in JS. */
.gauge-track.gradient {
  background: linear-gradient(to right, var(--missing) 0%, var(--taupe) 50%, var(--accent) 100%);
}
.gauge-spread {
  position: absolute;
  top: -3px;
  height: 14px;
  border-radius: 7px;
  background: rgba(30, 40, 32, 0.14);
}
.gauge-marker {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid var(--warm-white);
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(30, 40, 32, 0.25);
}
.gauge-value {
  position: absolute;
  top: 2px;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--charcoal);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.question-breakdown {
  margin-top: 0.6rem;
  padding: 0.4rem 0.1rem;
  border-top: 1px dashed var(--stone);
}
.question-breakdown .q-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  font-size: 0.8rem;
  color: var(--warm-grey);
}
.question-breakdown .q-label {
  font-style: italic;
}
.question-breakdown .q-score {
  font-variant-numeric: tabular-nums;
  color: var(--charcoal);
  flex-shrink: 0;
}

.layer-insight {
  margin-top: 1.1rem;
  padding: 1rem 1.2rem;
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  background: var(--cream);
  font-size: 0.88rem;
  color: var(--charcoal);
  line-height: 1.65;
}
.layer-insight.developing { border-left-color: #a89a72; }
.layer-insight.missing { border-left-color: var(--missing); }
.gauge-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  font-size: 0.68rem;
  color: var(--taupe);
}

.reading-guide {
  border: 1px solid var(--stone);
  border-top: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--warm-white);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.reading-guide-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--charcoal);
  font-size: 0.92rem;
  line-height: 1.7;
}
.reading-guide-list li { margin-bottom: 0.85rem; }
.reading-guide-list li:last-child { margin-bottom: 0; }
.reading-guide-list strong { font-weight: 500; }

table.gcas {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.gcas th, table.gcas td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--stone);
}
table.gcas th {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warm-grey);
  font-weight: 400;
}

.link-box {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: var(--cream);
  border: 1px solid var(--stone);
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  word-break: break-all;
}

.pill {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--stone);
  color: var(--warm-grey);
}
.pill.unlocked { background: var(--accent); color: var(--cream); }
