/* mPad site. Tokens: Design/DESIGN.md sections 2-4 and 7. Words: Design/COPY.md section 3. */

:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;

  --accent: #2F5BEA;
  --paper: #FFFFFF;
  --mist: #F2F4F8;
  --text: #0A0E1A;
  --text2: #5B6172;
  --line: #E3E6EE;
  --navy: #0E1F66;

  /* Primary button keeps the light accent in both schemes: white on #6B8CFF is 3.1:1, on #2F5BEA 5.5:1. */
  --button-fill: #2F5BEA;
  --button-text: #FFFFFF;

  --bezel: #1d1d1f;
  --frame-ring: transparent;
  --home-bar: rgba(10, 14, 26, 0.8);

  --gutter: 24px;
  --content: 1080px;
  --band: clamp(64px, 7vw, 96px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #6B8CFF;
    --paper: #0A0E1A;
    --mist: #141A2E;
    --text: #F2F4F8;
    --text2: #9AA1B4;
    --line: #262D45;
    --frame-ring: #262D45;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 17px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

img,
picture,
object {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
figure,
ol,
ul {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(var(--content), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

/* Type scale 56 / 40 / 28 / 20 / 17 */

h1 {
  font-size: 56px;
  line-height: 1.07;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h2 {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h3 {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
}

p {
  text-wrap: pretty;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  font: 600 17px/1 var(--font);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--button-fill);
  color: var(--button-text);
}

.btn--primary:hover {
  background: color-mix(in srgb, var(--button-fill) 86%, #000);
}

.btn--secondary {
  border: 1px solid var(--line);
  color: var(--text);
}

/* App Store badge slot: Apple's official SVG when present, otherwise the object's text fallback. */

.store {
  display: inline-flex;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
}

.store:hover .btn--secondary {
  background: var(--mist);
}

.store-badge {
  height: 48px;
  pointer-events: none;
  /* The badge document declares no color scheme; matching it keeps its canvas transparent on a dark page. */
  color-scheme: light;
}

/* Header */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter);
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  border-radius: 4px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.nav-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nav-actions .store-badge {
  height: 40px;
}

.nav-actions .btn {
  height: 40px;
  padding: 0 16px;
  font-size: 15px;
}

/* Hero */

.hero {
  padding-top: clamp(48px, 7vw, 96px);
  text-align: center;
}

.hero h1 {
  max-width: 11em;
  margin-inline: auto;
}

.lead {
  max-width: 34em;
  margin: 24px auto 0;
  color: var(--text2);
  font-size: 20px;
  line-height: 1.5;
  text-wrap: balance;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
}

.cta-mac {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.note {
  color: var(--text2);
  font-size: 15px;
  line-height: 1.4;
}

/* The hero frame straddles the paper hero and the mist band that follows it. */
.stage {
  position: relative;
  margin-top: 64px;
  padding-inline: var(--gutter);
}

.stage::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 34%;
  background: var(--mist);
}

/* iPad frame, DESIGN.md section 7: radius 48, bezel 18 #1d1d1f, screen radius 36, 6 px home bar.
   All four scale with the frame width so the small frame keeps the same proportions. */
.device {
  position: relative;
  container-type: inline-size;
}

.device--hero {
  max-width: 1200px;
  margin-inline: auto;
}

.ipad {
  --b: clamp(5px, 1.5cqi, 18px);
  position: relative;
  padding: var(--b);
  border-radius: calc(var(--b) * 8 / 3);
  background: var(--bezel);
  box-shadow: 0 0 0 1px var(--frame-ring);
}

.ipad img {
  width: 100%;
  height: auto;
  border-radius: calc(var(--b) * 2);
}

.ipad::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(var(--b) * 1.6);
  width: 22%;
  height: max(2px, calc(var(--b) / 3));
  border-radius: 999px;
  background: var(--home-bar);
  transform: translateX(-50%);
}

.ipad--hero {
  box-shadow: 0 0 0 1px var(--frame-ring), 0 24px 64px rgba(14, 31, 102, 0.18);
}

@media (prefers-reduced-motion: no-preference) {
  .ipad--hero {
    animation: frame-in 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
}

@keyframes frame-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Bands: paper and mist alternate; section name in a four-column rail, content in the other eight. */

.band {
  padding-block: var(--band);
}

.band--mist {
  background: var(--mist);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 32px;
  align-items: baseline;
}

.rail {
  grid-column: 1 / span 4;
}

.main {
  grid-column: 5 / -1;
}

.main p,
.main h3 {
  max-width: 36em;
}

/* How it works: a real sequence, so the steps carry numerals. */

.steps {
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  padding-block: 24px;
  border-top: 1px solid var(--line);
  counter-increment: step;
}

.steps li:first-child {
  padding-top: 0;
  border-top: 0;
}

.steps li:last-child {
  padding-bottom: 0;
}

.steps li::before {
  content: counter(step);
  grid-row: 1;
  color: var(--text2);
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.steps li > * {
  grid-column: 2;
}

.steps p,
.blocks p {
  margin-top: 8px;
  color: var(--text2);
}

/* Not a remote desktop: three text blocks, one small frame under the heading. */

.grid--remote {
  align-items: start;
}

.grid--remote h2 {
  grid-row: 1;
}

.grid--remote .blocks {
  grid-row: 1 / span 2;
  padding-top: 4px;
}

.grid--remote .device {
  grid-row: 2;
  margin-top: 8px;
}

.blocks > div + div {
  margin-top: 32px;
}

/* Measured numbers */

.figure-num {
  font-size: 56px;
  line-height: 1.07;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.figure-label {
  color: var(--text2);
  font-size: 20px;
}

/* Private by design, requirements */

.statement {
  font-size: 28px;
  line-height: 1.36;
  letter-spacing: -0.005em;
}

.main .statement {
  max-width: 24em;
}

.plain {
  font-size: 20px;
}

/* Footer */

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px var(--gutter);
  padding-block: 32px;
  color: var(--text2);
  font-size: 15px;
}

.footer-links {
  display: flex;
  gap: 24px;
  padding: 0;
  list-style: none;
}

.footer-links a {
  border-radius: 4px;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Privacy and support pages */

.doc {
  width: min(680px, 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding-block: clamp(48px, 7vw, 96px) var(--band);
}

.doc p {
  max-width: 36em;
  margin-top: 20px;
}

.doc h1 + p {
  margin-top: 32px;
}

.doc a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.doc h2 {
  margin-top: 56px;
}

.doc h3 {
  max-width: 36em;
  margin-top: 32px;
}

.doc h3 + p {
  margin-top: 8px;
}

.doc .updated {
  margin-top: 40px;
  color: var(--text2);
  font-size: 15px;
}

/* Tablet and phone */

@media (max-width: 899px) {
  .rail,
  .main,
  .grid--remote h2,
  .grid--remote .blocks,
  .grid--remote .device {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .grid--remote .device {
    max-width: 520px;
    margin-top: 16px;
  }

  .grid {
    row-gap: 24px;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 20px;
  }

  .nav-actions {
    display: none;
  }

  h1 {
    font-size: 40px;
  }

  .lead,
  .statement {
    font-size: 20px;
    line-height: 1.5;
  }

  .figure-num {
    font-size: 40px;
  }

  .stage {
    margin-top: 48px;
  }

  .site-footer .wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}
