/* Tokens and art match the Rounds app (frontend/src/index.css). Light only, as in the app. */
:root {
  --font-sans: "Hanken Grotesk", system-ui, sans-serif;
  --font-serif: "Newsreader", Georgia, serif;
  --ink: #191f5c;
  --ink-soft: #3a4282;
  --muted: #646b9e;
  --line: #e2e5f3;
  --paper: #fdfbf8;
  --sheet: rgb(255 255 255 / 0.9);
  --select: #d9defa;
  --shadow-lift: 0 1px 2px rgb(25 31 92 / 0.06), 0 16px 36px -20px rgb(25 31 92 / 0.42);
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--select);
}

h1,
h2,
h3,
p,
ol {
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Hero on the app's watercolor world, with the Welcome screen's soft paper glow behind the words.
   On narrow screens the painting fades into the paper below it. */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 56px 16px 120px;
  text-align: center;
  background:
    linear-gradient(to bottom, transparent 70%, var(--paper) calc(100% - 6px)),
    url("assets/world.jpg") center / cover no-repeat;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 55% at 50% 50%, rgba(255, 253, 250, 0.9), rgba(255, 253, 250, 0.5) 60%, transparent 85%);
}

.hero > * {
  position: relative;
}

/* "Rounds" with the dawn disc standing in for the o, as in the app. */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  font-size: clamp(64px, 16vw, 96px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
}

.disc {
  width: 0.56em;
  height: 0.56em;
  margin: 0 0.02em;
  flex-shrink: 0;
  align-self: baseline;
  transform: translateY(0.02em);
}

.tagline {
  max-width: 24ch;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.4px;
  text-wrap: balance;
}

.award {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-shadow: 0 0 6px #fff, 0 0 12px #fff, 0 0 20px rgb(255 255 255 / 0.9);
  text-wrap: balance;
}

/* The translucent sheet the app's screens sit on. */
.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: calc(100% - 32px);
  max-width: 1120px;
  margin: -80px auto 32px;
  padding: 16px;
}

/* Content-box sizing keeps the picture itself at 16:9 inside the white border, so no black bars show. */
.demo video {
  display: block;
  box-sizing: content-box;
  width: calc(100% - 24px);
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 18px;
  border: 12px solid #fff;
  background: #000;
  box-shadow: var(--shadow-lift);
}

.demo video:fullscreen {
  object-fit: contain;
}

.steps {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
}

/* Same card as the Welcome screen's role cards, compacted to one row. */
.card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgb(125 143 230 / 0.4);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px -34px rgba(25, 31, 92, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* Step number on a disc of the sky painting, like the role card icons. */
.num {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.7), transparent 60%), url("assets/bloom.jpg") 30% 20% / 500% auto;
  color: #1f2a9c;
  font-size: 19px;
  line-height: 1;
}

h3 {
  font-size: 19px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.2px;
}

.card p {
  margin-top: 2px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink-soft);
}


footer {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-shadow: 0 0 6px #fff, 0 0 12px #fff;
  text-align: center;
}

a {
  color: #4a5fd9;
}

/* Closing call to action on the same white card as the steps: the heading, a welcome under it,
   then the button on its own line. */
.contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 16px 22px;
  border: 1px solid rgb(125 143 230 / 0.4);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px -34px rgba(25, 31, 92, 0.45);
  text-align: center;
}

.contact h2 {
  font-size: 26px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.3px;
}

.contact p {
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink-soft);
  text-wrap: balance;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow-lift);
  transition: transform 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
}

.cta:hover {
  background: #2a3290;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgb(25 31 92 / 0.08), 0 20px 40px -18px rgb(25 31 92 / 0.55);
}

.cta:active {
  transform: translateY(0);
}

.cta:focus-visible {
  outline: 3px solid #7d8fe6;
  outline-offset: 3px;
}

/* On phones the heading already says what the button is for, so just the address fits on one line. */
@media (max-width: 479px) {
  .cta-lead {
    display: none;
  }
}

.cta .arrow {
  transition: transform 200ms ease;
}

.cta:hover .arrow {
  transform: translateX(3px);
}

/* Motion: each piece rises into place in reading order on load, the hill in the disc rises
   like dawn, and cards lift a little under the pointer. Fill is backwards-only so the hover
   transforms still apply once the entrance has played. */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes dawn {
  from {
    transform: translateY(18px);
  }
}

.reveal {
  animation: rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0ms) backwards;
}

.disc path {
  animation: dawn 1400ms cubic-bezier(0.2, 0.7, 0.2, 1) 150ms backwards;
}

.card {
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgb(125 143 230 / 0.7);
  box-shadow: 0 28px 60px -30px rgba(25, 31, 92, 0.55);
}

.num {
  transition: transform 300ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.card:hover .num {
  transform: scale(1.08);
}

/* Phones and tablets scroll, so below the fold things rise as they come into view instead. */
@supports (animation-timeline: view()) {
  @media (max-width: 1023px) {
    .sheet .reveal {
      animation: rise linear backwards;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Desktop: one screen, no scrolling. The painting fills the window, and the video takes
   whatever height is left after the hero, the steps and the footer. */
@media (min-width: 1024px) {
  body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    /* One spacing step for every main gap; on tall windows the page sits centered and the
       leftover height goes to the top and bottom edges. */
    --space: clamp(10px, 2vh, 24px);
    justify-content: center;
    /* A soft paper glow under the steps keeps the text readable over the painted trees. */
    background:
      radial-gradient(ellipse 52% 26% at 50% 88%, rgba(253, 251, 248, 0.95), rgba(253, 251, 248, 0.75) 55%, transparent 100%),
      var(--paper) url("assets/world.jpg") center / cover no-repeat;
  }

  .hero {
    flex: none;
    gap: 6px;
    padding: var(--space) 16px 0;
    background: none;
  }

  .wordmark {
    font-size: clamp(44px, min(4.5vw, 6.5vh), 60px);
  }

  .tagline {
    max-width: none;
    font-size: clamp(22px, min(2.2vw, 3.6vh), 32px);
  }

  .sheet {
    flex: 0 1 auto;
    min-height: 0;
    gap: var(--space);
    margin: 0 auto;
    padding: var(--space) 20px;
  }

  /* As tall as the widest frame the sheet allows; on shorter windows it gives up height first. */
  .demo {
    flex: 0 1 auto;
    min-height: 0;
    height: calc((min(100vw - 32px, 1120px) - 64px) * 9 / 16 + 24px);
    display: flex;
    align-items: center;
    justify-content: center;
    container-type: size;
  }

  /* The largest 16:9 frame that fits the space left over. */
  .demo video {
    width: min(100cqw - 24px, (100cqh - 24px) * 16 / 9);
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }


  /* On desktop the contact card is one slim row, so the video keeps the height. */
  .contact {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 24px;
    row-gap: 2px;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 10px 12px 10px 22px;
    text-align: left;
  }

  .contact h2 {
    font-size: 20px;
  }

  .contact p {
    grid-column: 1;
    font-size: 15px;
    white-space: nowrap;
  }

  .cta {
    grid-column: 2;
    grid-row: 1 / 3;
    padding: 9px 18px;
    font-size: 15px;
  }

  .cta-lead {
    display: none;
  }
}
