/* allvallee.com — built from design/pages/website/website-spec.md.
   Colours are DESIGN.md roles (tokens/colors.json), spacing/radius are AppSpacing/AppRadius (tokens/spacing.json).
   1 pt = 1 px. Values marked "site metric" are listed in the spec §9. */

:root {
  color-scheme: light dark;
  /* Colour roles · light */
  --background: #FBFAFF;
  --surface: #FFFFFF;
  --surface-muted: #F4F1FB;
  --border: #E4DEF5;
  --text-primary: #1C1238;
  --text-secondary: #5E5878;
  --text-tertiary: #8C86A3;
  --brand: #5B34D6;
  --on-brand: #FFFFFF;
  --brand-soft: #EFEAFF;
  --on-brand-soft: #4A2BB8;
  --accent: #FF9F7A;
  --on-accent: #1C1238;
  --device-frame: #1C1238;               /* proposed role deviceFrame (spec §9) */
  --hairline-light-only: var(--border);  /* flat card border, sticker hairline: light mode only */
  --raised-shadow: 0 4px 16px rgba(42, 22, 96, .06);

  /* AppSpacing */
  --hairline: 2px; --tight: 4px; --inline: 6px; --compact: 8px; --tile: 10px; --row: 12px;
  --header-gap: 14px; --card-padding: 16px; --page: 20px; --screen-title-top: 26px;
  --actions-gap: 28px; --section-gap: 30px;
  /* AppRadius */
  --r-chip: 13px; --r-row: 20px; --r-card: 22px; --r-hero: 24px;

  /* Site metrics (spec §9) */
  --content-max: 1080px;
  --legal-max: 680px;
  --faq-max: 640px;
  --header-h: 64px;
  --panel-pad-desktop: 64px;
  --phone-w: 300px;
  --bezel: 10px;
  --phone-r: 52px;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0B0A10;
    --surface: #1A1822;
    --surface-muted: #15131C;
    --border: #2A2636;
    --text-primary: #F4F2FA;
    --text-secondary: #A49FB6;
    --text-tertiary: #7A748F;
    --brand: #8B6BFF;
    --on-brand: #1C1238;
    --brand-soft: #2A2340;
    --on-brand-soft: #C9B8FF;
    --hairline-light-only: transparent;
    --raised-shadow: none;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Text roles (DESIGN.md §2) ---------- */
.t-display  { font-size: 34px; line-height: 40px; font-weight: 800; letter-spacing: -0.9px; }
.t-title    { font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -0.5px; }
.t-headline { font-size: 17px; line-height: 22px; font-weight: 600; }
.t-card-subtitle { font-size: 16px; line-height: 22px; font-weight: 500; }
.t-subtitle { font-size: 15px; line-height: 20px; font-weight: 500; }
.t-body     { font-size: 16px; line-height: 24px; font-weight: 400; }
.t-caption  { font-size: 12px; line-height: 16px; font-weight: 700; }
.t-meta     { font-size: 13px; line-height: 18px; font-weight: 500; }
.t-button   { font-size: 17px; line-height: 22px; font-weight: 600; }
.t-button-compact { font-size: 15px; line-height: 20px; font-weight: 600; }
/* proposed role marketingDisplay (spec §9): fluid 390 → 1280 px */
.t-mkt-hero  { font-size: clamp(40px, 31.24px + 2.247vw, 60px); line-height: 1.06; font-weight: 800; letter-spacing: -0.026em; margin: 0; text-wrap: balance; }
.t-mkt-panel { font-size: clamp(34px, 27.87px + 1.573vw, 48px); line-height: 1.08; font-weight: 800; letter-spacing: -0.026em; margin: 0; text-wrap: balance; }

/* ---------- Header ---------- */
.site-header {
  height: var(--header-h);
  max-width: var(--content-max); margin: 0 auto; padding: 0 var(--page);
  display: flex; align-items: center; justify-content: space-between;
}
.lockup { display: inline-flex; align-items: center; gap: 9px; color: var(--text-primary); }
.lockup:hover { text-decoration: none; }
.lockup svg { width: 28px; height: 28px; flex: none; }
.wordmark {
  display: inline-block; width: 102px; height: 20px; background: currentColor;
  -webkit-mask: url(wordmark.svg) left center / contain no-repeat;
          mask: url(wordmark.svg) left center / contain no-repeat;
}
.header-link { color: var(--brand); }
.hero .lockup, .hero .header-link { color: var(--on-brand); }
.dip-sky { fill: #5B34D6; fill-opacity: .3; }
@media (prefers-color-scheme: dark) { .dip-sky { fill: #8B6BFF; fill-opacity: .4; } }

/* ---------- Buttons (BrandButton) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--compact);
  height: 56px; padding: 0 28px; border-radius: 28px; border: 0;
  background: var(--brand); color: var(--on-brand);
  font: 600 17px/22px var(--font);
  transition: transform .15s ease, filter .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn.inverse { background: var(--surface); color: var(--text-primary); } /* proposed BrandButton.inverse */
.btn svg { width: 18px; height: 18px; }

/* ---------- Panels ---------- */
.panel { position: relative; overflow: hidden; }
.panel.fill-brand  { background: var(--brand);      color: var(--on-brand); }
.panel.fill-soft   { background: var(--brand-soft); color: var(--text-primary); }
.panel.fill-accent { background: var(--accent);     color: var(--on-accent); }
.panel .lead { margin: var(--row) auto 0; max-width: 30em; }
.panel.fill-soft .lead { color: var(--text-secondary); }

.panel-inner {
  max-width: var(--content-max); margin: 0 auto;
  padding: var(--section-gap) var(--page) 0;
  display: grid; justify-items: center; text-align: center;
}
.panel.hero .panel-inner { padding-top: var(--compact); }
.copy { max-width: 560px; }
.cta { margin-top: var(--actions-gap); display: flex; flex-direction: column; align-items: center; }
.cta .btn { width: 100%; max-width: 360px; }
.cta .trust { margin-top: var(--compact); }

/* Stage holds phone + stickers. Sticker positions are on a 390 px artboard (site metrics). */
.stage { position: relative; width: 100%; max-width: 390px; height: 430px; margin-top: var(--section-gap); }
.hero .stage { height: 460px; }

/* PhoneShot */
.phone {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: var(--phone-w); height: calc(100% - 6px);
  border: var(--bezel) solid var(--device-frame); border-bottom: 0;
  border-radius: var(--phone-r) var(--phone-r) 0 0;
  background: var(--background); overflow: hidden;
}
.phone picture, .phone img { width: 100%; height: auto; }
.phone img { transform: translateY(calc(var(--offset, 0%) * -1)); } /* % of screenshot height, per panel */

/* ---------- Stickers (BrandSticker, DESIGN.md §4.14) ---------- */
.sticker-pos { position: absolute; z-index: 2; }
.sticker {
  display: inline-flex; align-items: center; gap: var(--compact);
  height: 44px; padding: 0 18px; border-radius: 22px; white-space: nowrap;
  font: 600 17px/22px var(--font);
}
.sticker.has-symbol { padding-left: 16px; }
.sticker svg { width: 16px; height: 16px; flex: none; }
.s-brand  { background: var(--brand);      color: var(--on-brand);      box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--hairline-light-only); }
.s-soft   { background: var(--brand-soft); color: var(--on-brand-soft); box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--hairline-light-only); }
.s-accent { background: var(--accent);     color: var(--on-accent);     box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--hairline-light-only); }
.s-plain  { background: var(--surface);    color: var(--text-primary);  box-shadow: 0 0 0 1px var(--hairline-light-only); }
.s-plain .sym-brand { color: var(--brand); }
.sticker.circle {
  width: 88px; height: 88px; padding: 0; border-radius: 50%;
  flex-direction: column; justify-content: center; gap: var(--hairline);
  text-align: center; line-height: 19px; white-space: normal;
}
.sticker.circle svg { width: 18px; height: 18px; }
.goal-text { position: relative; width: 98px; height: 22px; }
.goal-text span { position: absolute; inset: 0; opacity: 0; }
.goal-text span:first-child { opacity: 1; }

/* Motion (spec §3.3) */
.js .panel .slap { opacity: 0; }
.js .panel.in .slap { animation: slap .55s cubic-bezier(.3, 1.6, .5, 1) both; }
.float { animation: float 4s ease-in-out infinite alternate; }
.js .goal-text span { animation: cycle 10s infinite; }
.js .goal-text span:first-child { opacity: 0; }
.goal-text span:nth-child(2) { animation-delay: 2.5s; }
.goal-text span:nth-child(3) { animation-delay: 5s; }
.goal-text span:nth-child(4) { animation-delay: 7.5s; }
@keyframes slap { from { transform: scale(1.5) rotate(-10deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes float { from { transform: translateY(-3px); } to { transform: translateY(3px); } }
@keyframes cycle {
  0% { opacity: 0; transform: translateY(10px); }
  3%, 22% { opacity: 1; transform: none; }
  25%, 100% { opacity: 0; transform: translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .float, .js .panel.in .slap, .js .goal-text span { animation: none; }
  .js .panel .slap { opacity: 1; }
  .js .goal-text span:first-child { opacity: 1; }
  .sticky-cta { transition: none; }
}

/* ---------- Download section ---------- */
.download { padding: 72px var(--page) 0; text-align: center; }
.download .icon { width: 64px; height: 64px; border-radius: 15px; margin: 0 auto var(--page); box-shadow: var(--raised-shadow); }
.download .lead { color: var(--text-secondary); margin: var(--row) auto 0; max-width: 28em; }
.download .trust { color: var(--text-secondary); }

/* ---------- FAQ ---------- */
.faq { max-width: var(--faq-max); margin: 0 auto; padding: calc(var(--section-gap) * 2) var(--page) 0; }
.faq h2 { margin: 0 0 var(--header-gap); }
.faq-list { display: grid; gap: var(--row); }
.faq details { background: var(--surface-muted); border-radius: var(--r-row); }
.faq summary {
  min-height: 56px; padding: var(--card-padding) var(--page);
  display: flex; align-items: center; justify-content: space-between; gap: var(--compact);
  cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { width: 15px; height: 15px; color: var(--text-tertiary); flex: none; transition: transform .2s ease; }
.faq details[open] summary svg { transform: rotate(180deg); }
.faq details p { margin: calc(var(--tight) - var(--card-padding)) var(--page) 0; padding-bottom: var(--card-padding); color: var(--text-secondary); }

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--content-max); margin: calc(var(--section-gap) + var(--page)) auto 0;
  padding: var(--section-gap) var(--page) calc(var(--section-gap) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--row) var(--page);
}
.site-footer .wordmark { color: var(--text-primary); }
.footer-links { display: flex; gap: var(--row) var(--page); flex-wrap: wrap; }
.footer-links a { color: var(--text-secondary); }
.footer-links a:hover { color: var(--brand); }
.site-footer .legal { color: var(--text-secondary); width: 100%; margin: 0; }

/* ---------- Sticky download bar (mobile) ---------- */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: var(--row) var(--page) calc(var(--row) + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border);
  transform: translateY(110%); transition: transform .25s ease;
}
.sticky-cta.show { transform: none; }
.sticky-cta .btn { width: 100%; }

/* ---------- Legal pages ---------- */
.legal-page { max-width: var(--legal-max); margin: 0 auto; padding: var(--screen-title-top) var(--page) 0; }
.legal-page .date { color: var(--text-secondary); margin: 0; }
.legal-page h1 { margin: var(--tight) 0 var(--page); }
.summary-card {
  background: var(--surface); border: 1px solid var(--hairline-light-only); border-radius: var(--r-card);
  padding: var(--card-padding);
}
.chip {
  display: inline-flex; align-items: center; height: 26px; padding: 0 var(--tile); border-radius: var(--r-chip);
  background: var(--brand-soft); color: var(--on-brand-soft);
}
.summary-card ul { margin: var(--header-gap) 0 0; padding-left: 1.2em; display: grid; gap: var(--compact); }
.legal-page h2 { margin: var(--section-gap) 0 var(--tight); }
.legal-page h3 { margin: var(--row) 0 var(--tight); color: var(--text-primary); }
.legal-page .effective { margin-top: var(--section-gap); }
.legal-page p, .legal-page li { color: var(--text-primary); }
.legal-page p { margin: 0 0 var(--row); }
.legal-page ul.body { margin: 0 0 var(--row); padding-left: 1.2em; display: grid; gap: var(--tight); }
.legal-page .toc { margin-top: var(--page); color: var(--text-secondary); }
.legal-page .toc a { color: var(--brand); }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  :root { --phone-w: 320px; }
  .panel-inner {
    grid-template-columns: 1fr 1fr; align-items: center; justify-items: start; text-align: left;
    padding-top: var(--panel-pad-desktop); column-gap: var(--page);
  }
  .panel.hero .panel-inner { padding-top: var(--section-gap); }
  .panel .lead { margin-left: 0; }
  .panel .cta { align-items: flex-start; }
  .cta .btn { width: auto; }
  .stage { margin-top: 0; justify-self: center; height: 540px; }
  .hero .stage { height: 580px; }
  .panel.flip .copy { order: 2; }
  .panel.flip .stage { order: 1; }
  .sticky-cta { display: none; }
}
