/* Backbilt landing page.
   Colours and type from the Backbilt house style (marine, turquoise, Adventor + Poppins);
   the stacked hero, the line drawing, the pill buttons and the editorial intro borrow from 51noord.be. */

@font-face {
  font-family: "Adventor";
  src: url("fonts/texgyreadventor-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("fonts/Poppins-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("fonts/Poppins-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --marine: #16233B;
  --turquoise: #13B5A4;
  --turquoise-text: #0B7A6F;
  --mint: #E9F7F5;
  --periwinkle: #CEDDF8;
  --text: #3D4757;
  --grey: #5B6575;
  --line: #E3E8EE;
  --white: #FFFFFF;

  --bg: var(--white);
  --surface: var(--white);
  --title: var(--marine);
  --accent: var(--turquoise);
  --link: var(--turquoise-text);
  --panel: var(--mint);
  --bubble: #F1F3F6;

  --ink-on-dark: #F5F7FA;
  --text-on-dark: #C9D2DE;

  --display: "Adventor", "URW Gothic", "Century Gothic", "Avenir Next", sans-serif;
  --body: "Poppins", "Avenir Next", "Segoe UI", sans-serif;

  --gutter: clamp(16px, 5vw, 64px);
  --max: 1240px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16233B;
    --surface: #1E2E4A;
    --title: #F5F7FA;
    --text: #C9D2DE;
    --grey: #A9B4C4;
    --line: #2A3A57;
    --accent: #2ED3BF;
    --link: #2ED3BF;
    --panel: #1E2E4A;
    --bubble: #2A3A57;
  }
}
:root[data-theme="dark"] {
  --bg: #16233B;
  --surface: #1E2E4A;
  --title: #F5F7FA;
  --text: #C9D2DE;
  --grey: #A9B4C4;
  --line: #2A3A57;
  --accent: #2ED3BF;
  --link: #2ED3BF;
  --panel: #1E2E4A;
  --bubble: #2A3A57;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  color: var(--title);
  margin: 0;
  letter-spacing: -0.01em;
}
p { margin: 0; }
a { color: var(--link); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 16px;
  background: var(--accent);
  color: var(--marine);
  border-radius: 999px;
  z-index: 10;
}
.skip:focus { top: 16px; }

/* Buttons: pills, as on 51noord.be; colours from the house style. */
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font: 500 16px/1 var(--body);
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background-color .15s ease, color .15s ease;
}
.pill-small { min-height: 40px; padding: 0 18px; font-size: 15px; }
.pill-accent { background: var(--accent); color: var(--marine); }
.pill-accent:hover { background: #2ED3BF; }
.pill-ghost { border-color: currentColor; color: var(--title); }
.pill-ghost:hover { background: var(--panel); }

.actions { display: flex; flex-wrap: wrap; gap: 16px; }

/* Header and hero sit on marine, like 51Noord's olive hero. */
.top {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 24px var(--gutter);
  background: var(--marine);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-right: auto;
}
.logo-mark { width: 28px; height: 34px; }
.m-spine { fill: #2ED3BF; }
.m-bone { fill: var(--ink-on-dark); }
.logo-word {
  font: 700 26px/1 var(--display);
  letter-spacing: 0.01em;
  color: var(--ink-on-dark);
}
.w-bilt { color: #2ED3BF; }
.nav { display: flex; gap: 28px; }
.nav a {
  color: var(--text-on-dark);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
}
.nav a:hover { color: var(--ink-on-dark); }
.login {
  color: var(--ink-on-dark);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
}
.login:hover { text-decoration: underline; text-underline-offset: 4px; }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: 32px;
  min-height: calc(100vh - 88px);
  min-height: calc(100svh - 88px);
  padding: 32px var(--gutter) 120px;
  background: var(--marine);
  color: var(--text-on-dark);
}
.hero h1 {
  font-size: clamp(44px, 6.6vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--ink-on-dark);
}
.hero h1 .line { display: block; }
.hero-lede {
  margin: 32px 0 40px;
  max-width: 38ch;
  font-size: 18px;
}
.hero .pill-ghost { color: var(--ink-on-dark); }
.hero .pill-ghost:hover { background: #1E2E4A; }
.hero .pill-accent { background: #2ED3BF; }
.hero .pill-accent:hover { background: var(--mint); }

.hero-drawing { width: 100%; height: auto; display: block; overflow: visible; }
.hero-drawing path {
  fill: none;
  stroke: var(--periwinkle);
  stroke-width: 1.1;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.hero-drawing .grid { stroke-opacity: .28; }
.hero-drawing .col { stroke-opacity: .55; }
.hero-drawing .spine path { stroke: #2ED3BF; stroke-width: 2; }
.hero-drawing .spine .ring { stroke-width: 1.4; }
.hero-drawing .lead { stroke-opacity: .7; stroke-width: 1; }
.hero-drawing circle { fill: #2ED3BF; }
.hero-drawing text {
  fill: var(--periwinkle);
  font: 500 15px var(--body);
}

/* The one orchestrated moment: the building draws itself, floor by floor, then the spine, then the labels. */
@media (prefers-reduced-motion: no-preference) {
  .hero-drawing path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw .9s cubic-bezier(.4, 0, .2, 1) forwards;
  }
  .hero-drawing .f0 path { animation-delay: .15s; }
  .hero-drawing .f1 path { animation-delay: .5s; }
  .hero-drawing .f2 path { animation-delay: .85s; }
  .hero-drawing .f3 path { animation-delay: 1.2s; }
  .hero-drawing .spine path { animation-duration: 1.1s; animation-delay: 1.6s; }
  .hero-drawing .note { opacity: 0; animation: appear .5s ease forwards; }
  .hero-drawing .note path { animation-duration: .5s; }
  .hero-drawing .n0, .hero-drawing .n0 path { animation-delay: 2.4s; }
  .hero-drawing .n1, .hero-drawing .n1 path { animation-delay: 2.55s; }
  .hero-drawing .n2, .hero-drawing .n2 path { animation-delay: 2.7s; }
  .hero-drawing .n3, .hero-drawing .n3 path { animation-delay: 2.85s; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }

/* The thin arrow from 51noord.be. */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 32px;
  width: 24px;
  height: 56px;
  transform: translateX(-50%);
}
.scroll-cue span,
.scroll-cue span::after {
  position: absolute;
  display: block;
}
.scroll-cue span {
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  background: var(--periwinkle);
}
.scroll-cue span::after {
  content: "";
  left: -5px;
  bottom: 0;
  width: 10px;
  height: 10px;
  border-right: 1px solid var(--periwinkle);
  border-bottom: 1px solid var(--periwinkle);
  transform: rotate(45deg);
  transform-origin: 50% 50%;
}

/* Shared section frame. */
.origin, .flow, .dossier, .remus, .makers, .demo, .foot {
  padding-left: max(var(--gutter), calc((100% - var(--max)) / 2));
  padding-right: max(var(--gutter), calc((100% - var(--max)) / 2));
}

/* Editorial intro, 51Noord-style: a statement, then prose with bold lead-ins. */
.origin {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 48px 64px;
  padding-top: 120px;
  padding-bottom: 120px;
  border-bottom: 1px solid var(--line);
}
.statement {
  font-size: clamp(30px, 3.6vw, 48px);
  line-height: 1.08;
  max-width: 14ch;
}
.origin-body { display: grid; gap: 24px; max-width: 60ch; font-size: 17px; }
.origin-body strong { color: var(--title); font-weight: 500; }

/* The flow, drawn as the logo: a turquoise spine with vertebrae. */
.flow {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  gap: 48px 96px;
  padding-top: 120px;
  padding-bottom: 120px;
}
.flow-head { align-self: start; position: sticky; top: 48px; }
.flow-head h2 { font-size: clamp(30px, 3.2vw, 40px); line-height: 1.1; max-width: 16ch; }
.flow-head p { margin-top: 24px; max-width: 40ch; color: var(--grey); }

.spine {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 8px 0 8px 0;
  display: grid;
  gap: 48px;
}
.spine::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  border-radius: 5px;
  background: var(--accent);
}
.spine li {
  position: relative;
  padding-left: 88px;
}
.spine li::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 8px;
  width: 52px;
  height: 12px;
  border-radius: 6px;
  background: var(--title);
}
.spine li:nth-child(4n+2)::before { width: 40px; }
.spine li:nth-child(4n+3)::before { width: 48px; }
.spine li:nth-child(4n)::before { width: 58px; }
.spine h3 { font-size: 22px; line-height: 1.2; }
.spine p { margin-top: 8px; max-width: 52ch; }

/* A dossier, as the app shows it. */
.dossier {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  gap: 48px 96px;
  align-items: center;
  padding-top: 120px;
  padding-bottom: 120px;
  border-top: 1px solid var(--line);
}
.dossier-copy h2 { font-size: clamp(30px, 3.2vw, 40px); line-height: 1.1; }
.dossier-copy p { margin-top: 24px; max-width: 40ch; color: var(--grey); }

.app {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 48px -32px rgba(22, 35, 59, .45);
  overflow: hidden;
  font-size: 15px;
}
.app-bar {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  color: var(--grey);
  font-size: 13px;
}
.app-body { padding: 24px; display: grid; gap: 24px; }
.app-title { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.app-ref { color: var(--grey); font-size: 13px; }
.app-name { font: 700 22px/1.2 var(--display); color: var(--title); }
.chip {
  flex: none;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--link);
  font-size: 13px;
  font-weight: 500;
}
.app-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); overflow: hidden; }
.app-tabs span {
  padding-bottom: 12px;
  color: var(--grey);
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.app-tabs .on { color: var(--title); border-color: var(--accent); }

.app-quote { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.app-quote caption { text-align: left; color: var(--grey); font-size: 13px; padding-bottom: 8px; }
.app-quote th { text-align: left; font-weight: 400; }
.app-quote td { text-align: right; white-space: nowrap; }
.app-quote th, .app-quote td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.app-quote .extra th, .app-quote .extra td { color: var(--link); }
.app-quote tfoot th, .app-quote tfoot td {
  border-bottom: 0;
  padding-top: 14px;
  font: 700 17px/1.2 var(--display);
  color: var(--title);
}

.app-pay-title { color: var(--grey); font-size: 13px; padding-bottom: 8px; }
.pay { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.pay li { display: grid; gap: 2px; font-size: 13px; }
.pay li::before {
  content: "";
  height: 10px;
  border-radius: 5px;
  margin-bottom: 8px;
  background: var(--line);
}
.pay li:nth-child(1) { flex: 30; }
.pay li:nth-child(2) { flex: 40; }
.pay li:nth-child(3) { flex: 30; }
.pay li span:first-child { color: var(--title); font-weight: 500; }
.pay li span:last-child { color: var(--grey); }
.pay .paid::before { background: var(--accent); }
.pay .sent::before { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }

/* Remus, on the mint panel of the house style. */
.remus {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 48px 96px;
  align-items: center;
  padding-top: 120px;
  padding-bottom: 120px;
  background: var(--panel);
}
.chat {
  display: grid;
  gap: 8px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  max-width: 440px;
}
.chat-head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; }
.remus-face { width: 40px; height: 40px; }
.remus-face rect { fill: var(--marine); }
.remus-face .eye, .remus-face .ant { fill: #2ED3BF; }
.remus-face .mouth { fill: none; stroke: #2ED3BF; stroke-width: 2; stroke-linecap: round; }
.chat-name { font: 700 18px/1.2 var(--display); color: var(--title); }
.chat-status { font-size: 13px; color: var(--grey); }
.chat-status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.who { font-size: 12px; color: var(--grey); margin-top: 8px; }
.who-right { text-align: right; }
.bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.45;
}
.bubble-in { justify-self: end; background: var(--bubble); color: var(--title); border-bottom-right-radius: 4px; }
.bubble-remus { justify-self: start; background: var(--turquoise); color: var(--marine); border-bottom-left-radius: 4px; }

.remus-copy { display: grid; gap: 20px; max-width: 56ch; }
.remus-copy h2 { font-size: clamp(30px, 3.2vw, 40px); line-height: 1.1; margin-bottom: 4px; }
.remus-copy .aside {
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--grey);
  font-size: 15px;
}

/* The makers: two people, each opened by a vertebra from the logo. */
.makers {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 3fr) minmax(0, 3fr);
  gap: 48px 64px;
  padding-top: 120px;
  padding-bottom: 120px;
}
.makers-head h2 { font-size: clamp(30px, 3.2vw, 40px); line-height: 1.1; }
.makers-head p { margin-top: 24px; max-width: 36ch; color: var(--grey); }
.person { max-width: 44ch; }
.person::before {
  content: "";
  display: block;
  width: 56px;
  height: 12px;
  margin-bottom: 24px;
  border-radius: 6px;
  background: var(--accent);
}
.person + .person::before { width: 44px; background: var(--title); }
.person h3 { font-size: clamp(28px, 2.6vw, 36px); line-height: 1; }
.person .role { margin: 8px 0 16px; color: var(--grey); font-weight: 500; }

/* Closing call to action. */
.demo {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  grid-template-rows: auto auto;
  column-gap: 96px;
  align-items: end;
  padding-top: 120px;
  padding-bottom: 120px;
  background: var(--marine);
  color: var(--text-on-dark);
}
.demo h2 {
  color: var(--ink-on-dark);
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1;
  letter-spacing: -0.02em;
  max-width: 14ch;
}
.demo h2 { grid-column: 1; grid-row: 1 / span 2; }
.demo p { grid-column: 2; margin: 0 0 32px; max-width: 48ch; font-size: 18px; }
.demo .actions { grid-column: 2; }
.demo .pill-ghost { color: var(--ink-on-dark); }
.demo .pill-ghost:hover { background: #1E2E4A; }
.demo .pill-accent { background: #2ED3BF; }
.demo .pill-accent:hover { background: var(--mint); }

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 32px;
  padding-bottom: 32px;
  color: var(--grey);
  font-size: 14px;
}
.foot p:first-child { margin-right: auto; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero,
  :root:not([data-theme="light"]) .top { background: #101A2E; }
  :root:not([data-theme="light"]) .demo { background: #1E2E4A; }
  :root:not([data-theme="light"]) .remus-face rect:not(.eye):not(.ant) { fill: #16233B; }
}
:root[data-theme="dark"] .hero,
:root[data-theme="dark"] .top { background: #101A2E; }
:root[data-theme="dark"] .demo { background: #1E2E4A; }

/* Tablet and phone. */
@media (max-width: 960px) {
  .hero, .origin, .flow, .dossier, .remus, .demo, .makers { grid-template-columns: minmax(0, 1fr); }
  .demo h2, .demo p, .demo .actions { grid-column: 1; grid-row: auto; }
  .demo p { margin-top: 24px; }
  .hero { min-height: 0; padding-top: 24px; padding-bottom: 112px; }
  .hero-art { max-width: 560px; }
  .flow-head { position: static; }
  .origin, .flow, .dossier, .remus, .demo, .makers { padding-top: 80px; padding-bottom: 80px; }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .login { margin-left: auto; }
  .logo { margin-right: 0; }
  .top { gap: 16px; padding-top: 16px; padding-bottom: 16px; }
  .logo-word { font-size: 22px; }
  .logo-mark { width: 24px; height: 29px; }
  .hero-lede { font-size: 17px; }
  .hero-drawing text { font-size: 22px; }
  .spine { gap: 40px; }
  .spine li { padding-left: 64px; }
  .spine li::before { left: 16px; width: 36px; }
  .spine li:nth-child(4n+2)::before { width: 28px; }
  .spine li:nth-child(4n+3)::before { width: 32px; }
  .spine li:nth-child(4n)::before { width: 40px; }
  .app-body { padding: 16px; }
  .app-bar { padding: 12px 16px; }
  .pay li { font-size: 12px; }
  .chat { padding: 16px; }
}
@media (max-width: 400px) {
  .top .pill-small { padding: 0 14px; font-size: 14px; }
}
