/*
 * Quantilo marketing site. Same world as the app (docs/UI_UX.md): warm neutral surfaces, ink for
 * text, terracotta only for actions, IBM Plex Sans and Mono served from this folder (OFL 1.1).
 * Colours are the app's tokens (frontend/src/styles/tokens.css); light and dark follow the system.
 */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --font-ui: "IBM Plex Sans", system-ui, sans-serif;
  --font-code: "IBM Plex Mono", ui-monospace, monospace;

  --surface-0: #f7f5f2;
  --surface-1: #fffdfa;
  --surface-2: #efebe5;
  --ink-1: #24201b;
  --ink-2: #5c544a; /* 6.8:1 on surface-0 */
  --ink-3: #71695f; /* 5.0:1 on surface-0, 4.6:1 on surface-2 */
  --line: #e2dcd3;
  --line-strong: #cfc6ba;
  --accent: #ad4a27; /* 5.1:1 as text on surface-0; white on it 5.6:1 */
  --accent-ink: #ffffff;
  --accent-soft: #f6e3da;
  --accent-hover: #963f20;
  --ok: #2f7d4f;
  --warn: #8f5b00;

  --gutter: 16px;
  --max: 1200px;
  --radius: 6px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

@media (min-width: 640px) {
  :root { --gutter: 24px; }
}
@media (min-width: 1024px) {
  :root { --gutter: 32px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface-0: #14120f;
    --surface-1: #1d1a16;
    --surface-2: #27231e;
    --ink-1: #ede8e1;
    --ink-2: #b5aca0;
    --ink-3: #988f83; /* 5.9:1 on surface-0, 4.9:1 on surface-2 */
    --line: #332e28;
    --line-strong: #4a433b;
    --accent: #e07a50;
    --accent-ink: #14120f; /* 6.3:1 on the accent */
    --accent-soft: #3a2519;
    --accent-hover: #ea8d66;
    --ok: #5dbb84;
    --warn: #e0a23a;
    }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--surface-0);
  color: var(--ink-1);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink-1);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a,
button,
summary {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  text-wrap: balance;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
  text-wrap: pretty;
}

code,
.mono {
  font-family: var(--font-code);
  font-size: 0.875em;
}

.skip {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.skip:focus {
  top: 8px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* --- Buttons --------------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface-1);
  color: var(--ink-1);
  font: 500 15px/1 var(--font-ui);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 120ms var(--ease-out),
    border-color 120ms var(--ease-out),
    transform 120ms var(--ease-out);
}
.btn:hover {
  color: var(--ink-1);
  border-color: var(--ink-3);
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-ink);
}
.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

/* --- Header ---------------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface-0) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand:hover {
  color: var(--ink-1);
}
.brand img {
  width: 26px;
  height: 26px;
}
.nav {
  display: none;
  gap: 4px;
  margin-left: 16px;
}
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 15px;
}
.nav a:hover {
  color: var(--ink-1);
}
.header-end {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.site-header .btn {
  min-height: 44px;
  padding: 0 14px;
  font-size: 14px;
}
@media (min-width: 860px) {
  .nav {
    display: flex;
  }
}
@media (max-width: 380px) {
  .brand span {
    display: none;
  }
}

/* --- Hero ------------------------------------------------------------------------------------ */

.hero {
  padding: 48px 0 56px;
}
.hero .wrap {
  display: grid;
  gap: 40px;
}
.hero h1 {
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 21ch;
}
.hero .lede {
  margin-top: 20px;
  font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.2rem);
  color: var(--ink-2);
  max-width: 44ch;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.hero .facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 14px;
}
.hero .facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero .facts svg {
  width: 16px;
  height: 16px;
  color: var(--ink-3);
  flex: none;
}
@media (min-width: 1024px) {
  .hero {
    padding: 72px 0 88px;
  }
  .hero .wrap {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 56px;
    align-items: start;
  }
}

/* The readout: what the engine said about a real file, line by line, with measured times. */
.readout {
  margin: 0;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.readout-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.readout-head .file {
  font: 500 14px/1.3 var(--font-code);
}
.readout-head .shape {
  font-size: 13px;
  color: var(--ink-3);
}
.readout ol {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}
.readout li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 18px;
}
.readout li + li {
  border-top: 1px solid var(--line);
}
.readout .t {
  font: 400 13px/1.5 var(--font-code);
  color: var(--ink-3);
  text-align: right;
  padding-top: 1px;
}
.readout .what {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.01em;
}
.readout .said {
  display: block;
  font-size: 15px;
  line-height: 1.45;
}
.readout .said code {
  font-size: 13.5px;
  background: var(--surface-2);
  padding: 1px 4px;
  border-radius: 3px;
}
.readout .tag {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 500;
}
.tag-auto {
  color: var(--ok);
}
.tag-you {
  color: var(--warn);
}
.readout-foot {
  padding: 12px 18px 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-3);
}
.readout-foot a {
  color: var(--ink-2);
}
@media (max-width: 479px) {
  .readout li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .readout .t {
    text-align: left;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .readout li {
    animation: line-in 420ms var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 260ms + 150ms);
  }
  /* The lines arrive in the order the engine produced them. */
  .readout li:nth-child(2) { --i: 1; }
  .readout li:nth-child(3) { --i: 2; }
  .readout li:nth-child(4) { --i: 3; }
  .readout li:nth-child(5) { --i: 4; }
  .readout li:nth-child(6) { --i: 5; }
}
@keyframes line-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

/* --- Sections -------------------------------------------------------------------------------- */

section {
  padding: 64px 0;
}
.section-line {
  border-top: 1px solid var(--line);
}
.section-alt {
  background: var(--surface-1);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
h2 {
  font-size: clamp(1.6rem, 1.25rem + 1.3vw, 2.25rem);
  line-height: 1.15;
  max-width: 24ch;
}
.intro {
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 1.0625rem;
  max-width: 62ch;
}
@media (min-width: 1024px) {
  section {
    padding: 96px 0;
  }
}

/* How it works: three moves of one sequence, on one rule line. */
.steps {
  display: grid;
  gap: 32px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  position: relative;
  padding-top: 20px;
  border-top: 2px solid var(--ink-1);
}
.steps .n {
  font: 500 13px/1 var(--font-code);
  color: var(--accent);
}
.steps h3 {
  margin-top: 12px;
  font-size: 1.2rem;
}
.steps p {
  margin-top: 8px;
  color: var(--ink-2);
  max-width: 40ch;
}
@media (min-width: 860px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
  }
}

/* Proof: real screenshots of the app on the same file. */
.shot {
  margin: 0;
}
.shot .frame {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-1);
}
.shot img {
  width: 100%;
}
.shot figcaption {
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 15px;
  max-width: 62ch;
}
.shot figcaption strong {
  color: var(--ink-1);
  font-weight: 600;
}
.proof {
  display: grid;
  gap: 48px;
  margin-top: 40px;
}
.proof-pair {
  display: grid;
  gap: 48px;
}
@media (min-width: 860px) {
  .proof-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
  }
}

/* Layers: each built on the one before. */
.layers {
  display: grid;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-strong);
}
.layers li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 4px 16px;
  padding: 18px 0;
}
.layers li + li {
  border-top: 1px solid var(--line);
}
.layers .n {
  grid-row: span 2;
  font: 500 13px/1.6 var(--font-code);
  color: var(--accent);
}
.layers h3 {
  font-size: 1.05rem;
}
.layers p {
  color: var(--ink-2);
  font-size: 15px;
}
@media (min-width: 860px) {
  .layers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 48px;
    grid-auto-flow: column;
    grid-template-rows: repeat(5, auto);
  }
  .layers li:nth-child(6) {
    border-top: none;
  }
}

/* Counts read from the code. */
.counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 24px;
  margin: 40px 0 0;
}
.counts div {
  border-left: 1px solid var(--line-strong);
  padding-left: 16px;
}
.counts dt {
  font-size: 14px;
  color: var(--ink-2);
  margin-top: 6px;
}
.counts dd {
  margin: 0;
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
}
/* The label comes first in the markup (dt, dd); the number reads first on screen. */
.counts div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
}
.counts-note {
  margin-top: 24px;
  font-size: 13px;
  color: var(--ink-3);
  max-width: 80ch;
}
@media (min-width: 860px) {
  .counts {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Automatic, never blind. */
.principle {
  display: grid;
  gap: 40px;
  margin-top: 40px;
}
.points {
  display: grid;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.points h3 {
  font-size: 1.05rem;
}
.points p {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 15px;
}
@media (min-width: 1024px) {
  .principle {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 56px;
    align-items: start;
  }
}

/* Where it runs: a comparison table. */
.table-wrap {
  margin-top: 40px;
}
.deploy {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.deploy th,
.deploy td {
  text-align: left;
  vertical-align: top;
  padding: 14px 16px 14px 0;
  border-top: 1px solid var(--line);
}
.deploy thead td,
.deploy thead th {
  border-top: 0;
  padding-bottom: 12px;
  font-size: 1.05rem;
  border-bottom: 2px solid var(--ink-1);
}
.deploy thead th span {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-2);
}
.deploy tbody th {
  font-weight: 500;
  color: var(--ink-2);
  width: 18%;
}
.deploy td {
  color: var(--ink-1);
}
.deploy .cell-cta {
  padding-top: 18px;
}
.deploy a.inline {
  font-weight: 500;
}
@media (max-width: 759px) {
  .deploy thead {
    display: none;
  }
  .deploy,
  .deploy tbody,
  .deploy tr,
  .deploy td,
  .deploy tbody th {
    display: block;
    width: 100%;
  }
  .deploy tr {
    padding: 4px 0 16px;
  }
  .deploy tbody th {
    border-top: 2px solid var(--ink-1);
    padding: 14px 0 4px;
    color: var(--ink-1);
    font-weight: 600;
    font-size: 1.05rem;
  }
  .deploy td {
    border-top: 0;
    padding: 8px 0;
  }
  .deploy td::before {
    content: attr(data-label);
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-3);
  }
}

/* Pricing. */
.plans {
  display: grid;
  gap: 20px;
  margin-top: 40px;
}
.plan {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.plan-pro {
  border: 2px solid var(--ink-1);
  padding: 23px;
}
.plan h3 {
  font-size: 1.15rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.plan h3 small {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
}
.plan .for {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 15px;
  min-height: 3em;
}
.price {
  margin-top: 18px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.price .amount {
  font-size: 2.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}
.price .per {
  color: var(--ink-2);
  font-size: 15px;
}
.price-note {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--ink-3);
  min-height: 1.5em;
}
.plan ul {
  margin: 20px 0 24px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  font-size: 15px;
}
.plan li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
}
.plan li svg {
  width: 16px;
  height: 16px;
  margin-top: 4px;
  color: var(--ink-3);
}
.plan li .soon {
  color: var(--ink-3);
  font-size: 13px;
  white-space: nowrap;
}
.plan .btn {
  margin-top: auto;
  width: 100%;
}
@media (min-width: 760px) {
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 880px;
    align-items: stretch;
  }
}
.talk {
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink-2);
}
.talk a {
  color: var(--ink-1);
  font-weight: 500;
}
.plans-note {
  margin-top: 20px;
  font-size: 14px;
  color: var(--ink-2);
  max-width: 72ch;
}

/* Early access. */
.early {
  padding: 28px;
  background: var(--surface-2);
  border-radius: 8px;
  max-width: 760px;
}
.early h2 {
  font-size: 1.5rem;
}
.early p {
  margin-top: 10px;
  color: var(--ink-2);
}
.early p a {
  color: var(--ink-1);
  font-weight: 500;
}
.early:target {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* FAQ. */
.faq {
  margin-top: 32px;
  padding-top: 4px;
  max-width: 820px;
  border-top: 1px solid var(--line-strong);
}
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 14px 0;
  font-weight: 500;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 1.5px solid var(--ink-2);
  border-bottom: 1.5px solid var(--ink-2);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 180ms var(--ease-out);
}
.faq details[open] summary::after {
  transform: translateY(2px) rotate(-135deg);
}
.faq summary:hover {
  color: var(--accent);
}
.faq .answer {
  padding: 0 0 20px;
  color: var(--ink-2);
  max-width: 68ch;
}
.faq .answer p + p {
  margin-top: 10px;
}
.faq .answer a {
  color: var(--ink-1);
}

/* Closing call. */
.close {
  text-align: left;
}
.close h2 {
  max-width: 20ch;
}
.close .cta-row {
  margin-top: 24px;
}

/* Footer. */
.site-footer {
  padding: 40px 0 48px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-2);
}
.site-footer .wrap {
  display: grid;
  gap: 24px;
}
.site-footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  margin-left: -8px;
  margin-right: 8px;
  color: var(--ink-2);
}
.site-footer nav a:hover {
  color: var(--ink-1);
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.site-footer small {
  font-size: 13px;
  color: var(--ink-3);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}

@media print {
  .site-header,
  .cta-row {
    display: none;
  }
}
