/* AYM platform tour. Tokens from the staff app (packages/ui theme) by way of the marketing kit
   (videos/aym-promo/assets/kit/aym-kit.css): cream ground, one green accent, deep green for the opening and closing. */

@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/poppins-regular.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/poppins-medium.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/poppins-semibold.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --text: #141812;
  --muted: #606a5b;
  --light: #8a9485;
  --surface: #ffffff;
  --frame: #e9ece4;
  --line: #dce0d4;
  --primary: #2e7235;
  --primary-hover: #255d2b;
  --primary-soft: rgba(46, 114, 53, 0.08);
  --primary-soft-hover: rgba(46, 114, 53, 0.14);
  --card-bg: rgba(46, 114, 53, 0.04);
  --card-border: rgba(46, 114, 53, 0.2);
  --deep: #092306;
  --on-deep: #f2f5ef;
  --on-deep-muted: rgba(242, 245, 239, 0.66);
  --primary-on-deep: #6dba73;
  --sage: #b7c0a5;
  --dim: rgba(9, 35, 6, 0.42);
  --font: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-move: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --camera: 1100ms;
  --gutter: 32px;
  --bar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body[data-view="intro"], body[data-view="end"] { background: var(--deep); }
main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 8px; }
.view--deep :focus-visible { outline-color: var(--primary-on-deep); }

/* Top bar */
.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
body[data-view="intro"] .bar, body[data-view="end"] .bar { background: var(--deep); border-bottom-color: rgba(242, 245, 239, 0.08); }
.bar__brand { display: inline-flex; align-items: center; border-radius: 6px; }
.bar__logo { height: 30px; width: auto; display: block; }
.bar__logo--deep { display: none; }
body[data-view="intro"] .bar__logo--deep, body[data-view="end"] .bar__logo--deep { display: block; }
body[data-view="intro"] .bar__logo--light, body[data-view="end"] .bar__logo--light { display: none; }
.bar__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding-left: 14px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
body[data-view="intro"] .bar__title, body[data-view="end"] .bar__title { color: var(--on-deep-muted); border-left-color: rgba(242, 245, 239, 0.14); }
.lang {
  margin-left: auto;
  display: inline-flex;
  padding: 3px;
  border-radius: 100px;
  background: var(--primary-soft);
  flex-shrink: 0;
}
.lang__btn {
  border: 0;
  background: transparent;
  height: 30px;
  min-width: 42px;
  padding: 0 12px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 200ms, color 200ms;
}
.lang__btn[aria-pressed="true"] { background: var(--surface); color: var(--primary); box-shadow: 0 1px 2px rgba(9, 35, 6, 0.08); }
body[data-view="intro"] .lang, body[data-view="end"] .lang { background: rgba(242, 245, 239, 0.08); }
body[data-view="intro"] .lang__btn, body[data-view="end"] .lang__btn { color: var(--on-deep-muted); }
body[data-view="intro"] .lang__btn[aria-pressed="true"], body[data-view="end"] .lang__btn[aria-pressed="true"] { background: var(--on-deep); color: var(--deep); box-shadow: none; }

/* Type */
.eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}
.eyebrow--deep { color: var(--primary-on-deep); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 200ms, color 200ms, box-shadow 200ms, transform 200ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn--lg { height: 54px; padding: 0 28px; font-size: 16px; }
.btn--primary { background: var(--primary); color: var(--bg); }
.btn--primary:hover { background: var(--primary-hover); box-shadow: 0 6px 18px rgba(46, 114, 53, 0.22); }
.btn--soft { background: var(--primary-soft); color: var(--primary); }
.btn--soft:hover { background: var(--primary-soft-hover); }
.btn--soft:disabled { opacity: 0.4; cursor: default; }
.btn--deep-primary { background: var(--primary-on-deep); color: var(--deep); font-weight: 600; }
.btn--deep-primary:hover { background: #82c788; box-shadow: 0 8px 26px rgba(109, 186, 115, 0.25); }
.btn--deep-ghost { background: transparent; color: var(--on-deep); box-shadow: inset 0 0 0 1.5px rgba(242, 245, 239, 0.28); }
.btn--deep-ghost:hover { box-shadow: inset 0 0 0 1.5px rgba(242, 245, 239, 0.6); }

/* Opening and closing grounds: deep green, concentric rings in the corner. */
.view--deep {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: var(--deep);
  color: var(--on-deep);
  isolation: isolate;
}
.rings { position: absolute; right: -14vmax; bottom: -22vmax; width: 70vmax; height: 70vmax; z-index: -1; pointer-events: none; }
.rings i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(109, 186, 115, 0.12); }
.rings i:nth-child(2) { inset: 13%; border-color: rgba(109, 186, 115, 0.09); }
.rings i:nth-child(3) { inset: 26%; border-color: rgba(109, 186, 115, 0.07); }

/* Intro */
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  padding: clamp(40px, 7vh, 88px) clamp(24px, 6vw, 96px);
}
.intro__copy { max-width: 600px; }
.intro__title {
  margin: 18px 0 0;
  font-size: clamp(34px, 3.9vw, 56px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--on-deep);
  text-wrap: balance;
}
.intro__title em { font-style: normal; color: var(--primary-on-deep); }
.intro__body { margin: 22px 0 0; max-width: 520px; font-size: clamp(16px, 1.25vw, 18px); color: var(--on-deep-muted); text-wrap: pretty; }
.intro__actions { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 12px; }
.intro__note { margin: 22px 0 0; font-size: 13px; color: var(--on-deep-muted); display: flex; align-items: center; gap: 10px; }
.intro__note::before { content: ""; width: 18px; height: 1.5px; background: var(--primary-on-deep); border-radius: 2px; flex-shrink: 0; }
.intro__preview { margin: 0; perspective: 1600px; }

/* Browser frames */
.window {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(9, 35, 6, 0.04), 0 18px 48px -18px rgba(9, 35, 6, 0.22);
  overflow: hidden;
  min-width: 0;
}
.window__bar {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 0 16px;
  background: #fbfbf9;
  border-bottom: 1px solid var(--line);
}
.window__dots { display: inline-flex; gap: 7px; flex-shrink: 0; }
.window__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--frame); box-shadow: inset 0 0 0 1px var(--line); }
.window__address {
  flex: 1;
  min-width: 0;
  max-width: 340px;
  margin: 0 auto;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 100px;
  background: var(--frame);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.window__tools { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.window--float {
  border-color: rgba(242, 245, 239, 0.12);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.55);
  transform: rotateY(-9deg) rotateX(3deg) translateZ(0);
  transform-origin: left center;
  animation: float-in 1200ms var(--ease-out) both 120ms;
}
.window__shot { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg); }
.window__shot img { display: block; width: 100%; height: auto; }
@keyframes float-in { from { opacity: 0; transform: rotateY(-14deg) rotateX(5deg) translate3d(36px, 18px, 0); } }

/* Tour */
.tour { position: relative; flex: 1; display: flex; flex-direction: column; padding: 22px var(--gutter) 22px; gap: 18px; }
.progress { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: transparent; }
.progress__fill { display: block; height: 100%; width: 0; background: var(--primary); transition: width 600ms var(--ease-move); border-radius: 0 3px 3px 0; }
.tour__grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(280px, 25vw, 360px);
  gap: clamp(20px, 2.4vw, 36px);
  align-items: center;
  min-height: 0;
}

.viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: calc(100dvh - var(--bar-h) - 42px - 150px);
  min-height: 260px;
  overflow: hidden;
  background: var(--frame);
  touch-action: pan-y;
}
.plate {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
  transition: transform var(--camera) var(--ease-move), opacity 380ms ease;
}
.plate.is-instant, .plate.is-instant .spot { transition: none; }
.plate__img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.spot {
  position: absolute;
  border-radius: calc(12px * var(--inv, 1));
  box-shadow: 0 0 0 calc(2px * var(--inv, 1)) var(--primary), 0 0 0 calc(8px * var(--inv, 1)) rgba(46, 114, 53, 0.16), 0 0 0 9999px var(--dim);
  transition: left var(--camera) var(--ease-move), top var(--camera) var(--ease-move), width var(--camera) var(--ease-move), height var(--camera) var(--ease-move), opacity 500ms ease, border-radius var(--camera) var(--ease-move);
  pointer-events: none;
}
.is-full .spot { opacity: 0; }
.plate__labels, .phone-shot__labels { position: absolute; inset: 0; pointer-events: none; }
.tag {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: 100px;
  background: var(--deep);
  color: var(--on-deep);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 6px 18px -6px rgba(9, 35, 6, 0.45);
}
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary-on-deep); }
.plate .tag { transform: scale(var(--inv, 1)); transform-origin: 100% 0; }

.phone-shot { display: none; margin: 0; position: relative; background: var(--frame); }
.phone-shot__img { display: block; width: 100%; height: auto; }
.phone-shot .tag { bottom: 10px; transform: translateX(-50%); height: 28px; padding: 0 11px; font-size: 12px; }

.areas { display: inline-flex; gap: 4px; }
.areas button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--light);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 200ms, color 200ms;
}
.areas button[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); }
.full-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 100px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 200ms, color 200ms;
}
.full-toggle:hover { background: var(--primary-soft); color: var(--primary); }
.full-toggle[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); }
.full-toggle__close, .full-toggle[aria-pressed="true"] .full-toggle__open { display: none; }
.full-toggle[aria-pressed="true"] .full-toggle__close { display: inline; }

/* Caption: a tinted card, no shadow. */
.caption {
  align-self: center;
  padding: 26px 26px 24px;
  border-radius: 14px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
}
.caption__title { margin: 10px 0 0; font-size: clamp(24px, 2vw, 30px); line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
.caption__body { margin: 14px 0 0; font-size: 16px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.caption__hint { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--card-border); font-size: 12px; color: var(--light); }
.caption.is-entering .eyebrow, .caption.is-entering .caption__title, .caption.is-entering .caption__body { animation: rise 600ms var(--ease-out) both; }
.caption.is-entering .caption__title { animation-delay: 60ms; }
.caption.is-entering .caption__body { animation-delay: 120ms; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* Controls */
.controls { display: flex; align-items: center; justify-content: center; gap: 18px; }
.dots { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.dots button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.dots button::before { content: ""; width: 9px; height: 9px; border-radius: 100px; background: rgba(46, 114, 53, 0.22); transition: width 400ms var(--ease-out), background-color 300ms; }
.dots button:hover::before { background: rgba(46, 114, 53, 0.45); }
.dots button[aria-current="step"] { width: 34px; }
.dots button[aria-current="step"]::before { width: 26px; background: var(--primary); }

/* End */
.end {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 24px;
}
.end__mark { height: 64px; width: auto; animation: rise 800ms var(--ease-out) both; }
.end__title { margin: 26px 0 0; font-size: clamp(34px, 4.4vw, 60px); line-height: 1.06; font-weight: 600; letter-spacing: -0.025em; animation: rise 800ms var(--ease-out) both 80ms; }
.end__body { margin: 16px 0 0; font-size: 18px; color: var(--on-deep-muted); animation: rise 800ms var(--ease-out) both 140ms; }
.end__actions { margin-top: 34px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; animation: rise 800ms var(--ease-out) both 200ms; }
.end .intro__note { margin-top: 30px; }
.end .intro__note::before { display: none; }

/* Tablets and narrow laptops: the caption goes under the screen. */
@media (max-width: 1023px) {
  :root { --gutter: 24px; }
  .intro { grid-template-columns: 1fr; }
  .intro__copy { max-width: 640px; }
  .window--float { transform: none; animation-name: rise; }
  .tour__grid { grid-template-columns: 1fr; align-items: start; flex: none; }
  .viewport { max-height: none; }
  .caption { align-self: stretch; }
  .controls {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin: 0 calc(var(--gutter) * -1) -22px;
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
    background: rgba(246, 247, 243, 0.94);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    justify-content: space-between;
  }
}

/* Phones: the screen shows the step's area as the app shows it on a phone, and the caption sits below. */
@media (max-width: 639px) {
  :root { --gutter: 16px; --bar-h: 56px; }
  .bar { gap: 10px; }
  .bar__logo { height: 26px; }
  .bar__title { font-size: 13px; padding-left: 10px; }
  .intro { padding: 36px 20px 40px; gap: 36px; align-content: start; }
  .intro__title { font-size: 33px; }
  .intro__actions .btn { width: 100%; }
  .tour { padding-top: 16px; gap: 14px; }
  .window { border-radius: 12px; }
  .window__bar { height: 38px; padding: 0 8px 0 12px; gap: 8px; }
  .window__dots { display: none; }
  .window__address { margin: 0; justify-content: flex-start; padding: 0 10px; font-size: 11px; }
  .areas { display: none; }
  .full-toggle { padding: 0 8px; }
  .full-toggle__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tour:not(.is-full) .viewport { aspect-ratio: auto; min-height: 0; background: var(--frame); }
  .tour:not(.is-full) .plate { display: none; }
  .tour:not(.is-full) .phone-shot { display: block; }
  .caption { padding: 20px 18px 18px; }
  .caption__title { font-size: 24px; }
  .caption__body { font-size: 15.5px; }
  .caption__hint { display: none; }
  .controls { gap: 6px; }
  .controls .btn { height: 44px; padding: 0 18px; }
  .controls [data-action="prev"] { width: 44px; padding: 0; flex-shrink: 0; }
  .controls [data-action="prev"] span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .dots { gap: 0; }
  .dots button { width: 18px; }
  .dots button::before { width: 7px; height: 7px; }
  .dots button[aria-current="step"] { width: 26px; }
  .dots button[aria-current="step"]::before { width: 18px; }
  .end__actions { flex-direction: column; width: 100%; max-width: 340px; }
  .end__actions .btn { width: 100%; }
}

@media (max-width: 359px) {
  .controls [data-action="next"] { width: 44px; padding: 0; }
  .controls [data-action="next"] span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --camera: 0ms; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}
