/* Final project-page corrections from the release visual audit. */

/* Keep controls clear of the moving-study captions. */
.workShell[data-work="diffractive-flora"] .flora-motion-study-film .workVideoToggle{
  top: 10px;
  bottom: auto;
  width: 44px;
  height: 44px;
}

/* Keep the complete headings and reading columns inside narrow viewports. */
.workShell[data-work="diffractive-flora"] .flora-process-index-copy .textTitle{
  font-size: clamp(38px, 4.9vw, 88px);
}

@media (max-width: 900px){
  .workShell[data-work="american-textures"] .american-atlas-ongoing-stage .workThumb.american-atlas-panel{
    position: relative;
    inset: auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
    transform: none;
  }

  .workShell[data-work="diffractive-flora"] .flora-concept-constellation .workConstellationChapter.chapter-herbarium{
    grid-template-columns: minmax(0, 1fr);
  }

  .workShell[data-work="diffractive-flora"] .flora-concept-constellation .chapter-herbarium :is(.workConstellationChapterIntro, .workConstellationChapterBody){
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .workShell[data-work="diffractive-flora"] .flora-concept-constellation .workConstellationChapter.chapter-diffractive .workConstellationChapterTitle{
    font-size: clamp(28px, 10vw, 64px);
  }

  .workShell[data-work="diffractive-flora"] .flora-concept-constellation .chapter-herbarium .workConstellationChapterTitle{
    font-size: clamp(27px, 9vw, 62px);
  }

  .workShell[data-work="diffractive-flora"] .flora-statement-index{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .workShell[data-work="diffractive-flora"] .flora-statement-index > *{
    width: auto;
    max-width: 100%;
    margin: 0;
  }

  .workShell[data-work="diffractive-flora"] .flora-process-index-copy .textTitle{
    font-size: clamp(28px, 10vw, 72px);
  }

  .workShell[data-work="diffractive-flora"] .workConstellationChapter.chapter-technical{
    grid-template-columns: minmax(0, 1fr);
  }

  .workShell[data-work="diffractive-flora"] .chapter-technical :is(
    .workConstellationChapterIntro,
    .workConstellationChapterBody,
    .workConstellationChapterBody p
  ){
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .workShell[data-work="diffractive-flora"] .workConstellationChapter.chapter-technical .workConstellationChapterTitle{
    font-size: clamp(32px, 11.5vw, 82px);
    transform: none;
    line-height: 0.92;
  }
}

/* American Textures: the colored phrases provide rhythm without editorial
   numbering, and the Surfaces images follow their section copy. */
.workShell[data-work="american-textures"] :is(
  .american-middle-copy,
  .american-ongoing-note,
  .american-film-note,
  .american-fragments-note
) .textBody{
  padding-top: 0;
  background: none;
}

.workShell[data-work="american-textures"] :is(
  .american-middle-copy,
  .american-ongoing-note,
  .american-film-note,
  .american-fragments-note
) .textBody::before{
  content: none;
}

.workShell[data-work="american-textures"] .textAccent{
  color: #fff7dc;
  font-style: normal;
  font-weight: 700;
  font-size: 1.14em;
  text-decoration: none;
}

@media (min-width: 901px){
  .workShell[data-work="american-textures"] .american-middle-triptych .american-middle-copy{
    grid-column: 1 / -1;
    grid-row: 1;
    padding-top: 0;
    padding-bottom: clamp(22px, 2.5vw, 36px);
  }

  .workShell[data-work="american-textures"] .american-middle-triptych .american-prologue-landscape{
    grid-column: 1 / span 7;
    grid-row: 2;
  }

  .workShell[data-work="american-textures"] .american-middle-triptych .american-prologue-portrait{
    grid-column: 8 / span 5;
    grid-row: 2;
  }

  .workShell[data-work="american-textures"] .american-fragments-note{
    grid-template-rows: auto auto;
    row-gap: clamp(24px, 2.8vw, 40px);
  }

  .workShell[data-work="american-textures"] .american-fragments-note .textLabel{
    grid-column: 1 / span 2;
    grid-row: 1 / span 2;
  }

  .workShell[data-work="american-textures"] .american-fragments-note .textBody:first-of-type{
    grid-column: 3 / span 4;
    grid-row: 1;
    max-width: 34ch;
    font-size: clamp(18px, 1.45vw, 23px);
    line-height: 1.62;
  }

  .workShell[data-work="american-textures"] .american-fragments-note .textBody:nth-of-type(2){
    grid-column: 7 / span 4;
    grid-row: 1;
    max-width: 38ch;
  }

  .workShell[data-work="american-textures"] .american-fragments-note .textBody:nth-of-type(3){
    grid-column: 3 / span 8;
    grid-row: 2;
    max-width: 72ch;
    padding-top: clamp(20px, 2vw, 28px);
    border-top: 1px solid rgba(186, 215, 151, 0.28);
    color: rgba(245, 237, 208, 0.78);
  }
}

@media (max-width: 900px){
  .workShell[data-work="american-textures"] .american-middle-triptych .american-middle-copy{
    grid-row: 1;
    padding-bottom: 10px;
  }

  .workShell[data-work="american-textures"] .american-middle-triptych .american-prologue-landscape{
    grid-row: 2;
  }

  .workShell[data-work="american-textures"] .american-middle-triptych .american-prologue-portrait{
    grid-row: 3;
  }

  .workShell[data-work="american-textures"] .american-fragments-note .textBody:nth-of-type(3){
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid rgba(186, 215, 151, 0.24);
  }
}

/* Cobalt: keep the editorial two-column introduction and source composition
   until the layout truly reaches tablet size. */
@media (min-width: 901px) and (max-width: 1200px){
  .workShell[data-work="representacion-cobalt"] .workHeader{
    grid-template-columns: minmax(180px, 0.24fr) minmax(0, 0.76fr);
    gap: clamp(26px, 4vw, 48px);
  }

  .workShell[data-work="representacion-cobalt"] .workStatement{
    margin-top: 12px;
    max-width: 22ch;
  }

  .workShell[data-work="representacion-cobalt"] .workLead{
    width: 100%;
    font-size: clamp(42px, 5vw, 64px);
  }

  .workShell[data-work="representacion-cobalt"] .workLead .lead-line.is-offset{
    padding-left: clamp(18px, 4vw, 48px);
  }

  .workShell[data-work="representacion-cobalt"] .workLead .lead-line.is-tail{
    padding-left: 0;
  }

  .workShell[data-work="representacion-cobalt"] .cobalt-source-triptych{
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(20px, 2.6vw, 32px);
    align-items: start;
  }

  .workShell[data-work="representacion-cobalt"] .cobalt-source-photo{
    grid-column: 1 / span 7;
    grid-row: 1 / span 2;
    padding-top: 0;
  }

  .workShell[data-work="representacion-cobalt"] .cobalt-source-copy{
    grid-column: 8 / span 5;
    grid-row: 1;
    max-width: 34ch;
  }

  .workShell[data-work="representacion-cobalt"] .cobalt-source-split{
    grid-column: 9 / span 4;
    grid-row: 2;
    margin-top: 0;
  }
}

/* Diffractive Flora: media edges disappear into the black field and controls
   remain available without sitting on top of the work at rest. */
.workShell[data-work="diffractive-flora"] .workVideo,
.workShell[data-work="diffractive-flora"] .workItem.workVideo video{
  border: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
}

.workShell[data-work="diffractive-flora"] .workVideoToggle{
  right: 10px;
  bottom: 10px;
  width: clamp(30px, 2.8vw, 36px);
  height: clamp(30px, 2.8vw, 36px);
  border-color: rgba(246, 241, 223, 0.18);
  background: rgba(5, 7, 6, 0.34);
  color: rgba(246, 241, 223, 0.88);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: scale(0.86);
  backdrop-filter: blur(7px) saturate(0.7);
  -webkit-backdrop-filter: blur(7px) saturate(0.7);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease);
}

.workShell[data-work="diffractive-flora"] .workVideo:hover .workVideoToggle,
.workShell[data-work="diffractive-flora"] .workVideo:focus-within .workVideoToggle,
.workShell[data-work="diffractive-flora"] .workVideoToggle:focus-visible{
  opacity: 0.78;
  transform: scale(1);
}

.workShell[data-work="diffractive-flora"] .workVideoToggle:hover,
.workShell[data-work="diffractive-flora"] .workVideoToggle:focus-visible{
  opacity: 1;
  background: rgba(5, 7, 6, 0.58);
  border-color: rgba(246, 241, 223, 0.42);
  outline-width: 1px;
  outline-offset: 2px;
}

.workShell[data-work="diffractive-flora"] .workVideoToggle[data-state="pause"] .workVideoIcon--pause{
  width: 9px;
  height: 11px;
  border-left-width: 3px;
  border-right-width: 3px;
}

@media (hover: none), (max-width: 900px){
  .workShell[data-work="diffractive-flora"] .workVideoToggle{
    opacity: 0.58;
    transform: scale(1);
  }
}

/* The selected chapter stays legible, but the animated signal treatment is
   reserved for actual hover/focus again. */
.workShell[data-work="diffractive-flora"] .workConstellationNode.is-active:not(:hover):not(:focus-visible){
  color: #fff;
  filter: none;
  transform: translate(-50%, -50%);
}

.workShell[data-work="diffractive-flora"] .workConstellationNode.is-active:not(:hover):not(:focus-visible)::before{
  width: clamp(42px, 7vw, 128px);
  opacity: 0.42;
  background: color-mix(in oklab, var(--node-accent) 48%, transparent);
}

.workShell[data-work="diffractive-flora"] .workConstellationNode.is-active:not(:hover):not(:focus-visible)::after{
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-12deg) scale(0.58);
}

.workShell[data-work="diffractive-flora"] .workConstellationNode.is-active:not(:hover):not(:focus-visible) .workConstellationPin{
  transform: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.workShell[data-work="diffractive-flora"] .workConstellationNode.is-active:not(:hover):not(:focus-visible) .workConstellationIndex{
  padding: 0;
  color: currentColor;
  background: transparent;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
  transform: none;
}

.workShell[data-work="diffractive-flora"] .workConstellationNode.is-active:not(:hover):not(:focus-visible) .workConstellationTitle{
  color: color-mix(in oklab, var(--node-accent) 72%, #fff);
  border-color: color-mix(in oklab, var(--node-accent) 44%, transparent);
  transform: none;
}

/* Shared reading details and navigation, with each project's palette retained. */
#workModal .workShell{ --audit-label: #dfdecf; }
#workModal .workShell[data-work="representacion-cobalt"]{ --audit-label: #536340; }
#workModal .workShell :is(.textLabel, .blockMeta){
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: .16em;
  color: var(--audit-label);
  opacity: 1;
}
#workModal .workShell :is(.workItem, .workThumb) > figcaption{
  font-size: 12px;
  line-height: 1.55;
  opacity: 1;
}
#workModal .workShell .workConstellationIndex{
  font-size: 11px;
  opacity: .9;
}
#workModal .workShell .workTopActions{ top: 16px; left: 16px; }
#workModal .workShell .workTopNav{ top: 16px; right: 16px; gap: 8px; }
#workModal .workShell :is(.workTopActions .close, .workTopNav button){
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 76px;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(16,19,28,.82);
  color: #fff7e8;
  font: 600 11px/1.2 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: 1;
  text-shadow: none;
}
#workModal .workShell .workTopActions .close::before{ content: "←"; margin-right: 6px; letter-spacing: 0; }
#workModal .workShell :is(.workTopActions .close, .workTopNav button):is(:hover,:focus-visible){
  background: #242936;
  color: #fff;
  outline: 2px solid #fff7e8;
  outline-offset: 3px;
}
@media(max-width:520px){
  #workModal .workShell .workTopActions{ top: 10px; left: 10px; }
  #workModal .workShell .workTopNav{ top: 10px; right: 10px; gap: 6px; }
  #workModal .workShell :is(.workTopActions .close, .workTopNav button){ min-width: 70px; padding: 10px; font-size: 10px; }
}

/* Quiet carousel-like navigation: open arrows and a light reading surface. */
#workModal .workShell :is(.workTopActions .close, .workTopNav button){
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: inherit;
  font-weight: 500;
  letter-spacing: .2em;
  text-shadow: 0 1px 8px rgba(0,0,0,.2);
}
#workModal .workShell .workTopNav{
  border-bottom: 0;
  color: #eeeadd;
  background: transparent;
}
#workModal .workShell .workTopActions{ color:#eeeadd; }
#workModal.is-hero-past .workShell[data-work="representacion-cobalt"] :is(.workTopNav,.workTopActions){ color:#171b3c; }
#workModal .workShell :is(.workTopActions .close, .workTopNav button):hover{
  background: transparent;
  color: inherit;
  outline: none;
  opacity: .65;
}
#workModal .workShell :is(.workTopActions .close, .workTopNav button):focus-visible{
  background: transparent;
  color: inherit;
  outline: 1px solid currentColor;
  outline-offset: 2px;
}
#workModal .workShell[data-work="american-textures"] .american-reflection .textAccent{
  color: var(--american-sage);
  font-size: 1.2em;
  font-weight: 700;
  font-style: normal;
  text-decoration: none;
}
#workModal .workShell[data-work="american-textures"] .american-reflection .pairText{
  border-top-color: color-mix(in srgb, var(--american-sage) 45%, transparent);
  padding-top: 24px;
}
#workModal .workShell[data-work="american-textures"] .american-reflection > div:last-child .pairText{
  border-left: 2px solid var(--american-sage);
  padding-left: 22px;
  box-sizing: border-box;
}
#workModal .workShell :is(.workTopActions .close, .workTopNav button):focus-visible{
  outline: none;
  box-shadow: inset 0 -2px currentColor;
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Accent colors follow the existing sage and blue palette throughout the essay. */
#workModal .workShell[data-work="american-textures"] .textAccent{
  color: var(--american-sage);
  font-size: 1.2em;
  font-weight: 700;
  font-style: normal;
  text-decoration: none;
}
#workModal .workShell[data-work="american-textures"] :is(.textBody, .pairText):nth-of-type(even) .textAccent{
  color: color-mix(in srgb, var(--american-blue) 65%, #e2edf5);
}
#workModal .workShell :is(.workTopActions .close, .workTopNav button){
  text-decoration: none;
  box-shadow: none;
}
#workModal .workShell :is(.workTopActions .close, .workTopNav button):is(:hover,:focus-visible){
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
  box-shadow: none;
}
