/* DuoChat home page. The page is a conversation: two voices in bubbles at display scale.
   Navy is the logo's own ground; blue and orange are the two voices; the light blue of the
   logo's overlap is kept for the act of translation. */

@font-face {
  font-family: 'Gabarito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/site/fonts/gabarito-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Gabarito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/site/fonts/gabarito-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --navy: #111827;
  --navy-2: #1a2336;
  --blue: #2563eb;
  --orange: #f97316;
  --both: #93c5fd;
  --ink: #f5f7fc;
  --soft: #c3cce0;
  --quiet: #9aa5bf;
  --display: 'Gabarito', ui-rounded, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --text: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(16px, 4.5vw, 56px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--navy);
  color: var(--ink);
  font: 100%/1.5 var(--text);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scrollbar-color: #3a4764 var(--navy);
}
body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
}
h1,
h2,
p,
figure {
  margin: 0;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
a {
  color: inherit;
}
::selection {
  background: var(--both);
  color: var(--navy);
}
:focus-visible {
  outline: 3px solid var(--both);
  outline-offset: 3px;
  border-radius: 6px;
}
a,
button {
  touch-action: manipulation;
}

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus {
  top: calc(12px + env(safe-area-inset-top, 0px));
}

/* ---------- top ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top, 0px)) calc(var(--gutter) + var(--safe-r)) 0 calc(var(--gutter) + var(--safe-l));
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font: 700 1.35rem/1 var(--display);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.top nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.lang,
.login {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 22px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.lang {
  color: var(--soft);
}
.login {
  background: rgba(255, 255, 255, 0.1);
  transition: background-color 160ms;
}

/* ---------- the conversation ---------- */

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 calc(var(--gutter) + var(--safe-r)) 0 calc(var(--gutter) + var(--safe-l));
}
.turn {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.4vw, 16px);
  padding-top: clamp(84px, 13vw, 176px);
}
/* The whole exchange, the one-line description and both actions fit the first screen. */
.turn.opening {
  padding-top: clamp(20px, 3.4vw, 44px);
  min-height: calc(100svh - 76px);
  justify-content: center;
  padding-bottom: clamp(20px, 3vw, 40px);
}

.msg {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(100%, 21em);
  font: 700 clamp(1.7rem, 4.3vw, 3.15rem) / 1.08 var(--display);
  letter-spacing: -0.022em;
}
/* The Spanish voice speaks from the right, the English voice from the left. */
.msg.o {
  align-self: flex-end;
  align-items: flex-end;
}
.msg.b {
  align-self: flex-start;
  align-items: flex-start;
}
.bubble {
  display: grid;
  padding: 0.42em 0.62em 0.48em;
  border-radius: 0.72em;
  font: inherit;
  letter-spacing: inherit;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.msg.b .bubble {
  border-bottom-left-radius: 0.2em;
  background: var(--blue);
  color: #fff;
}
.msg.o .bubble {
  border-bottom-right-radius: 0.2em;
  background: var(--orange);
  color: var(--navy);
}
.bubble.xl {
  font-size: clamp(2.5rem, 7.2vw, 5.1rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
}
.msg:has(.xl) {
  max-width: min(100%, 62rem);
}

/* A translated bubble holds both versions in one cell, so it never changes size when flipped. */
.face {
  grid-area: 1 / 1;
  transition: opacity 420ms var(--ease), filter 420ms var(--ease), transform 420ms var(--ease);
}
.face.orig {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(0.14em);
  pointer-events: none;
}
.msg.show-orig .face.orig {
  opacity: 1;
  filter: none;
  transform: none;
}
.msg.show-orig .face.now {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(-0.14em);
}

.note {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-height: 44px;
  margin: -4px 0 0;
  padding: 4px 6px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--both);
  font: 500 0.95rem/1.3 var(--text);
  letter-spacing: 0;
  text-align: inherit;
  cursor: pointer;
  transition: opacity 420ms var(--ease);
}
.msg.o .note {
  justify-content: flex-end;
}
.note svg {
  flex-shrink: 0;
}
.note-action {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(245, 247, 252, 0.45);
  text-underline-offset: 3px;
}
/* While a message is still "arriving" in its own language, the note has not appeared yet. */
.msg.arriving .note {
  opacity: 0;
}

/* ---------- words between the bubbles ---------- */

.intro {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 34rem;
  margin-top: clamp(14px, 2vw, 26px);
}
.lede {
  color: var(--soft);
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
  line-height: 1.5;
  text-wrap: pretty;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 26px;
  background: var(--ink);
  color: var(--navy);
  font: 700 1.08rem/1 var(--display);
  text-decoration: none;
  transition: transform 140ms var(--ease), background-color 160ms;
}
.cta.quiet {
  background: none;
  box-shadow: inset 0 0 0 2px rgba(245, 247, 252, 0.34);
  color: var(--ink);
}
.cta:active,
.login:active {
  transform: scale(0.97);
}

.aside {
  align-self: center;
  max-width: 62ch;
  margin-top: clamp(14px, 2.4vw, 30px);
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--navy-2);
  color: var(--soft);
  font-size: 1rem;
  line-height: 1.55;
  text-wrap: pretty;
}

/* ---------- real screens, sent as photos in the conversation ---------- */

.phones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 2.4vw, 28px);
  align-items: start;
  width: min(100%, 720px);
  margin: clamp(14px, 2.4vw, 30px) auto 0;
}
.phones figcaption {
  grid-column: 1 / -1;
  color: var(--quiet);
  font-size: 0.93rem;
  text-align: center;
}
.msg.photo {
  max-width: none;
  padding: clamp(4px, 0.7vw, 7px);
  border-radius: clamp(20px, 3.4vw, 36px);
}
.msg.b.photo {
  border-bottom-left-radius: 8px;
  background: var(--blue);
}
.msg.o.photo {
  border-bottom-right-radius: 8px;
  background: var(--orange);
}
.phones .msg.o.photo {
  margin-top: clamp(24px, 6vw, 72px);
}
.msg.photo img {
  width: 100%;
  border-radius: clamp(16px, 2.8vw, 30px);
  background: #0b1020;
}
.msg.photo.solo {
  width: min(64%, 320px);
  margin-top: clamp(14px, 2.4vw, 30px);
}

/* ---------- close ---------- */

.closing .actions {
  align-self: center;
  justify-content: center;
  margin-top: clamp(18px, 3vw, 34px);
}
.foot {
  max-width: 1180px;
  margin: clamp(84px, 13vw, 176px) auto 0;
  padding: 0 calc(var(--gutter) + var(--safe-r)) calc(36px + env(safe-area-inset-bottom, 0px)) calc(var(--gutter) + var(--safe-l));
}
.install {
  max-width: 40rem;
  padding-top: 28px;
  border-top: 1px solid rgba(245, 247, 252, 0.14);
}
.install h2 {
  font: 700 clamp(1.3rem, 2.4vw, 1.7rem) / 1.15 var(--display);
  letter-spacing: -0.015em;
}
.install p {
  margin-top: 8px;
  color: var(--soft);
  max-width: 60ch;
}
.small {
  margin-top: 40px;
  color: var(--quiet);
  font-size: 0.9rem;
}
.small span {
  color: var(--soft);
  font-weight: 600;
}
.small a {
  display: inline-block;
  padding: 13px 0; /* a comfortable touch target for the language switch */
  text-underline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .login:hover {
    background: rgba(255, 255, 255, 0.18);
  }
  .lang:hover {
    color: var(--ink);
  }
  .cta:hover {
    background: #fff;
  }
  .cta.quiet:hover {
    background: rgba(245, 247, 252, 0.1);
  }
  .note:hover .note-action {
    text-decoration-color: var(--ink);
  }
}

@media (max-width: 560px) {
  .msg {
    max-width: 94%;
  }
  .msg:has(.xl) {
    max-width: 100%;
  }
  .lang {
    padding: 0 8px;
  }
  .cta {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .face,
  .note,
  .cta {
    transition-duration: 1ms;
  }
  .face.orig,
  .msg.show-orig .face.now {
    filter: none;
    transform: none;
  }
}
@media (prefers-contrast: more) {
  :root {
    --soft: #e6ebf7;
    --quiet: #d3daea;
  }
  .aside {
    box-shadow: inset 0 0 0 1px rgba(245, 247, 252, 0.5);
  }
}

/* Someone who is already logged in only needs the way into the app. */
.signed-in .cta.quiet {
  display: none;
}
/* Opened from the Home Screen: nothing is drawn while standalone.js moves on to the app. */
html.to-app body {
  visibility: hidden;
}
