/* The night ending (v17-ending.js; the page's ending since round 9, ?ending=classic shows the one before): lights out
   after the stack, the closing in type, and the ink as the footer. Every rule hangs on a class the ending sets (is-night,
   has-night, the night-* states, is-ink-footer). */

/* The story holds its finished stack for the night stretch (app.js sets --night-length in pixels). */
#samura.is-v16.is-night.logo-travels.is-enhanced .story{height:calc(360svh + var(--v16-travel) + var(--night-length,0px))}

/* Lights out: the story's copy leaves with the light; the room goes black; the line arrives, kanji first in red. */
#samura.has-night .story-layout,#samura.has-night .story-footer{transition:opacity .6s ease}
#samura.has-night.night-out .story-layout,#samura.has-night.night-out .story-footer{opacity:0;pointer-events:none}
#samura .night{position:absolute;inset:0;z-index:20;pointer-events:none;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 4%;text-align:center}
#samura .night-black{position:absolute;inset:0;background:#030304;opacity:0;transition:opacity .7s ease}
#samura.night-dark .night-black{opacity:1}
#samura .night-line{position:relative;font-family:var(--display);font-weight:600;font-size:clamp(92px,13.6vw,236px);line-height:.84;letter-spacing:-.014em;text-transform:uppercase;color:#f4f4f0;opacity:0;transition:opacity .45s ease}
#samura.night-text .night-line{opacity:1}
#samura .night-row{display:block;white-space:nowrap}
#samura .night-row+.night-row{margin-top:12px}
/* Round 9: the line is white throughout (the owner: "should be all white"); only its kanji flash red. */
#samura .night-cell{position:relative;display:inline-block;white-space:pre}
#samura .night-cell.is-scrambled .night-plain{visibility:hidden}
#samura .night-kanji{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-family:'Samura Japanese',serif;font-weight:600;font-size:.62em;letter-spacing:0;color:inherit}
#samura .night-cell:not(.is-scrambled) .night-kanji{visibility:hidden}
/* The film section rises out of the black. It does not say the line it has just been given a second time: its first act
   has a heading of its own after the dark (film-story.js, `night`); round 8 left that act without copy. */
#samura .night-rise{position:absolute;inset:0;z-index:4;background:#030304;pointer-events:none}

/* The ink: the brand's brush stroke painted across the footer, the wordmark on it, the links below. */
#samura .site-footer.is-ink-footer{display:block;padding:0;border-top:0;background:var(--ground);color:#9a9d9e;font-size:13px}
#samura .site-footer.is-ink-footer>[hidden]{display:none!important}
#samura .ink{position:relative;height:clamp(420px,72svh,680px);display:flex;align-items:center;justify-content:center;overflow:hidden}
#samura .ink-stroke{position:absolute;left:7%;right:7%;top:20%;height:48%;background:var(--red);-webkit-mask:url(./assets/samura-brush-stroke.svg) center/100% 100% no-repeat;mask:url(./assets/samura-brush-stroke.svg) center/100% 100% no-repeat;transform:rotate(-3deg);clip-path:inset(0 100% 0 0);transition:clip-path .85s cubic-bezier(.75,0,.2,1)}
#samura .ink.is-painted .ink-stroke{clip-path:inset(0 0 0 0)}
#samura .ink-word{position:relative;width:min(64vw,900px);height:auto;margin-top:-4%;transform:rotate(-3deg) translateY(14px);opacity:0;filter:drop-shadow(0 8px 22px rgba(0,0,0,.38));transition:opacity .5s ease .6s,transform .7s cubic-bezier(.2,.8,.2,1) .6s}
#samura .ink.is-painted .ink-word{opacity:1;transform:rotate(-3deg)}
#samura .ink-tag{position:absolute;left:0;right:0;bottom:10%;margin:0;text-align:center;font-family:var(--display);font-size:clamp(22px,2.7vw,38px);letter-spacing:.08em;text-transform:uppercase;color:#e2dcd9;opacity:0;transition:opacity .6s ease 1s}
#samura .ink.is-painted .ink-tag{opacity:1}
/* Round 9: one line under the ink. The legal links in the middle and a single way back to the top, as a button; the
   closing right above already holds the enquiry and the range, so the footer does not repeat them. */
#samura .foot-bar{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:24px;width:1720px;max-width:100%;margin:0 auto;padding:26px 4.5% 30px;border-top:1px solid #ffffff14;font-size:11px;letter-spacing:.04em;color:#7e8283}
#samura .foot-note{justify-self:start}
#samura .foot-legal{display:flex;gap:30px;justify-self:center}
#samura .foot-legal a{font-size:12px;color:#a6a9a9;transition:color .2s}
#samura .foot-top{justify-self:end;display:inline-flex;align-items:center;gap:16px;font-family:var(--display);font-size:17px;font-weight:500;line-height:1;letter-spacing:.08em;text-transform:uppercase;color:#e2dcd9;transition:color .2s}
#samura .foot-top i{display:grid;place-items:center;width:48px;height:48px;border:1px solid #ffffff38;border-radius:50%;color:#f4f4f0;transition:background .25s,border-color .25s,transform .35s cubic-bezier(.2,.8,.2,1)}
#samura .foot-top svg{display:block;transition:transform .35s cubic-bezier(.2,.8,.2,1)}
#samura .foot-legal a:hover,#samura .foot-top:hover{color:#fff}
#samura .foot-top:hover i{background:var(--red);border-color:var(--red);transform:translateY(-3px)}
#samura .foot-top:hover svg{transform:translateY(-1px)}
#samura .foot-legal a:focus-visible,#samura .foot-top:focus-visible{outline:2px solid var(--red);outline-offset:6px;border-radius:3px}

/* Round 9: the closing after the film section's two photographs is set in type on the dark, not on a third photograph
   (the owner: "another image right after... not optimal"). A thin red line, the cut, leads into it. */
#samura.is-night .product-section{min-height:0;padding:clamp(130px,19vh,210px) 0 clamp(120px,17vh,190px);background:radial-gradient(ellipse 64% 58% at 50% 0%,#1b1c1a 0%,#131413 72%)}
#samura.is-night .product-section>.closing-photo,#samura.is-night .product-section>.photo-glitch,#samura.is-night .product-section>.closing-shade{display:none}
#samura.is-night .product-copy{align-items:center;text-align:center;padding:0 6%}
#samura.is-night .product-copy::before{content:'';display:block;width:1px;height:clamp(64px,10vh,110px);margin-bottom:clamp(36px,5vh,56px);background:linear-gradient(180deg,#e63b3500,#e63b35)}
#samura.is-night .product-copy h2{font-size:clamp(84px,8.6vw,158px)}
#samura.is-night .product-copy p{max-width:430px;margin-top:34px}
#samura.is-night .product-copy .primary-cta{margin-top:40px}
@media(max-width:760px){
  #samura .night-line{font-size:18vw}
  #samura .ink{height:clamp(320px,56svh,520px)}
  #samura .ink-stroke{left:-4%;right:-4%;top:26%;height:40%}
  #samura .ink-word{width:84vw}
  #samura .ink-tag{font-size:6vw;bottom:12%}
  #samura .foot-bar{grid-template-columns:1fr;justify-items:center;gap:20px;padding:30px 6% 30px;text-align:center}
  #samura .foot-top{order:-1;justify-self:center}
  #samura .foot-legal{justify-self:center;flex-wrap:wrap;justify-content:center;gap:12px 22px}
  #samura .foot-note{justify-self:center;font-size:10px}
  #samura.is-night .product-section{min-height:0;padding:110px 0 104px}
  #samura.is-night .product-copy{padding:0 6%}
  #samura.is-night .product-copy h2{font-size:clamp(68px,19vw,104px)}
  #samura.is-night .product-copy p{font-size:13px;max-width:320px}
}
@media(prefers-reduced-motion:reduce){
  #samura .night-black,#samura .night-line,#samura.has-night .story-layout,#samura.has-night .story-footer,#samura .ink-stroke,#samura .ink-word,#samura .ink-tag,#samura .foot-top i,#samura .foot-top svg{transition:none}
}
