/* Friday Funded for iPhone — App Store-style footer entry and iOS install sheet. */

:is(body.landing-rebuild, body.site-subpage) .site-footer-terminal-action {
  display: grid !important;
  grid-template-columns: minmax(0, 390px) !important;
  justify-items: start;
  gap: 10px;
  width: min(100%, 390px) !important;
}

:is(body.landing-rebuild, body.site-subpage)
  .site-footer-terminal-action:has(> .site-footer-ios-button) {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px;
  width: min(100%, 520px) !important;
}

:is(body.landing-rebuild, body.site-subpage) .site-footer-terminal-button,
:is(body.landing-rebuild, body.site-subpage) .site-footer-ios-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  width: min(100%, 248px) !important;
  min-width: 0;
  min-height: 54px;
  padding: 8px 15px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 10px;
  background: #050506 !important;
  color: #fff;
  font: inherit;
  text-align: left;
  text-decoration: none;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

:is(body.landing-rebuild, body.site-subpage) :is(.site-footer-terminal-icon, .site-footer-ios-icon) {
  display: grid;
  width: 30px !important;
  height: 30px !important;
  flex: 0 0 30px;
  place-items: center;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #fff !important;
}

.site-footer-terminal-icon svg,
.site-footer-ios-icon img {
  width: 26px !important;
  height: 26px !important;
}

.site-footer-ios-icon img {
  display: block;
  filter: invert(1);
}

.site-footer-terminal-copy,
.site-footer-ios-copy {
  display: block;
  min-width: 0;
}

.site-footer-terminal-copy small,
.site-footer-terminal-arrow {
  display: none !important;
}

.site-footer-terminal-copy strong,
.site-footer-ios-copy strong {
  overflow: hidden;
  color: #fff !important;
  font-family: "Friday Golos Text", "Golos Text", "Friday Roboto", Arial, sans-serif;
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.025em !important;
  line-height: 1.1 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(body.landing-rebuild, body.site-subpage)
  .site-footer-terminal-action:has(> .site-footer-ios-button)
  > :is(.site-footer-terminal-button, .site-footer-ios-button) {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  justify-content: stretch;
  justify-items: start;
  width: 100% !important;
  min-height: 56px;
  gap: 6px;
  padding-inline: clamp(8px, 3vw, 12px);
  overflow: hidden;
}

:is(body.landing-rebuild, body.site-subpage)
  .site-footer-terminal-action:has(> .site-footer-ios-button)
  :is(.site-footer-terminal-copy, .site-footer-ios-copy) {
  width: 100%;
}

:is(body.landing-rebuild, body.site-subpage)
  .site-footer-terminal-action:has(> .site-footer-ios-button)
  :is(.site-footer-terminal-icon, .site-footer-ios-icon) {
  width: 24px !important;
  height: 24px !important;
  flex-basis: 24px;
}

.site-footer-terminal-action:has(> .site-footer-ios-button)
  :is(.site-footer-terminal-icon svg, .site-footer-ios-icon img) {
  width: 22px !important;
  height: 22px !important;
}

.site-footer-terminal-action:has(> .site-footer-ios-button)
  :is(.site-footer-terminal-copy strong, .site-footer-ios-copy strong) {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(0.75rem, 3.2vw, 0.8rem) !important;
  line-height: 1.08 !important;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

@media (hover: hover) and (pointer: fine) {
  :is(body.landing-rebuild, body.site-subpage) .site-footer-terminal-button:hover,
  :is(body.landing-rebuild, body.site-subpage) .site-footer-ios-button:hover {
    border-color: #fff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
  }
}

:is(body.landing-rebuild, body.site-subpage) .site-footer-terminal-button:focus-visible,
:is(body.landing-rebuild, body.site-subpage) .site-footer-ios-button:focus-visible {
  outline: none;
  border-color: #fff;
  background: #111214 !important;
}

html.ff-ios-app-open,
body.ff-ios-app-open {
  overflow: hidden !important;
}

.ff-ios-app-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #f7f5f2;
}

.ff-ios-app-dialog::backdrop {
  background: rgba(0, 0, 0, 0.66);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.ff-ios-app-dialog[open] {
  display: block;
}

.ff-ios-app-sheet {
  --ff-ios-drag-y: 0px;
  position: absolute;
  bottom: 0;
  left: 50%;
  display: flex;
  width: min(100%, 590px);
  min-height: min(60dvh, 520px);
  max-height: calc(100dvh - 14px);
  flex-direction: column;
  padding: 8px clamp(24px, 6vw, 38px) max(18px, env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 0;
  border-radius: 38px 38px 0 0;
  background:
    radial-gradient(circle at 82% -16%, rgba(239, 48, 47, 0.1), transparent 36%),
    #121316;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 -22px 70px rgba(0, 0, 0, 0.46);
  color: #f7f5f2;
  transform: translate3d(-50%, var(--ff-ios-drag-y), 0);
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  animation: ff-ios-sheet-enter 240ms cubic-bezier(0.22, 0.78, 0.28, 1) both;
}

.ff-ios-app-sheet::-webkit-scrollbar {
  display: none;
}

.ff-ios-app-drag-zone {
  display: grid;
  width: 100%;
  min-height: 34px;
  flex: 0 0 34px;
  place-items: start center;
  padding: 5px 0 0;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.ff-ios-app-drag-zone:active {
  cursor: grabbing;
}

.ff-ios-app-handle {
  display: block;
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.ff-ios-app-title {
  display: grid;
  align-content: start;
  justify-items: center;
  width: 100%;
  margin: 9px auto 0;
  color: #f7f5f2;
  font-family: "Friday Golos Text", "Golos Text", "Friday Roboto", Arial, sans-serif;
  font-size: clamp(2rem, 8.9vw, 3rem);
  font-style: normal !important;
  font-weight: 900;
  font-variation-settings: "wght" 900;
  letter-spacing: -0.01em;
  line-height: 0.92;
  text-align: center;
  text-transform: uppercase;
}

body.landing-rebuild dialog.ff-ios-app-dialog
  .ff-ios-app-title:not(#ff-ios-title-a):not(#ff-ios-title-b):not(#ff-ios-title-c),
body.site-subpage dialog.ff-ios-app-dialog
  .ff-ios-app-title:not(#ff-ios-title-a):not(#ff-ios-title-b):not(#ff-ios-title-c) {
  margin-top: 9px !important;
  color: #f7f5f2 !important;
  font-family: "Friday Golos Text", "Golos Text", "Friday Roboto", Arial, sans-serif !important;
  font-size: clamp(2rem, 8.9vw, 3rem) !important;
  font-style: normal !important;
  font-weight: 900 !important;
  font-variation-settings: "wght" 900 !important;
  letter-spacing: -0.01em !important;
  line-height: 0.92 !important;
  text-align: center !important;
  text-transform: uppercase !important;
}

.ff-ios-app-title > span {
  display: block;
  max-width: 12ch;
}

.ff-ios-app-title-accent {
  color: #ef302f;
}

.ff-ios-app-steps {
  display: grid;
  gap: 11px;
  width: 100%;
  margin: 24px 0 0;
  padding: 0 0 0 1.35em;
  color: #f3f1ee;
  list-style: decimal;
}

.ff-ios-app-steps li {
  padding-left: 5px;
  color: #f3f1ee;
  font-family: "Friday Roboto", "Roboto", Arial, sans-serif;
  font-size: clamp(0.91rem, 3.8vw, 1.03rem);
  font-weight: 470;
  letter-spacing: -0.018em;
  line-height: 1.31;
}

.ff-ios-app-steps li::marker {
  font-variant-numeric: tabular-nums;
  font-weight: 520;
}

.ff-ios-app-primary {
  display: grid;
  width: 100%;
  min-height: 58px;
  margin-top: 24px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #ef302f;
  color: #fff;
  font-family: "Golos Text", "Friday Roboto", Arial, sans-serif;
  font-size: 0.98rem;
  font-weight: 680;
  letter-spacing: -0.025em;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(239, 48, 47, 0.22);
}

.ff-ios-app-url {
  align-self: center;
  margin: 11px auto 0;
  color: rgba(232, 230, 226, 0.42);
  font-family: "Friday Roboto", "Roboto", Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 530;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.ff-ios-app-primary:focus-visible,
.ff-ios-app-url:focus-visible {
  outline: 2px solid #ef302f;
  outline-offset: 3px;
}

.ff-ios-app-drag-zone:focus-visible {
  outline: none;
}

.ff-ios-app-drag-zone:focus-visible .ff-ios-app-handle {
  background: rgba(255, 255, 255, 0.42);
}

.ff-ios-app-dialog.is-installed .ff-ios-app-steps {
  display: none;
}

.ff-ios-app-sheet:is(.is-dragging, .is-settling, .is-dismissing) {
  animation: none;
  will-change: transform, opacity;
}

.ff-ios-app-sheet.is-dragging {
  transition: none;
  user-select: none;
}

.ff-ios-app-sheet.is-settling {
  transition: transform 220ms cubic-bezier(0.22, 0.8, 0.28, 1);
}

.ff-ios-app-sheet.is-dismissing {
  opacity: 0;
  transition: transform 190ms cubic-bezier(0.4, 0, 1, 1), opacity 160ms linear;
}

@keyframes ff-ios-sheet-enter {
  from {
    opacity: 0;
    translate: 0 22px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@media (min-width: 700px) {
  .ff-ios-app-sheet {
    width: min(590px, calc(100% - 40px));
    min-height: min(560px, 72dvh);
    border-radius: 38px 38px 0 0;
  }

  body.landing-rebuild dialog.ff-ios-app-dialog
    .ff-ios-app-title:not(#ff-ios-title-a):not(#ff-ios-title-b):not(#ff-ios-title-c),
  body.site-subpage dialog.ff-ios-app-dialog
    .ff-ios-app-title:not(#ff-ios-title-a):not(#ff-ios-title-b):not(#ff-ios-title-c) {
    font-size: 3rem !important;
  }
}

@media (max-width: 620px) {
  body.landing-rebuild
    .site-footer-terminal-action.site-footer-actions:has(> .site-footer-ios-button),
  body.site-subpage
    .site-footer-terminal-action.site-footer-actions:has(> .site-footer-ios-button) {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: none !important;
  }

  html[lang="ru"]
    :is(body.landing-rebuild, body.site-subpage)
    .site-footer-terminal-action:has(> .site-footer-ios-button)
    .site-footer-ios-copy {
    max-width: 100px;
  }

  .ff-ios-app-sheet {
    padding-inline: 24px;
  }
}

@media (max-width: 360px) {
  .ff-ios-app-sheet {
    min-height: min(63dvh, 520px);
    padding-inline: 20px;
    border-radius: 32px 32px 0 0;
  }

  body.landing-rebuild dialog.ff-ios-app-dialog
    .ff-ios-app-title:not(#ff-ios-title-a):not(#ff-ios-title-b):not(#ff-ios-title-c),
  body.site-subpage dialog.ff-ios-app-dialog
    .ff-ios-app-title:not(#ff-ios-title-a):not(#ff-ios-title-b):not(#ff-ios-title-c) {
    font-size: 1.86rem !important;
  }

  .ff-ios-app-steps {
    gap: 9px;
    margin-top: 20px;
  }

  .ff-ios-app-primary {
    min-height: 54px;
    margin-top: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(body.landing-rebuild, body.site-subpage) .site-footer-ios-button,
  .ff-ios-app-sheet,
  .ff-ios-app-sheet:is(.is-dragging, .is-settling, .is-dismissing) {
    animation: none !important;
    transition: none !important;
  }
}
