/* Last-loaded homepage phone safety net. Beats taiko / style / later custom rules. */

.hero-interview__mount,
.hero-interview__portal {
  display: contents;
}

.hero-interview__sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: auto;
  max-width: 100%;
  pointer-events: none;
  transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-interview__backdrop,
.hero-interview__handle {
  display: none;
}

.hero-interview__messages {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  display: flex;
  width: min(620px, calc(100vw - 40px));
  box-sizing: border-box;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
  height: min(38vh, 260px);
  overflow-y: auto;
  padding: 22px 8px 22px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.34) transparent;
  pointer-events: auto;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  justify-content: flex-start;
  transform: translateX(-50%);
}

.hero-interview__messages.has-overflow {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
}

.hero-interview__messages::-webkit-scrollbar { width: 8px; }
.hero-interview__messages::-webkit-scrollbar-track { background: transparent; }
.hero-interview__messages::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34) padding-box;
}
.hero-interview__messages::-webkit-scrollbar-thumb:hover { background-color: rgba(0, 0, 0, 0.6); }

.hero-interview__messages:empty { display: none; }

.hero-interview__message-row {
  display: flex;
  width: 100%;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 9px;
}

.hero-interview__message-row:first-child { margin-top: auto; }

.hero-interview__message-row--assistant { justify-content: flex-start; }
.hero-interview__message-row--user { justify-content: flex-end; }

.hero-interview__avatar {
  display: block;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  object-fit: cover;
  background: #ededed;
}

.hero-interview__avatar--user { display: block; padding: 0; overflow: hidden; border: 0; background: #000; clip-path: circle(50%); }
.hero-interview__avatar--user svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.hero-interview__avatar--assistant { width: 40px; height: 40px; flex-basis: 40px; padding: 5px; border: 0; background: #fff; object-fit: contain; }

.hero-interview__message {
  width: fit-content;
  max-width: min(90%, calc(100% - 50px));
  margin: 0;
  padding: 9px 12px;
  border-radius: 14px;
  font: 400 14px/1.45 "Geist", sans-serif;
  overflow-wrap: anywhere;
  text-align: start;
}

.hero-interview__message--assistant {
  color: #272727;
  background: #fff;
  border-bottom-left-radius: 5px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.hero-interview__message--user {
  align-self: flex-end;
  color: white;
  background: #000;
  border-bottom-right-radius: 5px;
}

.hero-interview__message--pending { color: #777; }
.hero-interview__message--error { color: #9c2d2d; }
.hero-interview__message--rate-limit { color: #111; }
.hero-interview__message.is-answer { animation: hero-answer-arrive 420ms cubic-bezier(0.2, 0, 0, 1) both; }

@keyframes hero-answer-arrive {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-interview__form {
  display: flex;
  width: min(360px, calc(100vw - 40px));
  box-sizing: border-box;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid #dedede;
  border-radius: 999px;
  background: #fff;
  text-align: left;
  pointer-events: auto;
  z-index: 10;
  transition: width 440ms cubic-bezier(0.34, 1.56, 0.64, 1), border-color 160ms ease, box-shadow 160ms ease;
}

/* Never leave a transform on the form — iOS zooms inputs inside transformed ancestors */
.hero-interview__form.slide-up {
  transform: none !important;
  animation: hero-interview-form-in 0.55s ease-out both;
}

.hero-interview__form.is-settled,
.hero-interview__form.is-title-ready {
  transform: none !important;
  animation: none !important;
  opacity: 1 !important;
}

@keyframes hero-interview-form-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 768px) {
  .hero-interview__form.slide-up {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

.hero-interview__form.is-title-ready { width: min(620px, calc(100vw - 40px)); }

.hero-interview__form:focus-within {
  border-color: #dedede;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.2);
}

.hero-interview__form textarea:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.hero-interview__form:has(textarea:focus-visible) {
  outline: 3px solid #171717;
  outline-offset: 3px;
}

.hero-interview__form textarea {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  min-height: 40px;
  max-height: 120px;
  resize: none;
  padding: 8px 9px;
  border: 0;
  outline: 0;
  color: #171717;
  background: transparent;
  /* 16px+: required to avoid mobile focus-zoom */
  font-family: "Geist", sans-serif;
  font-weight: 400;
  font-size: 16px !important;
  line-height: 1.25;
}

.hero-interview__form textarea::placeholder { color: #929292; white-space: nowrap; text-overflow: ellipsis; }

.hero-interview__voice,
.hero-interview__send {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.hero-interview__voice { color: #000; background: #f1f1f1; }
.hero-interview__voice:hover { background: #e6e6e6; }
.hero-interview__voice.is-recording { color: #b42121; background: #ffeded; animation: interview-pulse 1.2s ease-in-out infinite; }
.hero-interview__send { color: #fff; background: #000; }
.hero-interview__send:hover { background: #414141; transform: translateY(-1px); }
.hero-interview__voice:disabled,
.hero-interview__send:disabled { opacity: 0.45; cursor: wait; }
.hero-interview__form button:active { scale: 0.92; }
.hero-interview__voice svg,
.hero-interview__send svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

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

@keyframes interview-pulse {
  50% { box-shadow: 0 0 0 5px rgba(180, 33, 33, 0.12); }
}

@media (max-width: 1166px) {
  /* Closed: form stays inline under H1. Open: bottom-sheet popup after submit. */
  .page-home .hero-interview__sheet {
    display: flex;
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    width: 100%;
    max-height: none;
    flex-direction: column;
    align-items: center;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
    overflow: visible;
  }

  .page-home .hero-interview__form {
    gap: 10px;
    padding: 10px 12px;
  }

  .page-home .hero-interview__form textarea {
    min-height: 52px;
    max-height: 140px;
    padding: 10px;
  }

  .page-home .hero-interview__voice,
  .page-home .hero-interview__send {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }

  .page-home .hero-interview__voice svg,
  .page-home .hero-interview__send svg {
    width: 24px;
    height: 24px;
  }

  .page-home .hero-interview__handle,
  .page-home .hero-interview__messages {
    display: none;
  }

  .page-home .hero-interview__form,
  .page-home .hero-interview__form.is-title-ready,
  .page-home .hero-interview__form.is-settled {
    width: min(100%, calc(100vw - 40px)) !important;
    margin: 0;
  }

  body > .hero-interview__portal.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    pointer-events: none;
  }

  body > .hero-interview__portal.is-open .hero-interview__backdrop.is-open,
  .page-home .hero-interview__backdrop.is-open {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.45);
    pointer-events: auto;
  }

  body > .hero-interview__portal.is-open .hero-interview__sheet.is-open,
  .page-home .hero-interview__sheet.is-open {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    width: 100%;
    height: min(88dvh, 720px);
    max-height: min(88dvh, 720px);
    align-items: stretch;
    padding: 0 0 env(safe-area-inset-bottom, 0);
    border-radius: 24px 24px 0 0;
    background: #fff;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.22);
    pointer-events: auto;
    overflow: hidden;
    touch-action: pan-y;
    will-change: transform;
  }

  .page-home .hero-interview__sheet.is-open .hero-interview__handle {
    display: block;
    flex: 0 0 auto;
    width: 44px;
    height: 5px;
    margin: 12px auto 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
  }

  .page-home .hero-interview__sheet.is-open .hero-interview__messages {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 8px 16px 16px;
  }

  .page-home .hero-interview__sheet.is-open .hero-interview__form,
  .page-home .hero-interview__sheet.is-open .hero-interview__form.is-title-ready,
  .page-home .hero-interview__sheet.is-open .hero-interview__form.is-settled {
    width: calc(100% - 24px) !important;
    max-width: none;
    margin: 0 12px 12px;
    flex: 0 0 auto;
  }

  body.is-interview-open {
    overflow: hidden;
  }
}

@media (max-width: 520px) {
  .page-home .hero-interview__form textarea {
    min-height: 52px;
    padding: 10px 8px;
  }
  .page-home .hero-interview__voice,
  .page-home .hero-interview__send {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }
}

:where(button, [role="button"], input[type="button"], input[type="submit"]):active { scale: 0.97; }

@media (prefers-reduced-motion: reduce) {
  .hero-interview__voice.is-recording { animation: none; }
  .hero-interview__form { transition: none; }
  .hero-interview__message.is-answer { animation: none; }
  .hero-interview__messages { scroll-behavior: auto; }
  .page-home .hero-copy--home,
  .page-home .hero-copy--home .hero-title { transition: none; }
}

.page-home .tko-tile .prevent-hero__tags {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-start !important;
  align-content: flex-start !important;
  gap: 8px !important;
  row-gap: 8px !important;
  overflow: visible !important;
  mask-image: none !important;
  -webkit-mask-image: none !important;
  margin-top: 14px !important;
}

.page-home .tko-tile .prevent-hero__tag {
  display: inline-flex !important;
  align-items: center !important;
  position: static !important;
  float: none !important;
  flex: 0 0 auto !important;
  line-height: 1.2 !important;
  font-size: 10px !important;
  padding: 7px 10px !important;
  margin: 0 !important;
  white-space: nowrap !important;
  color: #111218 !important;
  border-color: rgba(17, 18, 24, 0.28) !important;
}

/* Smartphone only — desktop starts at 1167px */
@media (max-width: 1166px) {
  .page-home {
    --home-edge-pad: 8px;
    --home-gutter: 8px;
    --home-logo-height: 104px;
    --home-nav-height: 56px;
  }

  .page-home.is-edge-padded {
    --home-edge-pad: 8px;
  }

  .page-home #main-container {
    overflow-x: hidden;
    padding: 8px !important;
  }

  .page-home .wrapper {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .page-home .main-content--home,
  .page-home .tko-stories,
  .page-home .em-vf-5,
  .page-home #arcana-integration-03.section-medium,
  .page-home .ns-footer {
    margin-top: 8px;
    border-radius: 16px !important;
  }

  .page-home .main-content--home {
    margin-top: 0;
    overflow: hidden !important;
    isolation: isolate;
  }

  .page-home .header-wrapper--home {
    --home-logo-height: 104px;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    grid-template-columns: none !important;
    grid-template-areas: none !important;
    gap: 12px !important;
    padding: 14px 0 0 !important;
    overflow: visible !important;
  }

  .page-home .header__nav--left,
  .page-home .header__nav--right {
    display: contents !important;
  }

  .page-home .header__navs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    clip-path: inset(0 0 20px 0);
    gap: 4px !important;
    width: 100% !important;
    padding: 12px 28px 28px 24px !important;
    margin: 0 0 -20px !important;
    cursor: grab !important;
    touch-action: pan-x !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    user-select: none;
  }

  .page-home .elastic-pulse-btn-navi {
    padding: 6px 4px !important;
  }

  .page-home .elastic-pulse-btn-navi__content {
    padding: 16px 28px !important;
  }

  .page-home .elastic-pulse-btn-navi__span {
    font-size: 14px !important;
    line-height: 1.2 !important;
  }

  .page-home .hero-stage--home {
    align-items: center !important;
    padding: calc(14px + var(--home-logo-height, 104px) + 12px + var(--home-nav-height, 56px)) 8px 48px !important;
  }

  .page-home .hero-copy--home .hero-title,
  .page-home .tko-stories__headline {
    font-size: 38px !important;
    letter-spacing: -0.06em !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .page-home .hero-copy--home .hero-title {
    line-height: 1.2 !important;
    word-spacing: 0.2em !important;
  }

  .page-home .tko-stories__headline {
    line-height: 0.92 !important;
  }

  .page-home .hero-copy--home .hero-title__line {
    white-space: normal !important;
    overflow: visible !important;
    max-width: 100% !important;
    line-height: inherit !important;
  }

  .page-home .hero-copy--home .hero-title__word:not(:last-child) {
    margin-right: 0.4em !important;
  }

  .page-home .tko-stories {
    --tko-home-align: 8px;
    --tko-gap: 40px;
  }

  .page-home .tko-stories__inner {
    padding: 48px 8px 12px !important;
  }

  .page-home .tko-stories__headline {
    margin: 0 0 16px !important;
  }

  .page-home .tko-stories__col {
    width: 100% !important;
    flex: 0 0 100% !important;
    padding-bottom: 4px;
  }

  .page-home .tko-tile--odd,
  .page-home .tko-tile--even {
    margin-top: 0 !important;
  }

  .page-home .tko-tile__media {
    aspect-ratio: 16 / 9 !important;
  }

  .page-home .tko-tile__bottom {
    margin-top: 12px !important;
    padding: 0 2px !important;
  }

  .page-home .tko-tile__headline {
    font-size: clamp(1.35rem, 6vw, 1.75rem) !important;
    letter-spacing: -0.04em !important;
    line-height: 1.1 !important;
    color: #111218 !important;
  }

  .page-home .em-vf-5 .main-container {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .page-home .em-vf-5 .section {
    padding-top: 100px !important;
    padding-bottom: 48px !important;
  }

  .page-home .em-vf-5 .headline-home-b-about {
    margin-bottom: 48px !important;
  }

  .page-home .em-vf-5 .home-b-about-images {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto auto !important;
    align-items: start !important;
    column-gap: 12px !important;
    row-gap: 24px !important;
  }

  .page-home .em-vf-5 .left-home-b-about {
    max-width: none !important;
    width: 100%;
  }

  .page-home .em-vf-5 .left-home-b-about .home-b-about-image {
    height: 220px !important;
  }

  .page-home .em-vf-5 .right-home-b-about {
    display: contents !important;
    max-width: none !important;
  }

  .page-home .em-vf-5 .home-b-about-image.small {
    height: 180px !important;
    margin-top: 40px;
    width: 100%;
  }

  .page-home .em-vf-5 .text-wrap-home-b-about {
    grid-column: 1 / -1 !important;
    max-width: none !important;
    width: 100% !important;
  }

  .page-home #arcana-integration-03.section-medium {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .page-home .ns-footer {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}

@media (max-width: 480px) {
  .page-home .hero-copy--home .hero-title {
    line-height: 0.88 !important;
    word-spacing: 0.4em !important;
    letter-spacing: -0.03em !important;
  }
}

.page-home .hero-copy--home .hero-title {
  font-size: 38px !important;
  overflow: visible;
}

@media (min-width: 1167px) {
  .page-home .hero-copy--home .hero-title {
    font-size: 62px !important;
    line-height: 1.05 !important;
  }

  .page-home .hero-copy--home.has-interview-input .hero-title {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none;
  }

  .page-home .hero-copy--home.has-interview-input .hero-interview__sheet {
    transform: translateY(72px);
  }

  .page-home .hero-copy--home.has-interview-input .hero-interview__messages {
    height: min(48vh, 360px);
  }
}

@media (max-width: 768px) {
  .page-home .hero-copy--home .hero-title {
    font-size: 38px !important;
    letter-spacing: -0.04em !important;
    line-height: 42px !important;
  }
}

.page-home .hero-copy--home {
  gap: 36px !important;
  overflow-anchor: none;
}

@media (max-width: 768px) {
  .page-home .hero-copy--home {
    gap: 28px !important;
    padding-top: 24px;
  }

  .page-home .hero-stage--home {
    align-items: center !important;
    padding-top: calc(14px + var(--home-logo-height, 80px) + 12px + var(--home-nav-height, 56px)) !important;
  }
}

.page-home .hero-interview__form,
.page-home .hero-interview__form textarea {
  overflow-anchor: none;
}

.page-home .hero-copy--home .hero-title__word:not(:last-child) {
  margin-right: calc(0.4em + 2px) !important;
}


