/* prt.run - Stilltone. Variables dans base.css (seul --gold-soft est ajusté ici). */

:root {
  --gold-soft: rgba(176, 141, 58, 0.16);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(1200px 620px at 50% -12%, #fff, rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #fdfdfb 0%, #f2f5f9 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: var(--gold-soft);
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 22px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── header ─────────────────────────────────────────────── */
header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}
/* ── header menu: one link per step, beside the title ──── */
.mini {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0 auto 0 36px;
}
.mini a {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.mini a b {
  font-family: var(--serif);
  color: var(--gold);
  font-size: 13px;
}
.mini a:hover {
  color: var(--primary);
  text-decoration: none;
}

/* ── volume sliders: gold + speaker icon, to spot them at a glance ── */
.vol-ico {
  display: inline-block;
  width: 17px;
  height: 17px;
  flex: none;
  vertical-align: -3px;
  margin-right: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b08d3a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H2v6h4l5 4z' fill='%23b08d3a'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7M19 5a10 10 0 0 1 0 14'/%3E%3C/svg%3E") center / contain no-repeat;
}
input[type="range"].vol {
  height: 6px;
  background: linear-gradient(90deg, var(--gold) var(--fill, 50%), var(--gold-soft) var(--fill, 50%));
}
input[type="range"].vol::-webkit-slider-thumb {
  border-color: var(--gold);
}
input[type="range"].vol::-moz-range-thumb {
  border-color: var(--gold);
}

/* ── step player: play/pause + volume, same in every audio step ── */
.player {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  padding: 6px 16px 6px 6px;
  background: var(--hover);
  border: 1px solid var(--line);
  border-radius: 999px;
  align-self: center;
}
.pbtn {
  width: 40px;
  height: 40px;
  flex: none;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 15px;
  cursor: pointer;
}
.pbtn:hover {
  background: var(--primary-hover);
}
.pbtn.on {
  background: var(--gold);
}
.pbtn:disabled {
  background: var(--line);
  color: var(--faint);
  cursor: not-allowed;
}
.plabel {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.player input[type="range"] {
  width: 200px;
}
.player .slider-val {
  min-width: 44px;
  font-size: 15px;
}
.sel-inline {
  width: auto;
  padding: 10px 12px;
}

/* ── hero ───────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 56px 0 8px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
h1 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: 1.13;
}
h1 em {
  font-style: italic;
  color: var(--primary);
}
.rule {
  width: 48px;
  height: 1.5px;
  margin: 1.7rem auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.lede {
  max-width: 640px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 16.5px;
}
.pills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 22px;
}
.pills li {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
}
.pills strong {
  color: var(--ink);
}

/* ── notices ────────────────────────────────────────────── */
.notice {
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin: 34px 0;
  font-size: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.notice strong {
  color: var(--ink);
}
.notice-warn {
  background: var(--gold-soft);
  border-color: var(--gold-line);
}
.notice-danger {
  background: #fdf1ef;
  border-color: #eec7c0;
  color: #7d2b20;
}
.notice-danger strong {
  color: var(--danger);
}

/* ── step cards ─────────────────────────────────────────── */
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 34px 34px 30px;
  margin: 0 0 22px;
  box-shadow: var(--shadow);
  scroll-margin-top: 80px;
}
.step-plain {
  box-shadow: none;
  background: linear-gradient(180deg, #fff, #fbfcfd);
}
.step-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 10px;
}
.step-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold);
  border-bottom: 1.5px solid var(--gold-line);
  padding-bottom: 2px;
  flex: none;
}
h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 25px;
  letter-spacing: -0.01em;
}
.desc {
  color: var(--muted);
  font-size: 15px;
  max-width: 720px;
  margin-bottom: 22px;
}
.desc strong {
  color: var(--ink);
}
.desc em {
  color: var(--primary);
}
.tag {
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  vertical-align: middle;
  margin-left: 10px;
}
.hint {
  font-size: 13.5px;
  color: var(--muted);
  max-width: 720px;
  margin-top: 14px;
}
.hint-tight {
  margin: 2px 0 14px;
  font-size: 12.5px;
}
.hint strong {
  color: var(--ink);
}

/* ── fields ─────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.field label,
.slider-row > label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
select,
input[type="number"] {
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  width: 100%;
}
select:focus-visible,
input:focus-visible,
button:focus-visible,
input[type="range"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── big readout ────────────────────────────────────────── */
.readout {
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding: 10px 0 4px;
}
.readout-value {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: clamp(44px, 8vw, 68px);
  line-height: 1;
}
.readout-value.locked {
  color: var(--gold);
}
.readout-unit {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 8px;
}
.readout-small .readout-value {
  font-size: clamp(28px, 5vw, 38px);
}
.readout-small .readout-unit {
  font-size: 13px;
}
.readout-status {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  min-height: 20px;
}
.readout-status.live {
  color: var(--primary);
  font-weight: 600;
}

/* ── ruler ──────────────────────────────────────────────── */
.ruler-wrap {
  margin: 12px 0 4px;
}
canvas#ruler {
  display: block;
  width: 100%;
  height: 120px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fbfcfd, #f3f6f9);
  border: 1px solid var(--line);
}

/* ── range inputs ───────────────────────────────────────── */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    var(--primary) var(--fill, 50%),
    var(--line) var(--fill, 50%)
  );
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--primary);
  box-shadow: 0 1px 5px rgba(27, 42, 58, 0.3);
  cursor: grab;
}
input[type="range"]::-webkit-slider-thumb:active {
  cursor: grabbing;
}
input[type="range"]::-moz-range-thumb {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--primary);
  box-shadow: 0 1px 5px rgba(27, 42, 58, 0.3);
  cursor: grab;
}
#freq-slider {
  height: 10px;
  border-radius: 5px;
}
#freq-slider::-webkit-slider-thumb {
  width: 30px;
  height: 30px;
  border-width: 3px;
}
#freq-slider::-moz-range-thumb {
  width: 27px;
  height: 27px;
  border-width: 3px;
}
.slider-row {
  display: grid;
  grid-template-columns: 170px 1fr 130px;
  gap: 16px;
  align-items: center;
  margin: 14px 0;
}
.slider-row-wide {
  grid-template-columns: 170px 1fr;
  margin: 8px 0 18px;
}
.slider-val {
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* ── buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 11px 20px;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.08s;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: var(--line);
}
.btn-ghost:hover {
  background: var(--hover);
}
.btn-gold {
  background: var(--gold);
  color: #fff;
}
.btn-gold:hover {
  background: #9a7a30;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.btn-step {
  background: var(--hover);
  color: var(--ink);
  border-color: var(--line);
  font-family: var(--mono);
  font-size: 13px;
  padding: 7px 12px;
  min-width: 52px;
}
.btn-step:hover {
  background: #dde5ee;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 12px 0 4px;
}

/* ── fine tune strip ────────────────────────────────────── */
.nudge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--hover);
  border-radius: var(--radius);
}
.nudge-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}
.nudge-value {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  min-width: 96px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.nudge .num-input {
  width: 96px;
  font-family: var(--mono);
  font-size: 14px;
  text-align: center;
  padding: 7px 8px;
}
.unit {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

/* ── tips ───────────────────────────────────────────────── */
.tips {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.tips summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  list-style: none;
  letter-spacing: 0.01em;
}
.tips summary::-webkit-details-marker {
  display: none;
}
.tips summary::before {
  content: "▸ ";
  color: var(--gold);
}
.tips[open] summary::before {
  content: "▾ ";
}
.tips ul {
  margin: 12px 0 0 20px;
  font-size: 13.5px;
  color: var(--muted);
}
.tips li {
  margin-bottom: 8px;
}
.tips strong {
  color: var(--ink);
}

/* ── controls ───────────────────────────────────────────── */
.controls {
  margin-top: 22px;
  padding: 18px 20px;
  background: var(--hover);
  border-radius: var(--radius);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .btn {
    transition: none;
  }
}

/* ── protocol ───────────────────────────────────────────── */
.protocol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
}
.pcell {
  background: var(--hover);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.pk {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  color: var(--primary);
}
.pv {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 3px;
}

/* ── evidence ───────────────────────────────────────────── */
.evidence {
  list-style: none;
  font-size: 14.5px;
  color: var(--muted);
}
.evidence li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.evidence li:first-child {
  border-top: none;
  padding-top: 4px;
}
.evidence strong {
  color: var(--ink);
}
.cite {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold);
}
.disclaimer {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  margin: 26px 0 0;
}

/* ── footer ─────────────────────────────────────────────── */
.site-foot {
  margin-top: 46px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
}
.site-foot .wrap {
  padding-top: 26px;
  padding-bottom: 56px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.site-foot p + p {
  margin-top: 8px;
}

/* ── live audio graph ───────────────────────────────────── */
.graph {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: center;
  margin: 6px 0 4px;
}
.gchains {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.grow {
  display: flex;
  align-items: stretch;
  gap: 7px;
}
.gnode {
  flex: 1 1 0;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 11px;
  transition:
    border-color 0.18s,
    background 0.18s,
    box-shadow 0.18s;
}
.gnode .gk {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.gnode .gv {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.gnode.on {
  border-color: var(--primary);
  background: #f3f8fc;
  box-shadow: inset 2px 0 0 var(--primary);
}
.gnode.on .gk {
  color: var(--primary);
}
.gnode.idle {
  opacity: 0.5;
}
.gnode-cut.on {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: inset 2px 0 0 var(--gold);
}
.gnode-cut.on .gk,
.gnode-cut.on .gv {
  color: #8a6c22;
}
.gnode-master,
.gnode-out {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.gnode-master .gk,
.gnode-out .gk {
  color: rgba(255, 255, 255, 0.72);
}
.gnode-master .gv,
.gnode-out .gv {
  color: #fff;
}
.garrow {
  flex: 0 0 auto;
  align-self: center;
  color: #c3ccd6;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.grow.live .garrow {
  color: var(--primary);
}
.gmerge {
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: stretch;
  padding-left: 16px;
  border-left: 2px solid var(--line);
  min-width: 158px;
}
.gmerge.live {
  border-left-color: var(--primary);
}
.gmerge-cap {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.gmerge .garrow {
  align-self: center;
}
.gmerge-src {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  border-top: 1px dashed var(--line);
  padding-top: 7px;
}

/* ── live spectrum ──────────────────────────────────────── */
.spec-wrap {
  margin-top: 24px;
}
canvas#spectrum {
  display: block;
  width: 100%;
  height: 190px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fbfcfd, #f2f6f9);
  border: 1px solid var(--line);
}
.spec-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  padding: 9px 2px 0;
}
.spec-legend .sw {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}
.sw-out {
  background: var(--primary);
}
.sw-gap {
  background: var(--gold);
}
.spec-status {
  margin-left: auto;
  font-weight: 600;
  color: var(--muted);
}

/* ── responsive ─────────────────────────────────────────── */
@media (max-width: 680px) {
  .bar {
    flex-wrap: wrap;
    height: auto;
    padding-top: 12px;
  }
  .mini {
    order: 3;
    width: 100%;
    height: 40px;
    margin: 0;
    gap: 18px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .mini a {
    letter-spacing: 0;
  }
  .step {
    padding: 26px 20px;
    border-radius: var(--radius);
  }
  .slider-row,
  .slider-row-wide {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .slider-val {
    text-align: left;
  }
  .protocol {
    grid-template-columns: 1fr;
  }
  .step-head {
    flex-direction: column;
    gap: 6px;
  }
  .player {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    grid-template-areas: "btn lab val" "btn rng rng";
    row-gap: 6px;
    margin-left: 0;
    padding: 8px 16px 10px 8px;
    border-radius: var(--radius-lg);
    align-self: stretch;
  }
  .pbtn {
    grid-area: btn;
    align-self: center;
  }
  .plabel {
    grid-area: lab;
  }
  .player .slider-val {
    grid-area: val;
    text-align: right;
  }
  .player input[type="range"] {
    grid-area: rng;
    width: 100%;
  }
  .nudge {
    gap: 6px;
  }
  .nudge-value {
    min-width: 78px;
  }
  .row .btn {
    flex: 1 1 100%;
  }
  .graph {
    grid-template-columns: 1fr;
  }
  .gmerge {
    padding-left: 0;
    border-left: none;
    border-top: 2px solid var(--line);
    padding-top: 12px;
    min-width: 0;
  }
  .grow {
    flex-wrap: wrap;
  }
  .gnode {
    flex: 1 1 42%;
  }
  .garrow {
    display: none;
  }
  .spec-status {
    margin-left: 0;
    flex-basis: 100%;
  }
}
