/*
 * ORDRE III — Max-quality editorial edition
 * A single, cache-busted visual layer over the original utility stylesheet.
 */

:root {
  --ordre-ink: #18120d;
  --ordre-ink-soft: #665c52;
  --ordre-ivory: #f7f2e9;
  --ordre-paper: #efe7da;
  --ordre-gold: #a77734;
  --ordre-gold-light: #c8a46d;
  --ordre-rule: rgba(120, 83, 38, 0.24);
  --ordre-dark: #11161b;
  --ordre-dark-soft: #1a2025;
  --ordre-ease: cubic-bezier(.2, .72, .2, 1);
}

html {
  scroll-behavior: smooth;
  background: var(--ordre-ivory);
}

body {
  overflow-x: hidden;
  background: var(--ordre-ivory);
}

::selection {
  color: var(--ordre-ivory);
  background: var(--ordre-gold);
}

a, button, input {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 1px solid var(--ordre-gold);
  outline-offset: 5px;
}

img {
  image-rendering: auto;
}

/* A hairline reading progress marker. */
.ordre-scroll-progress {
  position: fixed;
  z-index: 120;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(167, 119, 52, .1);
  pointer-events: none;
}

.ordre-scroll-progress i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--ordre-gold);
  transform: scaleX(var(--scroll-progress, 0));
  transform-origin: left center;
}

.ordre-scroll-rail {
  position: fixed;
  z-index: 70;
  top: 50%;
  right: 20px;
  display: grid;
  gap: 13px;
  transform: translateY(-50%);
}

.ordre-scroll-rail a {
  position: relative;
  display: block;
  width: 22px;
  height: 8px;
}

.ordre-scroll-rail a::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 9px;
  height: 1px;
  background: rgba(102, 79, 54, .38);
  transition: width .35s var(--ordre-ease), background-color .35s;
}

.ordre-scroll-rail a:hover::before,
.ordre-scroll-rail a.is-current::before {
  width: 22px;
  background: var(--ordre-gold);
}

.ordre-scroll-rail span {
  position: absolute;
  right: 32px;
  top: -5px;
  opacity: 0;
  color: var(--ordre-ink-soft);
  font: 500 8px/1.2 Inter, sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .25s;
}

.ordre-scroll-rail a:hover span,
.ordre-scroll-rail a:focus-visible span {
  opacity: 1;
}

.theme-signal + .ordre-scroll-progress i,
.theme-signal .ordre-scroll-progress i {
  background: #d5aa55;
}

/* JS only adds these states after content is already present. */
.ordre-enhanced .ordre-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s var(--ordre-ease), transform 1s var(--ordre-ease);
}

.ordre-enhanced .ordre-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Exclusive selections: typography only, never a yellow panel. */
[role="tablist"] button,
button[aria-pressed] {
  background: transparent !important;
  box-shadow: none !important;
}

[role="tablist"] button[aria-selected="false"],
button[aria-pressed="false"] {
  color: #777067 !important;
  border-bottom-color: transparent !important;
}

[role="tablist"] button[aria-selected="false"] span,
button[aria-pressed="false"] span {
  color: #777067 !important;
}

[role="tablist"] button[aria-selected="true"],
button[aria-pressed="true"] {
  color: var(--ordre-gold) !important;
  border-bottom-color: var(--ordre-gold) !important;
  background: transparent !important;
}

[role="tablist"] button[aria-selected="true"] span,
button[aria-pressed="true"] span {
  color: var(--ordre-gold) !important;
}

[role="tablist"][aria-label="The three orders"] button {
  border-color: var(--ordre-rule) !important;
  background: transparent !important;
}

[role="tablist"][aria-label="The three orders"] button[aria-selected="true"] {
  background: transparent !important;
}

button[aria-pressed] span.h-px,
button[aria-pressed] span:last-child.h-px {
  background: rgba(167, 119, 52, .18) !important;
  transition: background-color .3s, width .35s var(--ordre-ease);
}

button[aria-pressed="true"] span.h-px,
button[aria-pressed="true"] span:last-child.h-px {
  background: var(--ordre-gold) !important;
}

/* Accordion marks turn into a restrained ×. */
button[aria-controls] > span:last-child,
button[aria-controls] svg,
button[aria-controls] [aria-hidden="true"] {
  transition: transform .48s var(--ordre-ease), background-color .35s;
}

button[aria-controls][aria-expanded="true"] > span:last-child,
button[aria-controls][aria-expanded="true"] svg,
button[aria-controls][aria-expanded="true"] [aria-hidden="true"] {
  transform: rotate(45deg);
}

/* All continuous ranges paint in both directions. */
input[type="range"] {
  --range-progress: 50%;
  appearance: none;
  -webkit-appearance: none;
  height: 3px;
  border-radius: 0;
  background: linear-gradient(to right,
    var(--ordre-gold) 0 var(--range-progress),
    rgba(167, 119, 52, .16) var(--range-progress) 100%);
  cursor: ew-resize;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(167, 119, 52, .55);
  border-radius: 50%;
  background: #faf6ee;
  box-shadow: 0 5px 20px rgba(44, 31, 18, .16);
}

input[type="range"]::-moz-range-thumb {
  width: 25px;
  height: 25px;
  border: 1px solid rgba(167, 119, 52, .55);
  border-radius: 50%;
  background: #faf6ee;
  box-shadow: 0 5px 20px rgba(44, 31, 18, .16);
}

.ordre-time-segments {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px !important;
}

.ordre-time-segments span {
  display: block;
  width: 100%;
  height: 2px !important;
  background: rgba(167, 119, 52, .14) !important;
  transition: background-color .42s, transform .42s var(--ordre-ease);
  transform-origin: left center;
}

.ordre-time-segments span.is-active {
  background: var(--ordre-gold) !important;
}

.ordre-time-labels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-top: 10px;
  color: rgba(92, 79, 67, .58);
  font: 500 8px/1.3 Inter, sans-serif;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.ordre-time-labels span:nth-child(2) { text-align: center; }
.ordre-time-labels span:last-child { text-align: right; }

.ordre-time-labels span.is-active {
  color: var(--ordre-gold);
}

.theme-signal input[type="range"],
.signal-suite input[type="range"] {
  background: linear-gradient(to right,
    #d5aa55 0 var(--range-progress),
    rgba(213, 170, 85, .17) var(--range-progress) 100%);
}

.theme-signal .ordre-time-segments span,
.signal-suite .ordre-time-segments span {
  background: rgba(213, 170, 85, .14) !important;
}

.theme-signal .ordre-time-segments span.is-active,
.signal-suite .ordre-time-segments span.is-active {
  background: #d5aa55 !important;
}

.theme-signal .ordre-time-labels { color: rgba(207, 198, 185, .52); }
.theme-signal .ordre-time-labels span.is-active { color: #d5aa55; }

/* Moving studies: actual H.264 motion with a graceful animated still fallback. */
.ordre-film {
  position: relative;
  padding: 0 clamp(0px, 2.5vw, 34px);
  overflow: hidden;
  border-block: 1px solid rgba(167, 119, 52, .26);
  background: #0d1115;
  color: #f4efe7;
}

.ordre-film-frame {
  position: relative;
  isolation: isolate;
  width: min(100%, 1440px);
  min-height: clamp(520px, 70vw, 810px);
  margin: 0 auto;
  overflow: hidden;
  background: #0d1115;
}

.ordre-film-poster,
.ordre-film video {
  position: absolute;
  inset: -2%;
  width: 104%;
  height: 104%;
  object-fit: cover;
  filter: saturate(.78) sepia(.05) contrast(1.08) brightness(.82);
}

.ordre-film-poster {
  z-index: 0;
  opacity: 1;
  animation: ordrePosterMove 18s ease-in-out infinite alternate;
  transition: opacity 1s var(--ordre-ease);
}

.ordre-film video {
  z-index: 1;
  opacity: 0;
  transition: opacity 1s var(--ordre-ease);
  background: transparent;
}

.ordre-film.is-film-playing video { opacity: 1; }
.ordre-film.is-film-playing .ordre-film-poster { opacity: 0; }

@keyframes ordrePosterMove {
  0% { transform: scale(1.015) translate3d(-.5%, 0, 0); }
  100% { transform: scale(1.065) translate3d(.8%, -.6%, 0); }
}

.ordre-film-shade {
  position: absolute;
  z-index: 2;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 10, 13, .87) 0, rgba(7, 10, 13, .58) 39%, rgba(7, 10, 13, .08) 73%, rgba(7, 10, 13, .24) 100%),
    linear-gradient(0deg, rgba(7, 10, 13, .58), transparent 60%);
  pointer-events: none;
}

.ordre-film-shade::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(208, 162, 79, .18);
}

.ordre-film-copy {
  position: absolute;
  z-index: 3;
  left: clamp(30px, 7vw, 100px);
  bottom: clamp(50px, 8vw, 104px);
  max-width: 650px;
}

.ordre-film-copy small {
  display: block;
  color: #d0a24f;
  font: 500 10px/1.3 Inter, sans-serif;
  letter-spacing: .34em;
  text-transform: uppercase;
}

.ordre-film-copy h2 {
  max-width: 630px;
  margin-top: 20px;
  color: #f4efe7;
  font: 400 clamp(44px, 6.5vw, 88px)/.93 "Cormorant Garamond", Georgia, serif;
  text-wrap: balance;
}

.ordre-film-copy p {
  max-width: 520px;
  margin-top: 24px;
  color: #c3baae;
  font: italic 400 clamp(18px, 2vw, 24px)/1.45 "Cormorant Garamond", Georgia, serif;
}

.ordre-film-index {
  position: absolute;
  z-index: 3;
  right: clamp(28px, 5vw, 72px);
  bottom: clamp(36px, 6vw, 78px);
  display: flex;
  gap: 10px;
  color: #d0a24f;
  font: 500 9px/1 Inter, sans-serif;
}

.ordre-film-index span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(208, 162, 79, .42);
}

.ordre-film-toggle {
  position: absolute;
  z-index: 5;
  top: clamp(26px, 4vw, 52px);
  right: clamp(28px, 5vw, 72px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  border: 1px solid rgba(222, 183, 111, .54);
  background: rgba(8, 11, 14, .58);
  color: #f1ece4;
  font: 500 9px/1 Inter, sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
  backdrop-filter: blur(9px);
  transition: background .25s, border-color .25s;
}

.ordre-film-toggle:hover {
  border-color: #d5aa55;
  background: rgba(8, 11, 14, .82);
}

.ordre-film-toggle-icon {
  position: relative;
  display: block;
  width: 13px;
  height: 13px;
}

.ordre-film-toggle-icon::before,
.ordre-film-toggle-icon::after {
  content: "";
  position: absolute;
  top: 1px;
  width: 2px;
  height: 11px;
  background: #d5aa55;
}

.ordre-film-toggle-icon::before { left: 3px; }
.ordre-film-toggle-icon::after { right: 3px; }

.ordre-film:not(.is-film-playing) .ordre-film-toggle-icon::before {
  top: 1px;
  left: 3px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid #d5aa55;
  background: transparent;
}

.ordre-film:not(.is-film-playing) .ordre-film-toggle-icon::after { display: none; }

.ordre-film video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}

/* Image-led editorial chapters. */
.ordre-editorial {
  position: relative;
  padding: clamp(76px, 10vw, 148px) 24px;
  overflow: hidden;
  border-block: 1px solid rgba(167, 119, 52, .22);
  background: #f1eadf;
  color: var(--ordre-ink);
}

.ordre-editorial::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, .7), transparent 42%),
    radial-gradient(rgba(46, 33, 21, .035) 1px, transparent 1px);
  background-size: auto, 4px 4px;
  pointer-events: none;
}

.ordre-editorial-frame {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(310px, 5fr);
  gap: clamp(42px, 8vw, 118px);
  align-items: center;
  width: min(100%, 1280px);
  margin: 0 auto;
}

.ordre-editorial--reverse .ordre-editorial-image { order: 2; }
.ordre-editorial--reverse .ordre-editorial-copy { order: 1; }

.ordre-editorial-image {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 1px solid rgba(91, 62, 29, .32);
  background: #1b1712;
  box-shadow: 0 32px 78px rgba(47, 34, 21, .17);
}

.ordre-editorial-image::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(247, 241, 231, .18);
  pointer-events: none;
}

.ordre-editorial-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.78) sepia(.07) contrast(1.06);
  transition: transform 1.5s var(--ordre-ease), filter 1.2s;
}

.ordre-editorial-image:hover img {
  transform: scale(1.028);
  filter: saturate(.9) sepia(.03) contrast(1.04);
}

.ordre-editorial-image figcaption {
  position: absolute;
  z-index: 2;
  right: 18px;
  bottom: 17px;
  padding: 8px 11px;
  background: rgba(15, 13, 10, .74);
  color: #e8dece;
  font: 500 8px/1 Inter, sans-serif;
  letter-spacing: .27em;
  text-transform: uppercase;
  backdrop-filter: blur(7px);
}

.ordre-editorial-copy { position: relative; }

.ordre-editorial-rule {
  display: block;
  width: 54px;
  height: 1px;
  margin-bottom: 25px;
  background: var(--ordre-gold);
}

.ordre-editorial-copy small {
  color: #966626;
  font: 500 10px/1.35 Inter, sans-serif;
  letter-spacing: .34em;
  text-transform: uppercase;
}

.ordre-editorial-copy h2 {
  max-width: 650px;
  margin-top: 23px;
  color: #1d160f;
  font: 400 clamp(42px, 5vw, 72px)/.96 "Cormorant Garamond", Georgia, serif;
  text-wrap: balance;
}

.ordre-editorial-copy h2 em {
  color: #665b50;
  font-weight: 400;
}

.ordre-editorial-copy p {
  max-width: 560px;
  margin-top: 28px;
  color: #645a50;
  font: italic 400 clamp(18px, 1.9vw, 24px)/1.52 "Cormorant Garamond", Georgia, serif;
}

.ordre-editorial-folio {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 44px;
  color: #966626;
}

.ordre-editorial-folio i {
  width: 78px;
  height: 1px;
  background: currentColor;
}

.ordre-editorial-folio b {
  font: 400 21px/1 "Cormorant Garamond", Georgia, serif;
}

.ordre-editorial--compact { padding-block: clamp(62px, 8vw, 104px); }
.ordre-editorial--compact .ordre-editorial-frame {
  grid-template-columns: minmax(0, 5fr) minmax(290px, 4fr);
  max-width: 1120px;
}
.ordre-editorial--compact .ordre-editorial-image { aspect-ratio: 16 / 10; }
.ordre-editorial--compact .ordre-editorial-copy h2 { font-size: clamp(36px, 4.2vw, 58px); }

.ordre-editorial--dark {
  border-color: rgba(213, 170, 85, .26);
  background: #12171c;
  color: #f1ece4;
}

.ordre-editorial--dark::before {
  background:
    radial-gradient(circle at 10% 15%, rgba(213, 170, 85, .08), transparent 42%),
    radial-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: auto, 4px 4px;
}

.ordre-editorial--dark .ordre-editorial-image {
  border-color: rgba(213, 170, 85, .42);
  box-shadow: 0 36px 84px rgba(0, 0, 0, .36);
}

.ordre-editorial--dark .ordre-editorial-copy small,
.ordre-editorial--dark .ordre-editorial-folio { color: #d5aa55; }
.ordre-editorial--dark .ordre-editorial-rule { background: #d5aa55; }
.ordre-editorial--dark .ordre-editorial-copy h2 { color: #f2ede5; }
.ordre-editorial--dark .ordre-editorial-copy h2 em,
.ordre-editorial--dark .ordre-editorial-copy p { color: #bcb4aa; }

/* Private IP remains visible as a specimen; a narrow segment is veiled. */
.has-private-mask {
  position: relative !important;
  isolation: isolate;
  min-height: 0 !important;
}

.has-private-mask > *:not(.ordre-private-mask) {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  user-select: none !important;
}

.ordre-private-mask {
  position: absolute !important;
  z-index: 42 !important;
  display: flex !important;
  align-items: center;
  gap: 16px;
  width: min(54%, 540px);
  min-height: 82px;
  padding: 15px 21px !important;
  overflow: hidden;
  border: 1px solid rgba(137, 93, 36, .58);
  background: rgba(240, 232, 218, .91) !important;
  color: #251c14 !important;
  text-align: left;
  visibility: visible !important;
  user-select: none;
  pointer-events: none !important;
  box-shadow: 0 16px 42px rgba(48, 34, 19, .17);
  backdrop-filter: blur(13px) saturate(.8);
}

.ordre-aperture .ordre-private-mask {
  right: 4% !important;
  bottom: 9% !important;
}

.ordre-private-mask::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .5), transparent 48%),
    repeating-linear-gradient(135deg, rgba(94, 65, 31, .045) 0 1px, transparent 1px 8px);
  pointer-events: none;
}

.ordre-private-mask::after {
  content: "HOUSE COPY";
  position: absolute;
  right: 13px;
  bottom: 8px;
  color: rgba(69, 45, 23, .2);
  font: 500 7px/1 Inter, sans-serif;
  letter-spacing: .25em;
}

.ordre-private-mask > * { position: relative; z-index: 2; }

.private-seal {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(137, 93, 36, .65);
  border-radius: 50%;
  color: #966626;
  font: 500 8px/1 Inter, sans-serif;
  letter-spacing: .08em;
}

.private-mask-copy { display: grid; gap: 7px; }

.private-mask-copy small {
  color: #966626;
  font: 500 8px/1.2 Inter, sans-serif;
  letter-spacing: .28em;
  text-transform: uppercase;
}

.private-mask-copy strong {
  color: #2a2018;
  font: italic 400 clamp(16px, 1.7vw, 21px)/1.15 "Cormorant Garamond", Georgia, serif;
}

.signal-suite .has-private-mask,
.signal-suite article:last-child.has-private-mask { min-height: 0 !important; }

.signal-suite .ordre-private-mask {
  top: 52% !important;
  right: 5% !important;
  left: auto !important;
  bottom: auto !important;
  width: min(68%, 520px);
  min-height: 84px;
  border-color: rgba(213, 170, 85, .5);
  background: rgba(18, 23, 28, .9) !important;
  color: #f2ece4 !important;
  box-shadow: 0 20px 52px rgba(0, 0, 0, .34);
  transform: translateY(-50%);
}

.signal-suite article:nth-child(2) .ordre-private-mask { right: 7% !important; }
.signal-suite article:last-child .ordre-private-mask {
  top: 48% !important;
  right: 7% !important;
  width: min(48%, 560px);
}

.signal-suite .ordre-private-mask::before {
  background:
    linear-gradient(115deg, rgba(213, 170, 85, .09), transparent 48%),
    repeating-linear-gradient(135deg, rgba(213, 170, 85, .045) 0 1px, transparent 1px 8px);
}

.signal-suite .ordre-private-mask::after { color: rgba(213, 170, 85, .2); }
.signal-suite .private-seal { color: #d5aa55; border-color: rgba(213, 170, 85, .58); }
.signal-suite .private-mask-copy small { color: #d5aa55; }
.signal-suite .private-mask-copy strong { color: #f2ece4; }

/* Keep the revealed instrument elegant and responsive beneath its veil. */
.signal-suite .ordre-specimen {
  transition: border-color .35s, box-shadow .35s;
}

.signal-suite .ordre-specimen:focus-within {
  border-color: rgba(213, 170, 85, .56);
  box-shadow: inset 0 0 0 1px rgba(213, 170, 85, .1);
}

@media (max-width: 1080px) {
  .ordre-scroll-rail { display: none; }
}

@media (max-width: 900px) {
  .ordre-editorial-frame,
  .ordre-editorial--compact .ordre-editorial-frame {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .ordre-editorial--reverse .ordre-editorial-image,
  .ordre-editorial--reverse .ordre-editorial-copy { order: initial; }

  .ordre-editorial-image { aspect-ratio: 4 / 3; }

  .ordre-film { padding: 0; }
  .ordre-film-frame { min-height: 650px; }
  .ordre-film-copy { right: 30px; bottom: 104px; }
  .ordre-film-index { left: 30px; right: auto; bottom: 40px; }
  .ordre-film-shade {
    background: linear-gradient(0deg, rgba(7, 10, 13, .96) 0, rgba(7, 10, 13, .58) 55%, rgba(7, 10, 13, .15) 100%);
  }

  .ordre-private-mask,
  .ordre-aperture .ordre-private-mask,
  .signal-suite .ordre-private-mask,
  .signal-suite article:nth-child(2) .ordre-private-mask,
  .signal-suite article:last-child .ordre-private-mask {
    top: auto !important;
    right: 16px !important;
    bottom: 18px !important;
    left: 16px !important;
    width: auto;
    min-height: 76px;
    transform: none;
  }
}

@media (max-width: 640px) {
  .ordre-film-frame { min-height: 610px; }
  .ordre-film-copy h2 { font-size: clamp(42px, 15vw, 64px); }
  .ordre-film-copy p { font-size: 18px; }
  .ordre-film-toggle {
    top: 22px;
    right: 22px;
    width: 43px;
    height: 43px;
    justify-content: center;
    padding: 0;
  }
  .ordre-film-toggle-label { display: none; }
  .ordre-editorial { padding-inline: 20px; }
  .ordre-editorial-copy h2 { font-size: clamp(39px, 12vw, 56px); }
  .ordre-time-labels { letter-spacing: .13em; }
  .ordre-private-mask { padding: 13px 15px !important; }
  .private-seal { flex-basis: 36px; width: 36px; height: 36px; }
  .private-mask-copy strong { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ordre-enhanced .ordre-reveal,
  .ordre-editorial-image img,
  .ordre-film-poster {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }
}
