/* Homepage opening gate. inari-gate.js builds it and adds html.has-gate while it stands; without JavaScript
   none of this applies. BRAND.md: the art is a night print in flat night ink, sumi and vermilion blocks, lit by
   foxfire. The header stays above the gate so the lockup and menus never move. */
html.has-gate { overflow: hidden; scrollbar-gutter: stable; }
/* Above the gate, and above the open-menu rule in navigation.css (three classes or attributes beat its two plus :has).
   Never drawn on card (main.js has not added .js yet). At night it is the sky's own colour, which is also what iPhone
   Safari tints its status bar from. Its colour changes are instant here: inari-gate.js fades the night bar away at
   dawn frame by frame, since Chrome runs a background-color transition on the compositor and can draw its end as one
   frame of where it started. */
html.has-gate body > header.lp-nav[data-lp-nav] { z-index: 1501; background: transparent; border-bottom-color: transparent; transition: none; }
html.has-gate:not(.gk-dawn) body > header.lp-nav[data-lp-nav] { background: #14121A; }
/* iPhone Safari draws the page past the gate's edge, behind its toolbar, and tints the toolbar from the page's
   background there. While the gate stands the page is clipped to the screen (still scrollable by script) and night-coloured underneath; both go
   back to day as the page comes up the tunnel. inari-gate.js turns the ground to day frame by frame: never a CSS
   transition, whose end Chrome could draw as one frame of night. Page overlays (the analytics choice, invitations) wait for the gate. */
html.has-gate:not(.gk-out), html.has-gate:not(.gk-out) body { background-color: #141218; }
html.has-gate body { max-height: 100vh; max-height: 100svh; overflow: hidden; }
html.has-gate :is(.analytics-choice, .analytics-settings, .sticky-cta, .tour-invite, .notice) { visibility: hidden; }
/* At night the header reads in ink, with the lockup for dark grounds, until the page comes up the tunnel and
   inari-gate.js adds .gk-dawn. */
html.has-gate:not(.gk-dawn) .lp-nav :is(nav > a, .nav-menu > summary, .nav-account) { color: var(--ink-dark); }
html.has-gate:not(.gk-dawn) .lp-nav .nav-account { --line: rgba(241, 236, 228, 0.28); }
html.has-gate:not(.gk-dawn) .lp-nav > a:first-child img { object-position: -9999px 0; background: url(/assets/kitsuvo-lockup-small-dark.svg?v=8f8bded4ab) center / contain no-repeat; }
@media (hover: hover) and (pointer: fine) {
  html.has-gate:not(.gk-dawn) .lp-nav :is(nav > a, .nav-menu > summary, .nav-account):hover { color: #FF7A45; }
}

.gk {
  /* Where the buttons stand: above the home indicator, and measured against the small viewport so a phone's
     toolbars never cover them. inari-gate.js fits the scene into the space above. */
  --gk-bottom: max(32px, calc(env(safe-area-inset-bottom, 0px) + 24px), 5.5vh);
  /* One compositor layer for the whole gate from the first paint, above the page as it scales up the tunnel, and
     faded as one at the end (inari-gate.js keeps everything inside it from being split into layers of its own). */
  position: fixed; inset: 0; z-index: 1500; overflow: hidden; will-change: opacity;
  background: transparent; cursor: pointer; touch-action: pinch-zoom; -webkit-tap-highlight-color: transparent;
}
@supports (height: 1svh) { .gk { --gk-bottom: max(32px, calc(env(safe-area-inset-bottom, 0px) + 24px), 5.5svh); } }
.gk-art { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* The one action, standing on the path: the homepage's primary button, so the gate and the page speak alike. */
.gk-enter {
  position: absolute; left: 50%; bottom: var(--gk-bottom);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 26px 0 22px;
  border: 0; border-radius: 999px; background: var(--washi); color: var(--sumi);
  font: 600 0.9375rem/1 var(--font); letter-spacing: -0.01em; white-space: nowrap; cursor: pointer;
  opacity: 0; translate: -50% 10px;
  transition: opacity 0.6s var(--ease), translate 0.6s var(--ease), background-color 0.2s ease;
}
.gk.is-ready .gk-enter, .gk-enter:focus-visible { opacity: 1; translate: -50% 0; }
.gk.is-leaving .gk-enter { opacity: 0; transition-duration: 0.2s; }
.gk-enter:focus-visible, .gk-music:focus-visible { outline: 2px solid #FF7A45; outline-offset: 3px; }
.gk-enter:active { scale: 0.97; }
@media (hover: hover) and (pointer: fine) { .gk-enter:hover { background: var(--vermilion); color: var(--card); } }
.gk-enter svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: translate 0.3s var(--ease); }
@media (hover: hover) and (pointer: fine) { .gk-enter:hover svg { translate: 0 -1px; } }
.gk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The Music toggle (inari-gate-music.js), in the corner beside the path. Its waves move only while sound plays. */
.gk-music {
  position: absolute; right: max(16px, calc(env(safe-area-inset-right, 0px) + 16px), 2.5vw);
  bottom: var(--gk-bottom);
  display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0;
  border: 1px solid rgba(241, 236, 228, 0.24); border-radius: 999px; background: rgba(241, 236, 228, 0.08); color: var(--ink-dark); cursor: pointer;
  opacity: 0; transition: opacity 0.6s var(--ease), color 0.2s ease, border-color 0.2s ease;
}
.gk.is-ready .gk-music, .gk-music:focus-visible { opacity: 1; }
.gk.is-leaving .gk-music { opacity: 0; pointer-events: none; transition-duration: 0.2s; }
@media (hover: hover) and (pointer: fine) { .gk-music:hover { color: #FF7A45; border-color: currentColor; } }
.gk-music svg { width: 20px; height: 20px; overflow: visible; }
.gk-speaker { fill: currentColor; }
.gk-waves, .gk-off { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.gk-music[aria-pressed="true"] .gk-off, .gk-music[aria-pressed="false"] .gk-waves { display: none; }
.gk-music.is-playing .gk-waves { animation: gk-waves 1.6s ease-in-out infinite; }
@keyframes gk-waves { 50% { opacity: 0.45; } }
/* Too narrow for both side by side (folded phones): the toggle stands above, at the edge. */
@media (max-width: 319px) { .gk-music { bottom: calc(var(--gk-bottom) + 60px); } }

/* Some stars twinkle, each on its own slow beat. fill-opacity, not opacity: Chrome gives every star animating opacity
   a compositor layer of its own (some 50), which splits the night into layers that flicker as the view moves. */
.gk-stars circle:nth-child(3n) { animation: gk-twinkle 3.4s ease-in-out infinite alternate; }
.gk-stars circle:nth-child(5n + 1) { animation: gk-twinkle 4.7s ease-in-out -2.1s infinite alternate; }
@keyframes gk-twinkle { to { fill-opacity: 0.08; } }

/* inari-gate.js moves focus to <main> after the gate opens; the page itself is not a control to outline. */
#main[tabindex="-1"]:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
  .gk-enter { translate: -50% 0; transition: opacity 0.2s linear, background-color 0.2s ease; }
  .gk-enter:active { scale: none; }
  .gk-music.is-playing .gk-waves, .gk-stars circle { animation: none; }
}
@media (forced-colors: active) { .gk-enter, .gk-music { border: 1px solid ButtonText; } }
@media print { .gk { display: none; } html.has-gate { overflow: visible; } }
