/* Mobile apps, coming soon (how-it-works.html #mobile-apps).
   An example animation: only the outer .home-media frame and the step pills under it follow
   the contract. Everything inside the frame (the Swift editor, the iPhone and the example
   app) is someone else's app and can use any value. See AGENTS.md "Homepage example
   animations". The stage is drawn at 920 x 640 (420 x 560 on narrow frames, phone only) and
   scaled to the frame by home-mobile.js. */

.home-media.mob-media {
  position: relative;
  height: auto;
  aspect-ratio: 920 / 640;
  overflow: hidden;
}

.mob-media[data-narrow] {
  aspect-ratio: 420 / 560;
}

.mob-stage {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  box-sizing: border-box;
  width: 920px;
  height: 640px;
  padding: 0 34px 0 30px;
  transform: scale(var(--mob-s, 1));
  transform-origin: 0 0;
  font-family: -apple-system, "SF Pro Text", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  transition: opacity 0.5s ease;
}

.mob-media[data-narrow] .mob-stage {
  justify-content: center;
  width: 420px;
  height: 560px;
  padding: 0;
}

.mob-media[data-narrow] .mob-editor {
  display: none;
}

.mob-media[data-fade] .mob-stage {
  opacity: 0;
}

/* ---------- Swift editor ---------- */
.mob-editor {
  width: 530px;
  margin-top: 78px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 12px;
  background: #1c1c20;
  box-shadow:
    0 30px 60px rgb(0 0 0 / 45%),
    0 2px 6px rgb(0 0 0 / 30%);
  color: #a1a1aa;
  font-size: 12px;
  line-height: 16px;
}

.mob-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 40px;
  padding: 0 12px 0 14px;
  border-bottom: 1px solid rgb(255 255 255 / 6%);
  background: #26262b;
}

.mob-lights {
  display: flex;
  gap: 7px;
}

.mob-lights i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f57;
}

.mob-lights i:nth-child(2) {
  background: #febc2e;
}

.mob-lights i:nth-child(3) {
  background: #28c840;
}

.mob-crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.mob-crumbs em {
  color: #5c5c66;
  font-style: normal;
}

.mob-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ececf1;
}

.mob-file i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(160deg, #fa7343, #f0442f);
}

.mob-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgb(255 255 255 / 6%);
  color: #d4d4da;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background 0.3s,
    color 0.3s;
}

.mob-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7a7a85;
  transition: background 0.3s;
}

.mob-media[data-issues] .mob-state {
  background: rgb(243 168 243 / 14%);
  color: var(--primary-pink);
}

.mob-media[data-issues] .mob-state i {
  background: var(--primary-pink);
}

.mob-media[data-done] .mob-state {
  background: rgb(110 226 160 / 14%);
  color: #6ee2a0;
}

.mob-media[data-done] .mob-state i {
  background: #6ee2a0;
}

.mob-code {
  position: relative;
  padding: 12px 0 14px;
}

.mob-scan {
  position: absolute;
  top: 12px;
  left: 0;
  width: 100%;
  height: 22px;
  background: linear-gradient(to right, transparent, rgb(255 255 255 / 9%) 40%, transparent);
  opacity: 0;
  transform: translateY(0);
}

.mob-media[data-scan] .mob-scan {
  opacity: 1;
  transform: translateY(330px);
  transition:
    transform 1.3s cubic-bezier(0.45, 0, 0.55, 1),
    opacity 0.2s;
}

.mob-ln {
  position: relative;
  display: flex;
  align-items: center;
  height: 22px;
  transition: background 0.4s;
}

.mob-ln i {
  flex: none;
  box-sizing: border-box;
  width: 42px;
  padding-right: 14px;
  color: #50505a;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-style: normal;
  text-align: right;
}

/* real code: its spaces and line breaks are part of the sample */
.mob-ln code {
  color: #e4e4e8;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  line-height: 22px;
  white-space: pre;
}

.mob-ln .k {
  color: #fc5fa3;
  font-weight: 600;
}

.mob-ln .ty {
  color: #5dd8ff;
}

.mob-ln .fn {
  color: #67b7a4;
}

.mob-ln .m {
  color: #a167e6;
}

.mob-ln .s {
  color: #fc6a5d;
}

.mob-ln .n {
  color: #d0bf69;
}

.mob-ln .new {
  display: none;
  padding: 1px 3px;
  border-radius: 4px;
  background: rgb(110 226 160 / 16%);
  color: #6ee2a0;
}

.mob-ln .old {
  text-decoration: underline wavy transparent 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.3s;
}

.mob-pill {
  position: absolute;
  top: 3px;
  right: 10px;
  padding: 0 8px;
  border-radius: 5px;
  background: rgb(243 168 243 / 16%);
  color: var(--primary-pink);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 16px;
  opacity: 0;
  transform: translateX(6px);
  transition:
    opacity 0.3s,
    transform 0.3s,
    background 0.3s,
    color 0.3s;
}

.mob-pill .ok {
  display: none;
}

.mob-ln.is-flag {
  background: rgb(243 168 243 / 7%);
}

.mob-ln.is-flag .old {
  text-decoration-color: var(--primary-pink);
}

.mob-ln.is-flag .mob-pill,
.mob-ln.is-fixed .mob-pill {
  opacity: 1;
  transform: none;
}

.mob-ln.is-fixed {
  background: rgb(110 226 160 / 7%);
}

.mob-ln.is-fixed .old,
.mob-ln.is-fixed .mob-pill .bad {
  display: none;
}

.mob-ln.is-fixed .new,
.mob-ln.is-fixed .mob-pill .ok {
  display: inline;
}

.mob-ln.is-fixed .new {
  animation: mob-pop 0.5s ease-out;
}

.mob-ln.is-fixed .mob-pill {
  background: rgb(110 226 160 / 16%);
  color: #6ee2a0;
}

.mob-media[data-done] .mob-ln.is-fixed {
  background: transparent;
}

@keyframes mob-pop {
  from {
    background: rgb(110 226 160 / 45%);
  }
}

.mob-foot {
  box-sizing: border-box;
  height: 36px;
  padding: 0 14px;
  border-top: 1px solid rgb(255 255 255 / 6%);
  background: #19191c;
  color: #8b8b95;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  line-height: 36px;
  white-space: nowrap;
}

.mob-foot b {
  color: var(--primary-pink);
  font-weight: 600;
}

.mob-media[data-done] .mob-foot b {
  color: #6ee2a0;
}

/* ---------- iPhone ---------- */
.mob-phone {
  position: relative;
  flex: none;
  width: 330px;
  height: 690px;
  margin-top: 40px;
  padding: 10px;
  box-sizing: border-box;
  border-radius: 56px;
  background: linear-gradient(150deg, #47474d, #1b1b1e 45%, #2c2c30);
  box-shadow:
    inset 0 0 0 1.5px rgb(255 255 255 / 16%),
    inset 0 0 0 5px #0c0c0e,
    0 40px 80px rgb(0 0 0 / 55%),
    0 0 0 1px rgb(0 0 0 / 60%);
}

.mob-phone::before,
.mob-phone::after {
  content: "";
  position: absolute;
  left: -3px;
  width: 3px;
  border-radius: 2px 0 0 2px;
  background: #2e2e32;
}

.mob-phone::before {
  top: 128px;
  height: 30px;
}

.mob-phone::after {
  top: 176px;
  height: 56px;
}

.mob-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  height: 100%;
  padding: 14px 18px;
  overflow: hidden;
  border-radius: 46px;
  background: #f2f2f7;
  color: #1c1c1e;
  font-size: 13px;
  line-height: 18px;
}

.mob-island {
  position: absolute;
  top: 11px;
  left: 50%;
  width: 98px;
  height: 29px;
  border-radius: 16px;
  background: #000;
  transform: translateX(-50%);
}

.mob-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  padding: 0 12px;
  font-size: 14px;
}

.mob-status b {
  font-weight: 600;
}

.mob-sys {
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.mob-sys i {
  width: 3px;
  height: 6px;
  border-radius: 1px;
  background: #1c1c1e;
}

.mob-sys i:nth-child(2) {
  height: 8px;
}

.mob-sys i:nth-child(3) {
  height: 10px;
}

.mob-sys u {
  width: 22px;
  height: 11px;
  margin-left: 5px;
  border-radius: 3px;
  background: #1c1c1e;
}

.mob-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 14px;
}

.mob-head b {
  font-size: 28px;
  font-weight: 700;
  line-height: 34px;
  letter-spacing: -0.4px;
}

.mob-head span,
.mob-sub {
  color: #8e8e93;
}

.mob-seg {
  display: flex;
  padding: 2px;
  border-radius: 9px;
  background: #e3e3e8;
  font-size: 12.5px;
  font-weight: 600;
}

.mob-seg span {
  flex: 1;
  padding: 5px 0;
  border-radius: 7px;
  color: #6c6c70;
  text-align: center;
}

.mob-seg .on {
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 12%);
  color: #1c1c1e;
}

.mob-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
}

.mob-card.is-picked {
  box-shadow: 0 0 0 2px #2f6bff;
}

.mob-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mob-row b {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
}

.mob-row em {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgb(47 107 255 / 12%);
  color: #2f6bff;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 700;
}

.mob-row span {
  font-weight: 600;
}

.mob-li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #3a3a3c;
}

/* a small round check drawn for the example app */
.mob-li::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background:
    linear-gradient(#fff, #fff) 5px 9px / 3px 1.6px no-repeat,
    linear-gradient(#fff, #fff) 7px 5px / 1.6px 6px no-repeat,
    #2f6bff;
  transform: rotate(40deg);
}

.mob-cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  margin-top: 32px;
  border-radius: 6px;
  background: #ff7a45;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition:
    background 0.6s,
    border-radius 0.6s,
    font-size 0.4s,
    font-weight 0.4s;
}

.mob-media[data-fix-font] .mob-cta {
  font-size: 16px;
  font-weight: 700;
}

.mob-media[data-fix-color] .mob-cta {
  background: #2f6bff;
}

.mob-media[data-fix-radius] .mob-cta {
  border-radius: 14px;
}

/* Grum's outline and tag on the button */
.mob-mark {
  position: absolute;
  inset: -6px;
  border: 2px dashed var(--primary-pink);
  border-radius: 10px;
  opacity: 0;
  transition:
    opacity 0.3s,
    border-color 0.3s,
    border-radius 0.6s;
}

.mob-media[data-fix-radius] .mob-mark {
  border-radius: 18px;
}

.mob-tag {
  position: absolute;
  bottom: calc(100% + 12px);
  left: -6px;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--primary-pink);
  color: var(--base-background);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.3s,
    transform 0.3s,
    background 0.3s;
}

.mob-media[data-marks] .mob-mark,
.mob-media[data-marks] .mob-tag {
  opacity: 1;
  transform: none;
}

.mob-media[data-done] .mob-mark {
  border-style: solid;
  border-color: #3ccf8e;
}

.mob-media[data-done] .mob-tag {
  background: #3ccf8e;
  color: #0d2a1c;
}

.mob-restore {
  color: #2f6bff;
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
}

/* ---------- steps under the frame (contract styles, as in Edit inline) ---------- */
.mob-steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--corner-small);
  color: var(--text-warm);
  font-size: var(--body-small-size);
}

.mob-step {
  display: inline-flex;
  align-items: center;
  gap: var(--corner-small);
  padding: var(--number) calc(var(--number) * 2);
  border: 1px solid var(--fade-10);
  border-radius: var(--corner-full);
  opacity: 0.55;
  transition:
    opacity 0.3s,
    border-color 0.3s,
    color 0.3s;
}

.mob-step b {
  font-family: var(--font-token);
  font-weight: var(--token-regular-weight);
}

.mob-step.on {
  border-color: var(--primary-pink);
  color: var(--text-on-base);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .mob-stage,
  .mob-stage * {
    transition: none !important;
    animation: none !important;
  }
}
