/* MahjongTableFlow ATELIER — natural scroll cadence
   Only the homepage imports this file. No scroll hijacking, sticky pins,
   fake scroll snapping, or viewport-length animation timelines. */
html{scroll-behavior:smooth;scroll-padding-top:88px}

/* A chapter should read in one natural motion, not an entire extra viewport
   of decorative spacing. The editorial headlines still carry the drama. */
.story-section{padding:clamp(56px,6.4vw,88px) 0}
.section{padding:clamp(64px,6.2vw,92px) 0}
#tension{margin-top:28px;padding:clamp(58px,6.4vw,94px) 0}
.at-featured{padding:clamp(65px,7vw,100px) 0}
.at-featured__card--lead{min-height:400px}
.at-featured__card{min-height:198px}
.at-featured__cards{grid-template-rows:repeat(2,minmax(0,1fr))}
#roles .story-head{padding:clamp(64px,7vw,92px) 32px 34px}
#roles .role-scene{min-height:clamp(670px,67vw,790px);max-height:790px}
.night-stage{padding:clamp(58px,6.2vw,88px) 0}
.night-stage .story-head{margin-bottom:30px}
.night-stage + .story-section{padding:clamp(64px,7vw,100px) 0}
.flow-stage{padding:clamp(66px,7.2vw,98px) 0}
.flow-stage .story-head{margin-bottom:30px}
#roles + .story-section{padding:clamp(66px,7vw,104px) 0}

/* Desktop animation used to lock two scenes in place. Restore the natural
   document flow whether GSAP loads or fails. The same readable resting
   states are used when motion is reduced. */
html.motion-active .night-stage__pin,
html.motion-active .flow-stage__pin{
  height:auto;
  min-height:0;
}
html.motion-active .night-stage__scene,
html.motion-active .flow-stage__scene{
  position:relative;
  inset:auto;
  top:auto;
  height:auto;
  min-height:0;
  overflow:visible;
  padding:clamp(22px,3vw,38px) clamp(16px,3vw,40px);
}
html.motion-active .night-stage__board{
  height:auto;
  min-height:0;
  max-width:850px;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  gap:10px;
}
html.motion-active .night-card,
html.motion-active .night-bubble{
  position:relative;
  inset:auto;
  width:auto;
  opacity:1;
  transform:none;
  will-change:auto;
}
html.motion-active .night-stage__line,
html.motion-active .night-stage__brand{
  position:relative;
  top:auto;
  bottom:auto;
  left:auto;
  opacity:1;
  transform:none;
  will-change:auto;
  text-align:center;
}
html.motion-active .night-stage__rail{display:none}
.night-stage__clock{color:var(--at-brass-lit);font-size:12px;letter-spacing:.12em}
.night-stage__line[data-night-chaos]{
  margin:12px 0 0;
  color:rgba(245,240,230,.7);
  font:400 clamp(21px,2.1vw,29px)/1.25 var(--at-serif);
}
.night-stage__line[data-night-flow]{
  margin:0;
  color:var(--at-brass-lit);
  font:italic 400 clamp(28px,3.6vw,48px)/1.13 var(--at-serif);
}
.night-stage__brand{color:rgba(245,240,230,.65);font-size:12px;letter-spacing:.14em}
.night-stage__board .night-card{
  border-radius:9px;
  padding:13px 17px;
  box-shadow:0 9px 22px -9px rgba(0,0,0,.42);
}
.night-stage__board .night-bubble{border-radius:12px;padding:12px 16px}
.night-stage__scene{gap:16px}

/* Minute-by-minute detail stays accessible without forcing the reader to
   scroll a six-line timeline before continuing into the next chapter. */
.at-timeline-details{
  width:min(860px,100%);
  margin:30px auto 0;
  border:1px solid rgba(201,165,109,.3);
  border-radius:17px;
  background:rgba(255,250,240,.035);
  color:var(--at-ivory);
  overflow:hidden;
}
.at-timeline-details summary{
  min-height:60px;
  padding:18px clamp(18px,3vw,30px);
  cursor:pointer;
  list-style:none;
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:center;
  font-weight:750;
  color:var(--at-ivory);
}
.at-timeline-details summary::-webkit-details-marker{display:none}
.at-timeline-details summary span{
  font:400 26px/1 var(--at-serif);
  color:var(--at-brass-lit);
  transition:transform 180ms ease;
}
.at-timeline-details[open] summary span{transform:rotate(45deg)}
.at-timeline-details[open] summary{
  border-bottom:1px solid rgba(201,165,109,.22);
  background:rgba(255,250,240,.06);
}
.at-timeline-details .timeline{
  margin:26px 28px 24px 56px;
  max-width:none;
}
.at-timeline-details .timeline__item{
  padding-bottom:26px;
}
.at-timeline-details summary:focus-visible{outline:2px solid var(--at-brass-lit);outline-offset:-4px;border-radius:12px}

/* The F L O W word builds as a fast, optional entrance, not a pinned
   animation. The explanation below it stays legible and compact. */
html.motion-active .flow-stage__scene{gap:22px}
html.motion-active .flow-tile,
html.motion-active .flow-tile__word,
html.motion-active .flow-chip,
html.motion-active .flow-stage__final{
  opacity:1;
  transform:none;
  will-change:auto;
}
.flow-stage .flow-tile{
  width:clamp(106px,11.6vw,158px);
  height:clamp(128px,14vw,182px);
}
.flow-stage .flow-tile__letter{font-size:clamp(44px,5vw,68px)}
.flow-stage .flow-tile__word{font-size:12px}
.flow-stage .flow-method{margin-top:34px;gap:14px}
.flow-stage .flow-card{padding:22px 20px}
.flow-stage .flow-card__letter{font-size:36px}
.flow-stage .flow-card h3{margin:10px 0 6px}
.flow-stage .flow-card p{font-size:14px}

/* Shorten visual processing when a section enters the viewport. */
.reveal{
  transition:opacity 220ms var(--at-ease-out),
             transform 300ms var(--at-ease-out);
}

/* Mobile already did not pin, but the chapters still accumulated into a
   long stack. Keep actionable content up front and trim blank intervals. */
@media(max-width:860px){
  .story-section{padding:52px 0}
  .section{padding:58px 0}
  .at-featured{padding:64px 0}
  #tension{margin-top:12px;padding:54px 0}
  .night-stage{padding:52px 0}
  .night-stage + .story-section{padding:56px 0}
  .flow-stage{padding:56px 0}
  #roles .story-head{padding:58px 20px 24px}
  #roles .role-scene{min-height:830px;max-height:none}
  #roles + .story-section{padding:58px 0}
  .night-stage__scene{padding:22px 12px}
  .night-stage__board{gap:8px}
  .night-stage__board .night-card,
  .night-stage__board .night-bubble{font-size:12px;padding:10px 12px}
  .at-timeline-details{margin-top:22px}
  .at-timeline-details .timeline{margin:22px 16px 20px 38px}
  .flow-stage .flow-method{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .flow-stage .flow-card{padding:18px 14px}
  .flow-stage .flow-card h3{font-size:18px}
  .flow-stage .flow-card p{font-size:13px;line-height:1.55}
}
@media(max-width:560px){
  .at-featured__card--lead{min-height:260px}
  .at-featured__card{min-height:245px}
  .flow-stage .flow-tile{width:clamp(70px,20vw,84px);height:110px}
  .flow-stage .flow-tile__letter{font-size:36px}
  .flow-stage .flow-tile__word{font-size:10.5px}
  .flow-stage .flow-stage__row{gap:8px}
  .flow-stage .flow-stage__visual{gap:8px}
  .flow-stage .flow-chip{font-size:11px}
  #roles .role-scene{min-height:800px}
}

/* Keyboard anchors and low-motion modes always get a predictable route. */
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .at-timeline-details summary span,.reveal{transition:none}
}
/* Timeline is a deliberate disclosure, not a second animated reveal.
   Expanded items must be readable immediately, including with a keyboard. */
.at-timeline-details[open] .timeline__item{
  opacity:1;
  transform:none;
  transition:none;
}
