:root {
  color-scheme: light;
  background: #fef6e3;
  color: #292821;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { --accent: #924a34; --phone-max: 244px; }
a { color: inherit; text-underline-offset: 4px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }

.page {
  width: min(100%, 1080px);
  height: 100svh;
  margin: 0 auto;
  padding: clamp(18px, 4svh, 38px) 56px 18px;
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr) 44px;
  gap: 14px;
}
header, .brand { display: flex; align-items: center; }
.brand { gap: 11px; font-size: 24px; font-weight: 750; letter-spacing: -.7px; }
.brand img { display: block; border-radius: 10px; }
.brand h1 { font: inherit; margin: 0; }

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .68fr);
  gap: clamp(40px, 7vw, 100px);
  align-items: center;
  min-height: 0;
  container-type: size;
}
.introduction { min-width: 0; }
.note { font-size: clamp(16px, 2.65svh, 20px); line-height: 1.52; letter-spacing: -.2px; }
.note p { margin: 0 0 clamp(10px, 2.2svh, 21px); }
.note p:last-child { margin-bottom: 0; }
.note .lead { font-weight: 650; }
.note strong { font-weight: 650; }

/* Match Monogram's Apple-icon pill, including its label and proportions. */
.download-app {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: clamp(16px, 3.5svh, 28px);
  padding: 12px 20px;
  min-height: 48px;
  border-radius: 99px;
  background: #000;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -.32px;
  text-decoration: none;
  touch-action: manipulation;
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.download-app svg { width: 22px; height: 22px; flex: 0 0 22px; }
.download-app:active { transform: scale(.95); transition-duration: .1s; }

figure {
  margin: 0;
  justify-self: end;
  /* Reserve room for the bezel, caption and shadow in the available main row. */
  width: min(100%, var(--phone-max), calc((100cqh - 64px) * .45977));
}
figcaption { margin-top: 15px; font-size: 12px; line-height: 1.4; text-align: center; color: #756e60; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; color: #756e60; }
footer p { margin: 0; }
footer nav { display: flex; gap: 24px; }
footer a, footer .contact-email { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--font-rounded); font-weight: 600; text-decoration: none; white-space: nowrap; }
footer a:hover { text-decoration: underline; }
footer { position: relative; }
footer .contact-email { position: absolute; right: 0; bottom: 0; }

.layout-bold { --accent: #244bcc; --phone-max: 270px; }
.layout-bold .page { width: min(100%, 1200px); }
.layout-bold main { grid-template-columns: minmax(0, 1fr) minmax(0, .53fr); gap: 60px; }
.layout-bold h1 { margin: 0 0 clamp(16px, 3svh, 28px); font-size: clamp(40px, 8.7svh, 76px); line-height: 1.03; letter-spacing: -.045em; font-weight: 750; }
.layout-bold .note { max-width: 455px; font-size: clamp(15px, 2.4svh, 18px); line-height: 1.5; }
.layout-bold .note .lead { font-weight: 400; }
.layout-bold .note strong { color: var(--accent); }
.layout-bold footer { justify-content: center; }

@media (max-height: 620px) and (min-width: 701px) {
  .page { padding-top: 16px; padding-bottom: 10px; gap: 8px; }
  .note { font-size: 16px; line-height: 1.45; }
  .note p { margin-bottom: 11px; }
  .layout-bold h1 { font-size: 44px; margin-bottom: 16px; }
  .layout-bold .note { font-size: 15px; }
  .download-app { margin-top: 16px; padding: 10px 18px; font-size: 16px; }
}

@media (max-width: 900px) and (min-width: 701px) {
  .page { padding-left: 32px; padding-right: 32px; }
  main, .layout-bold main { gap: 36px; grid-template-columns: minmax(0, 1fr) minmax(0, .58fr); }
  .layout-bold h1 { font-size: clamp(40px, 5.8vw, 52px); }
}

/* Mobile has its own reading flow; the fixed-height layout is for laptops. */
@media (max-width: 700px), (max-width: 950px) and (max-height: 500px) {
  html, body { height: auto; min-height: 100%; overflow: visible; }
  .page, .layout-bold .page {
    width: min(100%, 480px);
    height: auto;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 26px 24px max(20px, env(safe-area-inset-bottom));
  }
  header { margin-bottom: 38px; }
  .brand { font-size: 22px; gap: 10px; }
  .brand img { width: 36px; height: 36px; }
  main, .layout-bold main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 42px;
    container-type: normal;
  }
  .introduction { flex: none; }
  .layout-bold h1 {
    font-size: clamp(32px, 9.4vw, 44px);
    line-height: 1.07;
    letter-spacing: -.04em;
    margin: 0 0 24px;
  }
  .note, .layout-bold .note { font-size: 16px; line-height: 1.55; max-width: none; letter-spacing: -.15px; }
  .note p { margin-bottom: 16px; }
  .note p:last-child { margin-bottom: 0; }
  .download-app { margin-top: 25px; min-height: 52px; padding: 12px 22px; font-size: 17px; }
  .download-app svg { width: 21px; height: 21px; flex-basis: 21px; }
  figure {
    display: block;
    flex: none;
    width: min(100% - 32px, 278px);
    margin: 0 auto;
    container-type: normal;
  }
  figure .iphone-frame { width: 100%; padding: var(--frame-padding, 5px); }
  figcaption, footer p { display: none; }
  footer { justify-content: center; margin-top: 34px; font-size: 13px; }
  footer nav { justify-content: center; flex-wrap: wrap; column-gap: 28px; row-gap: 0; }
  .layout-bold footer { display: grid; grid-template-columns: 1fr; gap: 0; justify-items: center; }
  footer .contact-email { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .download-app { transition: none; }
}

/* A frameless screen with a chapter carousel driven by the video's own clock. */
.product-demo { width: min(100%, var(--phone-max), calc((100cqh - 88px) * .45977)); }
.demo-screen {
  overflow: hidden;
  aspect-ratio: 720 / 1500;
  /* Screen opening traced from Apple's iPhone 16 Pro artwork; no hardware bezel. */
  -webkit-mask: url("assets/product/screen-mask.svg") center / 100% 100% no-repeat;
  mask: url("assets/product/screen-mask.svg") center / 100% 100% no-repeat;
  background: #fff;
  box-shadow: 0 16px 32px -16px #30271938;
  isolation: isolate;
}
.demo-screen video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.demo-screen video::-webkit-media-controls,
.demo-screen video::-webkit-media-controls-enclosure,
.demo-screen video::-webkit-media-controls-start-playback-button { display: none !important; }
.demo-controls { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.demo-controls[hidden] { display: none; }
.demo-chapters {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 5px var(--end-space, 8px) 9px var(--start-space, 8px);
  scroll-padding-inline: 8px;
  mask-image: linear-gradient(to right, transparent, #000 8px, #000 calc(100% - 8px), transparent);
}
.demo-chapters::-webkit-scrollbar { display: none; }
.demo-controls button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.demo-pill {
  --progress: 0;
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;
  border: 0;
  border-radius: 99px;
  min-height: 44px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #716b5f;
  background: #fff8;
  overflow: hidden;
  white-space: nowrap;
  transition: color .2s, box-shadow .2s, background .2s;
}
.demo-pill img { position: relative; width: 28px; height: 28px; flex: 0 0 28px; object-fit: contain; }
.demo-pill span { position: relative; font-size: 15px; font-weight: 650; letter-spacing: -.15px; }
/* The same blue/green clay texture used by the app's publishing globe. */
.demo-globe {
  display: block;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: #245bea url('assets/clay/publish-globe.png') center / 200% 100% no-repeat;
  box-shadow: inset -4px -3px 6px #071a6359, inset 2px 2px 4px #ffffff40;
}

.demo-pill::before { content: ''; position: absolute; inset: 0; background: #e4dfd2; transform: scaleX(var(--progress)); transform-origin: left; }
.demo-pill[aria-pressed="true"] { color: #292821; background: #fff; box-shadow: 0 3px 8px #33271912; }
.demo-pill[aria-pressed="false"]::before { opacity: 0; }
.demo-pill:hover { color: #292821; }
.demo-controls button:focus-visible { outline: 2px solid #244bcc; outline-offset: 2px; }
.demo-fallback { display: block; text-align: center; padding: 14px; font-size: 13px; }
@media (max-width: 700px), (max-width: 950px) and (max-height: 500px) {
  .product-demo { width: min(100%, 340px); }
  .demo-controls { width: 100%; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-pill { transition: none; }
}

/* Let the selected demo share the header's empty right side to use more height. */
@media (min-width: 701px) and (min-height: 501px), (min-width: 951px) {
  .layout-bold .page {
    grid-template-columns: minmax(0, 1fr) minmax(0, .65fr);
    column-gap: clamp(32px, 5vw, 60px);
  }
  .layout-bold header { grid-column: 1; grid-row: 1; }
  .layout-bold main { display: contents; container-type: normal; }
  .layout-bold .introduction { grid-column: 1; grid-row: 2; align-self: center; }
  .layout-bold .product-demo {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    width: min(100%, 360px, calc((100svh - clamp(18px, 4svh, 38px) - 150px) * 720 / 1500));
  }
  .layout-bold footer { grid-column: 1 / -1; grid-row: 3; }
}
