/* Jejak Nusantara, landing page. The type system is the studio's (insightedgescore.com): one family, Archivo,
   and Bodoni Moda italic as the single accent. Flat: no shadows, glows, rules or ornament.
   How much text: a giant display line is 1 to 3 words, at most two of them on screen; anything longer is one small
   line (16 to 18 px, at most 32 characters a line and 3 lines) in a corner. Text covers about a fifth of the frame
   at most, and never the boat, the island or the sun. Text is one off-white or one near-black per beat (--fg). */
@font-face { font-family: "Archivo"; src: url("../fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: block; }
@font-face { font-family: "Bodoni Moda"; src: url("../fonts/bodoni-italic.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }

:root { --white: #f2efe6; --ink: #121210; --sea: #0f2c36; --fg: var(--white); --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
        --gutter: clamp(16px, 4.4vw, 44px); --top: max(var(--gutter), env(safe-area-inset-top)); --logo-h: 62px; }
* { box-sizing: border-box; }
html { background: var(--sea); }
body { margin: 0; color: var(--white); font: 400 17px/1.36 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, p, ol, ul { margin: 0; padding: 0; font: inherit; }
ol, ul { list-style: none; }

#scene { position: fixed; inset: 0; width: 100%; height: 100vh; height: 100lvh; display: block; }
main { position: relative; z-index: 2; }
#journey { height: 620vh; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.beat { position: absolute; inset: 0; padding: 0 var(--gutter); color: var(--fg); will-change: opacity, transform; }
.story, .in-it, .islands, .last { opacity: 0; visibility: hidden; }

/* the small line: for anything longer than three words */
.line { font: 400 17px/1.36 var(--sans); letter-spacing: -.005em; max-width: 16.5em; text-wrap: balance; }

/* giant display lines: one to three words each, two at most. On the live page they are drawn inside the scene,
   behind the boat, from these very elements; here they only hold their place. data-st="line" is the outlined kind. */
.giant { font: 800 clamp(2.6rem, 13.2vw, 5.6rem)/.86 var(--sans); letter-spacing: -.055em; text-transform: uppercase; }
.giant .row { display: block; white-space: nowrap; }
.giant [data-st="line"] { font-weight: 300; }
.boot .giant, .reveal .giant, .live .giant { color: transparent; }
.still .giant [data-st="line"] { color: transparent; -webkit-text-stroke: 1.5px var(--fg); }

/* ---------- the pill, as on the studio site: flat, hover inverts ---------- */
.pill { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; min-height: 2.75rem; padding: .12em 1.15em 0; border: 1.5px solid var(--white); border-radius: .7em;
        background: var(--white); color: var(--ink); font: 700 1rem/1 var(--sans); letter-spacing: -.01em; text-transform: uppercase; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pill:hover { background: var(--ink); color: var(--white); }
.pill:active { scale: .96; }
.pill:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
.pill--big { font-size: clamp(1.15rem, 1.5vw, 1.4rem); min-height: 3.5rem; padding-inline: 1.9em; }
.pill--small { font-size: .82rem; min-height: 2.3rem; padding-inline: 1em; }
.pill[hidden] { display: none; }

/* ---------- the bar: the logo, and a small PLAY whenever the big one is not on screen ---------- */
.bar { position: fixed; z-index: 6; left: 0; right: 0; top: 0; padding: var(--top) var(--gutter) 0; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
#logo { display: block; width: min(36vw, 230px); height: auto; image-rendering: pixelated; }
.bar .pill { opacity: 0; transition: opacity .35s ease; }
.bar .pill.on { opacity: 1; pointer-events: auto; }

/* ---------- first light: the scene opens. One small line under the logo, PLAY alone in the corner below. ---------- */
.first .line { position: absolute; left: var(--gutter); top: calc(var(--top) + var(--logo-h) + 16px); max-width: 11.5em; }
.first .pill { position: absolute; left: var(--gutter); top: calc(var(--top) + var(--logo-h) + 16px + 3.1rem + 1.3rem); }

/* ---------- the story ---------- */
.story .giant { position: absolute; left: var(--gutter); top: calc(var(--top) + var(--logo-h) + 5vh); }
.story .line { position: absolute; left: var(--gutter); top: calc(var(--top) + var(--logo-h) + 5vh + clamp(2.6rem, 13.2vw, 5.6rem) * 1.72 + 1.1rem); }

/* ---------- in the game: four figures, nothing else ---------- */
.figs { position: absolute; left: var(--gutter); right: var(--gutter); top: calc(var(--top) + var(--logo-h) + 4vh); display: grid; grid-template-columns: 1fr 1fr; gap: 3.5vh 4vw; }
.figs b { display: block; font: 300 clamp(4.6rem, 27vw, 11rem)/.8 var(--sans); letter-spacing: -.06em; font-variant-numeric: lining-nums; }
.figs span { display: block; margin-top: .7rem; font: 400 17px/1.2 var(--sans); }

/* ---------- the close: two display lines in open sky, PLAY, one small line; one smaller line at the very foot ---------- */
.last .giant { position: absolute; left: var(--gutter); top: calc(var(--top) + var(--logo-h) + 5vh); }
.last .pill--big { position: absolute; left: var(--gutter); top: calc(var(--top) + var(--logo-h) + 5vh + clamp(2.6rem, 13.2vw, 5.6rem) * 1.72 + 1.8rem); }
.last .line { position: absolute; left: var(--gutter); top: calc(var(--top) + var(--logo-h) + 5vh + clamp(2.6rem, 13.2vw, 5.6rem) * 1.72 + 1.8rem + 3.5rem + 1.3rem); max-width: 13em; }
.links { position: absolute; left: var(--gutter); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; gap: 1.5em; font: 400 17px/1.36 var(--sans); }
.links a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
.links a:hover, .links a:focus-visible { text-decoration: none; }

/* ---------- the route down the side ---------- */
.route { position: fixed; z-index: 4; right: max(10px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 12px; }
.route a { width: 20px; height: 20px; display: grid; place-items: center; }
.route a::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--white); opacity: .55; }
.route a.on::before { opacity: 1; width: 8px; height: 8px; }

/* ---------- the opening: a flat dark sea, the island names turning over at the top left, and a huge thin number
   at the bottom right that counts the bytes in. At 100 it fades into the scene. ---------- */
#pre { display: none; position: fixed; left: 0; right: 0; top: 0; height: 100vh; height: 100lvh; z-index: 50; background: var(--sea); color: var(--white); overflow: hidden; }
.pre__sky { position: absolute; left: 0; right: 0; top: 0; overflow: hidden; }
.pre__sun { position: absolute; border-radius: 50%; background: #fff9db; will-change: transform; }
.pre__line { position: absolute; left: 0; right: 0; height: 1px; background: rgba(242, 239, 230, .55); }
.boot #pre, .reveal #pre { display: block; }
.reveal #pre { pointer-events: none; }
.pre__word { position: absolute; left: var(--gutter); top: var(--top); font: 500 clamp(1.1rem, 2vw, 1.6rem)/1 var(--sans); letter-spacing: -.01em; text-transform: uppercase; }
.pre__n { position: absolute; right: var(--gutter); bottom: calc(var(--gutter) - .08em + env(safe-area-inset-bottom, 0px)); font: 200 clamp(7rem, 26vw, 24rem)/.8 var(--sans); font-stretch: 75%; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }

@media (orientation: landscape) and (min-width: 800px) {
  .line { font-size: 18px; }
  #logo { width: min(18vw, 260px); }
  .giant { font-size: clamp(4rem, 7.6vw, 10rem); }
  .first .pill { top: auto; bottom: calc(var(--gutter) + 3vh); }
  .first, .last { --fg: var(--ink); }
  .first .pill, .last .pill { background: var(--ink); color: var(--white); border-color: var(--ink); }
  .first .pill:hover, .last .pill:hover { background: var(--white); color: var(--ink); }
  .story .giant, .last .giant { top: calc(var(--top) + var(--logo-h) + 4vh); }
  .story .line { top: calc(var(--top) + var(--logo-h) + 4vh + clamp(4rem, 7.6vw, 10rem) * 1.72 + 1.2rem); }
  .last .pill--big { top: calc(var(--top) + var(--logo-h) + 4vh + clamp(4rem, 7.6vw, 10rem) * 1.72 + 1.8rem); }
  .last .line { top: calc(var(--top) + var(--logo-h) + 4vh + clamp(4rem, 7.6vw, 10rem) * 1.72 + 1.8rem + 3.5rem + 1.2rem); }
  .links { color: var(--white); font-size: 18px; }
  .figs { grid-template-columns: repeat(4, auto); justify-content: start; gap: 5vw; top: calc(var(--top) + var(--logo-h) + 7vh); }
  .figs b { font-size: clamp(6rem, 13vw, 14rem); }
  .route { right: 22px; }
}

/* ---------- the still page (no WebGL, or "reduce motion", or no script): the landing page itself, standing still.
   The same type, the same pill, the same places; behind each passage a still frame of the scene taken from the
   scene. One screen per passage, no opening, nothing moving. ---------- */
.still #scene, .still .route, .still .bar .pill, .still .islands { display: none; }
.still #journey { height: auto; }
.still .stage { position: static; height: auto; overflow: visible; }
.still .beat { position: relative; inset: auto; height: 100vh; height: 100svh; opacity: 1; visibility: visible; background: var(--sea) 50% 50% / cover no-repeat; }
.still .giant { color: var(--fg); }
.still .giant [data-st="line"] { color: transparent; -webkit-text-stroke: 1.5px var(--fg); }
.still .first { background-image: url("../img/still-0t.jpg"); } .still .story { background-image: url("../img/still-1t.jpg"); }
.still .in-it { background-image: url("../img/still-2t.jpg"); } .still .last { background-image: url("../img/still-4t.jpg"); }
@media (orientation: landscape) and (min-width: 800px) {
  .still .first { background-image: url("../img/still-0.jpg"); } .still .story { background-image: url("../img/still-1.jpg"); }
  .still .in-it { background-image: url("../img/still-2.jpg"); } .still .last { background-image: url("../img/still-4.jpg"); }
}
