/* Habe landing. Colors follow the app's palette; the theme comes from the system unless
   the person picked one in the header. */

:root {
  color-scheme: light dark;
  --bg: #f4f4f2;
  --ink: #121214;
  --on-ink: #fafafa;
  --surface: #ffffff;
  --muted: rgba(18, 18, 20, .55);
  --hairline: rgba(18, 18, 20, .08);
  --hairline-strong: rgba(18, 18, 20, .14);
  --brand: #5100ff;
  /* The logo keeps its day colours in both themes. */
  --logo-bg: #5100ff;
  --logo-ink: #ffffff;
  --phone: #0d0d0e;
  --pit: rgba(18, 18, 20, .035);
  --shadow-soft: 0 24px 60px -28px rgba(0, 0, 0, .35);
  --button-shadow: 0 12px 28px -14px rgba(18, 18, 20, .5);
  --gutter: 20px;
  --container: 1120px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111112;
  --ink: #f6f6f7;
  --on-ink: #111112;
  --surface: #222224;
  --muted: rgba(246, 246, 247, .55);
  --hairline: rgba(246, 246, 247, .08);
  --hairline-strong: rgba(246, 246, 247, .14);
  --phone: #1a1a1c;
  --pit: rgba(246, 246, 247, .05);
  --shadow-soft: 0 24px 60px -28px rgba(0, 0, 0, .7);
  --button-shadow: 0 14px 30px -12px rgba(0, 0, 0, .75);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111112;
    --ink: #f6f6f7;
    --on-ink: #111112;
    --surface: #222224;
    --muted: rgba(246, 246, 247, .55);
    --hairline: rgba(246, 246, 247, .08);
    --hairline-strong: rgba(246, 246, 247, .14);
    --phone: #1a1a1c;
    --pit: rgba(246, 246, 247, .05);
    --shadow-soft: 0 24px 60px -28px rgba(0, 0, 0, .7);
    --button-shadow: 0 14px 30px -12px rgba(0, 0, 0, .75);
  }
}

/* Headings: SF Pro Condensed, as in the app, on Apple devices (the system face set
   condensed: -apple-system in WebKit, BlinkMacSystemFont in Chrome on a Mac); Roboto
   Condensed everywhere else, where there is no SF. Korean falls through to the system
   face. */
@font-face {
  font-family: "Habe Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/robotocond-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;
}
@font-face {
  font-family: "Habe Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/robotocond-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116, U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

* { box-sizing: border-box; }
/* A double tap does not zoom the page; pinching still does. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; touch-action: manipulation; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 -apple-system, system-ui, "Helvetica Neue", sans-serif;
  letter-spacing: -.3px;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease, color .35s ease;
  overflow-x: clip;
}
a { color: inherit; }
button, input { font: inherit; letter-spacing: inherit; color: inherit; }
button { cursor: pointer; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3 {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Habe Condensed", sans-serif;
  font-stretch: 75%;
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: .98;
  overflow-wrap: anywhere;
}
:lang(ko) h1, :lang(ko) h2, :lang(ko) h3 { font-stretch: normal; letter-spacing: -.03em; line-height: 1.1; word-break: keep-all; }
/* Korean wraps between words, as Korean sites do, not between any two syllables. */
:lang(ko) body { word-break: keep-all; }

/* Buttons, as in the app: 64 tall, ink filled. */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 64px;
  padding: 0 32px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--button-shadow);
  transition: transform .5s cubic-bezier(.22, 1, .36, 1), box-shadow .5s cubic-bezier(.22, 1, .36, 1), background-color .35s ease, color .35s ease;
  /* The button stays on one layer with its label and Apple mark: WebKit drops the layer
     a transform transition gives an element once it ends and repaints it snapped to the
     pixel grid, which made the mark jump after the page's reveal and after a hover. */
  will-change: transform;
}
.button:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.button:active { transform: scale(.97); box-shadow: none; transition-duration: .15s; }
.button:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
/* The Apple mark beside the label of the App Store buttons, as on Labe: taller than
   the text, so nudged up onto its optical centre; on a hover it launches up and a fresh
   one rises from below. */
.apple-mark { position: relative; flex: none; width: 18px; height: 22px; margin-top: -4px; overflow: hidden; }
/* The marks move by top, not transform, so they are painted inside the button's layer
   instead of getting layers of their own that are dropped when the move ends. */
.apple-mark svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transition: top .48s cubic-bezier(.2, .8, .2, 1); }
.apple-mark svg + svg { top: 130%; }
@media (hover: hover) {
  .button:hover .apple-mark svg:first-child { top: -130%; }
  .button:hover .apple-mark svg + svg { top: 0; }
}

/* Header */

/* No bar behind the header: the logo and the ink-filled controls float over the page. */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
}
.top .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
/* Shown for a moment after the theme changes, so Safari takes the bar color again. */
.retint { position: fixed; top: 0; left: 0; right: 0; height: 8px; z-index: 11; background: var(--bg); pointer-events: none; }
.logo { display: block; line-height: 0; }
.logo svg, .logo img { height: 32px; width: auto; display: block; }
.logo-bg { fill: var(--logo-bg); transition: fill .35s ease; }
.logo-ink { fill: var(--logo-ink); transition: fill .35s ease; }
.controls { display: flex; align-items: center; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 600;
  font-size: 15px;
  transition: background-color .35s ease, color .35s ease, opacity .2s ease, transform .18s ease;
}
/* Only a mouse hovers; on touch the dimmed state would stick after a tap. */
@media (hover: hover) { .chip:hover { opacity: .86; } }
.chip:active { transform: scale(.95); }
.chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.chip.icon { width: 40px; padding: 0; }
.chip svg { width: 18px; height: 18px; flex: none; }
.chip .chev { width: 10px; height: 10px; opacity: .6; }

/* Theme: the sun sets as the moon rises. */
.theme .sun, .theme .moon { position: absolute; transition: transform .45s cubic-bezier(.34, 1.4, .64, 1), opacity .3s ease; }
.theme { position: relative; }
.theme .moon { opacity: 0; transform: translateY(14px) rotate(-40deg); }
:root[data-theme="dark"] .theme .sun { opacity: 0; transform: translateY(-14px) rotate(40deg); }
:root[data-theme="dark"] .theme .moon { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { opacity: 0; transform: translateY(-14px) rotate(40deg); }
  :root:not([data-theme="light"]) .theme .moon { opacity: 1; transform: none; }
}

/* Language menu */
.lang { position: relative; }
.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 164px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 16px 48px -12px rgba(0, 0, 0, .3), 0 0 0 1px var(--hairline);
  opacity: 0;
  transform: translateY(-6px) scale(.98);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity .18s ease, transform .22s cubic-bezier(.2, .8, .2, 1);
}
.menu.is-open { opacity: 1; transform: none; pointer-events: auto; }
.menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  text-align: left;
  font-size: 16px;
}
.menu button:hover, .menu button:focus-visible { background: var(--hairline); outline: none; }
.menu button[aria-checked="true"] { font-weight: 600; }
.menu button[aria-checked="true"]::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }

/* Hero: one grey box. The stickers fall from its top, behind the words, and pile up
   under them; touches on the words reach the stickers, all but the button's. */

/* The first screen's height comes from the script (see holdFirstScreen); svh is the fallback. */
.hero { position: relative; display: flex; flex-direction: column; min-height: max(calc(var(--first-screen, 100svh) - 36px), 740px); padding: 104px 0 0; }
/* Until the words are fitted they keep their room but are not seen (see the head script). */
.is-fitting .hero-copy, .is-fitting #lang-code { opacity: 0; transition: none; }
.hero-copy { position: relative; z-index: 1; display: grid; gap: 20px; justify-items: center; text-align: center; pointer-events: none; transition: opacity .3s ease; }
.hero-copy .button { pointer-events: auto; }
/* Two lines at the full size are kept for the title in every language, the text at
   their bottom, so the lead and the button stay put when a long title is set smaller. */
.hero h1 { display: grid; align-content: end; width: 100%; min-height: calc(1.96 * clamp(46px, 13.2vw, 112px)); font-size: clamp(46px, 13.2vw, 112px); text-wrap: balance; }
.hero .lead { margin: 0; max-width: 34ch; font-size: clamp(18px, 1.7vw, 25px); line-height: 1.35; color: var(--muted); text-wrap: balance; }
.hero .button { width: 100%; max-width: 360px; margin-top: 4px; }

/* The pit: stickers drop into it and stack; the floor and walls are the box itself. */
.pit-wrap { position: absolute; inset: 0; max-width: none; padding: 0; }
.pit {
  position: relative;
  height: 100%;
  border-radius: 32px;
  background: var(--pit);
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color .35s ease;
}
.pit.is-mouse { cursor: grab; }
.pit.is-mouse:active { cursor: grabbing; }
.pit img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  will-change: transform;
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
}
/* Without motion the stickers simply sit scattered. */
.pit.is-still img { transition: none; }

/* Statement: a big question and its answer that light up word by word on the way
   through the screen. */

.say { position: relative; isolation: isolate; padding: 88px 0 120px; }
/* The waves run behind the words and fade out towards the top and bottom of the block,
   so the circle never ends on a straight edge. */
.say-waves {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask: linear-gradient(transparent, #000 18%, #000 82%, transparent);
  mask: linear-gradient(transparent, #000 18%, #000 82%, transparent);
}
.say-wave {
  --d: max(1200px, 140vw);
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--d);
  height: var(--d);
  margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2);
  border-radius: 50%;
  background: conic-gradient(from 90deg, hsl(187 100% 71%), hsl(216 100% 71%), hsl(241 100% 71%), hsl(266 100% 71%), hsl(292 100% 71%), hsl(317 100% 71%), hsl(342 100% 71%), hsl(7 100% 71%), hsl(29 100% 71%), hsl(50 100% 71%), hsl(108 100% 71%), hsl(151 100% 71%), hsl(187 100% 71%));
  -webkit-mask: radial-gradient(closest-side, transparent, rgba(0, 0, 0, .1) 40%, #000);
  mask: radial-gradient(closest-side, transparent, rgba(0, 0, 0, .1) 40%, #000);
  animation: wave-spread 1.8s cubic-bezier(.215, .61, .355, 1) forwards, wave-fade 1.8s linear forwards;
}
@keyframes wave-spread { from { transform: scale(.01) rotate(0deg); } to { transform: scale(1) rotate(360deg); } }
@keyframes wave-fade { from { opacity: 1; } to { opacity: 0; } }
.say-text {
  margin: 0 auto;
  max-width: 17ch;
  font-family: -apple-system, BlinkMacSystemFont, "Habe Condensed", sans-serif;
  font-stretch: 75%;
  font-weight: 700;
  font-size: clamp(40px, 11vw, 124px);
  letter-spacing: -.015em;
  line-height: 1;
  text-align: center;
  text-wrap: balance;
}
:lang(ko) .say-text { font-stretch: normal; letter-spacing: -.03em; line-height: 1.12; }
/* Composited, so Safari moves the words without redrawing the text every frame. */
.say-word {
  display: inline-block;
  opacity: calc(.12 + .88 * var(--t, 0));
  transform: translate3d(0, calc((1 - var(--t, 0)) * .1em), 0);
  will-change: transform, opacity;
}
.say-answer { display: block; margin-top: 1.6em; }
.say-line { display: block; }

/* Features */

.features { padding: 24px 0 16px; }
.feature {
  display: grid;
  gap: 24px;
  justify-items: center;
  padding: 36px 0;
}
.feature + .feature { border-top: 1px solid var(--hairline); }
/* On a phone the words come first, then the demo. */
.feature .copy { order: -1; display: grid; gap: 12px; justify-items: center; text-align: center; max-width: 480px; width: 100%; }
.feature h2 { font-size: clamp(36px, 9.5vw, 64px); }
.feature p { margin: 0; font-size: 18px; line-height: 1.4; color: var(--muted); max-width: 36ch; text-wrap: pretty; }

/* Apple's own iPhone bezel around the recording: the screen hole measured from the
   PNG's alpha, the recording laid under it, the corners of the hole rounded like the
   display's. */
.phone { position: relative; width: min(300px, 76vw); }
.phone .bezel { position: relative; z-index: 2; display: block; width: 100%; height: auto; pointer-events: none; }
.phone video, .phone .poster {
  position: absolute;
  z-index: 1;
  left: 5.444%;
  top: 2.554%;
  width: 89.111%;
  height: 94.891%;
  border-radius: 13.5% / 6.2%;
  object-fit: cover;
}
.phone .poster { pointer-events: none; transition: opacity .25s ease; }
.phone.is-live .poster { opacity: 0; }
.phone::before {
  content: "";
  position: absolute;
  inset: 3% 4%;
  border-radius: 18% / 8%;
  box-shadow: var(--shadow-soft);
}

/* Beta */

.beta { padding: 32px 0 72px; }
.card {
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
  padding: 40px 24px;
  border-radius: 32px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--hairline);
  transition: background-color .35s ease;
}
.card h2 { font-size: clamp(38px, 10vw, 64px); }
.card p { margin: 0; color: var(--muted); font-size: 18px; max-width: 40ch; text-wrap: pretty; }
.card .button { width: 100%; max-width: 360px; margin-top: 8px; }

/* Footer: the logo from the Figma file in two layers, the same in both themes. Below,
   the app's colour wheel flows through the outline (a gradient twice as wide as the logo,
   sliding by half, masked by the outline's shape); above, the letters stand still and
   hop on a hover. */

.foot { padding: 56px 0 32px; border-top: 1px solid var(--hairline); }
.foot .container { display: grid; gap: 32px; justify-items: start; }
.foot-logo { position: relative; width: 100%; display: block; --logo-bg: transparent; --logo-ink: #121214; }
.foot-logo svg { position: relative; width: 100%; height: auto; display: block; overflow: visible; }
.foot-iris {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-mask: url("/assets/logo-bg.svg") 0 0 / 100% 100% no-repeat;
  mask: url("/assets/logo-bg.svg") 0 0 / 100% 100% no-repeat;
}
.foot-iris span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 200%;
  background: repeating-linear-gradient(90deg, #6bedff 0%, #6ba6ff 4.1667%, #6e6bff 8.3333%, #ac6bff 12.5%, #ea6bff 16.6667%, #ff6bd6 20.8333%, #ff6b97 25%, #ff7d6b 29.1667%, #ffb26b 33.3333%, #ffe76b 37.5%, #89ff6b 41.6667%, #6bffb8 45.8333%, #6bedff 50%);
  animation: iris 9s linear infinite;
}
@keyframes iris { to { transform: translateX(-50%); } }
.foot-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; width: 100%; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px 24px; margin: 0; padding: 0; list-style: none; font-size: 15px; font-weight: 500; text-align: left; }
.foot-links a { color: var(--muted); text-decoration: none; transition: color .2s ease; }
.foot-links a:hover { color: var(--ink); }
.foot-links a:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 4px; }
/* The signature, as on Jrnl: the size of the links beside it, in the ink colour. */
.foot-out { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.made { position: relative; font-size: 15px; font-weight: 500; color: var(--ink); text-decoration: none; }
/* On a hover a line sweeps in under it from the left, as on Labe's about page. */
.made::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .34s cubic-bezier(.16, 1, .22, 1);
}
.made:hover::after { transform: scaleX(1); }
.made:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 4px; }

/* Legal pages: one narrow column of text, in English or Russian. */

.legal { max-width: 760px; margin: 0 auto; padding: 24px var(--gutter) 72px; }
.legal h1 { font-size: clamp(30px, 9.4vw, 72px); }
.legal .updated { margin: 14px 0 32px; font-size: 15px; letter-spacing: 0; color: var(--muted); }
.legal h2 { margin: 36px 0 10px; font-size: clamp(26px, 6.4vw, 36px); line-height: 1.05; }
.legal p { margin: 0 0 14px; font-size: 17px; line-height: 1.55; }
/* A page without a date line keeps the same air under its title. */
.legal h1 + p:not(.updated) { margin-top: 24px; }
:root[data-lang="ru"] .legal-page [lang="en"], :root:not([data-lang="ru"]) .legal-page [lang="ru"] { display: none; }
.legal-page .chip[aria-pressed="false"] { background: var(--hairline); color: var(--ink); }

/* Scroll reveal, light by design. */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.reveal.is-in { opacity: 1; transform: none; }

@media (min-width: 768px) {
  :root { --gutter: 32px; }
  .top .container { height: 72px; }
  .logo svg, .logo img { height: 36px; }
  /* The box keeps to the column, and the words get extra room at its sides. */
  .hero { max-width: var(--container); margin: 0 auto; min-height: max(calc(var(--first-screen, 100svh) - 84px), 860px); }
  .hero-copy { padding: 0 calc(var(--gutter) + clamp(32px, 6vw, 96px)); }
  .hero .button { width: auto; min-width: 280px; }
  .hero h1 { min-height: calc(1.96 * clamp(80px, 9.4vw, 136px)); font-size: clamp(80px, 9.4vw, 136px); }
  .pit-wrap { inset: 0 var(--gutter); }
  .pit { border-radius: 40px; }
  .features { padding: 80px 0 32px; }
  .feature { grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; padding: 56px 0; }
  .feature .copy { order: 0; justify-self: start; justify-items: start; text-align: left; }
  .feature:nth-child(even) .phone { order: 2; }
  .feature h2 { font-size: clamp(56px, 6.2vw, 80px); }
  .say { padding: 140px 0 180px; }
  .card { padding: 64px 48px; }
  .card .button { width: auto; min-width: 280px; }
  .foot { padding: 72px 0 40px; }
  .foot .container { grid-template-columns: auto 1fr; align-items: start; }
  .foot-logo { width: 440px; }
  /* The links' cap height sits on the logo's top edge, Made by me on its bottom one. */
  .foot-meta { flex-direction: column; align-items: flex-end; justify-content: space-between; align-self: stretch; margin: -6px 0 -5px; }
  .foot-links { justify-content: flex-end; text-align: right; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .button, .chip, .theme .sun, .theme .moon, .menu, .foot-links a, .made::after, .apple-mark svg { transition: none; }
  .foot-iris span { animation: none; }
}
