/*
  Bioterafi company site.
  Layout: one full-width statement, then a two-column index: labels on the left axis, content on the right.
  Black and white, from the wordmark. The orange full stop is the only colour, and it appears only
  as the wordmark's dot and the headline's full stop.
*/

:root {
  --paper: #ffffff;
  --ink: #000000;
  --muted: #5c5c5c;        /* 6.7:1 on white */
  --soft: #d4d4d4;         /* decorative rules only */
  --dot: #ff5f00;          /* sampled from the wordmark */
  --plate: #000000;        /* the footer: always the inverse of the page */
  --plate-ink: #ffffff;
  --plate-muted: #a3a3a3;  /* 8.3:1 on black */
  --plate-soft: #3d3d3d;

  --sans: "Inter Tight", "Inter", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, Cambria, "Times New Roman", serif;

  --gutter: clamp(16px, 4.6vw, 64px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #000000;
    --ink: #ffffff;
    --muted: #a3a3a3;
    --soft: #333333;
    --plate: #ffffff;
    --plate-ink: #000000;
    --plate-muted: #5c5c5c;
    --plate-soft: #cfcfcf;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #000000;
  --ink: #ffffff;
  --muted: #a3a3a3;
  --soft: #333333;
  --plate: #ffffff;
  --plate-ink: #000000;
  --plate-muted: #5c5c5c;
  --plate-soft: #cfcfcf;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

::selection { background: var(--ink); color: var(--paper); }
.site-footer ::selection { background: var(--plate-ink); color: var(--plate); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

h1, h2, h3, p, ul, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--sans); text-wrap: balance; }
p, li, dd { text-wrap: pretty; }

/* Underlines sit back in running text and firm up under the pointer. */
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: currentColor;
  text-decoration-color: color-mix(in srgb, currentColor 42%, transparent);
}
a:hover {
  text-decoration-thickness: 2px;
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.wrap {
  max-width: 1280px;
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.skip {
  position: absolute;
  left: max(var(--gutter), env(safe-area-inset-left, 0px));
  top: 8px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  font: 600 0.9375rem/1 var(--sans);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* The brand dot: a circle sitting on the baseline, as in the wordmark. */
.dot {
  display: inline-block;
  width: 0.17em;
  height: 0.17em;
  margin-left: 0.055em;
  border-radius: 50%;
  background: var(--dot);
}
.keep { white-space: nowrap; }

/* Header */
.site-header { padding-top: env(safe-area-inset-top, 0px); }
.site-header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-block: 22px;
}
/* Weight and tracking matched to brand/bioterafi-wordmark-400.png; f and i stay apart, as in the mark. */
.wordmark,
.wordmark-type {
  font-weight: 650;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  white-space: nowrap;
}
.wordmark {
  font-family: var(--sans);
  font-size: 1.375rem;
  line-height: 1;
  letter-spacing: -0.015em;
  text-decoration: none;
}
.site-nav ul {
  display: flex;
  gap: clamp(16px, 3vw, 40px);
  list-style: none;
  padding: 0;
}
.site-nav a {
  font: 500 1rem/1 var(--sans);
  text-decoration: none;
}
.site-nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; }

/* The two-column index */
.row {
  display: grid;
  gap: 12px 32px;
  align-items: baseline;
}
.row-label, .row-body { min-width: 0; }

@media (min-width: 52em) {
  .wordmark { font-size: 1.625rem; }
  .row { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
  .row-label { grid-column: 1; }
  .row-body { grid-column: 2; }
}

/* Hero */
.hero { padding-block: clamp(40px, 8vw, 112px) clamp(64px, 9vw, 128px); }
.hero h1 {
  font-size: clamp(2.75rem, 0.55rem + 8.4vw, 7.25rem);
  font-weight: 760;
  line-height: 0.95;
  letter-spacing: -0.042em;
  word-spacing: 0.03em;
  margin-left: -0.015em; /* optical edge: the S starts flush with the text below */
  margin-bottom: clamp(32px, 5vw, 64px);
}
.lead {
  font-size: clamp(1.25rem, 1.05rem + 0.75vw, 1.625rem);
  line-height: 1.45;
  max-width: 34em;
}
.actions { margin-top: clamp(28px, 3.5vw, 40px); }
.button {
  display: inline-flex;
  align-items: center;
  font: 600 1rem/1 var(--sans);
  padding: 1em 1.5em;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 2px;
  text-decoration: none;
}
.button:hover { background: var(--paper); color: var(--ink); }

/* Sections */
.section { padding-block: clamp(48px, 6.5vw, 88px); }
.section > .wrap {
  display: grid;
  gap: clamp(40px, 5.5vw, 72px);
}
.section-head h2 {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.intro {
  font-size: clamp(1.125rem, 1rem + 0.4vw, 1.375rem);
  line-height: 1.45;
  color: var(--muted);
  max-width: 34em;
}
.statement {
  font-size: clamp(1.375rem, 1.1rem + 1.1vw, 2rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  max-width: 30em;
}

/* Products */
.product {
  border-top: 2px solid var(--ink);
  padding-top: clamp(20px, 2.5vw, 32px);
  row-gap: 16px;
}
.setting {
  font: 650 1.0625rem/1.35 var(--sans);
  letter-spacing: -0.005em;
}
.audience {
  font-style: italic;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--muted);
  margin-top: 4px;
  max-width: 20em;
}
.product-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 20px;
}
.product-name {
  font-size: clamp(2rem, 1.35rem + 2.3vw, 3.25rem);
  font-weight: 760;
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  transform: translateY(-0.2em);
}
.tag {
  display: inline-block;
  font: 600 0.8125rem/1 var(--sans);
  padding: 0.42em 0.62em 0.38em;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  white-space: nowrap;
}
.tag-live { background: var(--ink); color: var(--paper); }
.tag-draft { border-style: dashed; border-color: var(--muted); color: var(--muted); }

.job {
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  line-height: 1.55;
  max-width: 38em;
  margin-top: clamp(16px, 2vw, 24px);
}

.facts {
  margin-top: clamp(20px, 2.5vw, 28px);
  max-width: 44em;
  border-bottom: 1px solid var(--soft);
}
.facts > div {
  display: grid;
  gap: 2px;
  padding-block: 11px;
  border-top: 1px solid var(--soft);
}
.facts dt {
  font: 600 0.875rem/1.5 var(--sans);
  color: var(--muted);
}
.facts dd {
  font-size: 1.0625rem;
  line-height: 1.5;
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (min-width: 34em) {
  .facts > div {
    grid-template-columns: 9rem minmax(0, 1fr);
    gap: 16px;
    align-items: baseline;
  }
}

/* About: the principles sit on the same axis as the products, under a lighter rule */
.principles {
  display: grid;
  gap: 28px;
}
.principle {
  border-top: 1px solid var(--ink);
  padding-top: 16px;
}
.principle h3 {
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.principle p {
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  line-height: 1.55;
  max-width: 34em;
}

/* Contact: one address, set from a single token */
.address { margin-top: clamp(24px, 3vw, 36px); }
.address-field,
.address-pending {
  font: 650 clamp(1.25rem, 1rem + 1vw, 1.75rem)/1.3 var(--sans);
  letter-spacing: -0.015em;
  color: var(--ink);
}
.address-field {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
@supports (field-sizing: content) {
  .address-field { width: auto; field-sizing: content; }
}
.address-pending { display: none; }
.address-field[value*="{{"],
.address-field[value=""],
.address-field:not([value]) { display: none; }
.address-field[value*="{{"] ~ .address-pending,
.address-field[value=""] ~ .address-pending,
.address-field:not([value]) ~ .address-pending { display: block; }
.aside {
  margin-top: 20px;
  font-size: 1.0625rem;
  color: var(--muted);
}
.aside a { color: var(--ink); }

/* Footer */
.site-footer {
  background: var(--plate);
  color: var(--plate-ink);
  padding-top: clamp(56px, 8vw, 104px);
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
}
.site-footer :focus-visible { outline-color: var(--plate-ink); }
.footer-mark { margin-bottom: clamp(40px, 6vw, 80px); }
.wordmark-type {
  display: inline-block;
  font-family: var(--sans);
  font-size: clamp(3.5rem, 1.5rem + 9vw, 9.5rem);
  line-height: 0.9;
  letter-spacing: -0.025em;
  margin-left: -0.045em; /* optical edge: the B's side bearing is about 7 px at this size */
}
.footer-cols {
  display: grid;
  gap: 40px 32px;
}
.footer-navs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}
@media (min-width: 52em) {
  .footer-cols { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
}
.footer-col { min-width: 0; }
.footer-col h2 {
  font: 600 0.9375rem/1.4 var(--sans);
  color: var(--plate-muted);
  margin-bottom: 14px;
}
.footer-col ul {
  display: grid;
  gap: 10px;
  list-style: none;
  padding: 0;
}
.footer-navs a {
  font: 500 1rem/1.4 var(--sans);
  text-decoration: none;
}
.footer-navs a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.footer-use ul { gap: 14px; }
.footer-use li {
  font-size: 1rem;
  line-height: 1.5;
  max-width: 40em;
}
.footer-use a { font-family: var(--sans); font-weight: 600; }
.legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: clamp(40px, 6vw, 72px);
  padding-top: 20px;
  border-top: 1px solid var(--plate-soft);
  font: 500 0.875rem/1.4 var(--sans);
  color: var(--plate-muted);
}
.legal a { color: var(--plate-ink); text-decoration: none; }
.legal a:hover { text-decoration: underline; text-decoration-thickness: 2px; }

@media (forced-colors: active) {
  .dot { forced-color-adjust: none; }
  .tag-live { border-color: CanvasText; }
}

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

/* On paper: black on white whatever the screen theme, no black plate, nothing to click. */
@media print {
  :root:not([data-print]),
  :root[data-theme] {
    --paper: #ffffff;
    --ink: #000000;
    --muted: #4d4d4d;
    --soft: #bfbfbf;
    --plate: #ffffff;
    --plate-ink: #000000;
    --plate-muted: #4d4d4d;
    --plate-soft: #bfbfbf;
    color-scheme: light;
  }
  .skip, .site-nav, .actions, .legal a { display: none; }
  .hero, .section { padding-block: 24px; }
  .site-footer { border-top: 2px solid #000000; padding-block: 24px; }
  .product, .principle, .footer-use li { break-inside: avoid; }
  a { text-decoration: none; }
}
