/*
 * Orvia Mail for iPhone page. Follows DESIGN-SYSTEM.md: 80% canvas, start
 * alignment, SF Pro Display roles, the three text grays, no cards or dividers.
 * Phones sit directly on the page background; there are no media wells.
 */
.ip-page {
  --ip-button: #f2f2f2;
  width: 80%;
  margin: 0 auto;
  color: var(--orvia-text, rgba(0, 0, 0, 0.9));
}

html[data-orvia-resolved-theme="dark"] .ip-page {
  --ip-button: #20242a;
}

.ip-page h1,
.ip-page h2,
.ip-page h3,
.ip-page p {
  margin: 0;
}

.ip-page a {
  color: inherit;
  text-underline-offset: 3px;
  transition: color 150ms ease-out;
}

.ip-page a:hover {
  color: var(--orvia-accent, rgb(255, 91, 3));
}

/* Hero */
.ip-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 64px;
  padding: 132px 0 120px;
}

.ip-eyebrow {
  margin-bottom: 24px !important;
  color: var(--orvia-text-muted, rgba(0, 0, 0, 0.3));
  font: 600 13px/1.2 "SF Pro Display Semibold", -apple-system, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ip-hero h1 {
  font: 400 clamp(58px, 7.5vw, 104px) / 0.98 "SF Pro Display Regular", -apple-system, sans-serif;
  letter-spacing: -0.065em;
  text-wrap: balance;
}

.ip-lead {
  max-width: 24em;
  margin-top: 28px !important;
  color: var(--orvia-text-secondary, rgba(0, 0, 0, 0.5));
  font-size: clamp(21px, 2.2vw, 30px);
  line-height: 1.28;
  text-wrap: pretty;
}

.ip-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 40px;
}

.ip-store {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  box-sizing: border-box;
  width: 234px;
  height: 58px;
  padding: 0 22px;
  border-radius: 999px;
  background: #08090b;
  color: #fff !important;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.ip-store:hover {
  box-shadow: 0 14px 32px rgb(0 0 0 / 0.12);
  transform: translateY(-2px);
}

.ip-store img {
  width: 25px;
  height: 25px;
  filter: invert(1);
}

.ip-store span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ip-store small {
  font: 500 12px/1 "SF Pro Display Medium", -apple-system, sans-serif;
  opacity: 0.68;
}

.ip-store strong {
  font: 700 16px/1 "SF Pro Display Bold", -apple-system, sans-serif;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

/* Not on the App Store yet: a quiet, non-interactive pill */
.ip-store.is-soon {
  background: var(--ip-button);
  color: var(--orvia-text, rgba(0, 0, 0, 0.9)) !important;
  cursor: default;
}

.ip-store.is-soon:hover {
  box-shadow: none;
  transform: none;
}

html[data-orvia-resolved-theme="light"] .ip-store.is-soon img,
html:not([data-orvia-resolved-theme]) .ip-store.is-soon img {
  filter: none;
}

.ip-textlink {
  font: 600 17px/1.2 "SF Pro Display Semibold", -apple-system, sans-serif;
  text-decoration: none;
}

.ip-meta {
  margin-top: 18px !important;
  color: var(--orvia-text-muted, rgba(0, 0, 0, 0.3));
  font: 500 13px/1.2 "SF Pro Display Medium", -apple-system, sans-serif;
}

.ip-hero-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.ip-hint {
  max-width: 22em;
  color: var(--orvia-text-muted, rgba(0, 0, 0, 0.3));
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.ip-hero-phone {
  animation: ip-float 6s ease-in-out infinite;
}

@keyframes ip-float {
  50% {
    transform: translateY(-10px);
  }
}

/* The day */
.ip-day {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 44%);
  gap: 64px;
}

.ip-step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  max-width: 34em;
  opacity: 0.35;
  transition: opacity 400ms ease;
}

.ip-step.on {
  opacity: 1;
}

.ip-clock {
  font: 500 clamp(56px, 6vw, 84px) / 1 "SF Pro Display Medium", -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.ip-when {
  margin: 14px 0 26px !important;
  color: var(--orvia-text-muted, rgba(0, 0, 0, 0.3));
  font: 600 13px/1.2 "SF Pro Display Semibold", -apple-system, sans-serif;
  letter-spacing: 0.04em;
}

.ip-step h2,
.ip-sec h2 {
  font: 500 clamp(26px, 2.5vw, 34px) / 1.08 "SF Pro Display Medium", -apple-system, sans-serif;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.ip-step .ip-body,
.ip-sec .ip-seclead {
  margin-top: 20px !important;
  color: var(--orvia-text-secondary, rgba(0, 0, 0, 0.5));
  font-size: 17px;
  line-height: 1.6;
  text-wrap: pretty;
}

.ip-plan {
  display: grid;
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: ip-step;
}

.ip-plan li {
  position: relative;
  padding-left: 36px;
  color: var(--orvia-text-secondary, rgba(0, 0, 0, 0.5));
  font-size: 15px;
  line-height: 1.5;
  counter-increment: ip-step;
  transition: color 300ms ease;
}

.ip-plan li::before {
  content: counter(ip-step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--orvia-text-muted, rgba(0, 0, 0, 0.3));
  font: 500 12px/1 "SF Pro Display Medium", -apple-system, sans-serif;
  transition: background-color 300ms ease, box-shadow 300ms ease, color 300ms ease;
}

.ip-plan li.active {
  color: var(--orvia-text, rgba(0, 0, 0, 0.9));
}

.ip-plan li.active::before {
  box-shadow: inset 0 0 0 1.5px var(--orvia-accent, rgb(255, 91, 3));
  color: var(--orvia-accent, rgb(255, 91, 3));
}

.ip-plan li.done::before {
  content: "✓";
  background: var(--orvia-text, rgba(0, 0, 0, 0.9));
  box-shadow: none;
  color: var(--orvia-page, #fff);
}

.ip-plan .sub {
  display: block;
  margin-top: 3px;
  color: var(--orvia-text-secondary, rgba(0, 0, 0, 0.5));
  font-size: 13px;
}

.ip-plan .sub:empty {
  display: none;
}

.plus {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--ip-button);
  color: var(--orvia-text, rgba(0, 0, 0, 0.9));
  font: 600 11px/1 "SF Pro Display Semibold", -apple-system, sans-serif;
  vertical-align: 1px;
}

.ip-ctl {
  margin-top: 18px;
  min-height: 32px;
}

.ip-pp {
  padding: 8px 15px;
  border: 0;
  border-radius: 999px;
  background: var(--ip-button);
  color: var(--orvia-text, rgba(0, 0, 0, 0.9));
  font: 500 13px/1 "SF Pro Display Medium", -apple-system, sans-serif;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.ip-pp:focus-visible {
  outline: 2px solid var(--orvia-accent, rgb(255, 91, 3));
  outline-offset: 3px;
}

.ip-stage {
  position: sticky;
  top: 96px;
  display: flex;
  align-self: start;
  height: calc(100vh - 116px);
  min-height: 560px;
}

.ip-stagebox {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
}

.ip-mph {
  display: none;
}

/* Scripted finger for the automatic demo */
.ip-finger {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.18), 0 6px 16px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.8s cubic-bezier(0.45, 0, 0.2, 1), opacity 0.4s;
}

.ip-finger.on {
  opacity: 1;
}

.ip-finger.press {
  animation: ip-press 0.32s ease-out;
}

@keyframes ip-press {
  50% {
    scale: 0.8;
  }
}

/* Scroll demos play themselves; only the hero phone takes touches */
.ip-stage .ophone,
.ip-mph .ophone {
  pointer-events: none;
}

.ip-hero-phone .mcard.front {
  cursor: grab;
}

.ip-hero-phone .stampimg,
.ip-hero-phone .cat,
.ip-hero-phone .row,
.ip-hero-phone .bmain {
  cursor: pointer;
}

.ip-day.paused .ophone *,
.ip-day.paused .ip-finger {
  animation-play-state: paused !important;
}

/* Privacy, mailboxes, plans */
.ip-sec {
  padding-top: 120px;
  scroll-margin-top: 96px;
}

.ip-sec .ip-seclead {
  max-width: 36em;
}

.ip-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px;
  margin-top: 56px;
}

.ip-grid .ico {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ip-grid h3 {
  margin-top: 18px;
  font: 500 17px/1.3 "SF Pro Display Medium", -apple-system, sans-serif;
}

.ip-grid p {
  margin-top: 10px !important;
  color: var(--orvia-text-secondary, rgba(0, 0, 0, 0.5));
  font-size: 15px;
  line-height: 1.6;
}

.ip-providers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  font: 500 clamp(20px, 1.8vw, 27px) / 1.3 "SF Pro Display Medium", -apple-system, sans-serif;
  letter-spacing: -0.02em;
}

.ip-providers li:not(:last-child)::after {
  content: "·";
  margin: 0 0.45em;
  color: var(--orvia-text-muted, rgba(0, 0, 0, 0.3));
}

.ip-note {
  max-width: 44em;
  margin-top: 28px !important;
  color: var(--orvia-text-secondary, rgba(0, 0, 0, 0.5));
  font-size: 15px;
  line-height: 1.6;
}

.ip-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 64px;
  max-width: 960px;
  margin-top: 56px;
}

.ip-plans h3 {
  font: 500 clamp(26px, 2.5vw, 34px) / 1.08 "SF Pro Display Medium", -apple-system, sans-serif;
  letter-spacing: -0.035em;
}

.ip-price {
  margin-top: 10px !important;
  color: var(--orvia-text-secondary, rgba(0, 0, 0, 0.5));
  font-size: 15px;
}

.ip-plans ul {
  display: grid;
  gap: 12px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}

.ip-plans li {
  position: relative;
  padding-left: 26px;
}

.ip-plans li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--orvia-text-muted, rgba(0, 0, 0, 0.3));
}

/* 17-second film: sits on the page like the phones, no well; 4:3 at up to the reading width */
.ip-filmvid {
  display: block;
  width: 100%;
  max-width: 1040px;
  height: auto;
  margin: 56px auto 0;
  border-radius: 20px;
  background: var(--ip-button);
  cursor: pointer;
}

.ip-film .ip-ctl {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

/* Ending */
.ip-outro {
  padding: 160px 0 120px;
}

.ip-stamp {
  width: 150px;
  transform: rotate(-6deg);
}

.ip-outro h2 {
  margin-top: 32px;
  font: 400 clamp(40px, 5vw, 72px) / 1 "SF Pro Display Regular", -apple-system, sans-serif;
  letter-spacing: -0.05em;
}

.ip-outro .ip-lead {
  margin-top: 22px !important;
}

.ip-qr {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--orvia-text-secondary, rgba(0, 0, 0, 0.5));
  font-size: 13px;
  line-height: 1.5;
}

.ip-qr img {
  width: 92px;
  height: 92px;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
  image-rendering: pixelated;
}

.ip-fine {
  max-width: 44em;
  margin-top: 56px !important;
  color: var(--orvia-text-muted, rgba(0, 0, 0, 0.3));
  font-size: 13px;
  line-height: 1.6;
}

:lang(zh-CN) .ip-hero h1,
:lang(ja) .ip-hero h1 {
  letter-spacing: -0.03em;
  line-height: 1.08;
}

:lang(zh-CN) .ip-outro h2,
:lang(ja) .ip-outro h2 {
  letter-spacing: -0.02em;
  line-height: 1.12;
}

@media (max-width: 1199px) {
  .ip-hero {
    gap: 40px;
  }

  .ip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 809px) {
  .ip-page {
    width: auto;
    margin: 0 18px;
  }

  .ip-hero {
    grid-template-columns: 1fr;
    padding: 88px 0 80px;
  }

  .ip-day {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .ip-stage {
    display: none;
  }

  .ip-step {
    min-height: auto;
    padding: 64px 0 16px;
    opacity: 1;
  }

  .ip-mph {
    display: flex;
    position: relative;
    justify-content: center;
    margin-top: 28px;
    padding: 8px 0;
  }

  .ip-sec {
    padding-top: 88px;
  }

  .ip-filmvid {
    margin-top: 36px;
    border-radius: 14px;
  }

  .ip-grid,
  .ip-plans {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .ip-qr {
    display: none;
  }

  .ip-outro {
    padding: 112px 0 88px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ip-hero-phone {
    animation: none;
  }
}

/* TestFlight application dialog (iphone-apply.js) */
button.ip-store {
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.ip-apply {
  --ip-apply-bg: #fff;
  --ip-apply-field: #f5f5f5;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--ip-apply-bg);
  color: var(--orvia-text, rgba(0, 0, 0, 0.9));
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.22);
  overflow: auto;
}

html[data-orvia-resolved-theme="dark"] .ip-apply {
  --ip-apply-bg: #16191e;
  --ip-apply-field: #20242a;
}

.ip-apply::backdrop {
  background: rgb(0 0 0 / 0.36);
  backdrop-filter: blur(4px);
}

.ip-apply-form,
.ip-apply-done {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px 28px 28px;
}

.ip-apply h2 {
  margin: 0;
  padding-right: 32px;
  font: 600 24px/1.2 "SF Pro Display Semibold", -apple-system, sans-serif;
  letter-spacing: -0.02em;
}

.ip-apply p {
  margin: 0;
}

.ip-apply-lead,
.ip-apply-done p {
  color: var(--orvia-text-secondary, rgba(0, 0, 0, 0.5));
  font-size: 15px;
  line-height: 1.5;
}

.ip-apply-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: var(--ip-apply-field);
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.ip-apply-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 14px;
}

.ip-apply-field > span,
.ip-apply-field legend {
  padding: 0;
  font-weight: 600;
}

.ip-apply-field small {
  color: var(--orvia-text-muted, rgba(0, 0, 0, 0.35));
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.4;
}

.ip-apply-field input,
.ip-apply-field select,
.ip-apply-field textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--ip-apply-field);
  color: inherit;
  font: inherit;
  font-size: 15px;
}

.ip-apply-field textarea {
  resize: vertical;
}

.ip-apply-field input:focus,
.ip-apply-field select:focus,
.ip-apply-field textarea:focus {
  border-color: var(--orvia-accent, #0a84ff);
  outline: none;
}

.ip-apply-field[hidden],
.ip-apply-form[hidden],
.ip-apply-done[hidden] {
  display: none;
}

.ip-apply-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ip-apply-check {
  position: relative;
  cursor: pointer;
}

.ip-apply-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ip-apply-check span {
  display: inline-block;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--ip-apply-field);
  font-size: 13.5px;
  transition: background 120ms ease, border-color 120ms ease;
}

.ip-apply-check input:checked + span {
  border-color: var(--orvia-text, rgba(0, 0, 0, 0.9));
  font-weight: 600;
}

.ip-apply-check input:focus-visible + span {
  outline: 2px solid var(--orvia-accent, #0a84ff);
  outline-offset: 2px;
}

.ip-apply-honey {
  position: absolute;
  left: -9999px;
}

.ip-apply-privacy {
  color: var(--orvia-text-muted, rgba(0, 0, 0, 0.35));
  font-size: 12.5px;
  line-height: 1.5;
}

.ip-apply-privacy a {
  color: inherit;
}

.ip-apply-status:empty {
  display: none;
}

.ip-apply-status {
  font-size: 13.5px;
}

.ip-apply-status.is-error {
  color: #d92d20;
}

.ip-apply-submit {
  height: 50px;
  border: 0;
  border-radius: 999px;
  background: #08090b;
  color: #fff;
  font: 600 16px/1 "SF Pro Display Semibold", -apple-system, sans-serif;
  cursor: pointer;
}

html[data-orvia-resolved-theme="dark"] .ip-apply-submit {
  background: #fff;
  color: #08090b;
}

.ip-apply-submit:disabled {
  opacity: 0.6;
  cursor: progress;
}
