.ref-page {
  --ref-line: #d8dfd7;
  --ref-text: #20352b;
  --ref-muted: #516157;
  --ref-green: #295442;
  --ref-wash: #edf3ec;
}
.ref-anchor { scroll-margin-top: 6rem }
.ref-page .title-block { max-width: 54rem }
.ref-page .title-block p { max-width: 49rem }
.ref-nav, .era-tabs, .alphabet-nav { display: flex; flex-wrap: wrap; gap: .5rem }
.ref-nav a, .era-tabs button, .alphabet-nav a {
  color: var(--ref-green);
  text-decoration: none;
  border: 1px solid var(--ref-line);
  border-radius: .5rem;
  background: #fff;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.35;
}
.ref-nav a, .era-tabs button { padding: .6rem .9rem }
.era-tabs button { cursor: pointer }
.era-tabs button[aria-pressed="true"] { color: #fff; background: #244d3c; border-color: #244d3c }
.era-tabs button[aria-pressed="false"]:hover, .ref-nav a:hover, .alphabet-nav a:hover { background: var(--ref-wash); border-color: #8ca594 }
.ref-page :is(a, button):focus-visible { outline: 3px solid #58816a; outline-offset: 3px }

.timeline-list { list-style: none; margin: 2.2rem 0 0; padding: 0; max-width: 64rem }
.timeline-list .milestone { display: grid; grid-template-columns: 8.4rem minmax(0, 1fr); align-items: start }
.milestone[hidden] { display: none !important }
.milestone-year {
  font-family: var(--serif, 'Instrument Serif', Georgia, serif);
  color: var(--ref-green);
  font-size: clamp(2.15rem, 4vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -.04em;
  font-variant-numeric: lining-nums;
}
.milestone-body { position: relative; border-left: 1px solid #afc2b4; padding: .22rem 0 2.65rem 2.25rem }
.milestone-body::before {
  content: ''; position: absolute; top: .82rem; left: -.35rem;
  width: .66rem; height: .66rem; border: 2px solid #366048;
  border-radius: 50%; background: #f5f8ef; box-sizing: border-box;
}
.milestone-body h2, .path-step h2, .about-copy h2, .source-group-heading h2, .path-card h2 {
  color: var(--ref-text); margin: 0; font-family: var(--serif, 'Instrument Serif', Georgia, serif);
  font-size: clamp(1.65rem, 3vw, 2.15rem); line-height: 1.15; font-weight: 400; letter-spacing: -.025em;
}
.milestone-body p, .path-card p, .path-step p, .about-copy p {
  line-height: 1.65; color: var(--ref-muted); margin: .55rem 0 0; font-size: 1rem;
}
.milestone-body p { max-width: 47rem }
.milestone-links { display: flex; flex-wrap: wrap; column-gap: 1.35rem; row-gap: .45rem; margin-top: .85rem }
.milestone-links span { display: inline-flex; align-items: baseline; gap: .4rem }
.milestone-links .icon { align-self: flex-start; margin-top: .14rem; flex-shrink: 0; color: var(--ref-green) }
.milestone-links a, .source-backlinks a, .path-overview > a, .about-actions > a:not(.primary-btn) {
  color: var(--ref-green); font-size: .9rem; font-weight: 600; text-decoration: underline; text-decoration-color: #a5b7ab; text-underline-offset: .2em;
}
.milestone-links a:hover, .source-backlinks a:hover, .path-overview > a:hover { text-decoration-color: currentColor }

.paths-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem; margin-top: 1.5rem }
.path-card {
  border: 1px solid var(--ref-line); border-radius: .85rem; padding: clamp(1.2rem, 3vw, 2.1rem); background: #fff;
  color: var(--ref-text); text-decoration: none; display: flex; flex-direction: column; align-items: flex-start;
  transition: border-color 160ms, box-shadow 160ms;
}
.path-card:hover { border-color: #799784; box-shadow: 0 4px 14px #1838290b }
.path-card:hover h2 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .13em }
.path-card-top { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.1rem; color: var(--ref-muted); font-size: .875rem; font-weight: 600 }
.path-card p { margin-top: .5rem; margin-bottom: 1.2rem; max-width: 37rem }
.path-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; color: var(--ref-muted); font-size: .875rem; line-height: 1.5 }
.path-card .path-meta { margin-top: auto }
.path-card:first-child {
  grid-column: 1 / -1; background-color: #132d22;
  background-image: linear-gradient(90deg,#10271ff7 0%,#10271ff2 43%,#10271f9c 70%,#10271f10 100%),url('/assets/field.webp');
  background-repeat: no-repeat; background-size: cover; background-position: center, right 48%;
  border-color: #274434;
}
.path-card:first-child h2 { color: #f1f5e8; font-size: clamp(2.1rem, 4vw, 3.1rem) }
.path-card:first-child p { color: #e1e9df; max-width: 36rem }
.path-card:first-child .path-card-top, .path-card:first-child .path-meta { color: #c7ddce }
.path-detail-layout { display: grid; grid-template-columns: minmax(12rem, .8fr) minmax(0,2.6fr); gap: clamp(1.3rem,4vw,3.5rem); align-items: start }
.path-overview { background: var(--ref-wash); padding: 1.35rem; border: 1px solid #d2dfd3; border-radius: .75rem }
.path-overview h2, .about-nav h2 { font-size: 1.05rem; font-weight: 600; line-height: 1.35; margin: .9rem 0 .4rem; color: var(--ref-text) }
.path-overview .progress-count { margin: 0; color: var(--ref-text); font-size: .975rem }
.path-overview .path-meta { margin: 1.1rem 0; border-top: 1px solid #cedbcf; padding-top: .9rem }
.path-steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ref-line) }
.path-step { display: grid; grid-template-columns: 2.1rem minmax(0,1fr) auto; align-items: start; gap: 1rem; border-bottom: 1px solid var(--ref-line); padding: 1.35rem 0 1.5rem }
.step-position { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; background: var(--ref-wash); border-radius: 50%; font-size: .95rem; color: var(--ref-green); font-weight: 600 }
.path-step.is-read .step-position { background: #28563f; color: #fff }
.step-meta { color: var(--ref-muted); font-size: .83rem; line-height: 1.4; margin-bottom: .38rem }
.step-meta span { margin: 0 .2rem }
.path-step h2 { font-size: clamp(1.4rem, 2.3vw, 1.8rem) }
.path-step h2 a, .gloss-group dt a { color: inherit; text-decoration: none }
.path-step h2 a:hover, .gloss-group dt a:hover, .source-title:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em }
.path-step p { font-size: .95rem; margin-top: .3rem }
.step-read { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .6rem; background: #fff; color: var(--ref-green); border: 1px solid var(--ref-line); border-radius: .4rem; font: inherit; font-size: .83rem; cursor: pointer }
.step-read:hover { border-color: #829c89 }
.read-check { display: grid; place-items: center; width: 1.05rem; height: 1.05rem; border: 1px solid #92a899; border-radius: .23rem }
.step-read[aria-pressed="false"] .read-check .icon { visibility: hidden }
.step-read[aria-pressed="true"] .read-check { background: #28563f; border-color: #28563f; color: white }

.alphabet-nav { padding: .85rem 0; border-block: 1px solid var(--ref-line); gap: .3rem }
.alphabet-nav a, .alphabet-nav > span { display: grid; place-items: center; width: 2.16rem; min-height: 2.16rem; font-size: .9rem }
.alphabet-nav > span { color: #707a71 }
.glossary-list { max-width: 62rem }
.gloss-group { display: grid; grid-template-columns: 6rem minmax(0,1fr); gap: 1rem; padding: 1.8rem 0 1.5rem; border-bottom: 1px solid var(--ref-line) }
.gloss-group h2 { color: var(--ref-green); font: 400 3.5rem/1 var(--serif, 'Instrument Serif', Georgia, serif); margin: 0 }
.gloss-group dl { margin: 0 }
.gloss-group dl > div + div { margin-top: 1.35rem }
.gloss-group dt { color: var(--ref-text); font-size: 1.12rem; line-height: 1.4; font-weight: 600 }
.gloss-group dd { margin: .3rem 0 0; color: var(--ref-muted); font-size: 1rem; line-height: 1.65 }
.source-library { max-width: 67rem }
.source-group { margin: 2.35rem 0 0 }
.source-group-heading { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; padding-bottom: .8rem; border-bottom: 1px solid var(--ref-line) }
.source-group-heading h2 { font-size: clamp(1.65rem, 3vw, 2.1rem) }
.source-count { font-size: .85rem; color: var(--ref-muted); margin-left: auto }
.source-group ul { list-style: none; margin: 0; padding: 0 }
.source-group li { padding: 1.05rem 0; border-bottom: 1px solid var(--ref-line) }
.source-title { color: var(--ref-text); font-weight: 600; font-size: 1.02rem; line-height: 1.5; text-decoration: none; overflow-wrap: anywhere }
.source-title .icon { color: var(--ref-green); margin-left: .18rem; vertical-align: baseline }
.source-backlinks { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .45rem; margin-top: .4rem; color: var(--ref-muted); line-height: 1.5; font-size: .84rem }
.source-backlinks a { font-size: .84rem; font-weight: 500 }
.about-layout { display: grid; grid-template-columns: minmax(12rem, .8fr) minmax(0,2.3fr); gap: clamp(2rem,5vw,5rem); max-width: 67rem; align-items: start }
.about-nav { border: 1px solid var(--ref-line); background: #fff; border-radius: .65rem; padding: 1.2rem }
.about-nav h2 { margin-top: 0 }
.about-nav .ref-nav { display: flex; flex-direction: column; gap: .65rem; align-items: flex-start; margin-top: .8rem }
.about-nav a { border: 0; border-radius: 0; padding: 0; font-weight: 500; line-height: 1.5; text-decoration: underline; text-underline-offset: .15em; text-decoration-color: #b0bdb3 }
.about-nav a:hover { background: transparent; text-decoration-color: var(--ref-green) }
.about-copy section + section { margin-top: 1.9rem; border-top: 1px solid var(--ref-line); padding-top: 1.65rem }
.about-copy p { margin: .8rem 0 0; font-size: 1.03rem; line-height: 1.75 }
.about-actions { margin-top: 1.65rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1.05rem }

@media (max-width: 840px) {
  .path-step { grid-template-columns: 2.1rem minmax(0,1fr); gap: .6rem .85rem }
  .step-read { grid-column: 2; justify-self: start }
}
@media (max-width: 680px) {
  .timeline-list .milestone { grid-template-columns: 4.45rem minmax(0,1fr) }
  .milestone-year { font-size: 2rem }
  .milestone-body { padding-left: 1.15rem; padding-bottom: 1.85rem }
  .milestone-body::before { top: .6rem }
  .milestone-links { flex-direction: column; row-gap: .45rem }
  .era-tabs { gap: .35rem }
  .era-tabs button { padding: .5rem .65rem }
  .paths-grid { grid-template-columns: 1fr; gap: .8rem }
  .path-card:first-child { background-image: linear-gradient(90deg,#10271ffa,#10271fbe),url('/assets/field.webp') }
  .path-detail-layout, .about-layout { grid-template-columns: minmax(0,1fr); gap: 1.5rem }
  .path-overview { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .3rem .75rem }
  .path-overview .tile-icon { grid-row: span 2 }
  .path-overview h2 { margin: 0 }
  .path-overview .path-meta { grid-column: 1 / -1; margin: .6rem 0 .15rem }
  .path-overview > a { grid-column: 1 / -1 }
  .gloss-group { grid-template-columns: 2.7rem minmax(0,1fr); gap: .65rem }
  .gloss-group h2 { font-size: 2.65rem }
  .source-group-heading { gap: .45rem }
  .about-nav { padding: 1rem }
}
@media print {
  .ref-page :is(.era-tabs,.alphabet-nav,.ref-nav,.step-read,.about-actions) { display: none }
  .milestone[hidden] { display: grid !important }
  .path-card:first-child { background: #fff; color: black }
  .path-card:first-child :is(h2,p,.path-meta,.path-card-top) { color: black }
}
