/* ==========================================================================
   strategic-aperture.css · THE STRATEGIC APERTURE

   Carbon #171717, Acid #DFFF00, Bone #F2EFE9, Silver #9FA4A5: the homepage's
   own palette, type and easing. No rounded containers, no floating panels,
   no shadows, no new visual vocabulary. Rules and space only.
   ========================================================================== */

/* --------------------------------------------------------------- the cell --
   One wrapper per tile so a real <button> can sit beside the anchor rather
   than inside it. The wrapper becomes the grid item; the tile is unchanged. */
.sa-cell{position:relative;display:flex;flex-direction:column;min-width:0}
.sa-cell > .ck66-tile{flex:1 1 auto}

.sa-open{
  appearance:none;-webkit-appearance:none;
  display:flex;align-items:center;gap:8px;
  width:100%;min-height:44px;
  margin:0;padding:11px 14px 12px;
  background:none;border:0;border-top:1px solid rgba(242,239,233,.13);
  font:inherit;font-weight:500;font-size:10px;letter-spacing:.22em;
  text-transform:uppercase;color:#9FA4A5;
  cursor:pointer;text-align:left;
  transition:color .2s ease,border-color .2s ease;
}
.sa-open .sa-plus{
  margin-left:auto;font-size:13px;letter-spacing:0;color:#DFFF00;
  transition:transform .2s ease;
}
.sa-open:hover,.sa-open:focus-visible{color:#F2EFE9;border-top-color:rgba(223,255,0,.5)}
.sa-open:hover .sa-plus{transform:translateY(-1px)}
.sa-open:focus-visible{outline:2px solid #DFFF00;outline-offset:3px}
.sa-open[aria-expanded="true"] .sa-plus{transform:rotate(45deg)}

/* the media's held place while it is promoted: no layout shift */
.sa-spacer{width:100%;background:#0d0d0d}

/* the promoted media. The element is never re-created, only repositioned. */
.ck66-tile-media.sa-promoted{
  position:fixed;z-index:9002;margin:0;
  transition:top .42s cubic-bezier(.22,.61,.36,1),
             left .42s cubic-bezier(.22,.61,.36,1),
             width .42s cubic-bezier(.22,.61,.36,1),
             height .42s cubic-bezier(.22,.61,.36,1);
}

/* --------------------------------------------------------------- the field */
html.sa-locked,html.sa-locked body{overflow:hidden}

/* The hidden attribute must actually hide this. A bare `.sa-field{display:flex}`
   ties with the user-agent's `[hidden]{display:none}` on specificity and wins on
   order, which leaves a closed field laid out across the whole viewport at
   z-index 9000, invisible at opacity 0 but still hit-testable, swallowing every
   click on the page beneath it. */
.sa-field[hidden],.sa-close[hidden]{display:none}

.sa-field{
  position:fixed;inset:0;z-index:9000;
  background:#171717;
  color:#F2EFE9;
  opacity:0;
  transition:opacity .3s ease;
  display:flex;flex-direction:column;
}
.sa-field.is-open{opacity:1}

/* the acid rule that establishes the field, drawn from the tile's own accent */
.sa-rule{
  position:absolute;top:0;left:0;height:1px;width:0;
  background:#DFFF00;
  transition:width .34s cubic-bezier(.22,.61,.36,1);
}
.sa-field.is-open .sa-rule{width:100%}

.sa-inner{
  flex:1 1 auto;min-height:0;
  display:grid;
  grid-template-columns:5fr 3fr;
  column-gap:clamp(32px,4vw,72px);
  align-items:start;align-content:safe center;
  max-width:1460px;width:100%;
  margin:0 auto;
  padding:clamp(64px,9vh,116px) clamp(28px,5vw,84px) clamp(36px,6vh,64px);
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

/* ------------------------------------------------------------- the brief -- */
.sa-brief{min-width:0}

.sa-project{
  display:flex;align-items:baseline;gap:14px;
  margin:0 0 clamp(26px,3.4vh,44px);
  padding-bottom:14px;
  border-bottom:1px solid rgba(242,239,233,.14);
}
.sa-num{font-weight:500;font-size:10px;letter-spacing:.22em;color:#DFFF00}
.sa-name{font-weight:500;font-size:clamp(15px,1.3vw,19px);letter-spacing:.01em}

.sa-row{margin:0 0 clamp(22px,2.8vh,36px)}
.sa-row:last-of-type{margin-bottom:0}

.sa-label{
  margin:0 0 7px;
  font-weight:500;font-size:10px;letter-spacing:.2em;text-transform:uppercase;
  color:#9FA4A5;
}
.sa-label .sa-mid{color:rgba(159,164,165,.6);padding:0 .12em}

.sa-copy{
  margin:0;
  font-weight:400;font-size:clamp(15px,1.12vw,17.5px);line-height:1.56;
  color:#F2EFE9;
  max-width:49ch;
  text-wrap:pretty;
}

/* the two battles run side by side where the measure allows */
.sa-battles{
  display:grid;grid-template-columns:1fr 1fr;
  column-gap:clamp(26px,2.6vw,48px);
  margin:0 0 clamp(22px,2.8vh,36px);
}
.sa-battles .sa-row{margin-bottom:0}
@media (max-width:1180px){
  .sa-battles{grid-template-columns:1fr;row-gap:clamp(20px,2.6vh,30px)}
}

/* the intervention carries the emphasis, and the two battle lines converge
   on one acid point beside it */
.sa-row--int{
  padding-top:clamp(20px,2.6vh,32px);
  border-top:1px solid rgba(242,239,233,.14);
}
.sa-row--int .sa-label{color:#F2EFE9;position:relative;padding-left:16px}
.sa-point{
  position:absolute;left:0;top:.34em;
  width:6px;height:6px;border-radius:50%;background:#DFFF00;
  transform:scale(0);
  transition:transform .3s cubic-bezier(.22,.61,.36,1) .34s;
}
.sa-field.is-open .sa-point{transform:scale(1)}
.sa-row--int .sa-copy{
  font-size:clamp(17px,1.42vw,22px);line-height:1.44;letter-spacing:-.008em;
  font-weight:400;
}

.sa-row--proof .sa-label{color:#9FA4A5}
.sa-row--proof .sa-copy{font-size:clamp(14px,1.02vw,16px);color:#9FA4A5}

.sa-tail{margin:clamp(26px,3.2vh,42px) 0 0}
.sa-case{
  font-weight:500;font-size:11px;letter-spacing:.16em;text-transform:uppercase;
  color:#DFFF00;text-decoration:none;
  border-bottom:1px solid rgba(223,255,0,.4);padding-bottom:3px;
  display:inline-block;min-height:24px;
}
.sa-case:hover{border-bottom-color:#DFFF00}
.sa-case:focus-visible{outline:2px solid #DFFF00;outline-offset:4px}

/* the copy arrives in its causal order */
.sa-brief > *,.sa-battles > *{opacity:0;transform:translateY(6px)}
.sa-field.is-open .sa-brief > *,
.sa-field.is-open .sa-battles > *{
  opacity:1;transform:none;
  transition:opacity .34s ease,transform .34s cubic-bezier(.22,.61,.36,1);
}
.sa-field.is-open .sa-project{transition-delay:.18s}
.sa-field.is-open .sa-row--cond{transition-delay:.26s}
.sa-field.is-open .sa-battles > *:first-child{transition-delay:.34s}
.sa-field.is-open .sa-battles > *:last-child{transition-delay:.40s}
.sa-field.is-open .sa-row--int{transition-delay:.48s}
.sa-field.is-open .sa-row--proof{transition-delay:.56s}
.sa-field.is-open .sa-tail{transition-delay:.62s}

/* --------------------------------------------------------------- the media */
.sa-media{
  position:relative;width:100%;aspect-ratio:16/9;
  background:#0d0d0d;min-width:0;
}

/* --------------------------------------------------------------- the close */
.sa-close{
  position:fixed;top:0;right:0;z-index:9010;
  opacity:0;pointer-events:none;
  transition:opacity .3s ease,color .2s ease;
  appearance:none;-webkit-appearance:none;background:none;border:0;
  display:flex;align-items:center;gap:9px;
  min-height:44px;min-width:44px;
  padding:14px clamp(28px,5vw,84px) 14px 20px;
  font:inherit;font-weight:500;font-size:10px;letter-spacing:.22em;
  text-transform:uppercase;color:#9FA4A5;cursor:pointer;
}
.sa-close.is-open{opacity:1;pointer-events:auto}
.sa-close span{font-size:15px;letter-spacing:0;color:#DFFF00}
.sa-close:hover{color:#F2EFE9}
.sa-close:focus-visible{outline:2px solid #DFFF00;outline-offset:-2px}

/* ================================================================ MOBILE == */
@media (max-width:860px){
  .sa-inner{
    grid-template-columns:1fr;
    display:flex;flex-direction:column;
    padding:0;
    overflow:hidden;
  }
  /* the artwork becomes a masthead holding roughly 30% of the viewport */
  .sa-media{
    order:-1;flex:0 0 auto;
    height:30svh;aspect-ratio:auto;width:100%;
  }
  /* the acid rule moves to the seam, where the evidence meets the argument */
  .sa-rule{top:30svh}
  .sa-brief{
    flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;
    padding:clamp(22px,3.4vh,32px) 20px
            calc(28px + env(safe-area-inset-bottom,0px));
    padding-left:max(20px,env(safe-area-inset-left,0px));
    padding-right:max(20px,env(safe-area-inset-right,0px));
  }
  .sa-copy{font-size:16px;line-height:1.56}
  .sa-row--int .sa-copy{font-size:18px;line-height:1.44}
  .sa-row--proof .sa-copy{font-size:14.5px}
  .sa-copy{max-width:49ch}

  /* a persistent close, inside the safe area, over the masthead */
  .sa-close{
    top:env(safe-area-inset-top,0px);
    right:max(8px,env(safe-area-inset-right,0px));
    padding:14px 16px;
    background:rgba(23,23,23,.72);
  }
}
/* a tablet is neither phone nor desktop: the masthead grows and the measure
   is made by the margin rather than by a cap the reader can see */
@media (min-width:601px) and (max-width:860px){
  .sa-media{height:34svh}
  .sa-rule{top:34svh}
  .sa-brief{
    padding-left:max(clamp(32px,7vw,72px),env(safe-area-inset-left,0px));
    padding-right:max(clamp(32px,7vw,72px),env(safe-area-inset-right,0px));
    padding-top:clamp(30px,4vh,44px);
  }
  .sa-close{padding:16px clamp(24px,4vw,40px)}
}

@media (max-width:860px) and (max-height:520px){
  .sa-media{height:38svh}
  .sa-rule{top:38svh}
}

/* =========================================================== REDUCED MOTION */
@media (prefers-reduced-motion:reduce){
  .sa-field,.sa-rule,.sa-point,
  .ck66-tile-media.sa-promoted,
  .sa-brief > *,.sa-battles > *,
  .sa-open,.sa-open .sa-plus,.sa-close{transition:none!important}
  .sa-field,.sa-close.is-open{opacity:1}
  .sa-rule{width:100%}
  .sa-point{transform:scale(1)}
  .sa-brief > *,.sa-battles > *{opacity:1;transform:none}
}
