/* ===================================================================
   Ferma — design tokens
   =================================================================== */
:root {
  color-scheme: light;

  --bg: #ffffff;
  --fg: #111111;
  --muted: #4a4a4a;
  --soft: #6b6b6b;
  --faint: #9a9a9a;
  --line: #e6e6e6;
  --placeholder: #e2e2e2;
  --placeholder-inner: #ededed;
  --placeholder-flat: #d9d9d9;
  --field-line: #c9c9c9;
  --error: #b3261e;

  --footer-bg: #111111;
  --footer-fg: #ffffff;
  --footer-muted: #b5b5b5;

  --gutter: clamp(20px, 4.4vw, 64px);
  --gap: clamp(16px, 2.2vw, 32px);
  --maxw: 1680px;
  --header-h: 76px;

  --radius: 14px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue",
               Helvetica, "Segoe UI", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
figure { margin: 0; }

h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ===================================================================
   Header
   =================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: var(--header-h);
  padding-inline: var(--gutter);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.site-header.is-stuck { border-bottom-color: var(--line); }

body:not([data-page="home"]) .site-header { border-bottom-color: var(--line); }

.wordmark {
  grid-column: 2;
  justify-self: center;
  display: block;
  padding-block: 6px;
}
.wordmark img {
  display: block;
  height: clamp(19px, 1.75vw, 25px);
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 40px);
  font-size: clamp(13px, .95vw, 15px);
}
.nav-left  { grid-column: 1; justify-self: start; }
.nav-right { grid-column: 3; justify-self: end; }

.nav a {
  position: relative;
  padding-block: 4px;
  color: var(--fg);
  transition: opacity .2s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav a:hover::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--faint); }
.nav a[aria-current="page"]::after { display: none; }

/* Mobile menu button */
.nav-toggle {
  display: none;
  grid-column: 3;
  justify-self: end;
  width: 36px; height: 36px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 1.5px;
  margin: 5px auto;
  background: var(--fg);
  transition: transform .3s var(--ease), opacity .2s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child  { transform: translateY(-3.25px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: sticky;
  top: var(--header-h);
  z-index: 45;
  flex-direction: column;
  gap: 2px;
  padding: 8px var(--gutter) 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.mobile-nav a { padding: 10px 0; font-size: 1.05rem; }
.mobile-nav a[aria-current="page"] { color: var(--faint); }
.mobile-nav.is-open { display: flex; }

/* ===================================================================
   Media placeholders
   Drop an <img class="media-img" src="…" alt="…"> inside any .media
   =================================================================== */
.media {
  position: relative;
  aspect-ratio: var(--ratio, 4 / 3);
  background: var(--placeholder);
  border-radius: var(--radius);
  overflow: hidden;
}
.media-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Inset outline, as in the prototype */
.media-framed::after {
  content: "";
  position: absolute;
  inset: clamp(10px, 1.1vw, 18px);
  border: 1px solid rgba(0, 0, 0, .06);
  background: var(--placeholder-inner);
  border-radius: 4px;
  pointer-events: none;
}
.media-framed:has(.media-img)::after { background: none; }

/* ===================================================================
   Hero
   =================================================================== */
.hero {
  position: relative;
  height: clamp(460px, calc(100vh - var(--header-h)), 820px);
  overflow: hidden;
  background: var(--placeholder);
}
.hero-track { position: absolute; inset: 0; }

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .9s var(--ease), visibility .9s;
}
.hero-slide.is-active { opacity: 1; visibility: visible; }

.hero .media-cover {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
  border-radius: 0;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(0, 0, 0, 0) 38%,
    rgba(0, 0, 0, .32) 64%,
    rgba(0, 0, 0, .66) 100%);
}

.hero-copy {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(72px, 9vh, 120px);
  max-width: min(980px, 62%);
  color: #fff;
}
.hero-copy h1,
.hero-title {
  font-size: clamp(2rem, 4.1vw, 3.9rem);
  letter-spacing: -0.035em;
}
.hero-copy p {
  margin: clamp(16px, 1.8vw, 26px) 0 0;
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.55;
  color: rgba(255, 255, 255, .92);
}

.hero-dots {
  position: absolute;
  left: 0; right: 0;
  bottom: clamp(26px, 3.4vh, 44px);
  display: flex;
  justify-content: center;
  gap: 10px;
}
.hero-dots button {
  width: 7px; height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .45);
  cursor: pointer;
  transition: background .3s var(--ease), transform .3s var(--ease);
}
.hero-dots button[aria-selected="true"] {
  background: #fff;
  transform: scale(1.15);
}

/* ===================================================================
   Sections
   =================================================================== */
.section {
  padding-block: clamp(72px, 11vw, 170px);
  scroll-margin-top: var(--header-h);
}
.section[hidden] { display: none; }

.section h2 {
  font-size: clamp(1.6rem, 2.5vw, 2.3rem);
  margin-bottom: clamp(14px, 1.4vw, 22px);
}
.section p {
  margin: 0 0 1em;
  max-width: 43ch;
  color: var(--muted);
}
.section p:last-child { margin-bottom: 0; }

/* What is Bacteria Cellulose — text left, framed image right */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 110px);
  align-items: start;
}

/* Fermatex — staggered 12-column composition */
.fermatex {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: clamp(28px, 4vw, 64px);
}
.fermatex-text { grid-column: 1 / 6;  grid-row: 1; }
.fermatex-a    { grid-column: 9 / 13; grid-row: 1 / 3; align-self: start; }
.fermatex-b    { grid-column: 1 / 6;  grid-row: 2 / 4; align-self: start; }
.fermatex-c    { grid-column: 8 / 12; grid-row: 3; align-self: start;
                 margin-top: clamp(24px, 5vw, 80px); }

/* ===================================================================
   Footer
   =================================================================== */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-fg);
  padding-block: clamp(48px, 6vw, 86px);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(40px, 6vw, 80px);
  justify-content: space-between;
}
.footer-cols {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(36px, 6vw, 96px);
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: clamp(13px, .95vw, 15px);
}
.footer-col h2 {
  margin-bottom: 14px;
  font-size: clamp(13px, .95vw, 15px);
  font-weight: 700;
  letter-spacing: 0;
}
.footer-col a {
  color: var(--footer-muted);
  transition: color .2s var(--ease);
}
.footer-col a:hover { color: var(--footer-fg); }
.footer-col .is-pending { color: #6f6f6f; cursor: default; }
.contact-details .is-pending { color: var(--faint); }

.footer-cta { max-width: 42ch; }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 22px;
  margin-top: clamp(40px, 5vw, 72px);
  font-size: 12px;
  color: #7d7d7d;
}
.footer-cta p {
  margin: 0 0 clamp(16px, 2vw, 26px);
  font-size: clamp(13px, .95vw, 15px);
  color: var(--footer-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-width: 158px;
  padding: 13px 18px;
  border: 1px solid #fff;
  border-radius: 3px;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: clamp(13px, .95vw, 15px);
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn svg,
.text-link svg,
.back-link svg {
  width: 20px; height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .3s var(--ease);
}
.btn:hover { background: #e9e9e9; border-color: #e9e9e9; }
.btn:hover svg, .text-link:hover svg { transform: translateX(4px); }
.btn-dark { background: var(--fg); border-color: var(--fg); color: #fff; }
.btn-dark:hover { background: #333; border-color: #333; }
.btn-block { width: 100%; }
.btn-plain { justify-content: center; min-width: 0; padding-inline: 30px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ===================================================================
   Scroll reveal
   =================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ===================================================================
   Shared bits
   =================================================================== */
.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--fg);
  color: #fff;
  border-radius: 3px;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

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

:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
.site-footer :focus-visible { outline-color: #fff; }

.noscript { padding: 24px var(--gutter); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: clamp(18px, 2vw, 28px);
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
  color: var(--fg);
  font-size: clamp(14px, 1vw, 16px);
}
.inline-link {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.inline-link:hover { color: var(--soft); }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--soft);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-button:hover { color: var(--fg); }

.note { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--soft); }
.eyebrow { margin: 0 0 10px; font-size: 13.5px; color: var(--soft); }

.empty-state {
  padding-block: clamp(24px, 5vw, 72px);
  max-width: 52ch;
}
.empty-state h1, .empty-state h2 { font-size: clamp(1.5rem, 2.3vw, 2.1rem); font-weight: 600; margin-bottom: 14px; }
.empty-state p { margin: 0; color: var(--muted); }

/* ===================================================================
   Cart drawer
   =================================================================== */
html.drawer-open { overflow: hidden; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, .28);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .45s var(--ease), visibility 0s .45s;
}
.drawer-backdrop.is-open { opacity: 1; visibility: visible; transition: opacity .45s var(--ease); }

.cart-drawer {
  --pad: clamp(22px, 2.2vw, 32px);
  position: fixed;
  top: 0; right: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  width: min(100vw, 460px);
  max-height: 100vh;
  max-height: 100dvh;
  background: #fff;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .45s var(--ease), visibility 0s .45s;
}
.cart-drawer.is-open { transform: none; visibility: visible; transition: transform .45s var(--ease); }
/* With products in it the drawer fills the height and pins its footer. */
.cart-drawer.has-items { height: 100vh; height: 100dvh; }

.cart-drawer > h2 {
  margin: 0;
  padding: 36px var(--pad) 0;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.drawer-close {
  position: absolute;
  top: 14px; right: 16px;
  padding: 6px;
  border: 0;
  background: none;
  color: var(--soft);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.drawer-close:hover { color: var(--fg); }

.drawer-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 26px var(--pad) var(--pad); }
.drawer-empty { margin: 0 0 22px; }
.drawer-body > .btn { background: #4a4a4a; border-color: #4a4a4a; color: #fff; }
.drawer-body > .btn:hover { background: var(--fg); border-color: var(--fg); }

.drawer-lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 26px; }
.drawer-line {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 12px;
}
.drawer-thumb { display: block; }
.drawer-line-main { display: flex; flex-direction: column; justify-content: space-between; padding-top: 2px; }
.drawer-line-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.drawer-line-name { font-size: 1.02rem; }
.drawer-remove { grid-column: 1 / -1; justify-self: start; font-size: 14px; }

.drawer-foot {
  display: grid;
  gap: 18px;
  padding: 28px var(--pad) 26px;
  border-top: 1px solid var(--fg);
}
.drawer-foot .label { font-size: 12px; letter-spacing: .09em; text-transform: uppercase; }
.drawer-row { display: flex; justify-content: space-between; align-items: baseline; }
.drawer-note { margin: 6px 0 0; color: var(--soft); }
.drawer-foot .btn { padding-block: 15px; font-size: 15px; }
.drawer-view {
  justify-self: center;
  padding-bottom: 1px;
  border-bottom: 1px solid currentColor;
  font-size: 15px;
}

/* ===================================================================
   Inner pages: heading block + body
   =================================================================== */
.page-head { padding-top: clamp(32px, 4.2vw, 62px); }
.page-head h1,
.product-info h1 {
  font-size: clamp(1.6rem, 2.35vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: clamp(18px, 2vw, 30px);
}
.page-head p {
  margin: 0 0 1.5em;
  max-width: 80ch;
  line-height: 1.65;
}
.page-head p:last-child { margin-bottom: 0; }
.page-head .lead {
  max-width: 30ch;
  font-size: clamp(1.25rem, 2.1vw, 1.9rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.page-body {
  margin-top: clamp(44px, 5.4vw, 84px);
  padding-bottom: clamp(72px, 8vw, 128px);
}
.page-body-top { margin-top: clamp(24px, 3vw, 44px); }

.section-tight { padding-top: 0; }
.about-banner { margin-top: clamp(40px, 5vw, 72px); }

/* ===================================================================
   Entries (experiments, projects)
   =================================================================== */
.entry { display: block; }
.entry-title {
  margin-top: clamp(14px, 1.5vw, 24px);
  font-size: clamp(1.05rem, 1.45vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.entry-meta { margin: 6px 0 0; font-size: clamp(13px, .95vw, 15px); font-weight: 700; }
.entry-summary { margin: 10px 0 0; max-width: 46ch; color: var(--muted); }
.entry .media-img { transition: transform .9s var(--ease); }
a.entry:hover .media-img { transform: scale(1.03); }

/* Experiments: six staggered positions, repeating.
   Offsets are percentages of the container width so the composition
   keeps its proportions at any size. */
.stagger + .stagger { margin-top: 10%; }
.stagger-band {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  align-items: start;
}
.stagger-stack {
  grid-column: 1 / 10;
  display: grid;
  row-gap: clamp(48px, 9.5vw, 150px);
}
.slot-3 { width: 82%; }
.slot-2 { grid-column: 14 / 25; }
.band-2 { margin-top: -23%; }
.slot-4 { grid-column: 10 / 22; }
.band-3 { margin-top: 8%; }
.slot-5 { grid-column: 1 / 9; margin-top: 5%; }
.slot-6 { grid-column: 14 / 25; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 5vw, 80px) var(--gap);
}

/* ===================================================================
   Products
   =================================================================== */
.media-square { border-radius: 0; background: var(--placeholder-flat); }

.product-group + .product-group { margin-top: clamp(48px, 5.2vw, 78px); }
.product-group h2 {
  margin-bottom: clamp(14px, 1.4vw, 22px);
  font-size: clamp(15px, 1.2vw, 18px);
  font-weight: 500;
  letter-spacing: 0;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 3vw, 44px) clamp(10px, 1.1vw, 16px);
}
.product-card-link { display: block; }
.product-card .media { overflow: hidden; }
.product-card .media-img { transition: transform .9s var(--ease); }
.product-card-link:hover .media-img { transform: scale(1.03); }
.product-card-info {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(10px, 1.1vw, 16px);
  font-size: clamp(12.5px, .92vw, 14px);
  line-height: 1.6;
  color: var(--soft);
}
.product-card-specs { display: flex; flex-direction: column; min-width: 0; }
.product-card-name { color: var(--fg); font-weight: 500; white-space: nowrap; }
.product-card-price { white-space: nowrap; }
.quick-add {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: clamp(12.5px, .92vw, 14px);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.quick-add:hover { color: var(--soft); }

/* Single product */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--soft);
}
.back-link svg { transform: rotate(180deg); width: 18px; height: 18px; }
.back-link:hover { color: var(--fg); }

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 5vw, 88px);
  align-items: start;
  margin-top: clamp(20px, 2.4vw, 34px);
}
.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.gallery-thumb { padding: 0; border: 0; background: none; cursor: pointer; opacity: .55; transition: opacity .2s var(--ease); }
.gallery-thumb:hover, .gallery-thumb.is-active { opacity: 1; }

.product-info { position: sticky; top: calc(var(--header-h) + 28px); }
.product-info h1 { margin-bottom: 10px; }
.product-price { margin: 0 0 20px; font-size: clamp(1.05rem, 1.4vw, 1.3rem); }
.product-description { margin: 0 0 24px; max-width: 46ch; color: var(--muted); }
.spec-list { margin: 0 0 28px; border-top: 1px solid var(--line); }
.spec-list div { display: flex; justify-content: space-between; gap: 24px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.spec-list dt { color: var(--soft); }
.spec-list dd { margin: 0; text-align: right; }
.product-actions { display: grid; gap: 14px; justify-items: start; }
.buy-row { display: flex; flex-wrap: wrap; gap: 12px; }

.qty {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--field-line);
  border-radius: 3px;
}
.qty button {
  width: 40px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.qty button:hover { background: #f3f3f3; }
.qty input, .qty span {
  width: 44px;
  border: 0;
  background: none;
  font: inherit;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
.qty span { display: grid; place-items: center; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-small button { width: 32px; height: 32px; font-size: 16px; }
.qty-small span { width: 34px; font-size: 14px; }

/* ===================================================================
   Forms
   =================================================================== */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13.5px; color: var(--soft); }
.field .optional { color: var(--faint); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--field-line);
  border-radius: 3px;
  background: #fff;
  color: var(--fg);
  font: inherit;
  font-size: 16px;   /* stops iOS zooming on focus */
}
.field textarea { resize: vertical; min-height: 3em; }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible {
  outline: none;
  border-color: var(--fg);
  box-shadow: 0 0 0 1px var(--fg);
}
.field.has-error input, .field.has-error textarea { border-color: var(--error); }
.field.has-error label { color: var(--error); }
.form .btn { justify-self: start; }
.form .btn-block { justify-self: stretch; }
.form-status { margin: 0; min-height: 1.5em; font-size: 14px; color: var(--muted); }

/* ===================================================================
   Cart
   =================================================================== */
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.cart-lines { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.cart-line {
  display: grid;
  grid-template-columns: clamp(72px, 9vw, 120px) minmax(0, 1fr) auto;
  gap: clamp(14px, 2vw, 28px);
  padding: clamp(16px, 1.8vw, 24px) 0;
  border-bottom: 1px solid var(--line);
}
.cart-line-main { display: flex; flex-direction: column; gap: 4px; }
.cart-line-name { font-weight: 500; }
.cart-line-unit { font-size: 13.5px; color: var(--soft); }
.cart-line-controls { display: flex; align-items: center; gap: 16px; margin-top: auto; padding-top: 10px; }
.cart-line-total { font-weight: 500; white-space: nowrap; }

.cart-summary { position: sticky; top: calc(var(--header-h) + 28px); display: grid; gap: 20px; }
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.05rem, 1.3vw, 1.25rem);
}

/* ===================================================================
   About + contact
   =================================================================== */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(32px, 4vw, 64px);
  margin-top: clamp(20px, 2.4vw, 36px);
  padding-top: clamp(24px, 2.6vw, 40px);
  border-top: 1px solid var(--line);
}
.pillar h3 { margin-bottom: 12px; font-size: clamp(1.05rem, 1.3vw, 1.25rem); font-weight: 600; letter-spacing: -0.01em; }
.pillar p { max-width: 38ch; }
.pillar .text-link { margin-top: 18px; }

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(36px, 6vw, 110px);
  align-items: start;
}
.contact-details { margin: 0; display: grid; gap: 22px; }
.contact-details dt { margin-bottom: 4px; font-size: 13.5px; color: var(--soft); }
.contact-details dd { margin: 0; font-size: clamp(1.05rem, 1.5vw, 1.4rem); letter-spacing: -0.01em; overflow-wrap: anywhere; }

/* ===================================================================
   Responsive
   =================================================================== */
@media (max-width: 900px) {
  :root { --header-h: 64px; }

  .nav-left, .nav-right { display: none; }
  .nav-toggle { display: block; }
  .site-header { grid-template-columns: 1fr auto 1fr; }
  .wordmark { justify-self: center; }

  .split { grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 7vw, 48px); }
  .section p { max-width: 58ch; }

  .fermatex { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: clamp(20px, 5vw, 40px); }
  .fermatex-text { grid-column: 1 / -1; grid-row: auto; }
  .fermatex-a    { grid-column: 2 / 3;  grid-row: auto; }
  .fermatex-b    { grid-column: 1 / -1; grid-row: auto; }
  .fermatex-c    { grid-column: 1 / 2;  grid-row: auto; margin-top: 0; }

  .footer-inner { flex-direction: column; }

  .product-layout, .cart-layout, .contact-layout { grid-template-columns: minmax(0, 1fr); }
  .product-info, .cart-summary { position: static; }
  .pillars { grid-template-columns: minmax(0, 1fr); }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  /* Experiments: one column, in the order they are listed */
  .stagger { display: grid; row-gap: clamp(36px, 10vw, 56px); }
  .stagger + .stagger { margin-top: clamp(36px, 10vw, 56px); }
  .stagger-band, .stagger-stack { display: contents; }
  .stagger .entry { grid-column: auto; width: auto; margin-top: 0; }
  .project-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .hero-copy br { display: none; }
  .fermatex { grid-template-columns: minmax(0, 1fr); }
  .fermatex-a, .fermatex-b, .fermatex-c { grid-column: 1 / -1; }
  .cart-line { grid-template-columns: 64px minmax(0, 1fr) auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* The logo mark is drawn in dark ink; inverted here to sit on the black footer. */
.footer-mark {
  width: auto;
  height: clamp(40px, 3.6vw, 52px);
  margin-right: 2px;
  filter: invert(1);
  opacity: .92;
}
