/* ============================================================
   FILL.AI · filled in ink
   Fill.ai writes your answers into a form's blanks the way you would
   with a pen, and only what it can back up. So there is one colour,
   ink blue, and it means "Fill.ai wrote this". Everything else is the
   form: warm black paper, bone type, hairline blanks, and a blinking
   caret where something still waits for you.
   ============================================================ */

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/manrope-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/instrument-serif-400-italic-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/space-mono-400-latin.woff2') format('woff2');
}

:root {
  --bg: #0b0b0d;
  --paper: #121215;
  --ink: #f0efe9;
  --dim: rgba(240, 239, 233, 0.62);
  --faint: rgba(240, 239, 233, 0.36);
  --line: rgba(240, 239, 233, 0.11);

  /* the one colour: what Fill.ai writes */
  --pen: #4f63ff;
  --pen-text: #8a97ff;

  --ask: #f5b544;
  --yours: #ff7a9a;

  --rail: 64px;
  --pad: clamp(1.25rem, 3.4vw, 3rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'Space Mono', ui-monospace, 'Cascadia Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font: 16px/1.65 var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--pen-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

::selection {
  background: var(--pen);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--pen-text);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 em,
h2 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--pen-text);
}

.mono {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

kbd {
  font: 0.78rem/1 var(--mono);
  color: var(--ink);
  padding: 0.28em 0.5em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: var(--paper);
}

.keys {
  white-space: nowrap;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
}

/* ---------- rail ---------- */

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
  background: var(--bg);
  border-right: 1px solid var(--line);
}

.rail__mark svg {
  display: block;
  width: 38px;
  height: 38px;
}

.rail__caret {
  animation: caret 1.1s steps(1) infinite;
}

.rail__name {
  margin-top: 1.2rem;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--dim);
}

.rail__nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin-top: 2rem;
}

.rail__nav a {
  padding: 0.35rem 0.5rem;
  color: var(--faint);
  transition: color 0.2s ease;
}

.rail__nav a:hover,
.rail__nav a.is-here {
  color: var(--ink);
  text-decoration: none;
}

.rail__nav a.is-here {
  box-shadow: inset 2px 0 0 var(--pen);
}

.rail__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.rail__foot a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--dim);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.rail__foot a:hover {
  color: var(--ink);
  text-decoration: none;
}

.rail__foot svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.rail__foot svg .fill {
  fill: currentColor;
  stroke: none;
}

.rail__dl {
  color: #fff !important;
  background: var(--pen);
}

.rail__dl:hover {
  filter: brightness(1.15);
}

.rail__me {
  font-family: var(--mono);
  font-size: 0.7rem;
  border: 1px solid var(--line);
}

main,
.foot {
  margin-left: var(--rail);
}

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

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: var(--pad);
}

.hero__top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.hero__grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding-top: clamp(2rem, 6vh, 4rem);
}

h1 {
  font-size: clamp(2.8rem, 6.4vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

h1 em {
  font-size: 1.08em;
}

.lede {
  max-width: 34rem;
  margin-top: 1.6rem;
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  color: var(--dim);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.6rem;
  margin-top: 2rem;
}

.btn-ink {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1.4rem 0.95rem 1.1rem;
  color: #fff;
  background: var(--pen);
  transition: filter 0.2s ease, transform 0.2s var(--ease);
}

.btn-ink:hover {
  filter: brightness(1.12);
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-ink svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.btn-ink span {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.btn-ink strong {
  font-size: 1.02rem;
}

.btn-ink small {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  opacity: 0.78;
}

.btn-ink--big {
  padding: 1.2rem 1.8rem 1.2rem 1.4rem;
}

.btn-line {
  color: var(--ink);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color 0.2s ease;
}

.btn-line:hover {
  border-color: var(--ink);
  text-decoration: none;
}

.browser-note {
  max-width: 34rem;
  margin-top: 1.2rem;
  padding: 0.8rem 1rem;
  font-size: 0.92rem;
  border-left: 3px solid var(--ask);
  background: var(--paper);
}

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  margin-top: 2.2rem;
  list-style: none;
}

.trust li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.trust li::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--pen);
}

/* ---------- the self-filling form ---------- */

.demo {
  padding: clamp(1.2rem, 2.4vw, 2rem);
  background: var(--paper);
  border: 1px solid var(--line);
}

.demo__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.demo__rows {
  display: flex;
  flex-direction: column;
}

.f {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  align-items: end;
  gap: 1rem;
  padding: 1.05rem 0 0.35rem;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.4s ease;
}

.f.is-filled {
  border-bottom-color: var(--pen);
}

.f__label {
  font-size: 0.86rem;
  color: var(--dim);
  padding-bottom: 0.2rem;
}

.f__val {
  display: flex;
  align-items: flex-end;
  min-height: 1.9rem;
  min-width: 0;
}

/* Answers are set the way a real field shows its value: plain sans, in
   ink. (The serif italic stays for headlines; at this size it went thin.) */
.ink {
  overflow: hidden;
  font-family: var(--sans);
  font-size: clamp(1.02rem, 1.3vw, 1.14rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--pen-text);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.f sup {
  margin: 0 0 0.95em 0.3em;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--ink);
  transition: opacity 0.3s ease, transform 0.3s var(--ease);
}

.note {
  font-size: 0.8rem;
  color: var(--faint);
}

.f--wait .note {
  margin-left: 0.6rem;
  color: var(--ask);
}

.note--yours {
  color: var(--yours) !important;
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.4rem;
  background: var(--ink);
  animation: caret 1.1s steps(1) infinite;
}

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

.demo__foot {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: 1.6rem;
}

.submit {
  padding: 0.6rem 1.3rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--faint);
  border: 1px dashed var(--line);
}

.demo__src {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.4rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  list-style: none;
  counter-reset: src;
  font-size: 0.64rem;
  color: var(--faint);
}

.demo__src li {
  counter-increment: src;
}

.demo__src li::before {
  content: counter(src) ' ';
  color: var(--pen-text);
}

.demo__again {
  margin-top: 1rem;
  padding: 0.4rem 0;
  font: 0.7rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  background: none;
  border: 0;
  cursor: pointer;
}

.demo__again:hover {
  color: var(--ink);
}

/* Kept in the layout while hidden, so the form doesn't jump when it shows */
.js .demo__again {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.4s ease, visibility 0.4s;
}

.js .demo__again.is-on {
  visibility: visible;
  opacity: 1;
}

/* Before and while the form fills: answers hidden, then written in.
   Only with JS; without it the form simply shows filled. */
.js .demo.is-blank .f[data-answer] sup {
  opacity: 0;
  transform: translateY(4px);
}

.js .demo.is-blank .f[data-answer].is-filled sup {
  opacity: 1;
  transform: none;
}

.js .demo.is-blank .f--wait,
.js .demo.is-blank .f--yours,
.js .demo.is-blank .demo__foot .note,
.js .demo.is-blank .demo__src {
  opacity: 0;
}

.demo .f--wait,
.demo .f--yours,
.demo .demo__foot .note,
.demo .demo__src {
  transition: opacity 0.5s ease;
}

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

.block {
  padding: clamp(4rem, 10vw, 7rem) var(--pad) 0;
}

.head {
  max-width: 50rem;
  margin-bottom: clamp(2rem, 5vw, 3.2rem);
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.label {
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  line-height: 1.02;
}

.sub {
  max-width: 40rem;
  margin-top: 1rem;
  font-size: 1.05rem;
  color: var(--dim);
}

h3 {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.steps4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  list-style: none;
}

.steps4 li {
  padding: 1.4rem 1.6rem 1.8rem 0;
}

.steps4 li + li {
  padding-left: 1.6rem;
  border-left: 1px solid var(--line);
}

.num {
  display: block;
  margin-bottom: 1.8rem;
  color: var(--pen-text);
}

.steps4 p,
.steps p,
.option p,
.rules p,
.two p {
  margin-top: 0.5rem;
  color: var(--dim);
}

.shot {
  margin-top: clamp(2rem, 5vw, 3rem);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.shot figcaption {
  margin-top: 0.8rem;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
}

.shot figcaption code {
  text-transform: none;
}

.install {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.install .shot {
  margin-top: 0;
  position: sticky;
  top: 2rem;
}

.steps {
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  counter-increment: step;
  padding: 1.1rem 0 1.3rem 3.2rem;
  border-top: 1px solid var(--line);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1.25rem;
  font: 0.72rem/1 var(--mono);
  color: var(--pen-text);
}

.steps h3 a {
  color: var(--ink);
  border-bottom: 1px solid var(--pen);
}

.steps h3 a:hover {
  text-decoration: none;
  color: var(--pen-text);
}

.steps em,
.two em {
  font-style: normal;
  color: var(--ink);
}

.cmd {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  margin-top: 0.7rem;
  border: 1px solid var(--line);
  background: var(--paper);
}

.cmd code {
  padding: 0.5rem 0.8rem;
  overflow-x: auto;
  white-space: nowrap;
  color: var(--ink);
}

.copy {
  padding: 0 0.9rem;
  font: 0.68rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  background: none;
  border: 0;
  border-left: 1px solid var(--line);
  cursor: pointer;
}

.copy:hover {
  color: var(--ink);
}

/* The AI: three answers to one question, set like form options */
.options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.option {
  padding: 1.5rem 1.6rem 1.8rem 0;
}

.option + .option {
  padding-left: 1.6rem;
  border-left: 1px solid var(--line);
}

.option__top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 0.8rem;
  margin-bottom: 0.4rem;
}

.radio {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--faint);
  border-radius: 50%;
}

.radio--on {
  border-color: var(--pen);
  background: radial-gradient(circle, var(--pen) 0 4px, transparent 4.5px);
}

.tag {
  margin-left: auto;
  padding: 0.25rem 0.5rem;
  font-size: 0.62rem;
  border: 1px solid currentColor;
}

.tag--free {
  color: #6fdcaf;
}

.tag--paid {
  color: var(--ask);
}

.mini {
  margin-top: 1rem;
  padding-left: 1.2rem;
  color: var(--dim);
}

.mini li + li {
  margin-top: 0.5rem;
}

.mini li::marker {
  font-family: var(--mono);
  font-size: 0.8em;
  color: var(--pen-text);
}

.fine {
  font-size: 0.85rem;
  color: var(--faint) !important;
}

.note-warn {
  padding-left: 0.8rem;
  font-size: 0.85rem;
  border-left: 2px solid var(--ask);
}

/* Honest by design: a checklist, ticked in ink */
.rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  border-top: 1px solid var(--line);
}

.rules li {
  position: relative;
  padding: 1.4rem 1.6rem 1.6rem 2.4rem;
  border-bottom: 1px solid var(--line);
}

.rules li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.55rem;
  width: 14px;
  height: 14px;
  background: var(--pen);
}

.rules li::after {
  content: '';
  position: absolute;
  left: 3.5px;
  top: calc(1.55rem + 3.6px);
  width: 7px;
  height: 3.5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
}

.two > div {
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.two h2 {
  margin-bottom: 1.2rem;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
}

.two p + p {
  margin-top: 0.9rem;
}

.final {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin: clamp(5rem, 12vw, 9rem) var(--pad) 0;
  padding: clamp(2rem, 5vw, 3rem) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.final h2 {
  font-size: clamp(2.6rem, 6vw, 5rem);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 2rem;
  padding: 2rem var(--pad) 2.4rem;
  font-size: 0.66rem;
}

.foot a {
  color: var(--ink);
}

/* ---------- reveal ---------- */

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

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

/* ---------- smaller screens ---------- */

@media (max-width: 1100px) {
  .steps4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps4 li:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .steps4 li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hero__grid,
  .install,
  .two {
    grid-template-columns: minmax(0, 1fr);
  }

  .install .shot {
    position: static;
  }

  .options {
    grid-template-columns: minmax(0, 1fr);
  }

  .option,
  .option + .option {
    padding-left: 0;
    border-left: 0;
  }

  .option + .option {
    border-top: 1px solid var(--line);
  }

  .rail__nav {
    display: none;
  }
}

@media (max-width: 600px) {
  :root {
    --rail: 48px;
  }

  .rail__mark svg {
    width: 32px;
    height: 32px;
  }

  .hero__top-mid {
    display: none;
  }

  .steps4,
  .rules {
    grid-template-columns: minmax(0, 1fr);
  }

  .steps4 li,
  .steps4 li + li {
    padding-left: 0;
    border-left: 0;
  }

  .steps4 li + li {
    border-top: 1px solid var(--line);
  }

  .f {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.2rem;
  }

  .demo__head span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}
