/* Flavinn, flavinn.com landing page (English and Simplified Chinese).
   Shared tokens, fonts, header and footer live in styles.css.
   The phone renders are styled by phone.css, generated from the 2.0 design board. */

.ok { color: var(--green); }
.flag { color: var(--coral); }

.pi {
  display: block;
  flex: none;
  fill: currentColor;
}

/* ---------- scale wrapper ----------
   Phones and other fixed-size renders are drawn at their real size (a phone is 393 by
   852) and scaled with --s. The wrapper takes the scaled size so layout stays correct. */

.fit {
  --s: 1;
  position: relative;
  flex: none;
  width: calc(var(--w) * 1px * var(--s));
  height: calc(var(--h) * 1px * var(--s));
}

.fit-in {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--w) * 1px);
  height: calc(var(--h) * 1px);
  transform: scale(var(--s));
  transform-origin: 0 0;
}

.s-hero { --s: 0.86; }
.s-sec { --s: 0.84; }
.s-stage { --s: 1; }
.s-stage-phone { --s: 0.8; }
.s-mini { --s: 0.44; }

@media (max-width: 1100px) {
  .s-stage { --s: 0.84; }
}

@media (max-width: 960px) {
  .s-stage { --s: 0.72; }
}

@media (max-width: 860px) {
  .s-hero,
  .s-sec { --s: 0.9; }
  .s-stage { --s: 0.95; }
}

@media (max-width: 580px) {
  .s-stage { --s: 0.8; }
}

@media (max-width: 460px) {
  .s-hero,
  .s-sec { --s: 0.88; }
  .s-stage { --s: 0.62; }
}

@media (max-width: 380px) {
  .s-hero,
  .s-sec { --s: 0.8; }
  .s-stage { --s: 0.56; }
}

/* the typing caret in the hero's Ask bar */
.phone .ask-ph .caret {
  height: 19px;
  margin: 0 7px 0 0;
  vertical-align: -4px;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow-x: clip;
  padding-block: clamp(32px, 6vw, 80px) clamp(64px, 9vw, 120px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 22px;
  font: 600 13px/1 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--coral);
}

.eyebrow .n {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.hero h1 {
  margin: 0;
  font: 400 clamp(52px, 7.4vw, 100px) / 1 var(--serif);
  letter-spacing: -0.025em;
  color: var(--text);
  text-wrap: balance;
}

.hero h1 .dot {
  color: var(--coral);
}

.lede {
  margin: 28px 0 0;
  max-width: 30em;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.55;
  color: var(--text-2);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin-top: 36px;
}

.meta {
  margin: 0;
  font-size: 14px;
  color: var(--text-3);
}

.hero-device {
  position: relative;
  display: grid;
  place-items: center;
}

.hero-device .fit {
  position: relative;
  z-index: 1;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes rise-t {
  from { transform: translateY(18px); }
  to { transform: none; }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hero-copy > * { animation: rise 0.5s var(--ease) both; }
.hero-copy > :nth-child(2) { animation-delay: 60ms; }
.hero-copy > :nth-child(3) { animation-delay: 120ms; }
.hero-copy > :nth-child(4) { animation-delay: 180ms; }
.hero-device .fit { animation: rise-t 0.55s var(--ease) 80ms both; }

/* ---------- story sections ---------- */

.story-in {
  padding-block: clamp(72px, 9vw, 128px);
  border-top: 1px solid var(--line);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(40px, 7vw, 110px);
  align-items: center;
}

.split.flip {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.split.flip .copy {
  order: 2;
}

.copy h2,
.closing h2 {
  margin: 0;
  font: 400 clamp(38px, 4.6vw, 62px) / 1.05 var(--serif);
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}

.copy p:not(.eyebrow) {
  margin: 24px 0 0;
  max-width: 28em;
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.6;
  color: var(--text-2);
  text-wrap: pretty;
}

.copy.center {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.copy.center p:not(.eyebrow) {
  margin-inline: auto;
}

.copy.center .eyebrow {
  justify-content: center;
}

.visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

.caption {
  margin: 0;
  font-size: 14px;
  color: var(--text-3);
}

/* reveal on scroll: transform and opacity only, 500ms, ease-out */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* the Ask exchange plays once when it scrolls into view */

@keyframes msg-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.js .chat-phone .convo > * {
  opacity: 0;
}

.js .visual.is-in .chat-phone .convo > * {
  animation: msg-in 0.5s var(--ease) both;
}

.js .visual.is-in .chat-phone .convo > :nth-child(1) { animation-delay: 200ms; }
.js .visual.is-in .chat-phone .convo > :nth-child(2) { animation-delay: 480ms; }
.js .visual.is-in .chat-phone .convo > :nth-child(3) { animation-delay: 760ms; }
.js .visual.is-in .chat-phone .convo > :nth-child(4) { animation-delay: 1040ms; }
.js .visual.is-in .chat-phone .convo > :nth-child(5) { animation-delay: 1320ms; }
.js .visual.is-in .chat-phone .convo > :nth-child(6) { animation-delay: 1600ms; }
.js .visual.is-in .chat-phone .convo > :nth-child(7) { animation-delay: 1800ms; }
.js .visual.is-in .chat-phone .convo > :nth-child(8) { animation-delay: 1960ms; }

/* ---------- scan ---------- */

.stage-phone {
  position: absolute;
}

/* the Document page, with a shorter preview so "Original kept" shows without
   scrolling the page under the status bar */
.s-stage-phone .docview .paper {
  height: 240px;
}

.paper-prop {
  position: absolute;
  left: 0;
  top: 110px;
  width: 280px;
  height: 450px;
  padding: 26px 24px;
  overflow: hidden;
  border-radius: 6px;
  background: #f1ebdf;
  color: #26211b;
  font-family: var(--sans);
  transform: rotate(-4deg);
  box-shadow: 0 36px 60px -24px rgba(0, 0, 0, 0.75);
}

.pp-head {
  display: flex;
  justify-content: space-between;
  font: 600 9.5px/1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6f685c;
}

.pp-title {
  margin-top: 20px;
  font: 500 24px/1.1 var(--serif);
  color: #1c1a17;
}

.pp-meta {
  margin-top: 5px;
  font-size: 11.5px;
  color: #6f685c;
}

.pp-table {
  margin-top: 22px;
  font-size: 12.5px;
}

.pp-table .th,
.pp-table .tr {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  padding: 9px 0;
  border-bottom: 1px solid #d8d0c0;
}

.pp-table .th {
  font: 600 9.5px/1.4 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6f685c;
}

.pp-table .tr span:nth-child(2) {
  font-weight: 600;
}

.pp-table .tr.hl span:nth-child(2) {
  color: var(--coral-fill);
}

.pp-lines {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}

.pp-lines i {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: #ddd5c6;
}

.pp-lines i:nth-child(2) { width: 88%; }
.pp-lines i:nth-child(3) { width: 94%; }
.pp-lines i:nth-child(4) { width: 52%; }

.scanbox {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 150px;
  height: 142px;
}

.scanbox i {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--coral-fill);
}

.scanbox i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 7px 0 0 0; }
.scanbox i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 7px 0 0; }
.scanbox i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 7px; }
.scanbox i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 7px 0; }

/* ---------- one record ---------- */

.panel {
  width: 100%;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.p-name {
  font: 400 34px/1 var(--serif);
  letter-spacing: -0.01em;
}

.p-unit {
  font-size: 13px;
  color: var(--text-3);
}

.chart {
  position: relative;
  height: 220px;
  margin-top: 26px;
}

.chart svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* the band is the lab's range, which starts at 30; the dashed edge is 30 */
.band {
  position: absolute;
  left: 0;
  right: 0;
  top: 8%;
  height: 51%;
  background: rgba(247, 243, 236, 0.05);
  border-bottom: 1px dashed rgba(247, 243, 236, 0.36);
}

.band span {
  position: absolute;
  right: 12px;
  top: 9px;
  font-size: 11.5px;
  color: var(--text-3);
}

.pt {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px var(--surface);
}

.pt b {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  font: 600 15px/1 var(--sans);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.pt.flag b {
  bottom: auto;
  top: 20px;
}

/* in range is neutral ink; only a result outside the range is coloured */
.pt.ok {
  color: #d6cfc5;
}

.axis {
  position: relative;
  height: 46px;
  margin-top: 12px;
}

.axis span {
  position: absolute;
  top: 0;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-3);
}

.axis b {
  font: 600 12.5px/1.4 var(--sans);
  color: var(--text-2);
}

.beside {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px 8px 10px;
  border-radius: 999px;
  background: rgba(247, 243, 236, 0.06);
  font: 500 13px/1 var(--sans);
  color: var(--text);
}

.tag .pi {
  fill: var(--coral);
}

.langs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.lang-card {
  display: grid;
  gap: 3px;
  padding: 14px 16px 15px;
  border: 0.5px solid var(--line);
  border-radius: 18px;
  background: rgba(247, 243, 236, 0.04);
}

.lc-tag {
  font: 600 11px/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.lang-card b {
  margin-top: 8px;
  font: 400 24px/1.1 var(--serif);
}

.lang-card span:not(.lc-tag) {
  font: 600 14px/1.3 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}

.lang-card small {
  font: 600 13px/1.3 var(--sans);
}

/* ---------- sync ---------- */

.flow {
  display: grid;
  grid-template-columns: auto minmax(60px, 1fr) auto minmax(60px, 1fr) auto;
  align-items: start;
  justify-items: center;
  margin-top: clamp(48px, 6vw, 80px);
}

.node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  text-align: center;
}

.node .phone {
  text-align: left;
}

.node-label b {
  display: block;
  font: 400 28px/1.1 var(--serif);
  letter-spacing: -0.01em;
}

.node-label span {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  color: var(--text-2);
}

.link {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: start;
  gap: 12px;
  width: 100%;
  margin-top: 172px;
  padding: 0 10px;
}

.link-line {
  position: relative;
  width: 100%;
  height: 1px;
  background: repeating-linear-gradient(to right, rgba(247, 243, 236, 0.3) 0 6px, transparent 6px 12px);
}

.link-line::after {
  content: '';
  position: absolute;
  right: 0;
  top: -4px;
  width: 8px;
  height: 8px;
  border-top: 1.5px solid rgba(247, 243, 236, 0.5);
  border-right: 1.5px solid rgba(247, 243, 236, 0.5);
  transform: rotate(45deg);
}

.link-label {
  font: 600 12px/1 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--coral);
}

.account {
  display: flex;
  flex-direction: column;
  width: 280px;
  height: 375px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  text-align: left;
}

.acc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.acc-av {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(247, 243, 236, 0.08);
  font: 600 17px/1 var(--sans);
}

.acc-name {
  font: 600 16px/1.2 var(--sans);
}

.acc-rows {
  display: grid;
  gap: 4px;
  padding: 14px 0;
}

.acc-rows span {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  font: 500 15px/1.2 var(--sans);
}

.acc-rows .pi {
  fill: var(--text-2);
}

.acc-foot {
  margin-top: auto;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(247, 243, 236, 0.06);
  color: var(--text-2);
  font: 600 13px/1.2 var(--sans);
  text-align: center;
}

/* ---------- export ---------- */

.export-card {
  width: min(430px, 100%);
  padding: 12px 26px 28px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: var(--sheet);
  box-shadow: 0 60px 100px -40px rgba(0, 0, 0, 0.85);
}

.ex-grab {
  width: 40px;
  height: 5px;
  margin: 0 auto 24px;
  border-radius: 3px;
  background: var(--line-2);
}

.ex-title {
  font: 400 34px/1.1 var(--serif);
  letter-spacing: -0.01em;
}

.ex-sub {
  margin-top: 8px;
  font-size: 15px;
  color: var(--text-2);
}

.ex-rows {
  margin: 24px 0 26px;
}

.ex-rows > div {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.ex-rows b {
  flex: 1;
  font: 500 16px/1.2 var(--sans);
}

.ex-rows em {
  font: 600 15px/1 var(--sans);
  font-style: normal;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}

.ex-tile {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(247, 243, 236, 0.07);
  color: var(--text);
}

.ex-ok {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green);
  color: #16130f;
}

.ex-btn {
  display: grid;
  place-items: center;
  height: 52px;
  border-radius: 26px;
  background: var(--coral-fill);
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.25);
  color: #fff;
  font: 600 16px/1 var(--sans);
}

/* ---------- closing ---------- */

.closing {
  position: relative;
  overflow: hidden;
  padding-top: clamp(80px, 11vw, 150px);
  border-top: 1px solid var(--line);
}

.closing-in {
  position: relative;
  z-index: 1;
  text-align: center;
}

.closing h2 {
  font-size: clamp(44px, 7vw, 96px);
  line-height: 1;
}

.closing h2 .dot {
  color: var(--coral);
}

.closing-in > p {
  max-width: 30em;
  margin: 24px auto 0;
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--text-2);
}

.closing .btn {
  margin-top: 38px;
}

.closing-in > .survey {
  margin-top: 30px;
  font-size: 14px;
  color: var(--text-3);
}

.survey a {
  color: var(--coral);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(255, 126, 92, 0.4);
  text-underline-offset: 3px;
}

.survey a:hover {
  text-decoration-color: var(--coral);
}

.ghost-mark {
  margin-top: clamp(32px, 5vw, 72px);
  font: 400 clamp(110px, 24vw, 340px) / 0.78 var(--serif);
  letter-spacing: -0.04em;
  text-align: center;
  white-space: nowrap;
  color: rgba(247, 243, 236, 0.05);
  user-select: none;
  transform: translateY(14%);
}

.ghost-mark span {
  color: rgba(255, 126, 92, 0.16);
}

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .split,
  .split.flip {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .split.flip .copy {
    order: 0;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .flow {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0;
  }
  .link {
    flex-direction: row;
    justify-content: center;
    width: auto;
    margin: 28px 0;
    padding: 0;
  }
  .link-line {
    width: 1px;
    height: 56px;
    background: repeating-linear-gradient(to bottom, rgba(247, 243, 236, 0.3) 0 6px, transparent 6px 12px);
  }
  .link-line::after {
    right: -4px;
    top: auto;
    bottom: 0;
    transform: rotate(135deg);
  }
}

@media (max-width: 460px) {
  .chart {
    height: 200px;
  }
  .axis span {
    font-size: 10.5px;
  }
  .axis b {
    font-size: 11.5px;
  }
  .langs {
    gap: 10px;
  }
  .lang-card {
    padding: 12px 12px 13px;
  }
}

:lang(zh-Hans) .eyebrow,
:lang(zh-Hans) .link-label,
:lang(zh-Hans) .lc-tag {
  letter-spacing: 0.06em;
}

:lang(zh-Hans) .hero h1 {
  font-size: clamp(40px, 4.8vw, 66px);
  letter-spacing: 0;
  line-height: 1.14;
}

:lang(zh-Hans) .copy h2,
:lang(zh-Hans) .closing h2 {
  line-height: 1.14;
}

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
  .js .chat-phone .convo > * {
    opacity: 1;
  }
}
