/* ==========================================================================
   PROFIL SYMBOLIQUE — Editorial design system
   ========================================================================== */

:root {
  /* Palette */
  --bg:        #F8F4ED;     /* warm ivory */
  --bg-soft:   #F2EBDF;     /* cream surface */
  --surface:  #FBF8F2;      /* card */
  --ink:       #1F1B17;     /* deep charcoal */
  --ink-soft:  #4A4138;     /* secondary text */
  --ink-mute:  #7A6E60;     /* tertiary */
  --rule:      #E2D7C3;     /* divider */
  --rule-soft: #ECE3D2;
  --gold:      #B08D57;
  --gold-deep: #8E6F3F;
  --gold-soft: #D9C39A;

  /* Type */
  --serif: "Fraunces", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Inter", "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  /* Scale (fluid) */
  --text-xs:   clamp(0.75rem, 0.72rem + 0.10vw, 0.80rem);
  --text-sm:   clamp(0.86rem, 0.82rem + 0.15vw, 0.92rem);
  --text-base: clamp(1.00rem, 0.96rem + 0.18vw, 1.08rem);
  --text-md:   clamp(1.12rem, 1.05rem + 0.30vw, 1.22rem);
  --text-lg:   clamp(1.30rem, 1.18rem + 0.50vw, 1.55rem);
  --text-xl:   clamp(1.65rem, 1.40rem + 1.10vw, 2.20rem);
  --text-2xl:  clamp(2.10rem, 1.70rem + 1.80vw, 3.10rem);
  --text-hero: clamp(2.80rem, 1.90rem + 4.00vw, 5.40rem);
  --text-roman:clamp(6rem, 4rem + 8vw, 11rem);

  --leading: 1.72;
  --measure: 70ch;

  /* Layout */
  --sidebar-w: 280px;
  --content-pad-x: clamp(1.25rem, 4vw, 3.5rem);
  --content-max: 880px;

  /* Motion */
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* Reset */
*,*::before,*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; }
@media (max-width: 860px) { html { scroll-padding-top: 5rem; } }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: var(--leading);
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "kern";
  min-height: 100vh;
}

::selection { background: var(--gold-soft); color: var(--ink); }

/* ============================ Reading progress =========================== */
.progress-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px; background: transparent; z-index: 100;
  pointer-events: none;
}
.progress-bar::before {
  content: "";
  display: block; height: 100%;
  width: var(--scrollpct, 0%);
  background: linear-gradient(90deg, var(--gold-soft), var(--gold), var(--gold-deep));
  transition: width 80ms linear;
}

/* ============================== Mobile bar =============================== */
.mobile-bar {
  display: none;
  position: sticky; top: 0; z-index: 60;
  align-items: center; justify-content: space-between;
  padding: 0.6rem 1rem;
  background: rgba(248,244,237,0.92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.mobile-bar__brand {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--serif);
  font-size: 1rem; font-weight: 500;
  color: var(--ink);
}
.mobile-bar__brand .mark { color: var(--gold); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;
  border-radius: 999px; color: var(--ink);
  transition: background-color .2s var(--ease);
}
.icon-btn:hover { background: rgba(31,27,23,0.05); }

/* ============================== Sidebar ================================== */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  border-right: 1px solid var(--rule-soft);
  background: var(--bg);
  z-index: 50;
  overflow-y: auto;
}
.sidebar__inner {
  display: flex; flex-direction: column; gap: 1.6rem;
  padding: 1.8rem 1.5rem 1.5rem;
  min-height: 100%;
}
.sidebar__brand {
  display: inline-flex; align-items: center; gap: .7rem;
  text-decoration: none; color: var(--ink);
}
.sidebar__brand .mark { color: var(--gold); flex-shrink: 0; }
.sidebar__brand-title {
  font-family: var(--serif); font-size: 1.05rem; font-weight: 500;
  letter-spacing: 0.005em;
}
.sidebar__brand-sub {
  font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 1px;
}

.sidebar__nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.navlink, .subnav__link {
  display: block;
  padding: .55rem .65rem;
  border-radius: 6px;
  font-size: 0.86rem;
  color: var(--ink-soft);
  text-decoration: none;
  line-height: 1.45;
  transition: color .2s var(--ease), background-color .2s var(--ease);
  position: relative;
}
.navlink {
  font-weight: 500;
}
.navlink:hover, .subnav__link:hover { color: var(--ink); background: rgba(31,27,23,0.035); }
.navlink.is-active, .subnav__link.is-active {
  color: var(--gold-deep);
  background: rgba(176,141,87,0.06);
}
.navlink.is-active::before, .subnav__link.is-active::before {
  content: ""; position: absolute; left: -2px; top: 50%; transform: translateY(-50%);
  width: 2px; height: 16px; background: var(--gold); border-radius: 2px;
}
.navgroup { margin-top: .35rem; }
.subnav {
  display: flex; flex-direction: column; gap: 0.05rem;
  padding-left: 0.9rem;
  margin: 0.2rem 0 0.2rem 0.4rem;
  border-left: 1px solid var(--rule-soft);
}
.subnav__link { font-size: 0.8rem; padding: .42rem .55rem; font-weight: 400; }

.sidebar__foot {
  display: flex; flex-direction: column; gap: .5rem;
  padding-top: 1rem; border-top: 1px solid var(--rule-soft);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .45rem;
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
  min-height: 40px;
}
.btn--ghost {
  border: 1px solid var(--rule);
  color: var(--ink);
  background: var(--surface);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-deep); }
.btn--text {
  color: var(--ink-mute);
  font-size: 0.78rem;
}
.btn--text:hover { color: var(--gold-deep); }

/* Sidebar mobile drawer */
.sidebar-scrim {
  display: none;
  position: fixed; inset: 0; background: rgba(31,27,23,0.35);
  backdrop-filter: blur(2px);
  z-index: 49;
  opacity: 0; transition: opacity .25s var(--ease);
}
body.menu-open .sidebar-scrim { opacity: 1; }

/* ================================ Main =================================== */
.main {
  margin-left: var(--sidebar-w);
  padding: 0 var(--content-pad-x);
  min-height: 100vh;
}
.report {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) 0 5rem;
}

/* Eyebrows / labels */
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--gold-deep);
  font-weight: 500;
}
.eyebrow--small { font-size: 0.66rem; letter-spacing: 0.20em; }

/* ================================ Hero =================================== */
.hero {
  padding-top: clamp(2rem, 6vw, 4.5rem);
  padding-bottom: clamp(3rem, 7vw, 5.5rem);
  border-bottom: 1px solid var(--rule-soft);
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--gold-deep);
  font-size: 0.74rem;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  font-weight: 500;
}
.hero__eyebrow .ornament {
  display: inline-flex; color: var(--gold);
}
.hero__name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: var(--text-hero);
  line-height: 1.02;
  letter-spacing: -0.018em;
  margin: 1.1rem 0 1.5rem;
  color: var(--ink);
  font-style: normal;
  font-feature-settings: "ss01", "kern", "liga";
}
.hero__lead {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: var(--text-md);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 0 2rem;
}
.hero__divider {
  display: inline-flex; align-items: center; gap: .85rem;
  color: var(--gold);
  margin-top: 1.1rem;
  margin-bottom: 1.6rem;
}
.hero__line {
  display: inline-block; width: 64px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.hero__pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: var(--surface);
}
.hero__pill span { color: var(--gold-deep); font-weight: 500; }

/* ============================ Sections =================================== */
.section {
  padding: clamp(2.6rem, 6vw, 4.5rem) 0;
  border-bottom: 1px solid var(--rule-soft);
}
.section-head { margin-bottom: 1.8rem; }
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-xl);
  line-height: 1.18;
  letter-spacing: -0.012em;
  margin: .5rem 0 0;
  max-width: 24ch;
  color: var(--ink);
}

.prose p {
  margin: 0 0 1.1rem;
  max-width: var(--measure);
  font-size: var(--text-base);
  line-height: var(--leading);
  color: var(--ink-soft);
  font-weight: 400;
}
.prose p.lead {
  font-family: var(--serif);
  font-size: var(--text-md);
  font-weight: 400;
  font-style: normal;
  line-height: 1.55;
  color: var(--ink);
}
.muted-note {
  color: var(--ink-mute);
  font-size: var(--text-sm);
  max-width: var(--measure);
}
.small-note { margin-top: 1.4rem; font-style: italic; }

/* Intro grid */
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  margin-top: 2.6rem;
}
.intro-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem;
  padding: 1.6rem 1.6rem 1.6rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
}
.intro-card__num span {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  color: var(--gold);
  line-height: 1;
  letter-spacing: -0.02em;
}
.intro-card__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--text-md);
  margin: .35rem 0 .8rem;
  line-height: 1.25;
}
.intro-card__body p { margin: 0 0 .9rem; font-size: 0.92rem; color: var(--ink-soft); }
.axes-list {
  list-style: none; padding: 0; margin: .6rem 0 0;
  display: flex; flex-direction: column; gap: .55rem;
  border-top: 1px solid var(--rule-soft);
  padding-top: .9rem;
}
.axes-list li {
  display: grid; grid-template-columns: auto 1fr; gap: .65rem;
  font-size: 0.85rem; color: var(--ink-soft); line-height: 1.5;
}
.axes-list .axe-num {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--gold-deep);
  letter-spacing: 0.02em;
}

/* ============================== Phase ==================================== */
.phase {
  padding: clamp(3.5rem, 7vw, 6rem) 0 clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--rule-soft);
}
.phase-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  padding-bottom: clamp(1.6rem, 4vw, 2.6rem);
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--rule-soft);
}
.phase-roman {
  font-family: var(--serif);
  font-weight: 200;
  font-size: var(--text-roman);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--gold-soft);
  user-select: none;
}
.phase-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-2xl);
  line-height: 1.08;
  letter-spacing: -0.018em;
  margin: .25rem 0 0;
  max-width: 22ch;
  color: var(--ink);
}
.phase-intro {
  margin-top: 0; margin-bottom: clamp(2rem, 4vw, 3rem);
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--text-md);
  color: var(--ink-soft);
  max-width: 64ch;
  line-height: 1.5;
}

/* ============================== Axe ====================================== */
.axes-container { display: flex; flex-direction: column; gap: 0; }
.axe {
  padding: clamp(2rem, 4vw, 3rem) 0;
  border-bottom: 1px solid var(--rule-soft);
}
.axe:last-child { border-bottom: 0; }
.axe-head {
  display: flex; flex-direction: column; gap: .6rem;
  margin-bottom: 1.6rem;
}
.axe-num-eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  color: var(--gold-deep);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 500;
}
.axe-num-eyebrow::before {
  content: ""; width: 18px; height: 1px; background: var(--gold);
}
.axe-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--text-xl);
  line-height: 1.2;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 0;
  max-width: 28ch;
}
.axe-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--ink-mute);
  margin: .35rem 0 0;
  max-width: 60ch;
}
.axe-body p {
  margin: 0 0 1.2rem;
  font-size: var(--text-base);
  line-height: var(--leading);
  color: var(--ink-soft);
  max-width: var(--measure);
}
.axe-body p:first-child::first-letter {
  font-family: var(--serif);
  font-size: 3.2em;
  font-weight: 400;
  line-height: 0.9;
  float: left;
  padding: 0.05em 0.12em 0 0;
  color: var(--gold-deep);
}
.axe-scale {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
}
.axe-scale__inner {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--gold-soft);
  border-bottom: 1px solid var(--gold-soft);
  background: rgba(176, 141, 87, 0.04);
  min-width: 240px;
  max-width: 100%;
}
.axe-scale__label {
  font-family: var(--font-display, "Fraunces", serif);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.axe-scale__label strong { font-weight: 500; }
.axe-scale .scale-select { min-width: 120px; text-align: center; text-align-last: center; }
.axe-scale__caption {
  font-size: 0.78rem;
  color: var(--ink-muted, #6b6258);
  font-style: italic;
}
.axe-scale .scales__print { display: none; }

@media print {
  .axe-scale__inner { background: transparent; padding: 0.5rem 0; border-color: #ccc; }
  .axe-scale select, .axe-scale__caption { display: none !important; }
  .axe-scale .scales__print {
    display: block !important;
    font-family: var(--font-display, "Fraunces", serif);
    color: #1F1B17;
    font-size: 11pt;
  }
}
@media (max-width: 540px) {
  .axe-scale__inner { padding: 1rem 1.25rem; }
}

.axe-end {
  display: flex; align-items: center; justify-content: center; gap: .8rem;
  margin-top: 2rem;
  color: var(--gold);
}
.axe-end span {
  flex: 0 0 64px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}
.axe-end svg { color: var(--gold); }

/* =============================== Items =================================== */
.part { padding: clamp(2rem, 5vw, 3.5rem) 0 0; }
.part-head { margin-bottom: clamp(1.4rem, 3vw, 2.4rem); }
.part-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-xl);
  line-height: 1.18;
  letter-spacing: -0.012em;
  margin: .4rem 0 0;
  max-width: 30ch;
}
.part-subtitle { margin-top: .55rem; font-style: italic; }

.items { display: flex; flex-direction: column; gap: 0; }
.item {
  position: relative;
  padding: clamp(1.8rem, 4vw, 2.6rem) 0;
  border-top: 1px solid var(--rule-soft);
}
.item:first-child { border-top: 1px solid var(--rule); }
.item:last-child { border-bottom: 1px solid var(--rule); }
.item-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.1rem, 2.5vw, 1.8rem);
  align-items: start;
  margin-bottom: 1.4rem;
}
.item-num {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  line-height: 0.85;
  color: var(--gold);
  letter-spacing: -0.02em;
  padding-top: .2rem;
}
.item-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--text-lg);
  line-height: 1.22;
  letter-spacing: -0.008em;
  margin: 0;
  color: var(--ink);
  max-width: 42ch;
}
.item-body { display: flex; flex-direction: column; gap: 1.2rem; }
.item-block .subhead {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.item-block .subhead::before {
  content: ""; width: 14px; height: 1px; background: var(--gold);
}
.item-block p {
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--leading);
  color: var(--ink-soft);
  max-width: 64ch;
}

/* Scales panel */
.scales {
  margin-top: 1.5rem;
  padding: 1.2rem 1.3rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
}
.scales__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.scale-field {
  display: flex; flex-direction: column; gap: .4rem;
}
.scale-field label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}
.scale-field label strong {
  color: var(--ink);
  letter-spacing: 0.18em;
  font-weight: 600;
}
.scale-select {
  appearance: none; -webkit-appearance: none;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%237A6E60' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right 14px center,
    var(--bg-soft);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 6px;
  padding: 0.7rem 2.4rem 0.7rem 0.95rem;
  min-height: 44px;
  width: 100%;
  cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.scale-select:hover { border-color: var(--gold-soft); }
.scale-select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176,141,87,0.18); }
.scale-select.is-filled {
  background-color: rgba(176,141,87,0.10);
  border-color: var(--gold-soft);
  color: var(--gold-deep);
  font-weight: 600;
}
.scales__caption {
  margin-top: .9rem;
  font-size: 0.74rem;
  color: var(--ink-mute);
  letter-spacing: 0.01em;
}

/* Print summary (only in PDF / print) */
.scales__print {
  display: none;
}

/* ============================ Report foot ================================ */
.report-foot {
  margin-top: 4rem;
  padding-top: 3rem;
  text-align: center;
}
.report-foot__divider {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  color: var(--gold);
  margin-bottom: 1.6rem;
}
.report-foot__divider span {
  flex: 0 0 60px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}
.report-foot__line {
  font-family: var(--serif);
  font-size: var(--text-md);
  font-weight: 400;
  color: var(--ink);
  margin: 0;
}
.report-foot__line strong { font-weight: 500; }
.report-foot__small {
  font-size: 0.78rem; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--ink-mute);
  margin: .8rem 0 0;
}
.report-foot__actions {
  margin-top: 2rem;
  display: flex; justify-content: center;
}

/* ============================ Back to top ================================ */
.back-to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--rule);
  color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease), border-color .2s var(--ease);
  z-index: 40;
  box-shadow: 0 4px 18px rgba(31,27,23,0.06);
}
.back-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { border-color: var(--gold); color: var(--gold-deep); }

/* ================================ Toast ================================== */
.toast {
  position: fixed;
  bottom: clamp(1rem, 3vw, 2rem); left: 50%;
  transform: translate(-50%, 14px);
  background: var(--ink);
  color: var(--bg);
  font-size: 0.86rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  box-shadow: 0 6px 22px rgba(31,27,23,0.18);
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  z-index: 90;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ============================== Reveal =================================== */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============================ Responsive ================================= */
@media (max-width: 960px) {
  .intro-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  :root { --content-pad-x: 1.25rem; }
  .mobile-bar { display: flex; }
  .main { margin-left: 0; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .3s var(--ease);
    width: min(86vw, 320px);
    box-shadow: 8px 0 30px rgba(31,27,23,0.12);
  }
  body.menu-open .sidebar { transform: translateX(0); }
  body.menu-open .sidebar-scrim { display: block; }
  .sidebar-scrim { display: none; }
  .sidebar { padding-top: 64px; } /* clear mobile bar */
  .sidebar__inner { padding-top: 1.2rem; }

  .scales__row { grid-template-columns: 1fr; gap: 0.75rem; }

  .phase-head { grid-template-columns: 1fr; gap: 0.4rem; }
  .phase-roman { font-size: clamp(4.5rem, 14vw, 7rem); }

  .item-head { grid-template-columns: auto 1fr; gap: 1rem; }
  .item-num { font-size: clamp(2.2rem, 9vw, 2.8rem); }

  .axe-body p:first-child::first-letter { font-size: 2.6em; }

  .hero__pill { font-size: 0.74rem; }
}

@media (max-width: 420px) {
  .axe-body p:first-child::first-letter { float: none; padding: 0; font-size: 1em; color: inherit; }
}

/* ================================ PRINT ================================== */
@media print {
  @page { size: A4; margin: 18mm 16mm 22mm; }

  body { background: #fff; color: #111; font-size: 10.5pt; line-height: 1.55; }
  .progress-bar, .mobile-bar, .sidebar, .sidebar-scrim, .back-to-top, .toast,
  #pdf-export, #pdf-export-mobile, #share-btn, #share-btn-2,
  .print-hidden { display: none !important; }

  .main { margin-left: 0; padding: 0; }
  .report { max-width: none; padding: 0; }

  .reveal { opacity: 1 !important; transform: none !important; }

  .hero { padding: 0 0 1.4rem; border-bottom: 1px solid #ddd; }
  .hero__name { font-size: 32pt; line-height: 1.05; margin: .4rem 0 .6rem; color: #111; }
  .hero__lead { font-size: 12pt; color: #444; }
  .hero__divider { display: none; }
  .hero__pill { font-size: 9pt; }

  .section, .phase, .part { page-break-inside: auto; border-bottom: 0; padding: 1rem 0; }
  .axe, .item { page-break-inside: avoid; break-inside: avoid; padding: 0.8rem 0; border-bottom: 1px solid #eee; }
  .axe { page-break-before: auto; }
  .phase { page-break-before: always; }

  .phase-head { gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #ddd; margin-bottom: 1.2rem; page-break-inside: avoid; }
  .phase-roman { font-size: 60pt; color: #c8b58c; }
  .phase-title { font-size: 22pt; }

  .section-title, .part-title { font-size: 18pt; color: #111; }
  .axe-title { font-size: 16pt; color: #111; }
  .axe-subtitle { font-size: 11pt; color: #555; }
  .axe-body p, .item-body p, .prose p { color: #222; max-width: none; font-size: 10.5pt; }
  .axe-body p:first-child::first-letter { float: none; font-size: 1em; padding: 0; color: inherit; }

  .item-num { font-size: 22pt; color: #b08d57; }
  .item-title { font-size: 14pt; }

  .scales {
    background: transparent; border: 0; padding: 0; margin-top: .8rem;
  }
  .scales__row, .scales__caption { display: none !important; }
  .scales__print {
    display: block;
    font-size: 10pt;
    color: #333;
    border-top: 1px dashed #ccc;
    padding-top: 0.5rem;
    font-family: var(--sans);
    letter-spacing: 0.04em;
  }
  .scales__print strong { color: #111; }

  .intro-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .intro-card { background: #fafafa; border-color: #ddd; }

  .report-foot { page-break-before: avoid; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #ddd; }
  .report-foot__line { font-size: 11pt; }
  .report-foot__small { font-size: 8pt; }

  /* Page header/footer via running elements (where supported) */
  @page {
    @top-left { content: "Profil symbolique — " attr(data-client); font-family: serif; font-size: 9pt; color: #888; }
    @bottom-right { content: counter(page) " / " counter(pages); font-family: sans-serif; font-size: 9pt; color: #888; }
  }
}
