/*
 * AppMaster: the page is a phone home screen.
 *
 * On a phone the screen fills the viewport; on a wide screen it sits in a
 * device frame next to the pitch. Everything inside the screen is sized in
 * container units (cqw) so the frame and a real phone look the same.
 * Inside the screen we use the system UI font (it should feel native); the
 * display serif is for the brand voice only.
 */

@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  --wall-a: #f46a43;
  --wall-b: #d63f1c;
  --paper: #f3ede3;
  --sheet: #fbf8f2;
  --field: #ffffff;
  --ink: #1b1a17;
  --ink-2: #57534b;
  --ink-3: #8c867b;
  --hair: rgba(27, 26, 23, .1);
  --hair-2: rgba(27, 26, 23, .18);
  --accent: #dc4423;
  --danger: #c4361c;
  --glass: rgba(255, 255, 255, .2);
  --banner: rgba(251, 248, 242, .9);
  --squircle: 22.5%;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-display: "Instrument Serif", ui-serif, Georgia, serif;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --wall: var(--grain), radial-gradient(130% 85% at 10% 0%, var(--wall-a) 0%, var(--wall-b) 100%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --wall-a: #c4441f;
    --wall-b: #6f1c0a;
    --paper: #12110f;
    --sheet: #1c1b18;
    --field: #262420;
    --ink: #f3eee6;
    --ink-2: #c4beb3;
    --ink-3: #8d877c;
    --hair: rgba(243, 238, 230, .1);
    --hair-2: rgba(243, 238, 230, .18);
    --accent: #ff7d58;
    --danger: #ff7a61;
    --glass: rgba(20, 12, 8, .28);
    --banner: rgba(38, 36, 32, .9);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grain), var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.is-locked { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.spinner {
  width: 16px; height: 16px; border-radius: 999px; display: inline-block; vertical-align: -3px;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* An emoji on a colour: the icon style used for drafts and examples. */
.tile {
  display: grid; place-items: center;
  width: 100%; height: 100%;
  background: var(--c, #2f8f62);
  line-height: 1;
}

/* ================================================================ stage */

.stage { min-height: 100dvh; }

.pitch { display: none; }

@media (min-width: 900px) {
  .stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(40px, 6vw, 112px);
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px clamp(32px, 5vw, 80px);
  }
  .pitch { display: block; max-width: 620px; }
}

/* The AppMaster mark: three tiles and a plus on a solid badge with a hard shadow. */
.wordmark, .brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-weight: 900; letter-spacing: -.02em;
}
.wordmark-badge {
  flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--edge, #1b1a17);
  box-shadow: 0 3px 0 var(--edge, #1b1a17);
}
.wordmark-badge svg { display: block; }
.wordmark { color: var(--ink); font-size: 19px; }
.wordmark .wordmark-badge { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; }

.pitch h1 {
  margin: 64px 0 24px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(56px, 5.4vw, 80px);
  line-height: .96;
  letter-spacing: -.02em;
}
.pitch h1 em { font-style: italic; }
.pitch-copy { max-width: 22em; font-size: 20px; line-height: 1.45; color: var(--ink-2); }

/* ================================================================ device */

.device { position: relative; }

.screen {
  container-type: inline-size;
  position: relative;
  height: 100dvh;
  overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--wall);
  color: #fff;
  --icon: 16cqw;
}

@media (min-width: 900px) {
  .device {
    width: min(404px, calc((100dvh - 72px) * 0.46));
    aspect-ratio: 390 / 844;
    padding: 11px;
    border-radius: 60px;
    background: #0d0d0d;
    box-shadow:
      inset 0 0 0 1.5px #3a3a3a,
      0 0 0 1px rgba(0, 0, 0, .55),
      0 50px 90px -40px rgba(40, 16, 6, .55);
  }
  .device::before { /* dynamic island */
    content: ""; position: absolute; z-index: 90;
    top: 22px; left: 50%; translate: -50% 0;
    width: 30%; height: 30px; border-radius: 20px; background: #000;
  }
  .screen { height: 100%; border-radius: 49px; }
}

.statusbar { display: none; }
@media (min-width: 900px) {
  .statusbar {
    display: flex; align-items: center; justify-content: space-between;
    height: 52px; padding: 6px 30px 0 34px; flex: none;
    font-size: 15px; font-weight: 600; letter-spacing: -.01em;
  }
  .statusbar svg { display: block; }
  .sb-icons { display: flex; gap: 6px; align-items: center; }
}

/* Brand in the middle, account on the right: one line, like a title bar. */
.topline {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: calc(env(safe-area-inset-top) + 10px) 18px 0;
  flex: none;
}
.topline .account-btn { grid-column: 3; justify-self: end; }
.brand { grid-column: 2; color: #fff; font-size: 17px; gap: 8px; }
.brand .wordmark-badge {
  width: 28px; height: 28px; border-radius: 8px;
  background: #fbf8f2; color: var(--accent);
  --edge: #2a0c04;
  box-shadow: 0 2px 0 #2a0c04;
}
.brand .wordmark-badge svg { width: 15px; height: 15px; }
@media (min-width: 900px) { .topline { padding-top: 0; } }

.account-btn {
  display: grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  color: #fff;
  transition: transform .15s ease;
}
.account-btn:active { transform: scale(.92); }
.account-btn svg { display: block; }
.account-btn.is-avatar { background: #fff; }
.avatar { font-size: 14px; font-weight: 800; line-height: 1; color: var(--wall-b); text-transform: uppercase; }

/* ================================================================ home */

.home {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  align-content: start; justify-items: center;
  gap: 4.6cqw 0;
  padding: 3cqw 4.5cqw 4cqw;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
}
.home::-webkit-scrollbar { display: none; }

/* The one widget: the pitch and the way in */
.widget {
  grid-column: 1 / -1; width: 100%;
  margin-bottom: 1.4cqw;
  padding: 6cqw 5.6cqw 5.6cqw;
  border-radius: 7cqw;
  background: var(--sheet); color: var(--ink);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .08), 0 14px 28px -16px rgba(40, 10, 0, .55);
}
.widget-title {
  margin: 0 0 5.6cqw;
  font-family: var(--font-display); font-weight: 400;
  font-size: 10.6cqw; line-height: .96; letter-spacing: -.015em;
}
.widget-title em { font-style: italic; }
.widget-cta {
  display: block; width: 100%;
  padding: 3.4cqw;
  border: 0; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 4.2cqw; font-weight: 700;
  transition: transform .15s ease;
}
.widget-cta:active { transform: scale(.97); }

/* An app on the home screen */
.app {
  display: grid; justify-items: center; gap: 1.6cqw;
  width: 100%; padding: 0;
  border: 0; background: none; color: #fff;
  -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
}
.app .icon {
  position: relative;
  width: var(--icon); aspect-ratio: 1;
  border-radius: var(--squircle);
  overflow: hidden;
  background: rgba(255, 255, 255, .22);
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, .18), 0 8px 16px -8px rgba(0, 0, 0, .45);
  transition: transform .14s ease, filter .14s ease;
  font-size: calc(var(--icon) * .56);
}
.app:active .icon { transform: scale(.9); filter: brightness(.85); }
.app .icon > img { width: 100%; height: 100%; object-fit: cover; }
.app .label {
  max-width: calc(var(--icon) + 4.5cqw);
  font-size: 3.05cqw; font-weight: 500; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.app.is-new .icon { animation: pop .55s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.app .icon.add {
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .12);
  border: 1.5px dashed rgba(255, 255, 255, .75);
  box-shadow: none;
  font-size: calc(var(--icon) * .5); font-weight: 300; line-height: 1;
}
.app .badge {
  position: absolute; top: -1.2cqw; right: -1.2cqw;
  min-width: 5.4cqw; height: 5.4cqw; padding: 0 1.4cqw; border-radius: 999px;
  display: grid; place-items: center;
  background: #ff3b30; color: #fff; font-size: 3cqw; font-weight: 700;
  box-shadow: 0 0 0 .6cqw rgba(0, 0, 0, .08);
}
.app { position: relative; }

/* App-Store style install ring while a page is being built */
.veil {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, .42);
}
.ring { width: 52%; height: 52%; overflow: visible; }
.ring circle { fill: none; stroke-width: 4.5; }
.ring .track { stroke: rgba(255, 255, 255, .32); }
.ring .bar {
  stroke: #fff; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p, 0) * 100);
  transform: rotate(-90deg); transform-origin: 50% 50%;
  transition: stroke-dashoffset .6s ease;
}
.is-waiting .ring { animation: spin 1s linear infinite; }
.is-waiting .ring .bar { stroke-dashoffset: 72; }

/* Dock: the example apps */
.dock-wrap { flex: none; padding: 0 3cqw calc(3cqw + env(safe-area-inset-bottom)); }
.dock {
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 3.6cqw 1.5cqw;
  border-radius: 8.4cqw;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%);
}

/* ================================================================ notifications */

.banners {
  position: absolute; z-index: 80;
  top: calc(env(safe-area-inset-top) + 8px); left: 2.6cqw; right: 2.6cqw;
  display: grid; gap: 8px;
  pointer-events: none;
}
@media (min-width: 900px) { .banners { top: 58px; } }
.banner {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  border: 0; border-radius: 20px; text-align: left;
  background: var(--banner); color: var(--ink);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .45);
  animation: drop .38s cubic-bezier(.2, 1.1, .3, 1) both;
}
.banner.is-leaving { animation: lift .25s ease-in both; }
@keyframes drop { from { transform: translateY(-120%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lift { to { transform: translateY(-120%); opacity: 0; } }
.banner-icon { flex: none; width: 38px; height: 38px; border-radius: 9px; overflow: hidden; font-size: 21px; }
.banner-icon img { width: 100%; height: 100%; object-fit: cover; }
.banner-icon .tile { color: #fff; font-weight: 700; }
.banner-text { min-width: 0; font-size: 13.5px; line-height: 1.3; }
.banner-text b { display: block; font-size: 14px; font-weight: 650; }
.banner-text span { color: var(--ink-2); }
.banner.is-error .banner-text b { color: var(--danger); }

/* ================================================================ sheets */

.scrim {
  position: absolute; inset: 0; z-index: 40;
  background: rgba(0, 0, 0, .38);
  opacity: 0; transition: opacity .28s ease;
}
.scrim.is-on { opacity: 1; }

.sheet {
  position: absolute; z-index: 45; left: 0; right: 0; bottom: 0;
  max-height: calc(100% - 40px);
  display: flex; flex-direction: column;
  border-radius: 26px 26px 0 0;
  background: var(--sheet); color: var(--ink);
  box-shadow: 0 -12px 40px -16px rgba(0, 0, 0, .45);
  transform: translateY(105%);
  transition: transform .34s cubic-bezier(.2, .9, .25, 1);
}
.sheet.is-open { transform: none; }
.grabber { flex: none; width: 36px; height: 5px; margin: 7px auto 0; border-radius: 3px; background: var(--hair-2); }
.sheet-head {
  flex: none;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 6px 16px 4px;
}
.sheet-head h2 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.text-btn {
  justify-self: start;
  padding: 8px 0; border: 0; background: none;
  color: var(--accent); font-size: 16px; font-weight: 500;
}
.sheet-body { overflow-y: auto; padding: 10px 16px 14px; display: grid; gap: 14px; }
.sheet-foot {
  flex: none;
  display: grid; gap: 8px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hair);
}
.sheet-lede { font-size: 15px; color: var(--ink-2); text-align: center; text-wrap: pretty; }

.field, .big-input {
  width: 100%;
  border: 0; border-radius: 12px;
  background: var(--field); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--hair-2);
  padding: 12px 14px; font-size: 16px; /* 16px stops iOS zooming on focus */
  transition: box-shadow .15s ease;
}
.big-input {
  display: block; min-height: 118px; resize: none;
  padding: 14px 16px; border-radius: 16px;
  font-size: 19px; font-weight: 500; line-height: 1.35;
}
.field:focus, .big-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.kind-hint { margin: 8px 4px 0; font-size: 13.5px; font-weight: 600; color: var(--accent); }
.field::placeholder, .big-input::placeholder { color: var(--ink-3); }

.identity { display: flex; align-items: center; gap: 12px; }
.icon-pick {
  position: relative; flex: none;
  width: 58px; height: 58px; padding: 0;
  border: 0; border-radius: var(--squircle); overflow: hidden;
  font-size: 33px;
  box-shadow: 0 3px 10px -3px rgba(0, 0, 0, .35);
}
.icon-pick img { width: 100%; height: 100%; object-fit: cover; }
.icon-pick::after {
  content: "Edit";
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2px 0; background: rgba(0, 0, 0, .38);
  color: #fff; font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.identity .field { flex: 1; min-width: 0; }

.picker {
  display: grid; gap: 12px;
  padding: 12px; border-radius: 16px;
  background: var(--field); box-shadow: inset 0 0 0 1px var(--hair-2);
}
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-grid button {
  aspect-ratio: 1; padding: 0;
  border: 0; border-radius: 10px; background: none;
  font-size: 22px; line-height: 1;
}
.emoji-grid button[aria-pressed="true"] { background: var(--hair-2); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches button {
  width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--field), 0 0 0 4px var(--ink); }
.upload-link {
  position: relative; justify-self: start;
  color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer;
}
.upload-link input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.btn-primary, .btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px 16px;
  border: 0; border-radius: 14px;
  font-size: 17px; font-weight: 650; text-decoration: none;
  transition: transform .12s ease, opacity .12s ease;
}
.btn-primary { background: var(--ink); color: var(--sheet); }
.btn-secondary { background: var(--hair); color: var(--ink); }
.btn-primary:active, .btn-secondary:active { transform: scale(.98); }
.btn-primary:disabled, .btn-secondary:disabled { opacity: .45; cursor: not-allowed; }

.fine { margin: 0; text-align: center; font-size: 12.5px; color: var(--ink-3); text-wrap: pretty; }
.fine button { padding: 0; border: 0; background: none; color: var(--accent); font-weight: 600; }
.form-error { margin: 0; color: var(--danger); font-size: 14px; font-weight: 600; text-align: center; }
.password-row { position: relative; }
.password-row .field { padding-right: 72px; }
.reveal {
  position: absolute; right: 6px; top: 50%; translate: 0 -50%;
  padding: 8px 10px; border: 0; background: none;
  color: var(--accent); font-size: 14px; font-weight: 600;
}
.password-box {
  display: grid; gap: 8px;
  padding: 14px; border-radius: 16px;
  background: var(--field); box-shadow: inset 0 0 0 1px var(--hair-2);
}
.password-box .fine { text-align: left; }
.password-title { font-size: 15px; font-weight: 650; }
.code-input { font-size: 26px; font-weight: 600; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }

/* ================================================================ app view */

.appview {
  position: absolute; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  background: var(--sheet); color: var(--ink);
  transform-origin: var(--ox, 50%) var(--oy, 50%);
}
.appview.is-opening { animation: open-app .34s cubic-bezier(.2, .85, .25, 1) both; }
.appview.is-closing { animation: close-app .24s cubic-bezier(.4, 0, .9, .6) both; }
@keyframes open-app { from { transform: scale(.14); opacity: 0; border-radius: 40px; } to { transform: none; opacity: 1; } }
@keyframes close-app { to { transform: scale(.14); opacity: 0; border-radius: 40px; } }

.av-head {
  position: relative; flex: none;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: calc(env(safe-area-inset-top) + 6px) 12px 8px;
  border-bottom: 1px solid var(--hair);
}
@media (min-width: 900px) { .av-head { padding-top: 50px; } }
.av-title { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 56cqw; font-size: 15px; font-weight: 650; }
.av-title span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini { flex: none; width: 24px; height: 24px; border-radius: 6px; overflow: hidden; font-size: 14px; }
.mini img { width: 100%; height: 100%; object-fit: cover; }
.av-more {
  justify-self: end;
  width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--hair); color: var(--ink);
  display: grid; place-items: center;
}
.menu {
  position: absolute; z-index: 5; right: 12px; top: calc(100% - 2px);
  min-width: 210px; overflow: hidden;
  border-radius: 14px;
  background: var(--field);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .4), inset 0 0 0 1px var(--hair);
}
.menu button {
  display: block; width: 100%; padding: 12px 16px;
  border: 0; background: none; text-align: left;
  font-size: 15px; color: var(--ink);
}
.menu button + button { border-top: 1px solid var(--hair); }
.menu .danger { color: var(--danger); }
.menu button:disabled { opacity: .4; }

.av-body { position: relative; flex: 1; min-height: 0; background: #fff; }
.av-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.av-state {
  position: absolute; inset: 0;
  display: grid; align-content: center; justify-items: center; gap: 12px;
  padding: 28px; text-align: center;
  background: var(--sheet); color: var(--ink);
}
.av-state .big-icon {
  position: relative; width: 96px; height: 96px; margin-bottom: 6px;
  border-radius: var(--squircle); overflow: hidden; font-size: 54px;
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .45);
}
.av-state .big-icon img { width: 100%; height: 100%; object-fit: cover; }
.av-state h3 { font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.av-state p { max-width: 30ch; font-size: 14.5px; color: var(--ink-2); }
.av-state .is-danger { color: var(--danger); }

.av-bar {
  flex: none;
  display: grid; gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hair);
  background: var(--sheet);
}
.av-quote {
  margin: 2px 4px 2px;
  font-family: var(--font-display); font-style: italic;
  font-size: 21px; line-height: 1.15; text-align: center; text-wrap: balance;
  color: var(--ink);
}
.change { display: flex; align-items: flex-end; gap: 8px; }
.change textarea {
  flex: 1; min-width: 0;
  min-height: 44px; max-height: 132px; resize: none;
  padding: 11px 16px; border-radius: 22px;
  line-height: 1.35;
}
.send {
  flex: none; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
}
.send:disabled { opacity: .4; }
@media (prefers-color-scheme: dark) {
  /* white on the lighter dark-mode accent is too faint */
  .widget-cta, .send { color: #1b0d07; }
}
.av-meta { display: flex; justify-content: space-between; gap: 8px; padding: 0 6px; font-size: 12.5px; color: var(--ink-3); }
.av-meta button { padding: 0; border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 12.5px; }
.av-actions { display: flex; gap: 8px; }
.av-actions .btn-primary { flex: 1; width: auto; padding: 13px 14px; font-size: 16px; }
.square-btn {
  flex: none; width: 50px; padding: 0;
  border: 0; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--hair); color: var(--ink);
}

/* ================================================================ install page (/a/<id>) */

body.page-install { background: var(--wall); color: #fff; }

.install {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: calc(env(safe-area-inset-top) + 24px) 16px calc(28px + env(safe-area-inset-bottom));
}
.install-card { width: min(100%, 400px); text-align: center; }
.install-icon {
  width: 120px; margin: 0 auto 16px;
  aspect-ratio: 1; border-radius: var(--squircle); object-fit: cover;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .2), 0 24px 40px -18px rgba(0, 0, 0, .55);
}
.install-card h1 {
  font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1;
  overflow-wrap: anywhere; text-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.install-sub { margin: 6px 0 24px; font-size: 16px; opacity: .9; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }

.install-card > div:not([hidden]) {
  padding: 16px; border-radius: 24px;
  background: var(--sheet); color: var(--ink);
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .55);
}
.install-card > div .install-sub { margin: 0 0 14px; color: var(--ink-2); opacity: 1; }

.ios-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; text-align: left; }
.ios-steps li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 14px;
  background: var(--field); box-shadow: inset 0 0 0 1px var(--hair);
  font-size: 15px;
}
.ios-steps b {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--sheet); font-size: 13px;
}
.ios-steps svg { flex: none; margin-left: auto; color: var(--accent); }
.ios-steps em { font-style: normal; font-weight: 700; }

/* Buttons the install page and 404 use */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 16px; border: 0; border-radius: 14px;
  font-size: 16px; font-weight: 650; text-decoration: none;
  transition: transform .12s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; }
.btn-accent { background: var(--ink); color: var(--sheet); }
.btn-ghost { background: var(--hair); color: var(--ink); }
.btn-lg { padding: 15px 18px; font-size: 17px; }
.btn-block { width: 100%; }
.install-preview { margin-top: 8px; }

.install-foot { margin-top: 22px; font-size: 14px; }
.install-foot a { color: #fff; opacity: .9; }

.bounce-arrow {
  position: fixed; z-index: 5; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom));
  width: 36px; height: 36px; margin-left: -18px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--wall-b);
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .5);
  animation: bounce 1.2s ease-in-out infinite; pointer-events: none;
}
.bounce-arrow.is-right { left: auto; right: 22px; margin-left: 0; } /* Safari 26: "•••" sits bottom right */
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ================================================================ launched app (standalone) */

.launch {
  position: fixed; inset: 0;
  display: grid; place-items: center; text-align: center;
  padding: 24px;
  background: var(--app-color, #fff); color: #111;
}
@media (prefers-color-scheme: dark) { .launch { background: var(--app-color, #000); color: #f2f2f2; } }
.launch-inner { display: grid; justify-items: center; gap: 18px; width: min(100%, 340px); }
.launch-inner .app-icon, .launch-icon { width: 96px; aspect-ratio: 1; border-radius: var(--squircle); object-fit: cover; }
.launch-bar { width: 140px; height: 4px; border-radius: 999px; background: rgba(127, 127, 127, .3); overflow: hidden; }
.launch-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: currentColor; animation: load 2.6s cubic-bezier(.3, .1, .2, 1) forwards; }
@keyframes load { 0% { width: 0; } 55% { width: 72%; } 80% { width: 78%; } 100% { width: 100%; } }
.launch-emoji { font-size: 4rem; line-height: 1; animation: pop .5s cubic-bezier(.22, 1.6, .36, 1) both; }
.launch h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; text-wrap: balance; overflow-wrap: anywhere; }
.launch p { font-size: .9rem; opacity: .65; }
.launch a { color: inherit; }

/* The AI page, framed edge to edge; the splash shows until it has loaded. */
.launch-frame {
  position: fixed; inset: 0; z-index: 2;
  width: 100%; height: 100%; border: 0;
  background: #fff; opacity: 0; transition: opacity .2s ease;
}
.launch-frame.is-loaded { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
