/* formyl.ai. One family for the words (Schibsted Grotesk); IBM Plex Mono only where the text is what a terminal or a
   file holds. The colours are the console's: zinc ink, indigo for what you click, and its better/worse pair, which
   appear only where a comparison is shown. */

@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('/fonts/schibsted-grotesk-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f6f7f9;
  --raised: #ffffff;
  --ink: #18181b;
  --muted: #52525b;
  --rule: #dfe2e7;
  --brand: #4f46e5;
  --brand-deep: #3730a3;
  --better: #2f4f64;
  --better-soft: #b3c8d5;
  --worse: #bf3f18;
  --worse-soft: #f4c3af;
  --noise: #c4c4cc;
  --sans: 'Schibsted Grotesk', ui-sans-serif, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --measure: 34rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-feature-settings: 'ss01';
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ol,
ul,
figure,
pre {
  margin: 0;
}

a {
  color: var(--brand);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--brand-deep);
}
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The page's frame: one column, wide enough for the readout beside the pitch. */
.masthead,
main > section,
.colophon {
  width: min(72rem, 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.5rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.wordmark svg {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--brand);
}
.wordmark:hover {
  color: var(--ink);
}
.sign-in {
  font-weight: 500;
  text-decoration: none;
}
.sign-in:hover {
  text-decoration: underline;
}

/* The first screen: what it does on the left, what that looks like on the right. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  padding-block: clamp(2rem, 6vw, 5rem) clamp(3.5rem, 8vw, 6.5rem);
}
.pitch {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 0.5rem;
}
h1 {
  font-size: clamp(2.4rem, 4.6vw, 3.9rem);
  line-height: 1.02;
  font-weight: 760;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.lede {
  max-width: var(--measure);
  font-size: 1.15rem;
  color: var(--muted);
  text-wrap: pretty;
}

.cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}
.button {
  display: inline-block;
  padding: 0.8rem 1.3rem;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.18);
}
.button:hover {
  background: var(--brand-deep);
  color: #fff;
}
.cta-note {
  max-width: 26rem;
  font-size: 0.95rem;
  color: var(--muted);
}

/* The readout: the one object on the page. A terminal strip and the result sheet it leads to. */
.readout {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: var(--raised);
  box-shadow:
    0 0 0 1px var(--rule),
    0 24px 48px -28px rgb(24 24 27 / 0.35);
  overflow: hidden;
}
.terminal,
.steps pre {
  font-feature-settings: normal;
}
.terminal {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.25rem;
  background: #1d1d22;
  color: #e4e4e7;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: nowrap;
}
.prompt {
  color: #a5b4fc;
  user-select: none;
}

.sheet {
  padding: 1.25rem 1.25rem 0.5rem;
}
.sheet .sheet-title {
  max-width: none;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
  font-size: 1rem;
  color: var(--muted);
}
.sheet-title strong {
  color: var(--ink);
  font-weight: 650;
}
.sheet table {
  width: 100%;
  border-collapse: collapse;
}
.sheet thead th {
  padding: 0.6rem 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
}
.sheet thead th:last-child {
  text-align: right;
}
.sheet tbody th,
.sheet td {
  padding: 0.7rem 0;
  border-top: 1px solid var(--rule);
  vertical-align: middle;
}
.sheet tbody tr:first-child > * {
  border-top: 0;
}
.sheet tbody th {
  font-weight: 550;
  text-align: left;
  width: 38%;
  padding-right: 1rem;
}
.sheet td:nth-child(2) {
  width: 30%;
}
.kind {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}
.sheet td.result {
  text-align: right;
  font-weight: 600;
  padding-left: 1rem;
}
.result.is-better {
  color: var(--better);
}
.result.is-worse {
  color: var(--worse);
}

/* A pairwise judge's verdicts: better, the same, worse, as shares of one bar. */
.split {
  display: flex;
  height: 0.7rem;
  border-radius: 3px;
  overflow: hidden;
  gap: 2px;
}
.split > span {
  flex: 0 0 var(--share);
  transform-origin: left;
}
.split .better {
  background: var(--better);
}
.split .same {
  background: var(--noise);
}
.split .worse {
  background: var(--worse);
}

/* A difference and its interval, on an axis whose middle is no difference. */
.interval {
  position: relative;
  display: block;
  height: 0.7rem;
}
.interval::before {
  content: '';
  position: absolute;
  inset: 50% 0 auto;
  border-top: 1px solid var(--rule);
}
.interval::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -0.2rem;
  bottom: -0.2rem;
  border-left: 1px solid var(--muted);
}
.range {
  position: absolute;
  left: var(--from);
  right: calc(100% - var(--to));
  top: 0;
  bottom: 0;
  border-radius: 3px;
  background: var(--noise);
}
.range.is-better {
  background: var(--better);
}

.readout figcaption {
  padding: 0.85rem 1.25rem 1.1rem;
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--rule);
}

/* The one moment of motion: the readout's bars fill in as the page opens. */
@media (prefers-reduced-motion: no-preference) {
  .split > span,
  .range {
    animation: fill 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: 250ms;
  }
  .split .same {
    animation-delay: 380ms;
  }
  .split .worse {
    animation-delay: 480ms;
  }
  .range {
    transform-origin: center;
    animation-delay: 560ms;
  }
}
@keyframes fill {
  from {
    transform: scaleX(0);
  }
}

/* The sections below the first screen. */
main > section:not(.hero) {
  padding-block: clamp(3rem, 7vw, 5rem);
  border-top: 1px solid var(--rule);
}
h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  line-height: 1.15;
  font-weight: 720;
  letter-spacing: -0.025em;
  margin-bottom: 2rem;
}
h3 {
  font-size: 1.1rem;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 0.45rem;
}
section p {
  max-width: var(--measure);
}

/* How it works is a sequence, so it is numbered. */
.steps ol {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  display: flex;
  flex-direction: column;
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  font-weight: 650;
  font-size: 0.95rem;
}
.steps p {
  color: var(--muted);
}
.steps pre {
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: #1d1d22;
  color: #e4e4e7;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.25rem 4rem;
}
.points p {
  color: var(--muted);
}

/* Plans, once pricing is public (the worker puts them in). */
.plan-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  border-top: 2px solid var(--ink);
}
.plan-list li {
  padding: 1.25rem 1.5rem 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.plan-list li + li {
  padding-left: 1.5rem;
  border-left: 1px solid var(--rule);
}
.price {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}
.plan-list p:not(.price) {
  color: var(--muted);
}
.plans-note {
  margin-block: 1.5rem 2rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.colophon-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.colophon-entity {
  flex-basis: 100%;
}
.colophon {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
  color: var(--muted);
}

@media (max-width: 60rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .steps ol {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }
}
@media (max-width: 40rem) {
  .points {
    grid-template-columns: minmax(0, 1fr);
  }
  .plan-list li + li {
    padding-left: 0;
    border-left: 0;
  }
  /* Each score on a narrow screen: its name and result on one line, its bar under them. */
  .sheet tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 1rem;
    padding-block: 0.7rem;
    border-top: 1px solid var(--rule);
  }
  .sheet tbody tr:first-child {
    border-top: 0;
  }
  .sheet tbody th,
  .sheet tbody td {
    width: auto;
    padding: 0;
    border-top: 0;
  }
  .sheet td:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    width: auto;
  }
  .sheet td:nth-child(2):not(:empty) {
    padding-top: 0.6rem;
  }
  .sheet td:nth-child(2):empty {
    display: none;
  }
}
