/* The public website: cream paper, ink navy and bottle green, serif headings and
   generous space. Colour carries meaning: green acts, navy anchors, red marks a
   price that no longer applies. */

:root {
  --ink: #14233a;
  --ink-2: #404c5e;
  --ink-3: #586476;
  --cream: #faf7f0;
  --cream-2: #f3eee2;
  --cream-line: #e7e0cf;
  --paper: #f7f4ec;
  --paper-line: #e5e2d8;
  --emerald: #0f6b53;
  --mint: #e6f1ec;
  --was: #b3261e;
  --ochre: #7a4d05;
  --ochre-soft: #fbf3e2;
  --font-editorial: 'Newsreader', Georgia, 'Times New Roman', serif;
  --site-max: 72rem;
  --section: clamp(3rem, 6vw, 5rem);
}

/* Frame ------------------------------------------------------------------- */

.site { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; background: #fff; color: var(--ink); font-size: var(--fs-md); }
.site-wrap { width: min(var(--site-max), 100% - clamp(2rem, 6vw, 4rem)); margin-inline: auto; }
.site-main { flex: 1; width: 100%; min-width: 0; }
.site-main-padded { width: min(var(--site-max), 100% - clamp(2rem, 6vw, 4rem)); padding-block: var(--s7) var(--section); }
.site-main.site-wrap > .notice, .site-main > .notice { margin-top: var(--s4); }
.site .button { border-radius: var(--r-md); }

.strip { background: var(--ink); color: #fff; font-size: var(--fs-sm); font-weight: 600; }
.strip ul { list-style: none; padding: 0.45rem 0; margin-block: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.15rem var(--s6); text-align: center; }
.strip li { position: relative; }
.strip li + li::before { content: ''; position: absolute; left: calc(var(--s6) / -2 - 2px); top: 50%; width: 4px; height: 4px; margin-top: -2px; background: var(--accent-300); border-radius: 50%; }

.site-bar { position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid var(--cream-line); }
.site-bar .site-wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 4.5rem; }
.site-brand .brand-name { color: var(--ink); font: 600 1.2rem/1.1 var(--font-editorial); letter-spacing: -0.01em; }
.site-nav { display: flex; align-self: stretch; margin-inline: auto; }
.site-nav a { display: inline-flex; align-items: center; padding: 0 0.7rem; border-block: 3px solid transparent; color: var(--ink-2); text-decoration: none; font-size: var(--fs-base); font-weight: 500; white-space: nowrap; transition: border-color var(--t), color var(--t); }
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--cream-line); }
.site-nav a[aria-current] { color: var(--emerald); font-weight: 600; border-bottom-color: var(--emerald); }
.site-actions { display: flex; align-items: center; gap: var(--s2); }
.site-actions .button { white-space: nowrap; }
.site-register { padding-inline: 1.35rem; }
.site-menu { display: none; }

.site-foot { background: var(--cream-2); border-top: 1px solid var(--cream-line); padding-block: var(--s8) var(--s7); margin-top: auto; font-size: var(--fs-sm); }
.site-foot-grid { display: grid; grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)); gap: var(--s6); }
.site-foot-about p { max-width: 24em; margin-bottom: var(--s2); }
.site-foot h2 { font: 600 1.05rem/1.3 var(--font-editorial); color: var(--ink); }
.site-foot nav { display: flex; flex-direction: column; align-items: flex-start; }
.site-foot nav a { color: var(--ink-2); text-decoration: none; min-height: 2rem; display: inline-flex; align-items: center; }
.site-foot nav a:hover { text-decoration: underline; color: var(--ink); }
.cancel-link { font-weight: 700; }

/* Type -------------------------------------------------------------------- */

.display, .editorial { font-family: var(--font-editorial); font-weight: 600; letter-spacing: -0.018em; color: var(--ink); }
.display { font-size: clamp(2.4rem, 1.55rem + 3vw, 3.85rem); line-height: 1.06; margin-bottom: var(--s5); }
.display-md { font-size: clamp(2.1rem, 1.55rem + 2vw, 3rem); max-width: 18em; }
.editorial { font-size: clamp(1.7rem, 1.35rem + 1.2vw, 2.3rem); line-height: 1.16; }
h1.editorial { font-size: clamp(1.95rem, 1.55rem + 1.5vw, 2.65rem); }
.editorial a { color: inherit; text-decoration: none; }
.kicker { font: 600 var(--fs-sm)/1.4 var(--font-sans); color: var(--emerald); margin: 0 0 var(--s2); }
.fine { font-size: var(--fs-sm); color: var(--ink-3); line-height: 1.55; }
.page-intro { max-width: 46rem; margin-bottom: var(--s6); }
.arrow-back .icon { margin-right: 0.35rem; }
.hero-sub { font-size: clamp(1.1rem, 1.02rem + 0.35vw, 1.25rem); line-height: 1.55; color: var(--ink-2); max-width: 30em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s6) 0 0; }

.section { padding-block: var(--section); }
.section-intro { max-width: 40rem; margin-bottom: var(--s6); }
.section-intro p:last-child { margin-bottom: 0; }
.section-head-centre { text-align: center; max-width: 40rem; margin: 0 auto var(--s7); }
.section-head-centre .lede { margin-inline: auto; margin-bottom: 0; }
.section-more { text-align: center; margin: var(--s4) 0 0; }
.band-cream { background: var(--cream); border-block: 1px solid var(--cream-line); }

/* Home: words beside laboratory glassware --------------------------------- */

.landing { background: var(--cream); border-bottom: 1px solid var(--cream-line); padding-block: clamp(2rem, 4.5vw, 4rem) var(--s6); }
.landing-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.landing-art { min-width: 0; }
.lab-art { display: block; width: 100%; height: auto; max-height: 24rem; }
.points { list-style: none; padding: var(--s4) 0 0; margin-block: clamp(var(--s6), 4vw, var(--s7)) 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); border-top: 1px solid var(--cream-line); }
.points li { display: flex; gap: var(--s4); align-items: center; }
.points .icon { width: 1.8rem; height: 1.8rem; color: var(--emerald); }
.points strong { display: block; font-size: var(--fs-base); line-height: 1.35; }
.points span { display: block; font-size: var(--fs-sm); color: var(--ink-3); }

/* The promotional video --------------------------------------------------- */

.promo { padding-block: var(--section); border-bottom: 1px solid var(--cream-line); }
.promo-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(2rem, 7vw, 6rem); align-items: center; max-width: 60rem; }
.promo-text .lede { margin-bottom: 0; }
.reel { position: relative; width: min(18rem, 76vw); aspect-ratio: 9 / 16; border-radius: 1.5rem; overflow: hidden; background: var(--ink); box-shadow: 0 24px 48px -28px rgb(20 35 58 / 0.55); }
.reel video { display: block; width: 100%; height: 100%; object-fit: contain; }
.reel-play { position: absolute; inset: 0; width: 100%; display: grid; place-items: center; border: 0; background: rgb(20 35 58 / 0.18); cursor: pointer; transition: background-color var(--t); }
.reel-play:hover { background: rgb(20 35 58 / 0.08); }
.reel-play::before { content: ''; width: 4.5rem; height: 4.5rem; border-radius: 50%; background: #fff; box-shadow: 0 8px 24px -8px rgb(20 35 58 / 0.6); transition: transform var(--t) var(--ease); }
.reel-play::after { content: ''; position: absolute; left: 50%; top: 50%; translate: -35% -50%; border-style: solid; border-width: 0.8rem 0 0.8rem 1.3rem; border-color: transparent transparent transparent var(--emerald); }
.reel-play:hover::before { transform: scale(1.07); }
.reel-play:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
.reel-error { position: absolute; inset: auto 0 0 0; margin: 0; padding: var(--s4); background: var(--ink); color: #fff; font-size: var(--fs-sm); text-align: center; }

/* Books and the free preview ---------------------------------------------- */

.resource-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4); margin-top: var(--s6); }
.resource-links .sample-link { margin: 0; flex: 1 1 18rem; }
.band-cream .pending { border-top: 0; padding-top: 0; }
.try-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.try-grid .plate { max-width: 28rem; justify-self: end; width: 100%; }

.plate { margin: 0; padding: clamp(var(--s4), 2vw, var(--s5)); background: #fff; border: 1px solid var(--cream-line); border-radius: var(--r-xl); color: var(--ink); text-align: left; }
.plate-equation { margin: 0 0 var(--s3); padding-bottom: var(--s3); border-bottom: 1px solid var(--cream-line); font: 500 1rem/1.4 var(--font-editorial); text-align: center; }
.plate svg { display: block; width: 100%; height: auto; }
.plate figcaption { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--cream-line); font-size: var(--fs-xs); line-height: 1.55; color: var(--ink-2); }
.fig-band-pheno { fill: #f6d9e7; }
.fig-band-methyl { fill: #fbe5c4; }
.fig-grid line { stroke: rgb(20 35 58 / 0.1); stroke-width: 1; }
.fig-axis { fill: none; stroke: var(--ink); stroke-width: 1; }
.fig-ticks text { font: 500 9px var(--font-sans); fill: var(--ink-2); }
.fig-notes text { font: 600 8.5px var(--font-sans); fill: var(--ink); }
.fig-curve { fill: none; stroke: var(--emerald); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; }
.fig-point { fill: #fff; stroke: var(--ink); stroke-width: 2; }

/* Inner pages ------------------------------------------------------------- */

.page-hero { padding-block: clamp(2rem, 4.5vw, 3.5rem); background: var(--cream); border-bottom: 1px solid var(--cream-line); }
.page-hero .hero-sub { margin-bottom: 0; }
.choose { padding-block: clamp(2rem, 5vw, 3.5rem) var(--section); }
.choose-more { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--s3) var(--s7); margin: var(--s6) 0 0; font-size: var(--fs-sm); }

.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s8); margin: 0 0 var(--s7); }
.features > div { padding: var(--s4) 0; border-top: 1px solid var(--cream-line); }
.features dt { font: 600 1.2rem/1.35 var(--font-editorial); color: var(--ink); margin-bottom: var(--s1); }
.features dd { margin: 0; font-size: var(--fs-base); color: var(--ink-2); line-height: 1.6; }
.screens { display: grid; grid-template-columns: minmax(0, 3.4fr) minmax(0, 1fr); gap: var(--s6); align-items: end; }
.screen { margin: 0; }
.screen img { display: block; width: 100%; height: auto; border: 1px solid var(--cream-line); border-radius: var(--r-lg); background: #fff; box-shadow: 0 18px 40px -30px rgb(20 35 58 / 0.4); }
.screen figcaption { margin-top: var(--s3); font-size: var(--fs-sm); color: var(--ink-3); }

.soon { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4) var(--s5); padding: var(--s5) var(--s6); background: var(--cream); border: 1px solid var(--cream-line); border-radius: var(--r-xl); }
.soon > .icon { width: 2rem; height: 2rem; color: var(--emerald); }
.soon > div { flex: 1 1 16rem; }
.soon h2 { font: 600 1.35rem/1.3 var(--font-editorial); margin-bottom: var(--s1); }
.soon p { margin: 0; color: var(--ink-2); }
.soon .soon-date { font-weight: 700; color: var(--ink); }

/* The author */
.author { max-width: 46rem; }
.author-with-photo { display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); gap: clamp(var(--s6), 5vw, var(--s8)); max-width: none; align-items: start; }
.author-photo { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-lg); border: 1px solid var(--cream-line); }
.author-text { max-width: 42rem; }
.author-text > :last-child { margin-bottom: 0; }
.author-text h2:not(.editorial) { font: 600 1.35rem/1.3 var(--font-editorial); margin-top: var(--s6); }

.about-offer { padding-bottom: 0; }
.about-offer dl { margin: var(--s5) 0 0; max-width: 46rem; }
.about-offer dl > div { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: var(--s4); padding: var(--s4) 0; border-top: 1px solid var(--cream-line); }
.about-offer dt { font: 600 1.15rem/1.35 var(--font-editorial); }
.about-offer dd { margin: 0; color: var(--ink-2); }

/* Questions */
.faq-section { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: var(--s7); align-items: start; }
.accordion { border-top: 1px solid var(--cream-line); }
.accordion details { border-bottom: 1px solid var(--cream-line); }
.accordion summary { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); padding: var(--s4) 0; min-height: 3.5rem; cursor: pointer; font: 600 1.15rem/1.35 var(--font-editorial); list-style: none; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary:hover { color: var(--emerald); }
.accordion-mark { display: inline-grid; place-items: center; flex: none; color: var(--emerald); transition: transform var(--t) var(--ease); }
.accordion details[open] .accordion-mark { transform: rotate(180deg); }
.accordion-body { padding: 0 2.5rem var(--s4) 0; color: var(--ink-2); max-width: 44rem; }
.accordion-body > :last-child { margin-bottom: 0; }
.help-questions > h2 { font: 600 1.5rem/1.3 var(--font-editorial); margin-top: var(--s7); }
.help-questions > h2:first-child { margin-top: 0; }

.preview-list { list-style: none; padding: 0; max-width: 52rem; border-top: 1px solid var(--cream-line); }
.preview-list a { display: flex; align-items: center; gap: var(--s4); padding: var(--s4) var(--s2); border-bottom: 1px solid var(--cream-line); text-decoration: none; color: var(--ink); transition: background-color var(--t); }
.preview-list a:hover { background: var(--cream); color: var(--ink); }
.preview-list a > span { flex: 1; min-width: 0; }
.preview-list a > .icon { color: var(--emerald); }
.preview-list strong { display: block; font: 600 1.15rem/1.35 var(--font-editorial); }
.preview-list small { display: block; color: var(--ink-3); }

.legal-page { max-width: 52rem; margin-inline: auto; }
.legal-page.narrow { max-width: 38rem; }
.policy-switch { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); margin-bottom: var(--s7); }
.policy-switch a { display: flex; align-items: center; gap: var(--s4); padding: var(--s4); border: 1px solid var(--cream-line); border-radius: var(--r-lg); text-decoration: none; color: var(--ink); }
.policy-switch a:hover { border-color: var(--emerald); color: var(--ink); }
.policy-switch small { display: block; color: var(--ink-3); }
.policy { margin-top: var(--s8); display: grid; gap: var(--s4); }
.statement { white-space: pre-wrap; font-family: var(--font-mono); font-size: var(--fs-sm); }

/* The titration curve draws itself once. */
@media (prefers-reduced-motion: no-preference) {
  body[data-motion='full'] .plate .fig-curve { animation: trace 1.5s 0.15s var(--ease) both; }
}
@keyframes trace { from { stroke-dashoffset: 100; } }

/* Smaller screens ---------------------------------------------------------- */

@media (max-width: 68rem) {
  .site-nav, .site-actions > .site-signin { display: none; }
  .site-menu { display: inline-block; }
  .site-menu .menu-panel { right: 0; width: min(19rem, calc(100vw - 2rem)); }
  .site-menu .menu-panel a { min-height: 2.9rem; font-size: var(--fs-md); }
  .site-menu .menu-panel .menu-signin { border-top: 1px solid var(--cream-line); margin-top: var(--s2); font-weight: 600; }
  .site-menu .menu-panel a[aria-current] { box-shadow: inset 3px 0 0 var(--emerald); font-weight: 700; }
}
@media (max-width: 52rem) {
  .landing-grid, .try-grid, .faq-section { grid-template-columns: minmax(0, 1fr); }
  .landing-art { max-width: 28rem; width: 100%; margin-inline: auto; }
  .try-grid .plate { justify-self: start; }
  .promo-grid { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .promo-text { justify-self: stretch; }
  .screens, .features { grid-template-columns: minmax(0, 1fr); }
  .screen-tall { max-width: 18rem; }
  .site-foot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-foot-about { grid-column: 1 / -1; }
}
@media (max-width: 40rem) {
  .policy-switch, .author-with-photo, .about-offer dl > div, .points { grid-template-columns: minmax(0, 1fr); }
  .points { gap: var(--s4); }
  .about-offer dl > div { gap: var(--s1); }
  .author-photo { max-width: 14rem; }
  .site-foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-cta .button { width: 100%; }
  .landing-art { max-width: 20rem; }
  .strip li + li::before { display: none; }
  .accordion-body { padding-right: 0; }
}
@media (max-width: 26rem) {
  .site-brand .brand-name { font-size: 1rem; max-width: 7.5rem; }
  .site-brand .brand-mark svg { width: 1.9rem; height: 1.9rem; }
  .site-brand { gap: var(--s2); }
  .site-register { padding-inline: 0.85rem; }
}
@media print { .strip, .site-bar, .site-foot { display: none; } }
