/* Rightmed public site. Follows .claude/brand-voice-guidelines.md.
   Spectral (the logo's face) for headings and figures, Public Sans for
   text, IBM Plex Mono only inside the dispensing label. Forest, paper and
   a little brass; the leakage and switch colours mark data only.

   Spacing runs on one scale (--s*) and one grid: a single left edge, and
   split sections at 5:7 with the heading left and the text right. Fonts
   are self-hosted (OFL, see fonts/) so no visitor request leaves
   rightmed.co.uk. */

@font-face { font-family: "Spectral"; src: url("fonts/spectral-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Spectral"; src: url("fonts/spectral-latin-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("fonts/publicsans-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("fonts/publicsans-latin-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/plexmono-latin-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/plexmono-latin-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --forest: #0f3d32;
  --forest-deep: #0a2c24;
  --ink: #1b2429;
  --slate: #5d6b70;
  --paper: #f3f5f2;
  --rule: #d3dbd6;
  --brass: #a6752c;
  --white: #ffffff;
  --on-forest: #d6e2dc;
  --leak: #b23b3b;
  --leak-tint: #f8eded;
  --gain: #2e7d5b;
  --gain-tint: #eaf3ee;

  --display: "Spectral", Georgia, "Times New Roman", serif;
  --body: "Public Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Spacing scale */
  --s1: 0.5rem;
  --s2: 1rem;
  --s3: 1.5rem;
  --s4: 2rem;
  --s5: 3rem;
  --s6: 4rem;
  --s7: 6rem;
  --s8: 8rem;
  --section: var(--s7);
  --gutter: 1.5rem;
  --measure: 34rem;
  --radius: 3px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 6rem; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
}

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); }

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

/* Type scale: 14 / 18 / 21 / 24 / 36 / 60 */
h1, h2, h3 { font-family: var(--display); font-weight: 600; color: var(--forest); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 4.8vw, 3.75rem); line-height: 1.08; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.75rem, 2.8vw, 2.25rem); line-height: 1.15; letter-spacing: -0.01em; }
h3 { font-size: 1.3125rem; line-height: 1.3; }

p { margin: 0 0 var(--s2); }
p:last-child { margin-bottom: 0; }

.body-lg { font-size: 1.3125rem; line-height: 1.55; color: var(--ink); max-width: var(--measure); }
.descriptor { font-size: 0.875rem; font-weight: 600; color: var(--slate); margin: 0 0 var(--s3); }

/* Sections share one vertical rhythm; the heading sits a fixed step above its content. */
.section { padding: var(--section) 0; }
.section-head { max-width: 20ch; margin-bottom: var(--s5); }
.split { display: grid; grid-template-columns: 5fr 7fr; gap: var(--s6); align-items: start; }

/* Paper ground with the prescription form's fine security print. */
.closing {
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(135deg, rgba(15, 61, 50, 0.035) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(45deg, rgba(15, 61, 50, 0.025) 0 1px, transparent 1px 11px);
}

/* Masthead */
.masthead { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, 0.96); border-bottom: 1px solid var(--rule); }
.masthead-row { display: flex; align-items: center; gap: var(--s4); padding-top: var(--s2); padding-bottom: var(--s2); }
.wordmark { display: block; margin-right: auto; line-height: 0; }
.wordmark img { height: 36px; width: auto; }
.nav { display: flex; gap: var(--s4); font-size: 0.875rem; }
.nav a { color: var(--slate); text-decoration: none; }
.nav a:hover { color: var(--forest); }

/* Buttons: square, like the hallmark frame. */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: 0; }
.button {
  display: inline-block;
  font-family: var(--body);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.2;
  color: var(--white);
  background: var(--forest);
  text-decoration: none;
  padding: 0.95rem 1.5rem;
  border-radius: var(--radius);
  transition: background-color 150ms ease;
}
.button:hover { background: var(--forest-deep); color: var(--white); }
.button-small { font-size: 0.875rem; padding: 0.6rem 1.05rem; }
.or { color: var(--slate); font-size: 0.875rem; }

/* Hero: the forest field, so the white dispensing label is the first thing seen. */
.hero { padding: var(--s6) 0 var(--s4); overflow: hidden; background: var(--forest); color: var(--on-forest); }
.hero-grid { display: grid; grid-template-columns: 6fr 6fr; gap: var(--s6); align-items: center; }

/* The archival dispensary, toned forest to white, with the label laid over its corner. */
.hero-media { position: relative; padding-bottom: var(--s6); }
.photo { margin: 0; background: var(--forest); aspect-ratio: 4 / 3; overflow: hidden; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: screen;
             filter: grayscale(1) contrast(1.1); }
.hero-media .label { position: absolute; left: -3%; bottom: 0; max-width: 22rem; font-size: 0.9rem; padding: var(--s3); }
.hero-media .label-product { font-size: 1.125rem; }
.hero h1 { max-width: 20ch; color: var(--white); font-size: clamp(2.5rem, 5vw, 3.75rem); }
.lede { font-size: 1.3125rem; line-height: 1.55; color: var(--ink); max-width: 30rem; margin: var(--s4) 0 var(--s5); }
.hero .lede { color: var(--on-forest); }
.hero .button { background: var(--white); color: var(--forest); }
.hero .button:hover { background: var(--paper); color: var(--forest-deep); }
.hero .or { color: var(--on-forest); }
.hero .or a { color: var(--white); }
.hero :focus-visible { outline-color: var(--white); }

/* What anyone checking us out asks first, answered along the hero's foot. */
.proof { list-style: none; margin: var(--s6) 0 0; padding: var(--s3) 0 0; display: flex; flex-wrap: wrap;
         gap: var(--s1) var(--s5); border-top: 1px solid rgba(214, 226, 220, 0.25);
         font-size: 1rem; font-weight: 600; color: var(--white); }
.proof li { display: flex; align-items: center; gap: var(--s2); }
.proof li::before { content: ""; width: 6px; height: 6px; background: var(--brass); flex: none; }

/* The dispensing label: laid out like a real UK dispensing label, the one
   object on the page set in a thermal-printer mono. */
.label {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 32rem;
  margin: 0;
  background: var(--white);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.45;
  color: var(--ink);
  padding: var(--s4) var(--s4) var(--s3);
  border-radius: 6px;
  transform: rotate(-2deg);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5);
  animation: settle 900ms cubic-bezier(0.2, 0.8, 0.2, 1) 150ms both;
}
.label p { margin: 0; }
.label-product { display: grid; grid-template-columns: auto 1fr; gap: var(--s2); align-items: baseline;
                 font-weight: 600; font-size: 1.375rem; text-transform: uppercase; letter-spacing: 0.01em; }
.label-directions { margin-top: 0.75rem !important; }
.label-warning { margin-top: 0.85rem !important; padding: 0.45rem 0.6rem; border: 1.5px solid var(--ink);
                 font-weight: 600; font-size: 0.85rem; }
.label-patient { display: flex; justify-content: space-between; gap: var(--s2); margin-top: 0.9rem !important;
                 padding-top: 0.6rem; border-top: 1px solid var(--ink); font-weight: 600;
                 text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.03em; }
.label-keep { font-size: 0.82rem; font-weight: 600; margin-top: 0.35rem !important; }
.label-supplier { margin-top: 0.6rem !important; padding-top: 0.5rem; border-top: 1px solid var(--ink);
                  font-size: 0.78rem; color: var(--slate); }

@keyframes settle {
  from { opacity: 0; transform: translateY(28px) rotate(3deg); }
  to   { opacity: 1; transform: translateY(0) rotate(-2deg); }
}


/* What you get: the two findings, kept apart, beside an illustration of the report. */
.figures { background: var(--paper); }
.figures-intro { margin-bottom: var(--s6); }
.figures-grid { display: grid; grid-template-columns: 5fr 7fr; gap: var(--s6); align-items: start; }
.pair { display: grid; gap: var(--s3); margin: 0; }
.figure { padding: var(--s3) var(--s3) var(--s3) calc(var(--s3) - 4px); background: var(--white);
          border: 1px solid var(--rule); border-left: 4px solid currentColor; border-radius: var(--radius); }
.figure dt { font-family: var(--display); font-size: 1.5rem; font-weight: 600; line-height: 1.2; margin-bottom: var(--s1); }
.figure dd { margin: 0; color: var(--ink); }
.figure-leak { color: var(--leak); }
.figure-switch { color: var(--gain); }

.sample { margin: 0; background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
          padding: var(--s3) var(--s4); font-size: 0.875rem; }
.sample table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sample caption { text-align: left; font-family: var(--display); font-weight: 600; font-size: 1.3125rem;
                  color: var(--leak); padding-bottom: var(--s2); }
.sample th { text-align: left; font-weight: 600; color: var(--slate); padding: 0 var(--s2) var(--s1) 0;
             border-bottom: 1px solid var(--ink); }
.sample td { padding: 0.75rem var(--s2) 0.75rem 0; border-bottom: 1px solid var(--rule); }
.sample td:nth-child(2) { font-weight: 600; }
.sample .n { text-align: right; padding-right: var(--s3); white-space: nowrap; }
.flag { font-weight: 600; font-size: 0.875rem; padding: 0.1rem 0.4rem; background: var(--paper); border-radius: 2px; }
.flag-key { margin: var(--s2) 0 0; display: grid; gap: 0.25rem; }
.flag-key div { display: flex; gap: var(--s2); }
.flag-key dt { font-weight: 600; min-width: 1.75rem; }
.flag-key dd { margin: 0; }
.sample figcaption { font-size: 0.875rem; line-height: 1.5; color: var(--slate); padding-top: var(--s2); max-width: 36rem; }

/* How it works: a real sequence, so it is numbered. */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid;
         grid-template-columns: repeat(4, 1fr); gap: var(--s4); }
.steps li { counter-increment: step; padding-top: var(--s3); border-top: 2px solid var(--forest); }
.steps li::before { content: counter(step); display: block; font-family: var(--display); font-weight: 600;
                    font-size: 2.25rem; line-height: 1; color: var(--brass); margin-bottom: var(--s3); }
.steps h3 { margin-bottom: var(--s1); }
.steps p { max-width: 22rem; }
.fees { display: grid; grid-template-columns: 7fr 5fr; gap: var(--s5); align-items: start; margin-top: var(--s6); }
.fee-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.fee-table caption { text-align: left; font-family: var(--display); font-weight: 600; font-size: 1.5rem;
                     color: var(--forest); padding-bottom: var(--s2); }
.fee-table th { text-align: left; font-size: 0.875rem; font-weight: 600; color: var(--slate);
                padding: 0 var(--s2) var(--s1) 0; border-bottom: 1px solid var(--ink); }
.fee-table td { padding: var(--s2) var(--s2) var(--s2) 0; border-bottom: 1px solid var(--rule); }
.fee-table .n { text-align: right; white-space: nowrap; }
.fee-table td.n { font-family: var(--display); font-weight: 600; font-size: 1.3125rem; color: var(--forest); }
.fee-notes { padding-top: var(--s5); max-width: var(--measure); }

/* Switches: the forest band. */
.defend { background: var(--forest); color: var(--on-forest); }
.defend h2 { color: var(--white); }
.checks { list-style: none; padding: 0; margin: 0; max-width: var(--measure); }
.checks li { position: relative; padding: 0 0 var(--s3) 2.25rem; font-size: 1.125rem; }
.checks li:last-child { padding-bottom: 0; }
.checks li::before { content: "\2713"; position: absolute; left: 0; top: 0.2rem; width: 1.375rem; height: 1.375rem;
                     display: grid; place-items: center; font-size: 0.8rem; font-weight: 600; color: var(--forest);
                     background: var(--on-forest); border-radius: 2px; }

/* Founder, opening the closing section: initials in a single frame (the double
   rule is kept for the closing panel). */
.founder { margin-bottom: var(--s6); }
.founder-body { display: flex; gap: var(--s4); align-items: flex-start; max-width: 40rem; }
.monogram { flex: none; width: 5rem; height: 5rem; display: grid; place-items: center;
            border: 3px solid var(--forest);
            font-family: var(--display); font-weight: 600; font-size: 1.6rem; color: var(--forest); }
.founder-photo { display: block; flex: none; width: 10rem; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
                 border: 3px solid var(--forest); }
.founder-line { font-family: var(--display); font-size: 1.5rem; line-height: 1.45; color: var(--ink); }
.founder-line strong { color: var(--forest); font-weight: 600; }
.founder-why { font-size: 1.125rem; margin-top: var(--s3); }

/* Closing: the page's one double-ruled panel. */
.closing { padding: var(--section) 0; }
.closing-panel { background: var(--white); border: 3px solid var(--forest); outline: 1px solid var(--forest);
                 outline-offset: -10px; padding: var(--s6); }
.closing h2 { font-size: clamp(2rem, 3.6vw, 3rem); max-width: 24ch; margin-bottom: var(--s2); }
.closing-lede { max-width: 32rem; font-size: 1.125rem; }
.closing-actions { margin-top: var(--s4); }
.contact-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--s3); margin-top: var(--s5); }
.contact-tile { display: flex; flex-direction: column; gap: var(--s1); padding: var(--s3); background: var(--paper);
                border-radius: var(--radius); text-decoration: none; color: var(--ink); border: 1px solid transparent;
                transition: border-color 150ms ease; }
a.contact-tile:hover { color: var(--ink); border-color: var(--forest); }
.contact-kind { font-size: 0.875rem; font-weight: 600; color: var(--slate); }
.contact-value { font-family: var(--display); font-weight: 600; font-size: 1.3125rem; line-height: 1.3; color: var(--forest); overflow-wrap: anywhere; }
.contact-tile-plain .contact-value { font-family: var(--body); font-weight: 400; font-size: 1rem; line-height: 1.5; color: var(--ink); }

/* Privacy notice */
.doc-head { padding: var(--s7) 0 var(--s6); background: var(--paper); }
.doc-head h1 { font-size: clamp(2.25rem, 4.4vw, 3.5rem); max-width: 26ch; }
.doc-head .lede { margin-bottom: 0; }
.doc { padding: var(--s6) 0 var(--s7); }
.clause { display: grid; grid-template-columns: 5fr 7fr; gap: var(--s6); padding: var(--s4) 0; border-top: 1px solid var(--rule); }
.clause h2 { font-size: 1.3125rem; line-height: 1.3; }
.clause > div { max-width: 38rem; }
.clause ul { margin: 0 0 var(--s2); padding-left: 1.2rem; }
.clause li { margin-bottom: var(--s1); }
.clause-key > div { background: var(--paper); border-left: 4px solid var(--forest); padding: var(--s3); }
.updated { font-size: 0.875rem; color: var(--slate); margin-top: var(--s4); border-top: 1px solid var(--rule); padding-top: var(--s3); }

/* Footer */
.colophon { background: var(--forest-deep); color: #b2c2ba; font-size: 0.875rem; padding: var(--s5) 0; }
.colophon-row { display: flex; gap: var(--s5); align-items: flex-start; }
.colophon-row img { height: 28px; width: auto; flex: none; }
.colophon p { margin: 0 0 0.25rem; }
.colophon a { color: var(--white); }
.colophon a:hover { color: #e0c79a; }

/* Draft build only */
.draft-banner { background: #ffe9a8; color: #5a4300; border-bottom: 2px solid #d9b13b; text-align: center;
                font-size: 0.875rem; font-weight: 600; padding: 0.55rem 1rem; }
mark.missing { background: #fde2e1; color: #8a1c17; padding: 0 0.25em; border-radius: 2px; font-size: 0.85em; }

/* Responsive */
@media (max-width: 960px) {
  :root { --section: var(--s6); }
  .hero { padding: var(--s5) 0 var(--s4); }
  .hero-grid, .split, .figures-grid, .clause { grid-template-columns: 1fr; }
  .hero-grid { gap: var(--s6); }
  .split, .figures-grid { gap: var(--s4); }
  .clause { gap: var(--s2); }
  .label { justify-self: start; }
  .hero-media { padding-bottom: 0; }
  .hero-media .label { position: relative; left: 0; width: calc(100% - var(--s3)); margin: calc(-1 * var(--s6)) 0 0 var(--s3); }
  .steps { grid-template-columns: 1fr; gap: var(--s4); }
  .steps p { max-width: var(--measure); }
  .fees { grid-template-columns: 1fr; gap: var(--s3); }
  .fee-notes { padding-top: 0; }
  html { scroll-padding-top: 8rem; }
  .masthead-row { flex-wrap: wrap; row-gap: var(--s1); }
  .nav { order: 3; width: 100%; gap: var(--s3); }
  .section-head { max-width: 22ch; }
}
@media (max-width: 560px) {
  :root { --section: var(--s5); --gutter: 1rem; }
  .steps li::before { font-size: 1.5rem; margin-bottom: var(--s1); }
  body { font-size: 1.0625rem; }
  .wordmark img { height: 30px; }
  .masthead-row { padding-top: 0.75rem; padding-bottom: 0.75rem; }
  .hero { padding: var(--s4) 0 var(--s3); }
  .proof { flex-direction: column; margin-top: var(--s5); }
  .founder-body { flex-direction: column; gap: var(--s3); }
  .figures-intro, .founder { margin-bottom: var(--s5); }
  h1 { font-size: 2.25rem; }
  .lede, .body-lg { font-size: 1.125rem; }
  .lede { margin: var(--s3) 0 var(--s4); }
  .section-head { margin-bottom: var(--s4); }
  .label { transform: rotate(-1.5deg); padding: var(--s3) var(--s3); }
  .label-patient { flex-direction: column; gap: 0.1rem; }
  .founder-line { font-size: 1.3125rem; }
  .closing-panel { padding: var(--s5) var(--s3); outline-offset: -7px; }
  .sample { padding: var(--s2) var(--s3); }
  .sample .n { padding-right: var(--s2); }
  .fee-table td.n { font-size: 1.125rem; }
  .fee-table th:first-child { width: 40%; }
  .contact-tiles { margin-top: var(--s4); gap: var(--s2); }
  .colophon-row { flex-direction: column; gap: var(--s3); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .label { animation: none; }
  .button, .contact-tile { transition: none; }
}

@media print {
  .draft-banner, .actions, .nav, .button-small { display: none; }
  .masthead { position: static; }
  .hero, .closing, .defend, .colophon, .doc-head { background: none; color: var(--ink); }
  .defend h2, .hero h1, .proof { color: var(--forest); }
  .label { transform: none; box-shadow: none; border: 1px solid var(--ink); animation: none; }
}
