/* Appyverse website.
   Colour lives only in the Appies (tiles); the page itself is sky paper and ink. */
:root {
  --sky: #EEF3FA;
  --sky-deep: #DFE8F4;
  --ink: #16224A;
  --ink-soft: #46527A;
  --line: #C9D4E6;
  --white: #FFFFFF;
  --marigold: #F0A92E;
  --teal: #138A78;
  --teal-dark: #0E6E60;
  --plum: #7B4FB0;
  --leaf: #4E9F45;

  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Type scale: 1.25 ratio from an 18px body */
  --step--1: 0.889rem;
  --step-0: 1.125rem;
  --step-1: 1.406rem;
  --step-2: 1.758rem;
  --step-3: clamp(1.9rem, 1.4rem + 2vw, 2.75rem);
  --step-4: clamp(2.3rem, 1.3rem + 3.2vw, 3.7rem);

  --gutter: clamp(16px, 4vw, 40px);
  --radius-window: 18px;
  --radius-tile: 22%;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--display); color: var(--ink); margin: 0; }
h1 { font-size: var(--step-4); line-height: 1.02; font-weight: 800; letter-spacing: -0.025em; font-variation-settings: "opsz" 96; }
h2 { font-size: var(--step-3); line-height: 1.1; font-weight: 700; letter-spacing: -0.015em; max-width: 22ch; }
h3 { font-size: var(--step-1); line-height: 1.2; font-weight: 700; }
p { margin: 0; }
a { color: var(--teal-dark); text-underline-offset: 3px; }

:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1160px, 100%); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: 10px;
}
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header { padding-block: 22px; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.01em; }
.brand-mark { width: 32px; height: 32px; }
.site-nav { display: flex; align-items: center; gap: clamp(12px, 2.5vw, 28px); }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: var(--step--1); }
.site-nav a:hover { text-decoration: underline; }
.site-nav .nav-download { color: var(--white); background: var(--ink); padding: 9px 16px; border-radius: 999px; }
.site-nav .nav-download:hover { background: #24326A; text-decoration: none; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(32px, 6vw, 72px) clamp(56px, 8vw, 104px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-copy h1 .line { display: block; text-wrap: balance; }
.lede { margin-top: 24px; font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); max-width: 36ch; }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.hero-note { color: var(--ink-soft); font-size: var(--step--1); }

.button {
  display: inline-block; text-decoration: none; font-weight: 700;
  background: var(--teal); color: var(--white);
  padding: 15px 26px; border-radius: 14px; font-size: var(--step-0);
  box-shadow: 0 2px 0 var(--teal-dark);
}
.button:hover { background: var(--teal-dark); }
.button:active { transform: translateY(1px); box-shadow: none; }

/* The demo window: the one orchestrated motion on the page */
.demo { margin: 0; }
.demo figcaption { margin-top: 14px; color: var(--ink-soft); font-size: var(--step--1); }
.window {
  background: var(--white);
  border-radius: var(--radius-window);
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(22, 34, 74, 0.35), 0 2px 0 var(--sky-deep);
  overflow: hidden;
}
.window-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; background: var(--sky-deep); font-size: var(--step--1); color: var(--ink-soft); }
.window-bar i { width: 11px; height: 11px; border-radius: 50%; background: #C3CDE0; }
.window-bar span { margin-left: 8px; font-weight: 700; }
.window-body { padding: 20px; display: grid; gap: 16px; }

.request { background: var(--sky); border-radius: 14px 14px 14px 4px; padding: 14px 16px; }
.request-text { font-size: 1rem; line-height: 1.5; min-height: 4.5em; }
.caret { display: inline-block; width: 2px; height: 1.1em; vertical-align: -0.18em; background: var(--ink); margin-left: 2px; opacity: 0; }
.is-typing .caret { opacity: 1; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.progress { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--step--1); color: var(--ink-soft); }
.progress li { display: flex; align-items: center; gap: 10px; }
.progress li::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid var(--line); background: var(--white);
}
.progress li.done { color: var(--ink); }
.progress li.done::before { border-color: var(--teal); background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; }
.progress li.active::before { border-color: var(--teal); border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.appy { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.appy-head { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.1rem; }
.appy-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--tile); color: var(--white); display: grid; place-items: center; }
.appy-icon svg { width: 20px; height: 20px; }
.appy-search { border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; font-size: var(--step--1); color: #8592B5; }
.appy-list { list-style: none; margin: 0; padding: 0; font-size: 0.98rem; }
.appy-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 8px 2px; border-top: 1px solid var(--sky-deep); }
.appy-list em { font-style: normal; color: var(--ink-soft); font-size: var(--step--1); }
.appy-list b { color: #D9485F; font-weight: 400; }
.appy-list b.off { color: var(--line); }

/* Animation states — only applied when JS runs and motion is allowed */
.js-animate .progress li:not(.done):not(.active) { opacity: .55; }
.js-animate .appy { opacity: 0; transform: translateY(10px) scale(.98); transition: opacity .5s ease, transform .5s cubic-bezier(.2,.8,.2,1); }
.js-animate .appy.shown { opacity: 1; transform: none; }

/* ---------- Shelf ---------- */
.shelf-section { padding-block: clamp(56px, 8vw, 96px); background: var(--white); }
.section-lede { margin-top: 14px; color: var(--ink-soft); max-width: 62ch; text-wrap: pretty; }
.shelf { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px clamp(24px, 4vw, 56px); }
.shelf li { display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto 1fr; column-gap: 18px; row-gap: 6px; align-items: start; }
.tile {
  grid-row: span 2; width: 64px; height: 64px; border-radius: var(--radius-tile);
  background: var(--tile); color: var(--white); display: grid; place-items: center;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.12);
}
.tile svg { width: 32px; height: 32px; }
.shelf h3 { font-size: var(--step-1); align-self: end; }
.shelf p { color: var(--ink-soft); font-size: 1rem; max-width: 34ch; }

/* ---------- How it works (a real sequence) ---------- */
.how { padding-block: clamp(64px, 9vw, 112px); }
.steps { list-style: none; counter-reset: step; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(24px, 3vw, 40px); }
.steps li { counter-increment: step; border-top: 3px solid var(--ink); padding-top: 18px; }
.steps li::before {
  content: counter(step);
  display: block; font-family: var(--display); font-weight: 800; font-size: 3.2rem; line-height: 1;
  color: var(--ink); margin-bottom: 14px; font-variation-settings: "opsz" 96;
}
.steps h3 { margin-bottom: 8px; }
.steps p { color: var(--ink-soft); font-size: 1rem; }

/* ---------- Safety ---------- */
.safety { padding-block: clamp(64px, 9vw, 112px); background: var(--ink); color: #DCE3F2; }
.safety h2 { color: var(--white); }
.safety-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.promises { margin: 0; display: grid; gap: 30px; }
.promises dt { font-family: var(--display); font-weight: 700; font-size: var(--step-1); color: var(--white); margin-bottom: 6px; }
.promises dd { margin: 0; max-width: 54ch; }
.safety :focus-visible { outline-color: var(--marigold); }

/* ---------- Download ---------- */
.download { padding-block: clamp(64px, 9vw, 112px); }
.platforms { list-style: none; margin: 40px 0 0; padding: 0; border-top: 1px solid var(--line); max-width: 820px; }
.platforms li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 6px; border-bottom: 1px solid var(--line); }
.platforms li.yours { background: var(--white); border-radius: 14px; border-bottom-color: transparent; padding-inline: 18px; margin-block: 6px; box-shadow: 0 0 0 2px var(--teal); }
.platform-name { display: grid; gap: 2px; }
.platform-name strong { font-family: var(--display); font-size: var(--step-1); font-weight: 700; }
.platform-name span { color: var(--ink-soft); font-size: var(--step--1); }
.yours-label { display: inline-block; margin-left: 10px; font-family: var(--body); font-size: 0.8rem; font-weight: 700; color: var(--teal-dark); background: #DDF1EC; padding: 2px 8px; border-radius: 999px; vertical-align: 0.2em; }
.soon { color: var(--ink-soft); font-weight: 700; font-size: var(--step--1); white-space: nowrap; }
.platform-action .button { padding: 11px 18px; font-size: 1rem; white-space: nowrap; }
.which { margin-top: 28px; max-width: 70ch; }
.which summary { cursor: pointer; font-weight: 700; color: var(--teal-dark); }
.which p { margin-top: 10px; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 28px; color: var(--ink-soft); font-size: var(--step--1); }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .shelf { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 44px; }
  .safety-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 1.0625rem; }
  .site-nav a:not(.nav-download) { display: none; }
  .shelf { grid-template-columns: 1fr; gap: 32px; }
  .steps { grid-template-columns: 1fr; }
  .window-body { padding: 14px; }
  .platforms li { flex-direction: column; align-items: flex-start; gap: 10px; }
  .yours-label { display: table; margin: 6px 0 0; }
}
