/* Livus landing. Colours and type follow the Initial Branding book. */
:root {
  --ink: #270600;
  --brown: #6E1B00;
  --brown-soft: #6B4636;
  --butter: #FCEB96;
  --peach: #F5B894;
  --cream: #FBF5DF;
  --line: rgba(39, 6, 0, .22);

  --gutter: clamp(20px, 5vw, 72px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-door: cubic-bezier(.76, 0, .18, 1);

  --z-top: 10;
  --z-intro: 50;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
html.js:not(.no-intro) body { overflow: hidden; animation: unlock 0s 3.3s forwards; }
@keyframes unlock { to { overflow: visible; } }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Mulish', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brown); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

/* Opening */
.intro { display: none; }
.js:not(.no-intro) .intro {
  display: grid; place-items: center;
  position: fixed; inset: 0; z-index: var(--z-intro);
  animation: intro-gone 0s 3.55s forwards;
}
@keyframes intro-gone { to { visibility: hidden; } }
.intro-door {
  position: absolute; top: 0; bottom: 0; width: 50.1%;
  background: var(--ink);
  animation: .95s var(--ease-door) 2.6s forwards;
}
.intro-door--l { left: 0; animation-name: door-l; }
.intro-door--r { right: 0; animation-name: door-r; }
@keyframes door-l { to { transform: translateX(-100%); } }
@keyframes door-r { to { transform: translateX(100%); } }

.intro-mark {
  position: relative;
  width: min(62vw, 280px);
  color: var(--butter);
  animation: mark-out .35s ease-in 2.35s forwards;
}
@keyframes mark-out { to { opacity: 0; transform: scale(.98); } }
.intro-house { display: block; width: 100%; height: auto; }
.intro-house path {
  stroke: var(--butter); stroke-width: 2;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw 1.8s cubic-bezier(.45, .05, .55, .95) .1s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.intro-lockup {
  position: absolute; inset: 24% 0 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: clamp(13px, 3.4vw, 16px);
  opacity: 0; transform: translateY(8px);
  animation: lockup .7s var(--ease-out) 1.1s forwards;
}
@keyframes lockup { to { opacity: 1; transform: none; } }
.intro-logo { width: 54%; aspect-ratio: 396 / 182; }

/* Entrance of the page itself. CSS only, so a script failure cannot hide the form. */
.js .rise {
  opacity: 0; transform: translateY(16px);
  animation: rise .9s var(--ease-out) forwards;
  animation-delay: calc(2.9s + var(--i) * 170ms);
}
.js.no-intro .rise { animation-delay: calc(var(--i) * 170ms); }
.js .done .rise { animation-delay: calc(var(--i) * 170ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Header */
.top {
  position: absolute; top: 0; left: 0; right: 0; z-index: var(--z-top);
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(18px, 3vw, 32px) var(--gutter);
  padding-top: max(clamp(18px, 3vw, 32px), env(safe-area-inset-top));
}
.brand { display: block; color: var(--brown); border-radius: 4px; }
.brand-logo { display: block; width: clamp(88px, 9vw, 112px); aspect-ratio: 396 / 265; }

.lang {
  position: relative; display: flex;
  --idx: 0;
}
.lang button {
  position: relative; width: 44px; height: 44px;
  font-size: 13px; font-weight: 600; letter-spacing: .04em;
  color: var(--brown-soft);
  transition: color .2s;
}
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { color: var(--ink); }
.lang-pill {
  position: absolute; left: 12px; bottom: 7px; width: 20px; height: 2px;
  background: var(--brown);
  transform: translateX(calc(var(--idx) * 44px));
  transition: transform .45s var(--ease-out);
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 128px var(--gutter);
  text-align: center;
}
.hero-copy { position: relative; width: 100%; max-width: 680px; }
h1 {
  margin: 0;
  font-family: 'Ysabeau', 'Mulish', system-ui, sans-serif;
  font-size: clamp(38px, 5.2vw, 68px);
  line-height: 1.06; font-weight: 600; letter-spacing: -.028em;
  text-wrap: balance;
}
.lede {
  margin: 16px 0 0;
  max-width: 34em;
  margin-inline: auto;
  font-size: clamp(17px, 1.4vw, 19px);
  color: var(--brown-soft);
}
.flow { margin: 48px auto 0; max-width: 520px; }

/* Progress, at the foot of the hero */
.progress {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(20px, 4vh, 36px);
  display: flex; align-items: center; justify-content: center; gap: 4px;
  text-align: left;
}
.progress-meter { flex: none; display: flex; align-items: center; gap: 12px; }
.progress-labels {
  white-space: nowrap;
  font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums;
  color: var(--brown-soft);
}
.progress-track { display: flex; gap: 4px; }
.progress-track i {
  flex: none; width: 23.1px; height: 12px; /* 1.925, same as the paxlava band */
  background: var(--line);
  clip-path: polygon(0 50%, 50% 0, 100% 50%, 50% 100%);
  transition: background .3s;
}
.progress-track i.on { background: var(--brown); }
.progress-nav { flex: none; display: flex; color: var(--brown); }
.progress-nav button {
  display: grid; place-items: center; width: 44px; height: 44px;
  transition: opacity .2s, transform .25s var(--ease-out);
}
.progress-nav svg { width: 24px; height: 24px; }
.progress-nav button:disabled { opacity: .3; cursor: default; }
@media (hover: hover) {
  #prev:not(:disabled):hover { transform: translateY(-3px); }
  #down:hover { transform: translateY(3px); }
}

/* Fields */
.step label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.field {
  position: relative; display: flex; align-items: baseline; gap: 12px;
  border-bottom: 1px solid var(--line);
}
.field::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--brown);
  transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease-out);
}
.field:focus-within::after { transform: scaleX(1); }
.field.bad::after { background: #B3261E; transform: scaleX(1); }
.field input {
  flex: 1; min-width: 0; width: 100%;
  border: 0; outline: 0; background: transparent;
  padding: 10px 0 12px;
  text-align: center;
  font-size: clamp(22px, 2.3vw, 28px); font-weight: 500; letter-spacing: -.01em;
}
.field:has(.prefix) { justify-content: center; }
.field #phone { flex: none; width: 6.6em; text-align: left; }
.field #dial {
  flex: none; width: 3.1ch; min-width: 0; text-align: left; color: var(--brown-soft);
  transition: color .2s;
}
.field #dial:hover, .field #dial:focus { color: var(--ink); }
.field input::placeholder { color: var(--ink); opacity: .32; }
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  transition: background-color 9999s;
}
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.err { min-height: 22px; margin: 6px 0 0; font-size: 14px; font-weight: 500; color: #B3261E; }
.actions { display: flex; align-items: center; justify-content: center; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 26px;
  background: var(--brown); color: #fff;
  font-weight: 600; font-size: 16px;
  border-radius: 10px;
  transition: background .25s, transform .25s var(--ease-out);
}
.btn svg { width: 20px; height: 20px; transition: transform .35s var(--ease-out); }
@media (hover: hover) {
  .btn:hover { background: var(--ink); }
  .btn:hover svg { transform: translateX(4px); }
}
.btn:active { transform: scale(.98); }
.btn[disabled] { cursor: progress; opacity: .75; }
.btn[disabled] svg { display: none; }
.btn[disabled]::after {
  content: ''; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Pane changes */
.pane-out { animation: pane-out .18s ease-in forwards; }
.pane-in { animation: pane-in .55s var(--ease-out); }
@keyframes pane-out { to { opacity: 0; transform: translateX(-14px); } }
@keyframes pane-in { from { opacity: 0; transform: translateX(22px); } }
.pane-back-in { animation: pane-back-in .55s var(--ease-out); }
@keyframes pane-back-in { from { opacity: 0; transform: translateX(-22px); } }
.shake { animation: shake .36s ease; }
@keyframes shake { 25% { transform: translateX(-5px); } 60% { transform: translateX(4px); } }

/* Confirmation */
.done:focus { outline: 0; }
.flow--done { margin-top: 0; max-width: none; }
.done-title {
  display: flex; flex-direction: column; align-items: safe center; gap: 16px;
  margin: 0;
  white-space: nowrap; overflow: hidden;
  font-family: 'Ysabeau', 'Mulish', system-ui, sans-serif;
  font-size: clamp(38px, 5.2vw, 68px);
  line-height: 1.06; font-weight: 600; letter-spacing: -.028em;
}
.done-title svg { flex: none; width: 56px; height: 56px; overflow: visible; }
.done-title circle { transform-box: fill-box; transform-origin: center; }
.check-disc { fill: var(--brown); animation: check-disc .7s var(--ease-out) backwards; }
@keyframes check-disc { from { transform: scale(.4); opacity: 0; } }
.check-ring { stroke: var(--brown); stroke-width: .5; opacity: 0; animation: check-ring 1.2s var(--ease-out) .25s; }
@keyframes check-ring { from { transform: scale(1); opacity: .5; } to { transform: scale(1.7); opacity: 0; } }
.check-mark {
  stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw .55s var(--ease-out) .3s forwards;
}
.done-sub { margin: 16px 0 0; font-size: clamp(17px, 1.4vw, 19px); color: var(--brown-soft); }
.survey { margin: 32px 0 0; padding: 32px 0 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.survey legend { float: left; width: 100%; padding: 0; margin-bottom: 14px; font-weight: 600; }
.chips { clear: both; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip {
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-weight: 500;
  animation: rise .6s var(--ease-out) backwards;
  animation-delay: calc(.25s + var(--n) * 45ms);
  transition: background .2s, color .2s, border-color .2s, opacity .3s;
}
.chip:hover { border-color: var(--brown); background: rgba(110, 27, 0, .05); }
.chip[aria-pressed="true"] { background: var(--brown); border-color: var(--brown); color: #fff; }
.other { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; margin-top: 24px; }
.other .field { flex: 1 1 240px; }
.other .field input { font-size: 20px; }
.survey.answered .chip:not([aria-pressed="true"]) { opacity: .45; }
.survey.answered .chip:not([aria-pressed="true"]):hover { opacity: 1; }
.survey-thanks { margin: 14px 0 0; font-size: 15px; color: var(--brown-soft); animation: pane-in .5s var(--ease-out); }

/* Trade doodles, barely there, in the lower corners */
.doodles {
  position: absolute; bottom: 0; width: min(32vw, 440px); height: min(44vh, 340px);
  pointer-events: none;
  color: var(--ink);
  opacity: .1;
}
.js .doodles { opacity: 0; animation: doodles-in 1.6s ease 3.4s forwards; }
.js.no-intro .doodles { animation-delay: .6s; }
@keyframes doodles-in { to { opacity: .1; } }
.doodles--l { left: 0; -webkit-mask-image: linear-gradient(to right, #000 45%, transparent); mask-image: linear-gradient(to right, #000 45%, transparent); }
.doodles--r { right: 0; -webkit-mask-image: linear-gradient(to left, #000 45%, transparent); mask-image: linear-gradient(to left, #000 45%, transparent); }
.doodle {
  position: absolute; width: var(--s); height: var(--s);
  transform: translate(calc(var(--mx, 0) * var(--s) / 30), calc(var(--my, 0) * var(--s) / 30)) rotate(var(--r));
  fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round;
}

/* Promise */
.promise {
  position: relative;
  background: var(--ink); color: var(--butter);
  padding: clamp(150px, 26vh, 280px) var(--gutter) clamp(96px, 20vh, 200px);
}
.promise::before {
  /* Paxlava band from the brand's stationery. Each diamond is 77:40 (1.925). */
  --paxlava: 38.5px;
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: calc(var(--paxlava) * 60 / 77);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 77 60'%3E%3Crect width='77' height='60' fill='%23FBF5DF'/%3E%3Crect y='40' width='77' height='20' fill='%23270600'/%3E%3Cpath d='M0 20 38.500 0 77 20 38.500 40z' fill='%23270600'/%3E%3Cpath d='M0 20 38.500 40 0 60zM77 20 38.500 40 77 60z' fill='%23FBF5DF'/%3E%3C/svg%3E") 0 0 / var(--paxlava) 100% repeat-x;
}
.promise-text {
  margin: 0; max-width: 21em;
  font-size: clamp(28px, 4.2vw, 56px);
  line-height: 1.2; font-weight: 500; letter-spacing: -.022em;
}
.promise-text span { opacity: .2; transition: opacity .35s linear; }
.promise-text span.on { opacity: 1; }

/* Footer */
.foot {
  background: var(--ink); color: var(--butter);
  padding: 0 var(--gutter) max(28px, env(safe-area-inset-bottom));
  font-size: 14px;
}
.foot :focus-visible { outline-color: var(--butter); }
.social {
  display: flex; gap: 6px; margin-left: -10px; padding-bottom: 32px;
}
.social a {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .25s, color .25s, transform .3s var(--ease-out);
}
.social a:hover { background: var(--butter); color: var(--ink); transform: translateY(-2px); }
.social svg { width: 22px; height: 22px; }
.foot-row {
  color: rgba(255, 255, 255, .6);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding-top: 22px;
  border-top: 1px solid rgba(252, 235, 150, .2);
}
.credit {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
  transition: background-size .4s var(--ease-out);
  padding: 12px 0; margin: -12px 0;
}
.credit { transition: background-size .4s var(--ease-out), color .25s; }
.credit:hover { background-size: 100% 1px; color: #fff; }

@media (max-width: 899px) {
  .hero { padding-block: 96px; }
  .doodles { display: none; }
  .flow { max-width: none; }
  .btn { flex: 1; }
}
@media (max-width: 460px) {
  .foot-row { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-delay: 0s !important;
    transition-duration: .01ms !important; transition-delay: 0s !important;
  }
  .promise-text span { opacity: 1; }
}
