/* V5 course architecture: welcome → main 1–4 → publishing week → main 5–7 */

:where(a, button, input):focus-visible {
  outline: 3px solid #d5ae73;
  outline-offset: 4px;
}

body[data-v5-unit] .content p,
body[data-v5-resource] .content p { overflow-wrap: anywhere; }

.course-position {
  padding: 14px clamp(24px, 7vw, 110px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  color: rgba(255, 255, 255, 0.54);
  background: #101417;
  text-align: center;
}
.course-position p { margin: 0; font-size: 0.72rem; }
.course-position span { color: #d5ae73; font-weight: 780; }
.v5-current-stage { min-height: calc(100vh - 121px); }
.v5-current-stage .portal-current h1.is-short-title { white-space: nowrap; }
.v5-architecture-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.v5-architecture-grid article { min-height: 430px; }

.curriculum-roadmap {
  padding: clamp(90px, 11vw, 145px) clamp(24px, 7vw, 110px) clamp(110px, 14vw, 180px);
  color: var(--ink);
  background:
    radial-gradient(circle at 89% 8%, rgba(118, 42, 50, 0.08), transparent 26%),
    var(--paper);
}
.roadmap-heading {
  display: flex;
  max-width: 1320px;
  margin: 0 auto 60px;
  align-items: end;
  justify-content: space-between;
  gap: 42px;
}
.roadmap-heading > div:first-child { max-width: 780px; }
.roadmap-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5vw, 5.4rem);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 1.12;
}
.roadmap-heading > div:first-child > p:last-child {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--muted);
  font-family: var(--serif);
}
.course-progress { width: min(330px, 100%); color: var(--muted); font-size: 0.72rem; }
.course-progress i {
  position: relative;
  display: block;
  height: 2px;
  margin-top: 11px;
  background: var(--line);
}
.course-progress i b {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--wine);
  transition: width 0.4s;
}

.phase-list {
  display: grid;
  max-width: 1320px;
  margin: auto;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.path-phase {
  position: relative;
  min-height: 470px;
  padding: clamp(30px, 4vw, 52px);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.58);
}
.path-phase::after {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: transparent;
  content: "";
}
.path-phase.is-current { background: #fffaf0; }
.path-phase.is-current::after { background: var(--wine); }
.path-phase.is-complete::after { background: #355849; }
.path-phase > header { display: grid; align-items: start; gap: 18px; grid-template-columns: 42px 1fr; }
.path-phase > header > span { color: var(--wine); font: italic 0.78rem Georgia, serif; }
.path-phase > header p { margin: 0 0 5px; color: var(--gold); font-size: 0.6rem; font-weight: 820; letter-spacing: 0.15em; }
.path-phase > header h3 { margin: 0; font-family: var(--serif); font-size: clamp(1.8rem, 3vw, 3rem); font-weight: 500; letter-spacing: -0.045em; }
.phase-description { max-width: 560px; margin: 24px 0 33px 60px; color: var(--muted); font-family: var(--serif); font-size: 0.9rem; }
.path-phase ol { margin: 0 0 0 60px; padding: 0; list-style: none; }
.path-phase li {
  display: grid;
  min-height: 58px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  align-items: center;
  gap: 13px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
}
.path-phase li > span { color: var(--gold); font: italic 0.67rem Georgia, serif; }
.path-phase li a, .path-phase li strong { min-width: 0; font-family: var(--serif); font-size: 0.92rem; font-weight: 500; line-height: 1.45; text-decoration: none; }
.path-phase li a:hover { color: var(--wine); }
.path-phase li small { color: var(--muted); font-size: 0.58rem; font-weight: 720; white-space: nowrap; }
.path-phase li.is-current a, .path-phase li.is-current strong { color: var(--wine); font-weight: 700; }
.path-phase li.is-complete a { color: #355849; }
.path-phase li.is-locked { opacity: 0.56; }

.publishing-folio { border-top: 1px solid var(--line); }
.publishing-folio .journey-envelope.is-current {
  border-color: rgba(118, 42, 50, 0.42);
  box-shadow: 0 22px 48px rgba(76, 34, 29, 0.14);
}
.publishing-folio .journey-envelope.is-current .envelope-paper { transform: translateY(-18px) rotate(-1deg); }
.publishing-folio .journey-envelope.is-complete .envelope-shell b { background: #355849; }
.publishing-folio .journey-envelope.is-complete .envelope-paper { transform: translateY(-5px); }
.publishing-folio .journey-envelope.is-locked { background: #e8dfd2; }
.publishing-folio .journey-envelope.is-locked .envelope-paper { opacity: 0.34; transform: translateY(73px); }
.publishing-folio .journey-envelope.is-locked .envelope-shell { filter: grayscale(0.72); opacity: 0.75; }

.course-supplements {
  display: grid;
  padding: clamp(90px, 12vw, 155px) max(30px, calc((100vw - 1280px) / 2));
  gap: clamp(50px, 8vw, 105px);
  grid-template-columns: minmax(280px, 0.75fr) minmax(520px, 1.25fr);
  color: #f5efe5;
  background:
    radial-gradient(circle at 10% 14%, rgba(41, 77, 99, 0.36), transparent 34%),
    var(--night);
}
.course-supplements h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.3rem, 4vw, 4.3rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.2;
}
.supplement-links { border-top: 1px solid rgba(255, 255, 255, 0.15); }
.supplement-links a {
  display: grid;
  min-height: 120px;
  padding: 24px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  align-items: center;
  gap: 8px 25px;
  grid-template-columns: 120px minmax(0, 0.82fr) minmax(180px, 1.18fr);
  text-decoration: none;
}
.supplement-links a:hover strong { color: #d5ae73; }
.supplement-links small { color: #d5ae73; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.07em; }
.supplement-links strong { font-family: var(--serif); font-size: 1.18rem; font-weight: 500; transition: color 160ms ease; }
.supplement-links span { color: rgba(255, 255, 255, 0.5); font-family: var(--serif); font-size: 0.82rem; }

.single-course-grid { grid-template-columns: minmax(0, 1fr); }
.single-course-grid > a { min-height: 340px; }
.four-course-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.continuation-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.continuation-grid .featured-resource { min-height: 360px; grid-column: auto; }
.continuation-grid .featured-resource strong { font-size: clamp(2rem, 3.3vw, 3.4rem); }
.library-seven-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.publishing-directory {
  display: grid;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.publishing-directory a {
  display: grid;
  min-height: 72px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  align-items: center;
  gap: 20px;
  grid-template-columns: 70px minmax(0, 1fr);
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}
.publishing-directory a:hover strong { color: #d5ae73; }
.publishing-directory span { color: #d5ae73; font-size: 0.59rem; font-weight: 800; letter-spacing: 0.08em; }
.publishing-directory strong { font-family: var(--serif); font-size: 1.06rem; font-weight: 500; transition: color 160ms ease; }
.v5-library-reading { grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr) auto; }
.library-reading-links { display: flex; align-items: flex-start; gap: 18px; flex-direction: column; }
.library-epilogue {
  padding: clamp(105px, 15vw, 185px) 24px;
  color: #f5efe5;
  background: radial-gradient(circle at 50% 15%, rgba(118, 42, 50, 0.32), transparent 30%), var(--night);
  text-align: center;
}
.library-epilogue h2 { margin: 0; font-family: var(--serif); font-size: clamp(2.7rem, 5vw, 5.3rem); font-weight: 500; letter-spacing: -0.055em; line-height: 1.18; }
.library-epilogue > p:not(.v4-kicker) { max-width: 650px; margin: 26px auto 35px; color: rgba(255, 255, 255, 0.56); font-family: var(--serif); }

.v5-completion {
  display: grid;
  padding: clamp(105px, 14vw, 180px) 24px;
  place-items: center;
  border-top: 1px solid rgba(47, 36, 28, 0.16);
  color: #1a1714;
  text-align: center;
  background:
    radial-gradient(circle at 50% 37%, rgba(118, 42, 50, 0.1), transparent 29%),
    #e5dac8;
}
.v5-completion-kicker { margin: 0 0 20px; color: #762a32; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.16em; }
.v5-completion h2 { max-width: 850px; margin: 0; font-family: var(--serif, "Songti SC", serif); font-size: clamp(2.3rem, 4.5vw, 4.8rem); font-weight: 500; letter-spacing: -0.05em; line-height: 1.18; }
.v5-practice-copy { max-width: 680px; margin: 24px auto 34px; color: #746b61; font-family: var(--serif, "Songti SC", serif); font-size: 1rem; }
.v5-response-box { width: min(660px, 100%); padding: 28px; border: 1px solid rgba(47, 36, 28, 0.16); background: rgba(255, 250, 240, 0.68); text-align: left; }
.v5-response-box label { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.v5-response-box input { width: 21px; height: 21px; flex: 0 0 auto; accent-color: #762a32; }
.v5-response-box label span, .v5-response-box label small, .v5-response-box label strong { display: block; }
.v5-response-box label small { color: #762a32; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; }
.v5-response-box label strong { margin-top: 2px; font-family: var(--serif, "Songti SC", serif); font-weight: 500; }
.v5-response-box button { display: inline-flex; min-height: 54px; margin-top: 24px; padding: 0 23px; align-items: center; border: 0; border-radius: 2px; color: #fff; background: #1a1714; cursor: pointer; gap: 12px; }
.v5-response-box button:disabled { cursor: not-allowed; opacity: 0.42; }
.v5-response-box button span { display: grid; width: 18px; height: 18px; place-items: center; border: 1px solid rgba(255, 255, 255, 0.62); border-radius: 50%; font-size: 0.65rem; }
.v5-completion.is-done .v5-response-box { border-color: rgba(53, 88, 73, 0.38); }
.v5-completion.is-done .v5-response-box button { background: #355849; opacity: 1; }
.v5-arrival-copy { max-width: 660px; margin: 24px auto 0; color: #746b61; font-family: var(--serif, "Songti SC", serif); font-size: 0.86rem; }
.v5-completion-nav { display: flex; margin-top: 25px; gap: 24px; flex-wrap: wrap; justify-content: center; }
.v5-completion-nav a { color: #746b61; font-size: 0.75rem; font-weight: 700; text-decoration: none; }

.v5-resource-return {
  padding: clamp(90px, 12vw, 145px) 24px;
  color: #f4eee3;
  background: #161b1f;
  text-align: center;
}
.v5-resource-return p { max-width: 690px; margin: 0 auto 26px; color: rgba(255, 255, 255, 0.58); font-family: var(--serif, "Songti SC", serif); }
.v5-resource-return div { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.v5-resource-return a { display: inline-flex; min-height: 52px; padding: 0 22px; align-items: center; color: #161b1f; background: #f2e7d4; font-size: 0.76rem; font-weight: 750; text-decoration: none; }

@media (max-width: 980px) {
  .v5-architecture-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roadmap-heading { align-items: start; flex-direction: column; }
  .phase-list { grid-template-columns: 1fr; }
  .course-supplements { grid-template-columns: 1fr; }
  .four-course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .continuation-grid { grid-template-columns: 1fr; }
  .continuation-grid .featured-resource { grid-column: auto; }
  .v5-library-reading { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .v5-architecture-grid { grid-template-columns: 1fr; }
  .course-position { padding: 12px 20px; text-align: left; }
  .v5-current-stage { min-height: auto; }
  .v5-current-stage .portal-current h1.is-short-title { font-size: clamp(2.9rem, 12.5vw, 4rem); }
  .curriculum-roadmap { padding-right: 20px; padding-left: 20px; }
  .roadmap-heading { margin-bottom: 38px; }
  .roadmap-heading h2 { font-size: clamp(2.45rem, 12vw, 3.45rem); }
  .path-phase { min-height: 0; padding: 30px 22px 36px; }
  .phase-description, .path-phase ol { margin-left: 0; }
  .phase-description { margin-top: 22px; }
  .path-phase li { grid-template-columns: 34px minmax(0, 1fr); }
  .path-phase li small { grid-column: 2; white-space: normal; }
  .course-supplements { padding: 90px 24px; }
  .supplement-links a { min-height: 0; grid-template-columns: 1fr; }
  .four-course-grid { grid-template-columns: 1fr; }
  .v5-completion { padding: 95px 20px; }
  .v5-response-box { padding: 23px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
