:root {
  --paper: #F7F5F9;
  --ink: #1F1A33;
  --ink-soft: rgba(31, 26, 51, .62);
  --night: #1C1638;
  --tint-amount: 10%;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Hiragino Sans", system-ui, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15112A;
    --ink: #F1EDF7;
    --ink-soft: rgba(241, 237, 247, .66);
    --night: #0E0B1D;
    --tint-amount: 14%;
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
  overflow-x: clip;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

img {
  display: block;
  -webkit-user-drag: none;
}

a { color: inherit; }

/* Hero */

.hero {
  position: relative;
  min-height: max(100svh, 640px);
  background: linear-gradient(180deg, #4E3A9E 0%, #8A4E9E 34%, #E27D8C 66%, #FFB45E 100%);
  color: #fff;
  overflow: hidden;
}

.hero-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero .mist { animation: drift 24s ease-in-out infinite alternate; }

@keyframes drift {
  from { transform: translateX(-50px); }
  to { transform: translateX(50px); }
}

.hero-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(72px, 13vh, 140px) 24px 0;
  text-align: center;
}

.hero-mark {
  width: 66px;
  height: 76px;
}

.hero h1 {
  margin: 20px 0 0;
  font-weight: 600;
  font-size: clamp(56px, 9vw, 112px);
  line-height: 1;
  letter-spacing: -.035em;
  text-shadow: 0 2px 30px rgba(35, 27, 69, .25);
}

.hero-content > p {
  margin: 16px 0 0;
  font-size: clamp(17px, 2vw, 21px);
  color: rgba(255, 255, 255, .88);
}

.hero-apps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-top: 40px;
}

.hero-apps a {
  position: relative;
  border-radius: 24%;
  text-decoration: none;
}

.hero-apps img {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 6px 12px rgba(35, 27, 69, .3));
}

.hero-apps span {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(35, 27, 69, .55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -4px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}

.hero-apps a:hover span,
.hero-apps a:focus-visible span {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* App sections */

.app {
  --tint: color-mix(in oklab, var(--accent) var(--tint-amount), var(--paper));
  position: relative;
  isolation: isolate;
  background: var(--tint);
  scroll-margin-top: 40px;
}

.ridge {
  position: absolute;
  left: 0;
  bottom: calc(100% - 1px);
  width: 100%;
  height: clamp(48px, 7vw, 96px);
  fill: var(--tint);
}

.stage { position: relative; }

.app-info {
  position: absolute;
  z-index: 6;
  top: 32%;
  width: 32%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transform: translateY(-50%);
}

.text-left .app-info { left: 7%; }
.text-right .app-info { left: 63%; }

.app-icon {
  width: 88px;
  height: 88px;
  filter: drop-shadow(0 10px 20px color-mix(in oklab, var(--accent) 35%, transparent));
}

.app h2 {
  margin: 22px 0 0;
  font-weight: 600;
  font-size: clamp(36px, 4.2vw, 56px);
  line-height: 1.05;
  letter-spacing: -.02em;
}

.app-info p {
  margin: 12px 0 0;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.45;
  color: var(--ink-soft);
}

.store,
.soon {
  position: relative;
  z-index: 6;
  margin-top: 28px;
}

.store img { height: 44px; width: auto; }

.soon {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
  background: color-mix(in oklab, var(--accent) 8%, var(--paper));
  color: color-mix(in oklab, var(--accent) 78%, var(--ink));
  font-size: 15px;
  font-weight: 600;
}

/* Scenes */

.scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1440 / calc(720 - var(--top));
  container-type: inline-size;
}

.scene-bg,
.scene-fg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.scene-fg {
  z-index: 5;
  pointer-events: none;
}

.device {
  position: absolute;
  left: calc(var(--x) / 14.4 * 1cqw);
  top: calc((var(--y) - var(--top)) / 14.4 * 1cqw);
  width: calc(var(--w) / 14.4 * 1cqw);
  height: auto;
  filter: drop-shadow(0 24px 28px rgba(30, 20, 60, .3));
  transition:
    opacity .8s ease calc(var(--d) * .12s),
    transform 1s cubic-bezier(.2, .8, .2, 1) calc(var(--d) * .12s);
}

.js .scene:not(.open) .device {
  opacity: 0;
  transform: translateY(48px);
}

.app {
  --t1: color-mix(in oklab, var(--accent) 16%, var(--paper));
  --t2: color-mix(in oklab, var(--accent) 28%, var(--paper));
  --t3: color-mix(in oklab, var(--accent) 46%, var(--paper));
  --t4: color-mix(in oklab, var(--accent) 70%, #231B45);
}

.t1 { fill: var(--t1); }
.t2 { fill: var(--t2); }
.t3 { fill: var(--t3); }
.ac { fill: var(--accent); }

.shine {
  fill: none;
  stroke: #fff;
  stroke-opacity: .55;
  stroke-width: 3;
}

@media (prefers-color-scheme: dark) {
  .shine { stroke-opacity: .18; }
  .ripple path { stroke-opacity: .25; }
}

/* Reader */
.branch path { fill: none; stroke: #6B4456; stroke-linecap: round; }
.bl { fill: #FFF4F8; stroke: color-mix(in oklab, var(--accent) 35%, #fff); stroke-width: .8; }
.bl-c { fill: var(--accent); }
.petals { fill: color-mix(in oklab, var(--accent) 30%, #fff); }

/* Libretto */
.ripple path { stroke: #fff; stroke-opacity: .6; stroke-width: 3; stroke-linecap: round; }
.cr-w { fill: #fff; }
.cr-s { fill: color-mix(in oklab, var(--accent) 40%, #fff); }

/* Dazzle */
.scene-dazzle .sun { fill: color-mix(in oklab, var(--accent) 40%, #FFE6C2); }
.cloud { fill: #fff; opacity: .7; }
.waves use { fill: var(--t3); stroke: #fff; stroke-width: 3; }

/* Easel */
.scene-easel .stroke {
  fill: none;
  stroke: var(--accent);
  stroke-opacity: .18;
  stroke-width: 90;
  stroke-linecap: round;
}
.wood path { fill: none; stroke: #8A6A55; stroke-linecap: round; }
.wood-fill { fill: #8A6A55; }
.palette { fill: #F3E4D0; stroke: #B48F6E; stroke-width: 4; }
.hole { fill: var(--tint); stroke: #B48F6E; stroke-width: 4; }

/* Timesheet */
.arc {
  fill: none;
  stroke: var(--accent);
  stroke-opacity: .5;
  stroke-width: 4;
  stroke-dasharray: 2 14;
  stroke-linecap: round;
}
.sun-noon { fill: #FFD27A; }

/* Funds */
.snow { fill: #fff; }
.flag path:first-child { stroke: var(--t4); stroke-linecap: round; }

@media (max-width: 899px) {
  .app-info {
    position: static;
    width: auto;
    align-items: center;
    padding: 48px 24px 0;
    text-align: center;
    transform: none;
  }
  .app-icon { width: 76px; height: 76px; }
  .scene {
    /* scale the scene so its devices fill most of the width, centred */
    --sw: min(calc(var(--k) * 100%), 1500px);
    width: var(--sw);
    margin-left: calc(50% - var(--fx) * var(--sw) / 1440);
  }
}

@media (max-width: 700px) {
  /* a shorter header without the icon row, so the first app peeks in */
  .hero { min-height: max(64svh, 480px); }
  .hero-content { padding-top: clamp(64px, 11vh, 96px); }
  .hero-apps { display: none; }
}

/* Footer */

.footer {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 24px 56px;
  background: var(--night);
  color: rgba(255, 255, 255, .6);
  font-size: 14px;
  text-align: center;
}

.footer .ridge { fill: var(--night); }

.footer p { margin: 0; }

.footer-links {
  display: flex;
  gap: 20px;
}

.footer a {
  color: rgba(255, 255, 255, .8);
  text-decoration: none;
}

.footer a:hover { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero .mist { animation: none; }
  .hero-apps span { transition: none; }
  .device { transition: none; }
}
