/* IntroStory landing page. Values follow the IntroStory Brand Style Guide v1.0. */
:root {
  --dark: #121C4D;
  --bright: #54C0E8;
  --white: #FFFFFF;
  --orange: #FF8F1C;
  --bright-15: #E5F6FC;
  --dark-70: #596082;
  --dark-10: #E7E8ED;
  --error: #B3261E;
  --headline: indivisible, "Noto Sans", Arial, sans-serif;
  --body: "Noto Sans", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--white);
  color: var(--dark);
  font: 400 16px/1.6 var(--body);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { font-family: var(--headline); font-weight: 600; margin: 0 0 24px; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 24px; line-height: 1.2; }
h3 { font-size: 20px; line-height: 1.3; }
p { margin: 0 0 16px; }
a { color: var(--dark); text-decoration: underline; }

.wrap { max-width: 1248px; margin: 0 auto; padding: 0 24px; }
.wrap--narrow { max-width: 816px; }

.button {
  display: inline-block;
  padding: 12px 24px;
  border: 0;
  border-radius: 8px;
  background: var(--bright);
  color: var(--dark);
  font: 600 16px/1 var(--body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .3s ease, color .3s ease;
}
.button:hover { background: var(--dark); color: var(--white); }
.button:focus-visible { outline: 2px solid var(--dark); outline-offset: 2px; }
.button:disabled { background: var(--dark-10); color: var(--dark-70); cursor: default; }

/* Header, video, and description */
.hero { background: var(--dark); color: var(--white); padding-bottom: 48px; }
.hero__bar { padding-top: 24px; padding-bottom: 24px; }
.brand { display: inline-block; }
.brand img { display: block; height: 40px; width: auto; }
.hero__grid { display: grid; gap: 32px; }
/* Video: a muted looping preview in the page. Play opens the same player large, over a darkened page. */
.player { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; }
/* the empty slot left in the page while the video is open large */
.player.is-open { background: rgba(255, 255, 255, .08); }
.player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--dark);
}
.player__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  width: 100%;
  padding: 16px;
  border: 0;
  border-radius: 12px;
  background: none;
  cursor: pointer;
}
.player__pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 8px;
  border-radius: 24px;
  background: var(--dark);
  color: var(--white);
  font: 600 16px/1 var(--body);
  transition: background-color .3s ease, color .3s ease;
}
.player__pill svg { flex: none; }
.player__play:hover .player__pill { background: var(--white); color: var(--dark); }
.player__play:focus-visible { outline: 2px solid var(--bright); outline-offset: 2px; }
.player__backdrop, .player__close { display: none; }

.player.is-open .player__play { display: none; }
.player.is-open .player__backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(18, 28, 77, .88);
}
.player.is-open iframe {
  position: fixed;
  inset: auto;
  top: 50%;
  left: 50%;
  z-index: 101;
  width: min(80vw, calc(80vh * 16 / 9));
  height: auto;
  aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}
.player.is-open .player__close {
  display: flex;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 102;
  padding: 8px;
  border: 2px solid var(--white);
  border-radius: 8px;
  background: none;
  color: var(--white);
  cursor: pointer;
}
.player__close:hover { background: var(--white); color: var(--dark); }
.player__close:focus-visible { outline: 2px solid var(--bright); outline-offset: 2px; }
body.modal-open { overflow: hidden; }
.hero__text p { margin-bottom: 24px; }
/* On Dark the primary button keeps its Bright fill; hover inverts to white so it stays visible. */
.hero .button { line-height: 1.3; }
.hero .button:hover { background: var(--white); color: var(--dark); }
.hero .button:focus-visible { outline-color: var(--white); }
/* The straight Orange underline from the video. A graphic, so the text keeps its color. */
.underline {
  font-style: italic;
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.2em;
  text-decoration-skip-ink: none;
}

/* How it works: the three step cards from the video, linked by the Bright thread */
.how { padding: 64px 0; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; position: relative; }
.step {
  position: relative;
  background: var(--white);
  border: 2px solid var(--dark-10);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}
.step__label { color: var(--dark-70); font-weight: 600; font-size: 14px; line-height: 1.5; letter-spacing: .04em; margin-bottom: 16px; }
.step__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--bright-15);
  color: var(--dark);
}
.step h3 { margin: 0; }

/* Step icons play in turn on one 3.5 s cycle: the pencil scribbles, the check stamps in, the play button pulses.
   The pencil and check are their own svg layered over the icon; animating a path inside an svg renders it blurry. */
.step__icon { position: relative; }
.ic-pencil, .ic-check { position: absolute; top: 24px; left: 24px; }
.ic-pencil, .ic-check, .ic-play { animation: 3.5s ease-in-out infinite; }
.ic-pencil { transform-origin: 56% 74%; animation-name: scribble; }
.ic-check { transform-origin: 50% 62.5%; animation-name: stamp; }
.ic-play { animation-name: pulse; }
@keyframes scribble {
  0%, 24%, 100% { transform: none; }
  4% { transform: translate(-4px, 2px) rotate(-8deg); }
  8% { transform: translate(2px, -1px) rotate(5deg); }
  12% { transform: translate(-3px, 2px) rotate(-7deg); }
  16% { transform: translate(3px, 0) rotate(4deg); }
  20% { transform: translate(-1px, 1px) rotate(-3deg); }
}
@keyframes stamp {
  0%, 30% { opacity: 1; transform: none; }
  34% { opacity: 0; transform: none; }
  35% { opacity: 0; transform: scale(2.6); }
  43% { opacity: 1; transform: scale(.85); }
  47%, 100% { opacity: 1; transform: none; }
}
@keyframes pulse {
  0%, 60%, 74%, 88%, 100% { transform: none; }
  67%, 81% { transform: scale(1.15); }
}

/* Closed beta */
.beta { background: var(--bright-15); padding: 64px 0; scroll-margin-top: 0; }
.beta__grid { display: grid; gap: 32px; }
.beta__lead p { max-width: 44ch; }
.card { background: var(--white); border-radius: 12px; padding: 24px; }

/* The storefront from the video. On arrival the thread traces its outline, then the shop builds. */
/* centered in the left column */
.shop { position: relative; max-width: 400px; margin: 32px auto 0; }
.shop svg { display: block; width: 100%; height: auto; }
.shop__trace { position: absolute; inset: 0; }
.shop__trace path { fill: none; stroke: var(--bright); stroke-width: 8; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.shop.will-animate .shop__build { opacity: 0; }
.shop.is-in .shop__trace path { animation: trace .7s ease-in-out forwards, trace-out .3s ease 1s forwards; }
.shop.is-in .shop__build { animation: shop-in .5s ease-out .8s forwards; }
@keyframes trace { to { stroke-dashoffset: 0; } }
@keyframes trace-out { to { stroke-opacity: 0; } }
@keyframes shop-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.field { margin-bottom: 24px; }
.field label { display: block; font-weight: 600; font-size: 14px; line-height: 1.5; margin-bottom: 8px; }
.optional { font-weight: 400; color: var(--dark-70); }
.field input, .field textarea {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--dark-70);
  border-radius: 8px;
  background: var(--white);
  color: var(--dark);
  font: 400 16px/1.5 var(--body);
}
.field textarea { resize: vertical; }
.field ::placeholder { color: var(--dark-70); opacity: 1; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--dark); outline-offset: 0; }
.field--error input, .field--error textarea { border-color: var(--error); }
.field__error { color: var(--error); font-size: 14px; line-height: 1.5; margin: 8px 0 0; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice { border-radius: 8px; padding: 16px; margin-bottom: 24px; }
.notice--ok { background: var(--bright-15); }
.notice--ok.is-final { margin-bottom: 0; }
.notice--error { border: 1px solid var(--error); color: var(--error); }

/* Questions and answers */
.faq { padding: 64px 0; }
.qa { border-bottom: 2px solid var(--dark-10); }
.qa:first-of-type { border-top: 2px solid var(--dark-10); }
.qa summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  font: 600 20px/1.3 var(--headline);
  cursor: pointer;
  list-style: none;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border-right: 2px solid var(--dark);
  border-bottom: 2px solid var(--dark);
  transform: translateY(-3px) rotate(45deg);
  transition: transform .3s ease;
}
.qa[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.qa summary:focus-visible { outline: 2px solid var(--dark); outline-offset: 2px; }
.qa p { max-width: 70ch; margin: 0 0 24px; }
.qa ul { max-width: 70ch; margin: 0 0 24px; padding-left: 24px; }
.qa li { margin-bottom: 8px; }

/* Footer */
.foot { background: var(--dark); color: var(--white); padding: 32px 0; font-size: 14px; line-height: 1.5; }
.foot__inner { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; }
.foot p { margin: 0; }
/* 140 px is the smallest the wide logo may be shown */
.foot__logo { display: block; width: 140px; height: auto; }
.foot a { color: var(--bright); }
.foot a:focus-visible { outline: 2px solid var(--bright); outline-offset: 2px; }
.social { list-style: none; display: flex; gap: 8px; margin: 0 0 0 auto; padding: 0; }
.social a { display: flex; padding: 8px; border-radius: 8px; transition: color .3s ease; }
.social a:hover { color: var(--white); }

@media (min-width: 768px) {
  body { font-size: 18px; }
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  .hero { padding-bottom: 64px; }
  .how, .faq { padding: 80px 0; }
  .beta { padding: 80px 0; }
  .card { padding: 32px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  /* the thread runs behind the cards at icon height and shows in the gaps */
  .steps::before {
    content: "";
    position: absolute;
    left: 16.66%;
    right: 16.66%;
    top: 117px;
    height: 4px;
    background: var(--bright);
  }
  .step { padding: 32px 24px; }
}

@media (min-width: 1024px) {
  .hero__grid { grid-template-columns: 3fr 2fr; gap: 48px; align-items: center; }
  .beta__grid { grid-template-columns: 5fr 6fr; gap: 64px; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .qa summary::after, .social a, .player__pill { transition: none; }
  .ic-pencil, .ic-check, .ic-play { animation: none; }
}
