/* The landing page (welcome.html), for visitors who are not logged in. One screen: a navy stage
   with the looping video of the app on the left, the name and the two ways in on the right, all
   centred in their column. On narrow screens the halves stack: the words and buttons first, then
   the video. */
@import url('/fonts/fonts.css');

:root {
  color-scheme: light;
  --navy: #09152b;
  --navy-lift: #13234a;
  --slate: #2d3a52;
  --purple: #4f38e0;
  --purple-deep: #3826c0;
  --purple-pale: #f1eeff;
  --gold: #f2c94c;
  --cream: #f4f1ec;
  --cream-light: #faf7f2;
  --ink-soft: #4a5568;
  --font-body: 'Figtree', 'Bodhi Symbols', 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Fraunces', 'Bodhi Symbols', Georgia, 'Times New Roman', serif;
  --gutter: clamp(32px, 6vw, 112px);
  --frame-radius: 26px;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body.welcome {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--navy);
  background: var(--cream);
}

/* ---------- The words and the two ways in ---------- */
.hero-copy {
  padding: 40px 20px 36px;
}
/* The logo, the name, the line and the buttons form one block, centred in its column, and
   everything in it is centred too. */
.hero-block {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  text-align: center;
}
.hero-mark {
  display: block;
  width: 120px;
  height: auto;
  margin: 0 auto 26px;
}
.hero-copy h1 {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.25rem, 1.6rem + 4.2vw, 6.25rem);
  line-height: 0.96;
  letter-spacing: -0.012em;
  color: var(--navy);
}
/* The wordmark's own colouring, as in the header of every page: "Bank" on its own line. */
.hero-bank {
  display: block;
  color: var(--purple);
}
/* One sentence a line (welcome.html). */
.hero-line > span {
  display: block;
}
.hero-line {
  max-width: 25em;
  margin: 0 auto;
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.375rem);
  line-height: 1.55;
  color: var(--slate);
  text-wrap: pretty;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9.5rem;
  min-height: 54px;
  padding: 12px 28px;
  border-radius: 12px;
  border: 2px solid transparent;
  font: 700 18px/1.2 var(--font-body);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.hero-btn.primary {
  background: var(--purple);
  border-color: var(--purple);
  color: #ffffff;
  box-shadow: 0 2px 0 var(--purple-deep), 0 14px 28px -14px rgba(79, 56, 224, 0.7);
}
.hero-btn.primary:hover {
  background: var(--purple-deep);
  border-color: var(--purple-deep);
}
.hero-btn.secondary {
  background: transparent;
  border-color: var(--navy);
  color: var(--navy);
}
.hero-btn.secondary:hover {
  background: var(--cream-light);
  border-color: var(--purple-deep);
  color: var(--purple-deep);
}
.hero-btn:active {
  transform: translateY(1px);
}
a:focus-visible,
.hero-btn:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
}

/* ---------- The stage: the video on a fanned pack of pages ---------- */
.hero-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 56px 16px 64px;
  overflow: hidden;
  isolation: isolate;
  background: var(--navy);
}
/* A soft purple and gold light behind the pack, and a faint dot grid like squared paper. */
.hero-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(42% 36% at 46% 52%, rgba(79, 56, 224, 0.55), rgba(79, 56, 224, 0) 100%),
    radial-gradient(30% 26% at 62% 70%, rgba(242, 201, 76, 0.2), rgba(242, 201, 76, 0) 100%),
    radial-gradient(60% 60% at 50% 50%, var(--navy-lift), var(--navy) 100%);
}
.hero-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1.6px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(70% 62% at 50% 50%, #000 0%, transparent 100%);
  mask-image: radial-gradient(70% 62% at 50% 50%, #000 0%, transparent 100%);
}
.hero-pack {
  position: relative;
  width: min(86%, 340px); /* room for the pages fanned out behind it */
  aspect-ratio: 4 / 5;
}
/* Two pages of the pack, fanned out behind the screen. */
.hero-pack::before,
.hero-pack::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--frame-radius);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.55);
}
.hero-pack::before {
  background: var(--gold);
  transform: translate(-5%, 2.5%) rotate(-6deg);
}
.hero-pack::after {
  background: var(--cream-light);
  transform: translate(4%, 1.5%) rotate(4deg);
}
.hero-video {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--frame-radius);
  /* The first frame, tiny and blurred, under the poster: shown from the first paint, so the card is
     never blank while the poster and the video are still on their way (record-hero.cjs writes it). */
  background: var(--cream-light) url('data:image/webp;base64,UklGRpQCAABXRUJQVlA4IIgCAADQDgCdASpAAFAAPu1mqU6ppaOiMZRqqTAdiWcA1JG/NoD2q36iCd7jDa+8umh8Cf8kDlMxIjwmS8ENdVCc8IqH4n/GsI9kEXomkTxGMMXZNimsEMqsNmZ2ACqM9pnSHnPy5Yba4HuLYuO7J9MDj5VsXi0NEZ3B8artHUgKRfEAAP7w0ZAvSYuYW/4LTizIlfDUUTwUITcL3fGqem7Y2SIZNDPDdnIkdWmiizBuOyDUTyZYx9hnHNwl4VBBeJURXXU+9a7iNrc7Gasl7gV5hVb4ERbJdfzT3lOgvI1MEHeB0QYoKMJO3gRZ6AOhsi4e0+7yeTl2T6wyTU2GJgGUJh6uH7atFvpPqsi6/+JBM1MZf4wTTUFlBi8VXA1yHShDp1A2E7lz+6SxePvI/ZFegfQRf/suxeoJNleCeaNpWHhAeopvz0N16ozT0ZQy/sgT4oUe6pq2RlNYAs5Ke/QoadCvfwtSi76PiT/ZLxhi3ksbAZYf/Ol1AxEHlMrQbYR0l8rkCZqSJuh/sCg07D5UxZeHD19ET0bW0wKHSFN2PV+JXVMjtAtzGNs17FVHBjcZiyXwN/DLWk4AXE/0nQgfoPSHdJwi24jX1u1qPKcVgjQQ80DMwO0XAZCn16Et59CCzyfY3wXWkwN1ZIF4YAKBQ+Nxmk4CTdvICq8hLG7bIZNOs2VfZ9BSf64TJKNmUonwE/bDuOZfiBu/OkERbau6CKr7QbZEpWLGQ/Usn02Dla+sxUCeZV8+6M5+sEHbXV3WsdoYp0WBn8ploNfXrBXpfw5plXD7OpA947Cr2S+eInj6oQqBAAFmYreGE2WU0po5cyDWz8bj6rSMjd28QL7TR8O8SyWx1yuAAAA=') center / cover no-repeat;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    0 2px 6px rgba(0, 0, 0, 0.25),
    0 40px 80px -24px rgba(0, 0, 0, 0.7),
    0 0 90px -10px rgba(79, 56, 224, 0.55);
}
/* For a moment on returning to the page (welcome.js), so the video is drawn again at its size. */
.hero-video.hero-video-reset {
  display: none;
}
.hero-toggle {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(9, 21, 43, 0.82);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(9, 21, 43, 0.35);
  transition: background-color 0.15s ease;
}
.hero-toggle:hover {
  background: var(--navy);
}
/* Two rings, white then purple, so the focus shows on the dark button and on the white page behind. */
.hero-toggle:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 0;
  box-shadow: 0 0 0 6px var(--purple);
}
.hero-toggle[hidden] {
  display: none;
}
.hero-toggle[data-state='playing'] .icon-play,
.hero-toggle[data-state='paused'] .icon-pause {
  display: none;
}

/* ---------- Footer ---------- */
.hero-foot {
  padding: 22px 20px 28px;
  font-size: 15px;
  text-align: center;
  color: var(--ink-soft);
}
.hero-foot a {
  color: var(--purple-deep);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.hero-foot a:hover {
  color: var(--navy);
  text-decoration-thickness: 2px;
}

/* ---------- Tablets in portrait: still stacked, with more room ---------- */
@media (min-width: 600px) and (max-width: 959px) {
  .hero-copy {
    padding: 64px 48px 48px;
  }
  .hero-stage {
    padding: 72px 48px 80px;
  }
  .hero-pack {
    width: min(86%, 440px);
  }
  .hero-foot {
    padding: 24px 48px 32px;
  }
}

/* ---------- Two halves ---------- */
@media (min-width: 960px) {
  body.welcome {
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .hero-stage {
    grid-column: 1;
    grid-row: 1 / span 2;
    padding: clamp(40px, 7vh, 80px) clamp(56px, 6vw, 112px);
  }
  .hero-copy {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    padding: 56px var(--gutter) 24px;
  }
  .hero-foot {
    grid-column: 2;
    grid-row: 2;
    padding: 0 var(--gutter) 32px;
  }
  .hero-mark {
    width: 168px;
    margin-bottom: 30px;
  }
  .hero-pack {
    width: min(100%, calc(min(76vh, 780px) * 0.8));
    width: min(100%, calc(min(76svh, 780px) * 0.8));
  }
  .hero-toggle {
    right: 18px;
    bottom: 18px;
  }
}

/* The smallest phones (320 px): a smaller logo and closer lines keep both buttons on the first
   screen, even while the opening lifts them into place. */
@media (max-width: 359px) {
  .hero-mark {
    width: 92px;
    margin-bottom: 18px;
  }
  .hero-copy h1 {
    margin-bottom: 14px;
  }
  .hero-actions {
    margin-top: 24px;
  }
}
/* Phones: the buttons share the width. */
@media (max-width: 479px) {
  .hero-actions .hero-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 12px 16px;
  }
}

/* One moment of motion: the pages fan out from behind the screen as the page opens. */
.hero-the {
  display: block;
}
/* Opening: the logo, each line of the name, the line below it and the buttons float up and fade in
   gently, one after another (about 2 s in all), once welcome-intro.js has seen the fonts and the logo
   ready. No motion for people who ask for less, and nothing is ever hidden if the script does not run
   (it adds intro-wait itself). */
@media (prefers-reduced-motion: no-preference) {
  .intro-wait :is(.hero-mark, .hero-the, .hero-bank, .hero-line, .hero-actions) {
    opacity: 0;
  }
  .intro-go :is(.hero-mark, .hero-the, .hero-bank, .hero-line, .hero-actions) {
    animation: float-in 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .intro-go .hero-the {
    animation-delay: 0.18s;
  }
  .intro-go .hero-bank {
    animation-delay: 0.34s;
  }
  .intro-go .hero-line {
    animation-delay: 0.52s;
  }
  .intro-go .hero-actions {
    animation-delay: 0.72s;
  }
}
@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-pack::before {
    animation: fan-gold 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s both;
  }
  .hero-pack::after {
    animation: fan-cream 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s both;
  }
}
@keyframes fan-gold {
  from {
    transform: none;
  }
}
@keyframes fan-cream {
  from {
    transform: none;
  }
}
