/* Variant "The body is the index".
   One gold thread runs the length of the page. Four points on it (head,
   shoulders and back, whole body, feet) open the four treatments. */

.theme-corpo {
  --font-display: 'Libre Caslon Display', 'Times New Roman', serif;
  --font-body: 'Albert Sans', system-ui, sans-serif;
  --font-label: 'Libre Caslon Text', Georgia, serif;
  --gutter: 2.25rem; /* room kept free for the thread */
  --thread-x: 0.5rem; /* where the thread runs inside that room */
}
@media (min-width: 1024px) {
  .theme-corpo {
    --gutter: 5rem;
    --thread-x: 1.5rem;
  }
}

/* ---------- The thread ---------- */
.thread {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  overflow: visible;
  pointer-events: none;
}
.thread path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.thread-ghost {
  opacity: 0.22;
}

.rail {
  position: relative;
  padding-left: var(--gutter);
}

/* A point on the thread. Sits in the gutter of the nearest .rail row. */
.via {
  position: absolute;
  width: 1px;
  height: 1px;
}
.node {
  position: absolute;
  left: calc(var(--thread-x) - var(--gutter));
  top: 0.75em;
  width: 13px;
  height: 13px;
  margin: -6.5px 0 0 -6.5px;
  border-radius: 50%;
}
.node {
  z-index: 6;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgb(177 138 61 / 0.2);
  transition:
    background-color 0.6s,
    box-shadow 0.9s var(--ease-calm),
    transform 0.9s var(--ease-calm);
}
.node-small {
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  box-shadow: 0 0 0 4px rgb(177 138 61 / 0.18);
}

/* Only when corpo.js is drawing the thread do points start unlit */
.thread-live .node:not(.is-lit) {
  background: var(--marble);
  box-shadow: 0 0 0 1.5px var(--gold);
  transform: scale(0.8);
}
.thread-live .hero .node:not(.is-lit) {
  background: var(--ink);
}

/* ---------- Hero ---------- */
.hero-img {
  object-position: 42% 50%;
}
.hero-veil {
  background:
    linear-gradient(to right, rgb(20 10 11 / 0.88) 0%, rgb(20 10 11 / 0.62) 38%, rgb(20 10 11 / 0.12) 72%, rgb(20 10 11 / 0.3) 100%),
    linear-gradient(to top, rgb(20 10 11 / 0.8) 0%, rgb(20 10 11 / 0) 45%),
    linear-gradient(to bottom, rgb(20 10 11 / 0.55) 0%, rgb(20 10 11 / 0) 22%);
}
@media (max-width: 767px) {
  .hero-img {
    object-position: 46% 50%;
  }
  .hero-veil {
    background:
      linear-gradient(to top, rgb(20 10 11 / 0.94) 0%, rgb(20 10 11 / 0.78) 42%, rgb(20 10 11 / 0.2) 78%, rgb(20 10 11 / 0.5) 100%);
  }
}

.hero-index ol {
  position: relative;
  margin-left: auto;
  width: max-content;
  border-left: 1px solid rgb(217 190 133 / 0.55);
}
.hero-index a {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  min-height: 2.9rem;
  padding: 0.45rem 0 0.45rem 1.6rem;
  transition: opacity 0.4s;
}
.hero-index a::before {
  content: '';
  position: absolute;
  left: -4.5px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--gold-soft);
  transition: box-shadow 0.5s var(--ease-calm);
}
.hero-index a:focus-visible::before {
  box-shadow: 0 0 0 6px rgb(217 190 133 / 0.3);
}
@media (hover: hover) and (pointer: fine) {
  .hero-index a:hover::before {
    box-shadow: 0 0 0 6px rgb(217 190 133 / 0.3);
  }
  .hero-index ol:hover a:not(:hover) {
    opacity: 0.45;
  }
}
.hero-index em {
  font-family: var(--font-label);
  font-size: 1.2rem;
  color: #fff;
}
.hero-index span {
  font-size: 0.95rem;
  color: rgb(231 231 231 / 0.82);
}

/* ---------- Menu: anchors to the sections of this page ---------- */
.site-menu a {
  position: relative;
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.site-menu a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.55rem;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s var(--ease-calm);
}
.site-menu a:focus-visible::after {
  transform: scaleX(1);
}
@media (hover: hover) and (pointer: fine) {
  .site-menu a:hover::after {
    transform: scaleX(1);
  }
}

/* on phones the same links open from a small "Menu" button */
.menu summary {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding: 0 1.1rem;
  border: 1px solid rgb(231 231 231 / 0.55);
  border-radius: 999px;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  list-style: none;
}
.menu summary::-webkit-details-marker {
  display: none;
}
.menu[open] summary {
  background: var(--marble);
  color: var(--ink);
}
.menu ul {
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  z-index: 20;
  min-width: 13rem;
  padding: 0.5rem 0;
  border-radius: 1.25rem;
  background: var(--marble);
  color: var(--ink);
  box-shadow: 0 30px 60px -30px rgb(20 10 11 / 0.7);
}
.menu li a {
  display: flex;
  min-height: 3rem;
  align-items: center;
  padding: 0 1.4rem;
  font-size: 1.05rem;
}

/* ---------- Photographs ---------- */
.soft-photo {
  background: var(--mist);
  box-shadow: 0 40px 80px -48px rgb(65 65 65 / 0.55);
}

/* ---------- The difference ---------- */
.tick-item .node {
  top: 1.1rem;
}
.standard {
  max-width: 22ch;
}

/* ---------- The index ---------- */
.index {
  border-top: 1px solid rgb(20 10 11 / 0.14);
}
.index-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 4.5rem;
  column-gap: 1.25rem;
  align-items: center;
  padding: 1.6rem 0;
  border-bottom: 1px solid rgb(20 10 11 / 0.14);
  transition: opacity 0.5s var(--ease-calm);
}
.index-row .node {
  top: 50%;
}
.index-part {
  grid-column: 1;
  font-family: var(--font-label);
  font-size: 1.1rem;
  color: var(--gold-deep);
}
.index-word {
  grid-column: 1;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.2vw, 4.25rem);
  line-height: 1.02;
  transition: transform 0.6s var(--ease-calm);
}
.index-line {
  grid-column: 1;
  margin-top: 0.5rem;
  max-width: 38ch;
  font-size: 1.0625rem;
  font-weight: 300;
  color: rgb(20 10 11 / 0.8);
}
.index-line strong {
  display: block;
  margin-top: 0.35rem;
  font-weight: 500;
  color: var(--ink);
}
.index-thumb {
  grid-column: 2;
  grid-row: 1 / span 3;
  width: 4.5rem;
  height: 5.5rem;
  border-radius: 0.9rem;
  object-fit: cover;
}
@media (min-width: 1024px) {
  .index-row {
    grid-template-columns: 11rem minmax(0, 1fr) minmax(0, 24rem) 8.5rem;
    column-gap: 2rem;
    padding: 1.75rem 0;
  }
  .index-part,
  .index-word,
  .index-line {
    grid-column: auto;
    margin-top: 0;
  }
  .index-thumb {
    grid-column: auto;
    grid-row: auto;
    width: 8.5rem;
    height: 6.25rem;
    border-radius: 1rem;
  }
}
@media (hover: hover) and (pointer: fine) {
  /* Choosing one dims the other three */
  .index:hover .index-row:not(:hover),
  .index:focus-within .index-row:not(:focus-visible) {
    opacity: 0.32;
  }
  .index-row:hover .index-word,
  .index-row:focus-visible .index-word {
    transform: translateX(10px);
  }
  .index-row:hover .node,
  .index-row:focus-visible .node {
    box-shadow: 0 0 0 9px rgb(177 138 61 / 0.22);
  }
}

/* ---------- Stations: a callout from the thread to the photograph ---------- */
.callout {
  position: absolute;
  z-index: 6;
  top: var(--py, 50%);
  left: calc(var(--thread-x) - var(--gutter));
  width: calc(var(--gutter) - var(--thread-x) + var(--px, 50%));
  height: 1px;
  background: linear-gradient(to right, var(--gold) 0%, var(--gold) calc(var(--gutter) - var(--thread-x)), rgb(245 243 240 / 0.9) 100%);
  transform-origin: left center;
}
.callout .node {
  left: 0;
  top: 0;
}
.callout-ring {
  position: absolute;
  right: -11px;
  top: -11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  background: rgb(177 138 61 / 0.55);
  box-shadow: 0 0 0 0 rgb(255 255 255 / 0.5);
}
.callout-label {
  position: absolute;
  right: -11px;
  bottom: 20px;
  transform: translateX(50%);
  white-space: nowrap;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: var(--marble);
  font-family: var(--font-label);
  font-size: 1rem;
  color: var(--ink);
  box-shadow: 0 10px 24px -14px rgb(20 10 11 / 0.6);
}

.thread-live .callout {
  transform: scaleX(0);
  transition: transform 1.1s var(--ease-calm);
}
.thread-live .callout .callout-ring,
.thread-live .callout .callout-label {
  opacity: 0;
  transition: opacity 0.7s 0.7s;
}
.thread-live .callout.is-lit {
  transform: scaleX(1);
}
.thread-live .callout.is-lit .callout-ring,
.thread-live .callout.is-lit .callout-label {
  opacity: 1;
}
.thread-live .callout.is-lit .callout-ring {
  animation: press 1.8s 0.9s var(--ease-calm) 1;
}
/* The label must not be squashed while its line grows */
.thread-live .callout:not(.is-lit) .callout-label {
  visibility: hidden;
}
@keyframes press {
  0% {
    box-shadow: 0 0 0 0 rgb(255 255 255 / 0.55);
  }
  100% {
    box-shadow: 0 0 0 22px rgb(255 255 255 / 0);
  }
}

/* ---------- Mosaic ---------- */
.mosaic figcaption {
  margin-top: 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2vw, 1.8rem);
}

/* ---------- Steps ---------- */
.step .node {
  top: 0.7rem;
}
.step-num {
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--font-label);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--gold-deep);
}

/* ---------- Closing ---------- */
.closing-media {
  opacity: 0.34;
}
.closing-veil {
  background:
    radial-gradient(60% 50% at 50% 42%, rgb(177 138 61 / 0.2), rgb(177 138 61 / 0) 70%),
    linear-gradient(to bottom, var(--ink) 0%, rgb(20 10 11 / 0.35) 30%, rgb(20 10 11 / 0.55) 100%);
}
.knot {
  color: var(--gold);
}
.knot .via {
  top: 11.8%;
}
.knot-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.thread-live .knot-line {
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 2.8s cubic-bezier(0.45, 0, 0.2, 1);
}
.thread-live .knot.is-tied .knot-line {
  stroke-dashoffset: 0;
}

@media (prefers-reduced-motion: reduce) {
  .callout-ring {
    animation: none !important;
  }
}
