@import url('https://fonts.googleapis.com/css2?family=BIZ+UDPGothic:wght@400;700&family=Zen+Antique+Soft&display=swap');

:root { --font-display: 'Zen Antique Soft'; --font-body: 'BIZ UDPGothic'; }

:root {
  --jade: #1f5a4d;
  --jade-deep: #143b33;
  --jade-mid: #2c6e5e;
  --jade-soft: #e4ece6;
  --jade-tint: #eef3ef;
  --paper: #f5f3ec;
  --paper-card: #fbfaf3;
  --ink: #233029;
  --ink-soft: #54605a;
  --muted: #8b958d;
  --line: #e3ddce;
  --line-warm: #ded7c4;
  --rail-line: rgba(228, 236, 230, 0.22);
  --rail-text: #e9efe7;
  --rail-muted: #a9c1b6;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 22px 54px rgba(20, 59, 51, 0.14);
  --shadow-soft: 0 12px 30px rgba(20, 59, 51, 0.09);
  --rail-w: 280px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body), ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display), serif;
  font-weight: 400;
  line-height: 1.34;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 60;
  background: var(--jade-deep);
  color: var(--rail-text);
  padding: 0.65rem 0.95rem;
  border-radius: 8px;
}

.skip-link:focus {
  top: 1rem;
}

/* ===================================================================
   Shell: fixed left jade rail + scrolling right paper pane
   =================================================================== */
.shell {
  position: relative;
}

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-w);
  height: 100vh;
  overflow-y: auto;
  background:
    radial-gradient(circle at 30% -6%, rgba(44, 110, 94, 0.55), transparent 60%),
    linear-gradient(190deg, var(--jade) 0%, var(--jade-deep) 78%);
  color: var(--rail-text);
  border-right: 1px solid rgba(0, 0, 0, 0.18);
}

.rail-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 34px 26px 26px;
}

/* ---- brand: text wordmark, no glyph badge ---- */
.rail-brand {
  margin-bottom: 30px;
}

.wordmark {
  display: block;
  font-family: var(--font-display), serif;
  font-size: 1.62rem;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: #fff;
}

.wordmark-sub {
  margin: 8px 0 0;
  color: var(--rail-muted);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.route-line {
  display: block;
  margin-top: 18px;
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, rgba(233, 239, 231, 0.6), rgba(233, 239, 231, 0));
}

/* ---- research map / step rail ---- */
.rail-nav {
  flex: 1 1 auto;
}

.map-kicker {
  margin: 0 0 16px;
  color: var(--rail-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.map-list {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  position: relative;
}

/* the jade route line threading through the numbered nodes */
.map-list::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 18px;
  bottom: 18px;
  width: 1px;
  background: var(--rail-line);
}

.map-list li a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  color: var(--rail-text);
  transition: color 0.16s ease;
}

.map-no {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--rail-line);
  background: var(--jade-deep);
  color: var(--rail-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.map-label {
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.map-list li a:hover .map-label {
  color: #fff;
}

.map-list li a:hover .map-no {
  background: var(--jade-mid);
  border-color: rgba(233, 239, 231, 0.5);
  color: #fff;
}

.map-method {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--rail-muted);
  font-size: 0.86rem;
  font-weight: 700;
  border-top: 1px solid var(--rail-line);
  padding-top: 16px;
  width: 100%;
}

.map-method::before {
  content: "→";
}

.map-method:hover {
  color: #fff;
}

.rail-status {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--rail-line);
  color: var(--rail-muted);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

/* ---- right pane ---- */
.pane {
  margin-left: var(--rail-w);
  min-width: 0;
  min-height: 100vh;
}

/* ===================================================================
   Home dashboard
   =================================================================== */
.dash {
  width: min(880px, calc(100% - 88px));
  margin: 0 auto;
  padding: 66px 0 84px;
}

.dash-head {
  max-width: 720px;
  margin-bottom: 38px;
}

.dash-kicker {
  margin: 0 0 14px;
  color: var(--jade);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.dash-head h1 {
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  line-height: 1.28;
  color: var(--jade-deep);
}

.dash-lede {
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.85;
}

/* ---- featured deep guide (lead cover) ---- */
.featured {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.featured:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.featured-cover {
  min-height: 248px;
  background:
    linear-gradient(150deg, rgba(20, 59, 51, 0.34), rgba(31, 90, 77, 0.12)),
    url("/images/jadepilot-lead.jpg") center / cover no-repeat,
    linear-gradient(150deg, var(--jade) 0%, var(--jade-deep) 72%);
}

.featured-body {
  padding: 32px 34px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.featured-kicker {
  margin: 0;
  color: var(--jade);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.featured-body h2 {
  font-size: clamp(1.45rem, 2.5vw, 1.92rem);
  line-height: 1.36;
  color: var(--jade-deep);
}

.featured-lede {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.78;
}

.featured-cta {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--jade);
  font-weight: 700;
}

.featured-cta::after {
  content: "→";
}

/* ---- block headings ---- */
.block-head {
  margin: 56px 0 22px;
}

.block-head h2 {
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  color: var(--jade-deep);
}

.block-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.97rem;
}

/* ---- latest research list ---- */
.latest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  border-top: 1px solid var(--line);
}

.latest-list li a {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 6px 24px;
  align-items: baseline;
  padding: 22px 8px;
  border-bottom: 1px solid var(--line);
  transition: background 0.16s ease;
}

.latest-list li a:hover {
  background: var(--jade-tint);
}

.latest-date {
  grid-row: span 2;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.latest-title {
  font-family: var(--font-display), serif;
  font-size: 1.22rem;
  line-height: 1.4;
  color: var(--jade-deep);
}

.latest-desc {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ---- research tracks grid ---- */
.track-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.track-card {
  position: relative;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 26px 24px;
  box-shadow: var(--shadow-soft);
  scroll-margin-top: 24px;
}

.track-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 24px;
  bottom: 24px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--jade);
}

.track-no {
  display: inline-block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.track-label {
  display: inline-block;
  margin-left: 10px;
  color: var(--jade);
  background: var(--jade-soft);
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.track-card h3 {
  margin: 14px 0 8px;
  font-size: 1.24rem;
  color: var(--jade-deep);
}

.track-card > p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.track-focus {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.track-focus li {
  padding: 5px 11px;
  border: 1px solid var(--line-warm);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

/* ---- method ---- */
.method-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: 12px;
  max-width: 760px;
}

.method-list li {
  counter-increment: step;
  position: relative;
  padding: 18px 20px 18px 60px;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  line-height: 1.74;
}

.method-list li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 20px;
  top: 17px;
  color: var(--jade);
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---- dashboard footer ---- */
.dash-foot {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 2px solid var(--jade-soft);
  color: var(--muted);
}

.dash-foot strong {
  display: block;
  font-family: var(--font-display), serif;
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--ink);
}

.dash-foot p {
  margin: 8px 0 0;
  max-width: 560px;
  line-height: 1.7;
  font-size: 0.93rem;
}

.dash-foot-note {
  color: var(--jade);
  font-weight: 700;
}

/* ===================================================================
   Article reading pane
   =================================================================== */
.reading-pane {
  width: min(760px, calc(100% - 88px));
  margin: 0 auto;
  padding: 66px 0 88px;
}

.reading-head {
  margin-bottom: 14px;
}

.reading-kicker {
  margin: 0 0 14px;
  color: var(--jade);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.reading-head h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.85rem);
  line-height: 1.32;
  color: var(--jade-deep);
}

.step {
  scroll-margin-top: 24px;
}

.step-tag {
  display: inline-block;
  margin: 38px 0 14px;
  color: var(--jade);
  background: var(--jade-soft);
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.answer-lead {
  margin: 0;
  padding: 22px 24px;
  background: var(--jade-tint);
  border-left: 3px solid var(--jade);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.82;
}

/* ---- injected article body ---- */
.article-content {
  margin-top: 4px;
  color: #2c372f;
  font-size: 1.05rem;
  line-height: 1.92;
}

.article-content p {
  margin: 0 0 18px;
}

.article-content h2 {
  margin: 40px 0 14px;
  font-size: clamp(1.32rem, 2.3vw, 1.66rem);
  color: var(--jade-deep);
  padding-bottom: 9px;
  border-bottom: 1px solid var(--jade-soft);
}

.article-content a {
  color: var(--jade);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(31, 90, 77, 0.4);
  text-underline-offset: 3px;
}

.article-content a:hover {
  text-decoration-color: var(--jade);
}

.article-content ul,
.article-content ol {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 11px;
}

.article-content ul li {
  position: relative;
  padding-left: 26px;
  color: var(--ink-soft);
  line-height: 1.72;
}

.article-content ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--jade);
}

.article-content ol {
  counter-reset: li;
}

.article-content ol li {
  position: relative;
  padding-left: 30px;
  counter-increment: li;
  color: var(--ink-soft);
  line-height: 1.72;
}

.article-content ol li::before {
  content: counter(li);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--jade);
  font-weight: 700;
}

.article-content blockquote {
  margin: 26px 0;
  padding: 22px 26px;
  background: var(--paper-card);
  border-left: 3px solid var(--jade);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--jade-deep);
  font-family: var(--font-display), serif;
  font-size: 1.2rem;
  line-height: 1.74;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.96rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.article-content th,
.article-content td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 13px 15px;
  text-align: left;
  vertical-align: top;
  line-height: 1.6;
}

.article-content th:last-child,
.article-content td:last-child {
  border-right: 0;
}

.article-content tbody tr:last-child td {
  border-bottom: 0;
}

.article-content th {
  background: var(--jade-soft);
  color: var(--jade-deep);
  font-weight: 700;
}

/* ---- faq + sources ---- */
.step-faq h2,
.step-sources h2 {
  font-size: clamp(1.28rem, 2.1vw, 1.58rem);
  color: var(--jade-deep);
  margin-bottom: 6px;
}

.step-faq details {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.step-faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
}

.step-faq summary::-webkit-details-marker {
  display: none;
}

.step-faq summary::before {
  content: "+";
  display: inline-block;
  width: 1.3em;
  color: var(--jade);
  font-weight: 700;
}

.step-faq details[open] summary::before {
  content: "\2013";
}

.step-faq details p {
  margin: 10px 0 0 1.3em;
  color: var(--ink-soft);
  line-height: 1.76;
}

.step-sources {
  margin-top: 8px;
}

.step-sources > p {
  margin: 8px 0 0;
  padding: 20px 22px;
  background: var(--paper-card);
  border: 1px dashed var(--line-warm);
  border-radius: var(--radius);
  color: var(--ink-soft);
  line-height: 1.78;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  color: var(--jade);
  font-weight: 700;
}

.back-link::before {
  content: "←";
}

/* ===================================================================
   Responsive: collapse the fixed rail into a stacked top block
   =================================================================== */
@media (max-width: 960px) {
  .rail {
    position: static;
    width: 100%;
    height: auto;
  }

  .rail-inner {
    padding: 26px 28px;
  }

  .map-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
  }

  .map-list::before {
    display: none;
  }

  .map-list li a {
    padding: 6px 0;
  }

  .pane {
    margin-left: 0;
  }

  .dash,
  .reading-pane {
    width: min(760px, calc(100% - 48px));
    padding-top: 44px;
  }

  .featured {
    grid-template-columns: 1fr;
  }

  .featured-cover {
    min-height: 180px;
  }

  .track-grid {
    grid-template-columns: 1fr;
  }

  .latest-list li a {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .latest-date {
    grid-row: auto;
  }
}

@media (max-width: 520px) {
  .article-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
