/* ============================================================================
   Sea Cross V2: homepage. One story in two acts, carried by one working line.
   ACT 1, the opening (home-scene.js draws it; home.js scores the type over it):
   a vessel out of the haze, her bow, a working cable, the hook on it, a second
   sunlit hull where a load of stores is lifted to the rail. The four lines of
   work are met on the way up. ACT 2: the cable becomes the page's spine, its
   rules grow into the register of ports at dusk and carry the evidence at
   night, and the line comes to rest on the footer's edge.
   Without WebGL, or with reduced motion, Act 1 is two stills and the four lines
   in order, and Act 2 reads in order; every word is on the page either way.
   ========================================================================== */

.sx-link {
  display: inline-block; font-weight: 600; text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: .32em;
  transition: text-decoration-thickness .15s var(--sx-ease);
}
.sx-link:hover { text-decoration-thickness: 2px; }

/* ================================================================== ACT 1 */
.hs { --hs-fog: #c3c8c9; --hs-rel: #dde2e4; position: relative; height: 780vh; height: 780svh; background: var(--hs-fog); }
.hs__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate; background: var(--hs-fog); }
.hs__still--a, .hs__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hs__still--a img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hs__canvas { display: block; opacity: 0; transition: opacity .7s var(--sx-ease); }
.hs.is-live .hs__canvas { opacity: 1; }
/* one lens over photograph and render alike: a faint corner falloff and a fine grain */
.hs__stage::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(130% 100% at 50% 50%, rgba(0, 0, 0, 0) 62%, rgba(12, 16, 22, .2) 100%); }
.hs__stage::before {
  content: ""; position: absolute; inset: -50%; z-index: 3; pointer-events: none; opacity: .1; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: hs-grain .5s steps(4) infinite;
}
@keyframes hs-grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-1%, -2%); } }
.hs__release { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: var(--hs-rel); opacity: var(--rel, 0); }
/* the working line: the crane's wire carried across the hand-off, and at the release the rule the page is built on */
.hs__line { position: absolute; left: 0; top: 0; z-index: 4; width: 3px; height: 0; opacity: 0; pointer-events: none; will-change: transform, height; }

.hs__title-wrap { position: absolute; inset: auto 0 0 0; z-index: 5; padding-bottom: clamp(2rem, 9vh, 5.5rem); opacity: var(--h1, 1); translate: 0 calc((1 - var(--h1, 1)) * -1.5rem); }
.hs__title { font-size: clamp(2.35rem, 1.1rem + 4vw, 5.25rem); font-stretch: 118%; max-width: 15ch; color: rgba(21, 27, 33, .88); }

/* the four lines of work: chapter cues met on the way up, one place, one at a time, each with at most one
   of Sea Cross's own photographs opposite, small, as evidence */
.hs-chapters { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.hs-ch {
  position: absolute; inset: 0; margin: 0;
  display: grid; grid-template-columns: minmax(0, 31rem) minmax(0, 1fr) auto; grid-template-rows: 1fr auto auto auto; column-gap: var(--sx-gap); row-gap: .7rem;
  padding: 0 var(--sx-gutter) clamp(2rem, 9vh, 5.5rem);
  opacity: var(--o, 0); visibility: hidden;
}
.hs-ch.is-on { visibility: visible; }
.hs-ch.is-on a { pointer-events: auto; }
.hs-ch__name, .hs-ch__line, .hs-ch__more { grid-column: 1; color: #fff; text-shadow: 0 1px 22px rgba(10, 14, 18, .5); translate: 0 calc((1 - var(--o, 0)) * .9rem); }
.hs-ch__name { grid-row: 2; font-size: clamp(2rem, 1.2rem + 2.3vw, 3.4rem); }
.hs-ch__line { grid-row: 3; max-width: 32ch; font-size: clamp(1.05rem, .98rem + .3vw, 1.25rem); line-height: 1.45; color: rgba(255, 255, 255, .92); }
.hs-ch__more { grid-row: 4; justify-self: start; margin-top: .3rem; font-size: .95rem; }
.hs-print { grid-column: 3; grid-row: 2 / 5; align-self: end; margin: 0; width: clamp(150px, 15vw, 230px); }
.hs-print img { display: block; width: 100%; height: auto; filter: var(--sx-grade); box-shadow: 0 1.2rem 2.6rem -1.2rem rgba(10, 14, 18, .6); clip-path: inset(calc((1 - var(--o, 0)) * 18%) 0 0 0); }
.hs-print figcaption { margin-top: .45rem; font-size: .74rem; color: rgba(255, 255, 255, .86); text-shadow: 0 1px 12px rgba(10, 14, 18, .6); }
.hs-print .sx-meta { margin-right: .3rem; color: #fff; }

.hs__note {      /* said once, as the opening ends */
  position: absolute; z-index: 5; right: var(--sx-gutter); bottom: 1.1rem; margin: 0; max-width: 40ch;
  font-size: .76rem; line-height: 1.35; text-align: right; color: rgba(21, 27, 33, .72); opacity: var(--note, 0);
}
.hs__skip {
  position: absolute; z-index: 6; left: var(--sx-gutter); top: calc(var(--header-h) + 1rem);
  padding: .7rem 1rem; background: var(--sx-night); color: #fff; font-weight: 600; text-decoration: none;
  transform: translateY(-200%); opacity: 0; transition: transform .2s var(--sx-ease), opacity .2s;
}
.hs__skip:focus { transform: none; opacity: 1; }
.hs__still--b { display: none; margin: 0; }

/* still: no WebGL, no script, or reduced motion. The vessel with the title, the load against the hull, then the
   four lines of work in order. */
.hs.is-static, html.no-js .hs { height: auto; }
.hs.is-static .hs__stage, html.no-js .hs__stage { position: relative; height: auto; overflow: visible; display: flex; flex-direction: column; background: var(--sx-paper); }
.hs.is-static .hs__canvas, .hs.is-static .hs__skip, .hs.is-static .hs__release, .hs.is-static .hs__note, .hs.is-static .hs__line,
html.no-js .hs__canvas, html.no-js .hs__skip, html.no-js .hs__note, html.no-js .hs__line { display: none; }
.hs.is-static .hs__stage::before, .hs.is-static .hs__stage::after, html.no-js .hs__stage::before, html.no-js .hs__stage::after { display: none; }
.hs.is-static .hs__still--a, html.no-js .hs__still--a { position: relative; height: 100vh; height: 100svh; }
.hs.is-static .hs__title-wrap, html.no-js .hs__title-wrap { top: 0; bottom: auto; height: 100vh; height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; opacity: 1; translate: none; }
.hs.is-static .hs__still--b, html.no-js .hs__still--b { display: block; position: relative; height: 88vh; height: 88svh; background: #31404d; }
.hs.is-static .hs__still--b picture, html.no-js .hs__still--b picture { display: block; height: 100%; }
.hs.is-static .hs__still--b img, html.no-js .hs__still--b img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hs__still--b figcaption { position: absolute; right: var(--sx-gutter); bottom: 1rem; font-size: .76rem; color: rgba(255, 255, 255, .86); }
.hs.is-static .hs-chapters, html.no-js .hs-chapters {
  position: relative; inset: auto; pointer-events: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2.5rem, 5vw, 4rem) var(--sx-gap);
  padding: clamp(3.5rem, 8vw, 6rem) var(--sx-gutter); max-width: var(--sx-maxw); margin-inline: auto; width: 100%; color: var(--sx-ink);
}
.hs.is-static .hs-ch, html.no-js .hs-ch { position: relative; inset: auto; opacity: 1; visibility: visible; padding: 1.1rem 0 0; border-top: 1.5px solid var(--sx-ink); grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto; align-content: start; }
.hs.is-static .hs-ch a, html.no-js .hs-ch a { pointer-events: auto; }
.hs.is-static .hs-ch__name, .hs.is-static .hs-ch__line, .hs.is-static .hs-ch__more,
html.no-js .hs-ch__name, html.no-js .hs-ch__line, html.no-js .hs-ch__more { grid-row: auto; color: var(--sx-ink); text-shadow: none; translate: none; }
.hs.is-static .hs-ch__line, html.no-js .hs-ch__line { color: var(--sx-ink-2); }
.hs.is-static .hs-print, html.no-js .hs-print { grid-column: 2; grid-row: 1 / 4; width: clamp(110px, 12vw, 170px); }
.hs.is-static .hs-print img, html.no-js .hs-print img { clip-path: none; }
.hs.is-static .hs-print figcaption, .hs.is-static .hs-print .sx-meta, html.no-js .hs-print figcaption, html.no-js .hs-print .sx-meta { color: var(--sx-steel); text-shadow: none; }

/* =================================================================== ACT 2
   The working line is the spine. Rules grow out of it into the register of
   ports while the light falls to dusk; the same rules carry the evidence at
   night; the line comes to rest on the footer's edge. In normal flow the spine
   is a rule in the margin and the parts follow each other on one ground; on a
   wide screen home.js pins the stage (.is-pinned). With the opening live, the
   act rises over its last screen (.is-overlap), joining the release. */
.act { position: relative; z-index: 1; isolation: isolate; color: #fff; }
.act::after {
  content: ""; position: absolute; z-index: 2; pointer-events: none; top: 0; bottom: 0; width: 1px;
  left: calc(var(--sx-gutter) * .5);
  background: linear-gradient(180deg, rgba(21, 27, 33, .5) 0, rgba(21, 27, 33, .5) 12%, rgba(200, 203, 198, .38) 26%, rgba(200, 203, 198, .38) 100%);
}
.act.is-overlap { margin-top: -100vh; margin-top: -100svh; }
.act__ground { display: none; }
.act__part { position: relative; }
.act__part::before {          /* the same weathered plate the opening ends on, very faint */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background: url("/assets/images/home/detail.webp") 0 0 / 900px auto repeat;
}

.act-head { display: grid; gap: 1.1rem; justify-items: start; }
.act-head__title { font-size: var(--sx-t-1); max-width: 13ch; }
.act-head__text { max-width: 36ch; font-size: var(--sx-t-lede); line-height: 1.5; color: rgba(232, 229, 221, .82); text-wrap: pretty; }
.act-head__more { color: inherit; }

.act-n {
  margin: 0; font-family: var(--sx-font); font-weight: 600; font-stretch: 125%; letter-spacing: -.07em; line-height: .78;
  color: rgba(127, 179, 170, .07); -webkit-text-stroke: 1.5px rgba(127, 179, 170, .4); pointer-events: none;
}

.act-reg { list-style: none; margin: 0; padding: 0; color: #fff; }
.act-reg li { position: relative; display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); gap: .35rem 1.5rem; align-items: baseline; padding-block: 1rem; }
.act-reg li::before { content: ""; position: absolute; left: calc(var(--sx-gutter) * -.5); right: 0; top: 0; height: 1px; background: rgba(200, 203, 198, .32); transform-origin: 0 50%; opacity: var(--ro, 1); transform: scaleX(var(--rs, 1)); }
.act-reg li > * { opacity: var(--to, 1); }
.act-reg--ports .act-reg__a { color: var(--sx-teal-lt); text-transform: uppercase; letter-spacing: .07em; }
.act-reg--ports .act-reg__b { font-size: clamp(1.05rem, .95rem + .4vw, 1.35rem); font-weight: 500; font-stretch: 108%; line-height: 1.45; }
.act-reg--ports a { color: #fff; text-decoration: none; }
.act-reg--ports a:hover { text-decoration: underline; text-underline-offset: 4px; }
.act-reg--ports a.is-hq { font-weight: 700; }
.act-reg--ports a.is-hq::after { content: "Head office"; margin-left: .5rem; font: 400 .7rem/1 var(--sx-mono); color: var(--sx-fog); vertical-align: .2em; }
.act-reg__sep { color: rgba(200, 203, 198, .45); }
.act-reg--marks .act-reg__a { font-size: clamp(1.4rem, 1.05rem + 1vw, 2.1rem); letter-spacing: -.02em; }
.act-reg--marks .act-reg__b { font-size: .9rem; line-height: 1.45; color: var(--sx-fog); }

/* ---- normal flow */
.act__part--reach {
  background: linear-gradient(180deg, var(--hs-rel, #dde2e4) 0, #8e989c 10rem, #3b4853 22rem, #222c36 36rem, var(--sx-night) 56rem);
  padding: clamp(12rem, 24vw, 18rem) var(--sx-gutter) clamp(3rem, 6vw, 5rem); overflow: hidden; display: grid; gap: 2.5rem;
}
.act.is-overlap .act__part--reach {
  background: linear-gradient(180deg, rgba(221, 226, 228, 0) 0, #dde2e4 45vh, #8e989c 62vh, #3b4853 80vh, #222c36 100vh, var(--sx-night) 130vh);
  padding-top: 104vh; padding-top: 104svh;
}
.act__part--reach .act-n { position: absolute; z-index: -1; right: var(--sx-gutter); top: clamp(5rem, 12vw, 9rem); font-size: clamp(12rem, 5rem + 30vw, 30rem); }
.act.is-overlap .act__part--reach .act-n { top: 78vh; top: 78svh; }
.act__part--proof { background: var(--sx-night); padding: clamp(3rem, 6vw, 5rem) var(--sx-gutter) clamp(5rem, 10vw, 8rem); display: grid; gap: 2.5rem; }
.act__part > * { width: 100%; max-width: calc(var(--sx-maxw) - 2 * var(--sx-gutter)); margin-inline: auto; }
.act__part > .act-reg { max-width: min(60rem, calc(var(--sx-maxw) - 2 * var(--sx-gutter))); margin-left: max(0px, calc((100% - var(--sx-maxw)) / 2 + var(--sx-gutter))); }

/* ---- pinned: one stage. Left of the spine, the head (reach, then proof, in one place); right of it, the field,
   where the rules grow and the register changes from ports to evidence on the same lines. */
.act.is-pinned { --spine: 43vw; height: 470vh; }
.act.is-pinned::after { display: none; }
.act.is-pinned .act__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.act.is-pinned .act__ground { display: block; position: absolute; inset: 0; z-index: -2; background: var(--ground, var(--sx-night)); opacity: var(--ga, 1); }
.act.is-pinned .act__stage::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: calc(.07 * var(--ga, 1)); mix-blend-mode: overlay;
  background: url("/assets/images/home/detail.webp") 0 0 / 900px auto repeat;
}
.act.is-pinned .act__stage::after {
  content: ""; position: absolute; z-index: 1; pointer-events: none; left: var(--spine); top: 0; bottom: 0; width: 1px;
  background: var(--line-c, rgba(21, 27, 33, .5)); transform: translateX(-.5px);
}
.act.is-pinned .act__ground::after {      /* rest: the spine turns along the footer's edge */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgba(200, 203, 198, .32);
  transform-origin: var(--spine) 50%; transform: scaleX(var(--settle, 0));
}
.act.is-pinned .act__part { display: contents; }
.act.is-pinned .act__part::before { display: none; }
.act.is-pinned [data-a] { position: absolute; will-change: transform, opacity; }
.act.is-pinned .act-head { left: max(var(--sx-gutter), calc((100vw - var(--sx-maxw)) / 2 + var(--sx-gutter))); top: 22vh; width: min(34vw, 30rem); }
.act.is-pinned .act-head__title { font-size: clamp(2.1rem, 1rem + 2.6vw, 3.6rem); }
.act.is-pinned .act-n { right: var(--sx-gutter); top: 50%; font-size: 82vh; transform-origin: 70% 50%; z-index: -1; }
.act.is-pinned .act-reg { left: var(--spine); right: var(--sx-gutter); top: 18vh; }
.act.is-pinned .act-reg li { height: 9.4vh; padding: 0 0 0 2.4rem; align-content: center; }
.act.is-pinned .act-reg li::before { left: 0; background: var(--line-c, rgba(200, 203, 198, .32)); }

/* ================================================================ RESPONSIVE */
@media (max-width: 900px) {
  .act-reg li { grid-template-columns: minmax(0, 1fr); }
  .hs.is-static .hs-chapters, html.no-js .hs-chapters { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .hs { height: 660vh; height: 660svh; }
  .hs__title { font-size: clamp(2.1rem, 1.2rem + 5vw, 3.2rem); }
  .hs__title-wrap { padding-bottom: clamp(3rem, 10vh, 5.5rem); }
  .hs__note { left: var(--sx-gutter); right: var(--sx-gutter); text-align: left; }
  .hs-ch { grid-template-columns: minmax(0, 1fr) auto; padding-bottom: clamp(2.2rem, 7vh, 3.5rem); column-gap: 1rem; }
  .hs-ch__name, .hs-ch__line, .hs-ch__more { grid-column: 1; }
  .hs-ch__name { font-size: clamp(1.75rem, 1.2rem + 3.4vw, 2.3rem); }
  .hs-ch__line { font-size: 1rem; }
  .hs-print { grid-column: 2; width: clamp(92px, 27vw, 128px); }
  .hs-print figcaption { font-size: .66rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hs__stage::before { animation: none; }
  .hs__canvas { transition: none; }
}
