/*
  Bioterafi company site.
  Every page shares one header (a Products menu, About, Contact) and one footer.
  Each product has its own page, reached from the Products menu.
  Layout: a full-width headline, 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 home 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: the wordmark, three section links, and Contact as the one button. */
.site-header { padding-top: env(safe-area-inset-top, 0px); }
.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 18px;
}
/* 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;
  align-items: center;
  gap: clamp(16px, 2.6vw, 36px);
  list-style: none;
  padding: 0;
}
.site-nav a {
  display: inline-block;
  font: 500 1rem/1 var(--sans);
  padding-block: 10px;
  text-decoration: none;
  text-underline-offset: 0.4em;
}
/* The section you are in stays underlined. */
.site-nav a:hover,
.site-nav a[aria-current] {
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: currentColor;
}
.site-nav .nav-contact a {
  padding: 9px 14px;
  background: var(--ink);
  color: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
}
.site-nav .nav-contact a:hover,
.site-nav .nav-contact a[aria-current] {
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}
/* The Products menu: a details element, so it opens on click with no script.
   While it is open, a clear layer over the page closes it on the next click anywhere else. */
.nav-menu { position: relative; }
.nav-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font: 500 1rem/1 var(--sans);
  padding-block: 10px;
  cursor: pointer;
  list-style: none;
  text-underline-offset: 0.4em;
  -webkit-user-select: none;
  user-select: none;
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after {
  content: "";
  width: 0.4em;
  height: 0.4em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
}
.nav-menu details[open] > summary::after { transform: translateY(0.12em) rotate(-135deg); }
.nav-menu summary:hover,
.nav-menu summary.is-current,
.nav-menu details[open] > summary {
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: currentColor;
}
.nav-menu details[open] > summary::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  cursor: default;
}
.site-nav .nav-panel {
  position: absolute;
  z-index: 21;
  top: calc(100% + 8px);
  left: -22px;
  display: grid;
  gap: 0;
  width: max-content;
  min-width: 19rem;
  padding: 6px 22px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
}
.nav-panel li + li { border-top: 1px solid var(--soft); }
.site-nav .nav-panel a {
  display: grid;
  gap: 5px;
  padding-block: 14px;
  font: inherit;
  text-decoration: none;
}
.nav-panel-name {
  font: 650 1.125rem/1.2 var(--sans);
  letter-spacing: -0.01em;
  text-underline-offset: 0.2em;
}
.nav-panel-note {
  font: 500 0.875rem/1.35 var(--sans);
  color: var(--muted);
}
.nav-panel a:hover .nav-panel-name,
.nav-panel a[aria-current] .nav-panel-name {
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
}

/* On a phone the links take their own row under the wordmark, and the menu spans the page. */
@media (max-width: 39.99em) {
  .site-header-inner { position: relative; }
  .site-nav { flex-basis: 100%; }
  .site-nav ul { justify-content: space-between; }
  .nav-menu { position: static; }
  .site-nav .nav-panel {
    top: calc(100% - 10px);
    left: max(var(--gutter), env(safe-area-inset-left, 0px));
    right: max(var(--gutter), env(safe-area-inset-right, 0px));
    width: auto;
    min-width: 0;
    justify-content: stretch;
  }
}

/* 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; }
}

/* Home headline */
.hero { padding-block: clamp(40px, 8vw, 112px) clamp(32px, 5vw, 72px); }
.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);
}

/* Every other page opens with a smaller headline on the same axis. */
.page-hero { padding-block: clamp(36px, 6.5vw, 96px) clamp(24px, 4vw, 56px); }
.page-hero h1 {
  font-size: clamp(2.375rem, 1.2rem + 4.4vw, 5rem);
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.04em;
  max-width: 15em;
  margin-left: -0.02em;
  margin-bottom: clamp(24px, 3.5vw, 44px);
}
.product-id {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: clamp(16px, 2vw, 24px);
}
.product-id-name {
  font: 650 1.0625rem/1.2 var(--sans);
  letter-spacing: -0.005em;
}
.product-id .tags { transform: none; }

/* The hero's line and the short statements share one size. */
.lead,
.statement {
  font-size: clamp(1.25rem, 1.05rem + 0.75vw, 1.625rem);
  line-height: 1.45;
  max-width: 30em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: clamp(24px, 3vw, 36px);
}
.button {
  display: inline-flex;
  align-items: center;
  font: 600 1rem/1 var(--sans);
  padding: 1em 1.4em;
  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); }
.text-link { font: 600 1rem/1.4 var(--sans); }
.more { margin-top: 18px; }

/* Sections */
.section { padding-block: clamp(40px, 6vw, 80px); }
.section > .wrap {
  display: grid;
  gap: clamp(28px, 4vw, 48px);
}
.section-list > .wrap { gap: clamp(36px, 5vw, 56px); }
.section-title {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

/* Home: one card per product, each a single link */
.cards {
  display: grid;
  gap: 8px 32px;
  list-style: none;
  padding: 0;
}
@media (min-width: 52em) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 2px solid var(--ink);
  padding-block: 18px 32px;
}
.card-setting { order: -1; }
.card-name {
  font-size: clamp(1.75rem, 1.25rem + 1.5vw, 2.375rem);
  font-weight: 760;
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.card-name a { text-decoration: none; }
.card-name a::after { content: ""; position: absolute; inset: 0; }
.card:hover .card-name a {
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: currentColor;
  text-underline-offset: 0.12em;
}
.card-job {
  font-size: 1.0625rem;
  line-height: 1.5;
  max-width: 26em;
}
.card .tags { margin-top: 4px; transform: none; }

/* The intended-use list */
.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;
}
.use-name {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 760;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.use-name a { text-decoration: none; }
.use-name a:hover {
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.12em;
}
.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-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: 36em;
  margin-top: clamp(14px, 1.8vw, 20px);
}
.use-name + .job { margin-top: 10px; }
/* The intended-use line, or a product's own site. */
.meta {
  margin-top: 14px;
  font: 500 0.9375rem/1.5 var(--sans);
  color: var(--muted);
}
.meta a {
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* A product page's main feature, beside a picture of it */
.spotlight {
  display: grid;
  gap: 32px 56px;
  align-items: start;
}
@media (min-width: 52em) {
  .spotlight { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
.spotlight-text > p {
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  line-height: 1.55;
  max-width: 30em;
  margin-top: 18px;
}
.spotlight-list {
  list-style: none;
  padding: 0;
  margin-top: 24px;
  max-width: 24em;
  border-bottom: 1px solid var(--soft);
}
.spotlight-list li {
  font: 600 1rem/1.4 var(--sans);
  padding-block: 9px;
  border-top: 1px solid var(--soft);
}

/* Pictures: a real screen with its caption, or an illustration drawn in type and labelled as one */
.example { margin: 0; min-width: 0; }
.example figcaption {
  margin-top: 12px;
  font: 500 0.875rem/1.4 var(--sans);
  color: var(--muted);
}
.shot {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--soft);
  border-radius: 2px;
}
.example-frame {
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: clamp(16px, 2.4vw, 28px);
}
.example-title {
  font: 650 1rem/1.3 var(--sans);
  margin-bottom: 16px;
}
.beds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
  padding: 0;
}
.bed {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 8.5rem;
  padding: 14px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
}
.bed-alarm { background: var(--ink); color: var(--paper); }
.bed-name { font: 500 0.875rem/1.3 var(--sans); }
.bed-state {
  font: 700 clamp(1.0625rem, 0.95rem + 0.5vw, 1.375rem)/1.15 var(--sans);
  letter-spacing: -0.015em;
}
.bed-detail { font-size: 0.9375rem; line-height: 1.4; }
.facts-tight { margin-top: 0; max-width: none; }
.facts-tight > div { padding-block: 9px; }
@media (min-width: 34em) {
  .facts-tight > div { grid-template-columns: 7.5rem minmax(0, 1fr); }
}

/* Groups of features: three side by side, or two on a product page */
.features {
  display: grid;
  gap: 28px 32px;
  list-style: none;
  padding: 0;
}
@media (min-width: 52em) {
  .features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .features-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 56px; }
}
.feature {
  border-top: 2px solid var(--ink);
  padding-top: 18px;
}
.feature h2,
.feature h3 {
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  max-width: 14em;
}
.feature p {
  font-size: 1.0625rem;
  line-height: 1.55;
  max-width: 28em;
}
.features-2 .feature h2 { max-width: 18em; }
.features-2 .feature p { max-width: 32em; }

/* How a product works: a numbered sequence, because it is one */
.steps {
  display: grid;
  gap: 32px;
  list-style: none;
  padding: 0;
  counter-reset: step;
}
@media (min-width: 40em) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 64em) {
  .steps { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
}
.step {
  counter-increment: step;
  border-top: 2px solid var(--ink);
  padding-top: 14px;
}
.step::before {
  content: counter(step);
  display: block;
  font: 760 clamp(2.25rem, 1.6rem + 2vw, 3.5rem)/1 var(--sans);
  letter-spacing: -0.04em;
  margin-bottom: clamp(16px, 2vw, 28px);
}
.step h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.step h3 .tag { letter-spacing: 0; }
.step p {
  font-size: 1.0625rem;
  line-height: 1.55;
  max-width: 26em;
}

/* A product page's facts under its intended use */
.facts {
  margin-top: clamp(20px, 2.5vw, 28px);
  max-width: 40em;
  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;
  }
}

/* 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); }

/* The band before the footer: one way to get in touch */
.band { padding-block: clamp(40px, 6vw, 80px) clamp(48px, 7vw, 96px); }
.band-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 48px;
  border-top: 2px solid var(--ink);
  padding-top: clamp(24px, 3vw, 36px);
}
.band-title {
  font-size: clamp(1.625rem, 1.2rem + 1.7vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 18em;
}

/* 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, 72px); }
.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;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}
@media (min-width: 52em) {
  .footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.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-col a {
  font: 500 1rem/1.4 var(--sans);
  text-decoration: none;
}
.footer-col a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.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; }
}

@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, .band, .footer-cols, .legal a { display: none; }
  .hero, .page-hero, .section { padding-block: 24px; }
  .site-footer { border-top: 2px solid #000000; padding-block: 24px; }
  .product, .card, .feature, .step, .example { break-inside: avoid; }
  .bed-alarm { border-width: 3px; }
  a { text-decoration: none; }
}
