/* LightFlow Interactive: one scrolling page.
   Headings use Raleway thin, everything else Helvetica. */

:root {
  --black: #000000;
  --grey-1: #373737;
  --grey-2: #767676;
  --grey-3: #a8a8a8;
  --text: #f2f2f2;

  /* the LightFlow logo */
  --lf-navy: #010d17;
  --lf-sky: #007ac7;
  --lf-cyan: #007ac7;
  --lf-land: #010d17;   /* the logo's background colour: the home page below the landscape */

  --bf-bg: #0b212d;
  --bts-bg: #561000;
  --bts-deep: #1d0500;
  --bts-text: #f6e6dc;

  --head: "Raleway", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --body: Helvetica, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--black); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--head);
  font-weight: 200;
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin: 0 0 0.5em;
}
h1, h2 { font-size: clamp(2.2rem, 6vw, 4.2rem); font-weight: 100; }
h3 { font-size: clamp(1.8rem, 4.2vw, 3rem); }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; }
a { color: inherit; }

.kicker {
  font-family: var(--body);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 0 0 1.2em;
  opacity: 0.75;
}

.skip {
  position: absolute; left: 12px; top: -60px;
  background: #fff; color: #000; padding: 8px 12px; z-index: 100;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
/* the about text gets focus when you jump to it from the menu; no outline box around it */
.about:focus, .about:focus-visible { outline: none; }

/* ---------- top navigation (inverts over light and dark) ---------- */
.topnav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 40px);
  color: #fff;
  mix-blend-mode: difference;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}
.topnav a { text-decoration: none; }
.topnav a { transition: color 0.25s; }
/* home, and over the logo on any page: plain white menu; each link turns navy over the bright cyan parts (js/site.js sets on-light) */
html[data-page="home"] .topnav, .nav-light .topnav { mix-blend-mode: normal; }
.topnav a.on-light { color: var(--lf-navy); }
.topnav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.topnav-brand { font-weight: 700; letter-spacing: 0.02em; }
.topnav ul { display: flex; gap: clamp(14px, 3vw, 32px); list-style: none; margin: 0; padding: 0; }
@media (max-width: 640px) {
  .topnav { font-size: 0.8rem; }
  .topnav .long { display: none; }
  .topnav li:first-child { display: none; }
}

/* ---------- 1. opening ---------- */
.opening { position: relative; background: var(--lf-navy); }
.stage { position: relative; background: var(--lf-navy); }
html[data-page="home"], html[data-page="home"] body { background: var(--lf-navy); }
.lf-scene { position: relative; display: block; width: 100%; height: 100vh; height: 100svh; }
.open-stars { display: none; }
.motion .open-stars { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.lf-layer { will-change: transform; }
.motion .lf-sky { display: none; }

/* three dots under the wordmark, inside the logo drawing so they never touch it */
.scroll-hint circle { opacity: 0.5; }
.motion .scroll-hint circle { animation: hint 1.8s ease-in-out infinite; opacity: 0.12; }
.motion .scroll-hint circle:nth-child(2) { animation-delay: 0.25s; }
.motion .scroll-hint circle:nth-child(3) { animation-delay: 0.5s; }
@keyframes hint { 0%, 100% { opacity: 0.12; } 30% { opacity: 1; } }
/* the same three dots at the bottom of the first screen of each app page */
.scroll-dots { position: absolute; left: 50%; bottom: 7vh; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 13px; pointer-events: none; }
.scroll-dots span { width: 7px; height: 7px; border-radius: 50%; background: #a8a8a8; opacity: 0.5; }
.motion .scroll-dots span { animation: hint 1.8s ease-in-out infinite; opacity: 0.12; }
.motion .scroll-dots span:nth-child(2) { animation-delay: 0.25s; }
.motion .scroll-dots span:nth-child(3) { animation-delay: 0.5s; }

.about {
  max-width: 40rem;
  margin: 0 auto;
  padding: 12vh clamp(16px, 6vw, 48px) 14vh;
  text-align: center;
  color: var(--text);
}
.about h1 { color: #fff; }

/* with motion: the stage is pinned while the camera moves, and the about text sits on the sky */
.motion .opening { height: 500vh; }   /* js/site.js: P_END */
.motion .stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.motion .about {
  position: absolute; left: 0; right: 0; top: 0;
  color: #fff;   /* on the blue sky */
  padding-top: max(13vh, 76px);
  opacity: 0;
  pointer-events: none;
}
.motion .about.is-on { pointer-events: auto; }
.motion .about h1 { color: #fff; }
.motion .about .kicker { opacity: 0.85; }

/* ---------- the journey: one canvas behind the apps, both app sections and contact ---------- */
.journey { position: relative; overflow: hidden; overflow: clip; background: var(--black); }

.app-sky { display: none; }
.js .app-sky {
  display: block;
  position: sticky; top: 0;
  height: 100vh; height: 100lvh;
  margin-bottom: -100vh; margin-bottom: -100lvh;
  overflow: hidden;
}
.app-sky canvas { display: block; width: 100%; height: 100%; }
.js .app-fore { z-index: 2; pointer-events: none; }

.panel {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: 18vh clamp(16px, 8vw, 120px);
}
.panel-spacer { display: none; }
.js .panel-spacer { display: block; }
/* the two steps of the app page ending (hills rise, info sets): 30% of a screen each */
.js .panel-spacer { min-height: 30vh; min-height: 30svh; padding: 0; }

.panel-text { max-width: 30rem; }
.panel-text p { font-size: 1.05rem; opacity: 0.88; }
.panel-text h2 { font-size: clamp(2.6rem, 7vw, 5rem); }
.panel-intro .panel-text { max-width: 44rem; }
.panel-text .kicker { font-family: var(--body); font-size: 0.8rem; font-weight: 400; }

/* without JavaScript, solid colours stand in for the canvas */
.app-bf { color: #fff; background: radial-gradient(circle at 72% 30%, rgba(255, 140, 170, 0.25), transparent 30%), var(--bf-bg); }
.app-bts { color: var(--bts-text); background: radial-gradient(circle at 72% 30%, rgba(229, 124, 75, 0.35), transparent 28%), linear-gradient(var(--bts-bg), var(--bts-deep)); }
.js .app-bf, .js .app-bts { background: transparent; }

.app-bf .panel-text { text-shadow: 0 1px 18px rgba(0, 10, 20, 0.6); }
.app-bts .panel-text { text-shadow: 0 1px 18px rgba(30, 5, 0, 0.55); }

/* our apps: the two app logos */
.panel-apps { justify-content: center; text-align: center; }
.panel-apps .panel-text { max-width: 760px; width: 100%; }
.app-list {
  list-style: none; margin: 0 auto; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 48px;
}
.app-list a {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-decoration: none;
}
.app-list img { width: 96px; border-radius: 22px; margin-bottom: 12px; transition: transform 0.4s ease; }
.app-list a:hover img { transform: scale(1.05); }
.app-name { font-family: var(--head); font-weight: 200; font-size: 1.9rem; line-height: 1.2; }
.app-line { opacity: 0.7; font-size: 0.95rem; }

/* call to action panels */
.panel-cta { justify-content: center; text-align: center; }
.panel-cta .panel-text { display: flex; flex-direction: column; align-items: center; }
.app-icon { width: 100px; border-radius: 22px; margin-bottom: 24px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); }
.store { display: inline-block; margin: 8px 0 20px; }
.store img { width: 175px; display: block; }
/* "so go ahead" sits closer to the App Store panel that follows it */
.panel-lead { min-height: 50vh; min-height: 50svh; align-items: flex-end; padding-bottom: 4vh; }
.more { font-size: 0.95rem; text-underline-offset: 4px; }

/* ---------- 5. contact ---------- */
.contact { justify-content: center; text-align: center; flex-direction: column; }
.contact .panel-text { display: flex; flex-direction: column; align-items: center; max-width: 36rem; }
.lf-mark { width: 120px; height: 120px; margin-bottom: 28px; }
/* with JavaScript the canvas draws the big logo above, so the text sits low */
.js .contact .lf-mark { display: none; }
.js .contact { justify-content: flex-end; padding-bottom: 10vh; }
.js .contact .panel-text { position: relative; z-index: 3; }
.ig {
  font-family: var(--head); font-weight: 300; font-size: clamp(1.4rem, 4vw, 2rem);
  text-decoration: none; border-bottom: 1px solid var(--grey-2); padding-bottom: 2px;
}
.ig:hover { border-color: #fff; }

.footer {
  background: var(--black);
  color: var(--grey-2);
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  padding: 0 16px 40px;
}

/* phones: text sits low, the shapes sit high */
@media (max-aspect-ratio: 9/10) {
  .panel { align-items: flex-end; padding-bottom: 12vh; }
  .panel-cta, .panel-apps, .contact { align-items: center; }
  .panel-lead { padding-bottom: 4vh; }
}

/* text on the right, so the light can move to the left */
.panel-right { justify-content: flex-end; }

/* App Store panels: with motion the content stays pinned for a moment, a short pause in the scroll */
.motion .panel-hold { display: block; min-height: 0; height: 170vh; height: 170svh; padding: 0; }
.motion .panel-hold > .hold {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: 0 clamp(16px, 8vw, 120px);
}

/* home page contact: centred under the app logos, on the starry sky */
/* the app logos and contact sit close together: no full screen of sky between them */
.journey .panel-apps { min-height: 0; padding-top: 2vh; padding-bottom: 6vh; }
/* home: the app logos start over the bottom of the landscape and scroll up with it, while the hills
   darken the rest of the way (js/site.js: HANDOFF_P, P_END and darkAt follow this 80vh).
   The journey is see-through there, so the landscape shows behind the app logos. */
.motion[data-page="home"] .journey { margin-top: -80vh; background: transparent; }
.js .contact-home { justify-content: center; min-height: 0; padding-top: 6vh; padding-bottom: 18vh; }
html[data-page="home"] .journey { background: var(--lf-land); }
/* the footer carries on the black Breathing Flow opens with (the contact fades into it, see js/site.js HOME_LOW) */
html[data-page="home"] .footer { background: #000000; }
html[data-page="home"] .footer { color: rgba(255, 255, 255, 0.5); }
/* app pages end on the logo alone, which hands over to the top of the home page */
.js .panel-end .panel-text { visibility: hidden; }
/* the end of an app page: the night sky darkens a little over the hills, then the home page takes over */
/* the last step is short: the colours are already final as the info disappears */
.js .panel-end { min-height: 8vh; min-height: 8svh; padding: 0; }
.js[data-page="bf"] .footer, .js[data-page="bts"] .footer { display: none; }
.footer .back { color: var(--grey-3); font-size: 0.95rem; text-underline-offset: 4px; }

/* ---------- moving between pages ----------
   The home page is the bottom card. Breathing Flow slides in over it from the left,
   Breathing to Sleep from the right. Going back home, the app page slides back
   out the way it came and reveals the home page underneath.
   (js/pages.js picks the class; the top bar stays put.) */
@view-transition { navigation: auto; }
.topnav { view-transition-name: topnav; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.9s; animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
/* an app page slides in over the page below, which stays still and dims a little */
.enter-from-left::view-transition-new(root)  { animation-name: lf-in-left;  z-index: 2; }
.enter-from-right::view-transition-new(root) { animation-name: lf-in-right; z-index: 2; }
.enter-from-left::view-transition-old(root),
.enter-from-right::view-transition-old(root) { animation-name: lf-dim; z-index: 1; }
/* back home: the app page slides out, the home page underneath brightens */
.exit-to-left::view-transition-old(root)  { animation-name: lf-out-left;  z-index: 2; }
.exit-to-right::view-transition-old(root) { animation-name: lf-out-right; z-index: 2; }
.exit-to-left::view-transition-new(root),
.exit-to-right::view-transition-new(root) { animation-name: lf-undim; z-index: 1; }
@keyframes lf-out-left  { to   { transform: translateX(-100%); } }
@keyframes lf-out-right { to   { transform: translateX(100%); } }
@keyframes lf-in-right  { from { transform: translateX(100%); } }
@keyframes lf-in-left   { from { transform: translateX(-100%); } }
@keyframes lf-dim       { to   { opacity: 0.4; } }
@keyframes lf-undim     { from { opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
