/* Evergreen resource pages extend the same light editorial system as the
   simulator and methodology pages. Header and footer chrome stay in v3.css;
   every selector here is scoped to the resource canvas. */

.resource-canvas {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 0 4px;
}

.resource {
  display: grid;
  gap: 34px;
}

.resource-hero {
  display: grid;
  gap: 16px;
  padding: 22px 0 38px;
  border-bottom: 1px solid var(--line);
}

.resource-hero h1 {
  max-width: 850px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(36px, 6vw, 62px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.resource-dek {
  max-width: 790px;
  color: var(--ink-2);
  font-family: var(--font-serif);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.55;
}

.resource-updated {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.resource-body {
  display: grid;
  gap: 18px;
  width: min(100%, 860px);
}

.resource-body > section {
  display: grid;
  gap: 14px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.resource-body h2 {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(24px, 3.5vw, 34px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.resource-body h3 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.resource-body p,
.resource-body li {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.7;
}

.resource-body p + p { margin-top: 2px; }
.resource-body ul,
.resource-body ol { margin: 0; padding-left: 22px; }
.resource-body li + li { margin-top: 9px; }
.resource-body a { color: var(--accent-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.resource-body a:hover { color: var(--ink); }

.resource-body code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.resource-body .callout {
  margin: 2px 0 10px;
  padding: 24px;
  border: 1px solid #dfd1a8;
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--accent-soft);
}

.resource-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.resource-cards article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}

.resource-cards p { margin-top: 8px; color: var(--muted); font-size: 13px; }

/* About page mission graphic */
.about-flow {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  gap: 26px;
  margin: 10px 0 18px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid #252529;
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 52% 45%, rgb(176 133 51 / 22%), transparent 28%),
    linear-gradient(145deg, #0c0c0e, #1b1b1f);
  box-shadow: 0 22px 55px rgb(12 12 14 / 16%);
  color: #fff;
}

.about-flow::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgb(255 255 255 / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px);
  background-size: 34px 34px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.about-flow figcaption { display: grid; gap: 7px; max-width: 610px; }
.about-flow figcaption .kicker { color: #d4b468; }
.resource-body .about-flow h2 { color: #fff; font-size: clamp(25px, 4vw, 38px); }

.about-flow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px minmax(160px, .9fr) 38px minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
}

.about-flow-stage,
.about-engine {
  min-width: 0;
  min-height: 205px;
  padding: 17px;
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: var(--r-md);
  background: rgb(255 255 255 / 5%);
  backdrop-filter: blur(5px);
}

.about-flow-stage { display: grid; align-content: start; gap: 14px; }
.about-flow-label { color: #d4b468; font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.about-market-lines { display: grid; gap: 7px; }
.about-market-lines span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: var(--r-xs);
  background: rgb(0 0 0 / 24%);
  color: #d9d9dd;
  font-size: 10px;
}
.about-market-lines i { color: #fff; font-family: var(--font-mono); font-style: normal; }

.about-flow-arrow { display: grid; place-items: center; }
.about-flow-arrow span { position: relative; display: block; width: 100%; height: 1px; background: #8b753e; }
.about-flow-arrow span::after { position: absolute; top: -3px; right: 0; width: 7px; height: 7px; border-top: 1px solid #d4b468; border-right: 1px solid #d4b468; content: ""; transform: rotate(45deg); }

.about-engine {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}
.about-engine-count { position: relative; z-index: 1; color: #fff; font-family: var(--font-serif); font-size: clamp(31px, 5vw, 45px); letter-spacing: -.04em; line-height: 1; }
.about-engine-copy { position: relative; z-index: 1; max-width: 110px; margin-top: 7px; color: #c5c5c9; font-family: var(--font-mono); font-size: 8px; letter-spacing: .1em; line-height: 1.55; text-transform: uppercase; }
.about-engine-rings { position: absolute; inset: 0; display: grid; place-items: center; }
.about-engine-rings i { position: absolute; width: 78px; aspect-ratio: 1; border: 1px solid rgb(212 180 104 / 30%); border-radius: 50%; }
.about-engine-rings i:nth-child(2) { width: 120px; border-color: rgb(212 180 104 / 17%); }
.about-engine-rings i:nth-child(3) { width: 168px; border-color: rgb(212 180 104 / 9%); }

.about-flow-output { align-content: stretch; grid-template-rows: auto 1fr auto; }
.about-output-chart { display: flex; align-items: end; gap: 5px; min-height: 105px; padding: 8px 4px 0; border-bottom: 1px solid rgb(255 255 255 / 13%); }
.about-output-chart i { flex: 1; height: var(--h); min-height: 4px; border-radius: 2px 2px 0 0; background: linear-gradient(to top, #856526, #d4b468); }
.about-output-legend { display: flex; flex-wrap: wrap; gap: 5px; }
.about-output-legend span { padding: 4px 7px; border-radius: 999px; background: rgb(255 255 255 / 7%); color: #c5c5c9; font-size: 8px; letter-spacing: .04em; }

.about-flow-rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.about-flow-rules span { padding: 8px 10px; border: 1px solid rgb(212 180 104 / 22%); border-radius: 999px; color: #d8c694; font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em; text-align: center; text-transform: uppercase; }

.about-story { gap: 16px !important; }
.resource-body .about-story h3 { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line-soft); color: var(--ink); font-family: var(--font-serif); font-size: clamp(19px, 2.8vw, 24px); font-weight: 500; }
.resource-body .about-story h2 + h3 { margin-top: 0; padding-top: 2px; border-top: 0; }

.about-question {
  display: grid;
  gap: 10px;
  margin: 14px 0 6px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid #dfd1a8;
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--accent-soft);
}
.about-question span { color: var(--accent-deep); font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.resource-body .about-question p { color: var(--ink); font-family: var(--font-serif); font-size: clamp(23px, 4vw, 34px); line-height: 1.22; letter-spacing: -.02em; }

.resource-body .steps {
  display: grid;
  gap: 10px;
  padding: 0;
  counter-reset: resource-step;
  list-style: none;
}

.resource-body .steps li {
  position: relative;
  min-height: 58px;
  padding: 17px 18px 17px 54px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}

.resource-body .steps li::before {
  position: absolute;
  top: 17px;
  left: 18px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  content: counter(resource-step);
  counter-increment: resource-step;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}

.resource-body table { width: 100%; min-width: 560px; border-collapse: collapse; }
.resource-body th,
.resource-body td { padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--ink-2); text-align: left; vertical-align: top; }
.resource-body th { background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.resource-body tr:last-child td { border-bottom: 0; }

.resource-body .calculator {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin: 0 0 8px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface-3);
  box-shadow: 0 12px 34px rgb(12 12 14 / 5%);
}

.calculator form {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 8px;
}

.calculator label { color: var(--ink); font-size: 12px; font-weight: 650; }
.calculator small { color: var(--muted); font-size: 11px; }
.calculator input,
.calculator select {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.calculator input:focus,
.calculator select:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }

.calculator button,
.resource-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.calculator button { margin-top: 9px; }
.calculator button:hover,
.resource-button:hover { border-color: var(--ink-2); background: var(--ink-2); color: #fff; }

.calculator .result {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 210px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}

.calculator .result span { color: var(--muted); font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.calculator .result strong { display: block; margin: 8px 0; color: var(--accent-deep); font-family: var(--font-serif); font-size: clamp(30px, 5vw, 46px); font-weight: 500; letter-spacing: -0.035em; line-height: 1; }
.calculator .result p { color: var(--muted); font-size: 12px; line-height: 1.55; }
.calculator .result.is-error strong,
.calculator .result.is-error p { color: var(--negative); }

.resource-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  width: min(100%, 860px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}

.resource-next p { color: var(--ink-2); font-family: var(--font-serif); font-size: 17px; }

@media (max-width: 720px) {
  .resource-hero { padding-top: 8px; padding-bottom: 28px; }
  .resource { gap: 24px; }
  .resource-body { gap: 8px; }
  .resource-body > section { padding: 22px 0; }
  .resource-cards,
  .resource-body .calculator { grid-template-columns: 1fr; }
  .resource-body .calculator { padding: 12px; }
  .calculator .result { min-height: 160px; }
  .resource-next { align-items: flex-start; flex-direction: column; }
  .about-flow-grid { grid-template-columns: 1fr; }
  .about-flow-stage,
  .about-engine { min-height: 170px; }
  .about-flow-arrow { min-height: 28px; }
  .about-flow-arrow span { width: 1px; height: 28px; }
  .about-flow-arrow span::after { top: auto; right: -3px; bottom: 0; transform: rotate(135deg); }
  .about-flow-rules { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .calculator button,
  .resource-button { transition: none; }
}
