/* ============================================================
   BedsCare — Design tokens
   ============================================================ */
:root {
  /* Colour: charcoal + bronze-gold, warm paper — sourced from the
     BedsCare logo marks, not the docs' navy scheme (per brand call). */
  --ink: #211f1d;
  --ink-soft: #3a3632;
  --ink-faint: #6b655c;
  --gold: #96702e;
  --gold-deep: #765423;
  --gold-pale: #c9a667;
  --paper: #f5f2ea;
  --paper-deep: #eae3d3;
  --paper-line: #d9cfb8;
  --white: #ffffff;

  --text: var(--ink);
  --text-muted: var(--ink-faint);
  --surface: var(--paper);
  --surface-alt: var(--paper-deep);
  --line: var(--paper-line);
  --accent: var(--gold);
  --accent-deep: var(--gold-deep);

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --fs-100: 0.8125rem;
  --fs-200: 0.9375rem;
  --fs-300: 1rem;
  --fs-400: 1.125rem;
  --fs-500: 1.375rem;
  --fs-600: 1.875rem;
  --fs-700: 2.5rem;
  --fs-800: 3.25rem;
  --fs-900: 4.25rem;

  /* Space: 4/8pt rhythm */
  --sp-1: 0.5rem;
  --sp-2: 1rem;
  --sp-3: 1.5rem;
  --sp-4: 2rem;
  --sp-5: 3rem;
  --sp-6: 4.5rem;
  --sp-7: 6.5rem;
  --sp-8: 9rem;

  --radius: 3px;
  --container: 1180px;
  --shadow-soft: 0 8px 24px -12px rgba(33, 31, 29, 0.28);
  --dur-1: 160ms;
  --dur-2: 320ms;
  --ease: cubic-bezier(0.25, 0.7, 0.35, 1);
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-300);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.12; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }

:focus-visible {
  outline: 2.5px solid var(--gold-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--sp-2); top: -60px;
  background: var(--ink); color: var(--paper);
  padding: var(--sp-1) var(--sp-3); border-radius: var(--radius);
  z-index: 1000; transition: top var(--dur-1) var(--ease);
}
.skip-link:focus { top: var(--sp-2); }

/* ============================================================
   Layout helpers
   ============================================================ */
.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-3);
}
@media (min-width: 768px) { .wrap { padding-inline: var(--sp-4); } }

section { padding-block: var(--sp-6); }
.section-tight { padding-block: var(--sp-5); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-body); font-weight: 600;
  font-size: var(--fs-100); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-deep);
}
.eyebrow::before {
  content: ""; width: 1.5em; height: 1px; background: var(--gold-deep);
}

h1 { font-size: var(--fs-800); }
h2 { font-size: var(--fs-700); }
h3 { font-size: var(--fs-500); }
@media (min-width: 1024px) {
  h1 { font-size: var(--fs-900); }
  h2 { font-size: clamp(var(--fs-700), 4vw, 3rem); }
}

.lede {
  font-size: var(--fs-400);
  color: var(--text-muted);
  max-width: 46ch;
}

.section-head {
  display: flex; flex-direction: column; gap: var(--sp-2);
  margin-bottom: var(--sp-5);
  max-width: 62ch;
}

/* ============================================================
   Threshold motif — the site's signature device.
   An open architrave line (top + sides, no bottom): a doorway.
   Used to frame the hero image and CTA moments — "care that
   comes through your door" made literal in the UI.
   ============================================================ */
.threshold {
  position: relative;
  padding: var(--sp-4) var(--sp-4) 0;
}
.threshold::before {
  content: "";
  position: absolute; inset: 0 0 -18px 0;
  border: 1.5px solid var(--gold);
  border-bottom: none;
  pointer-events: none;
}
.threshold--dark::before { border-color: var(--gold-pale); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.6em;
  padding: 0.9em 1.6em;
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-300);
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease),
    border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
  min-height: 48px;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--primary:hover { background: var(--gold-deep); border-color: var(--gold-deep); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--gold { background: var(--gold); color: var(--paper); border-color: var(--gold); }
.btn--gold:hover { background: var(--gold-deep); border-color: var(--gold-deep); }
.btn--on-dark { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.btn--on-dark:hover { background: var(--gold-pale); border-color: var(--gold-pale); }
.btn--ghost-on-dark { background: transparent; color: var(--paper); border-color: rgba(245,242,234,0.5); }
.btn--ghost-on-dark:hover { border-color: var(--paper); }

/* ============================================================
   Header / nav
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 242, 234, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: var(--sp-2);
  gap: var(--sp-3);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6em;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.3rem;
}
.brand__mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand__mark path { stroke: var(--gold); }
.brand__tag {
  display: block; font-family: var(--font-body); font-weight: 500;
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); margin-top: 2px;
}

.nav {
  display: none;
  align-items: center; gap: var(--sp-4);
}
.nav__links { display: flex; gap: var(--sp-3); }
.nav__links a {
  text-decoration: none; font-weight: 500; font-size: var(--fs-200);
  color: var(--ink-soft);
  padding-block: 0.3em; border-bottom: 2px solid transparent;
  transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--gold-deep); border-color: var(--gold); }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: none; border: 1.5px solid var(--ink); border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--ink);
  position: relative; transition: transform var(--dur-1) var(--ease), opacity var(--dur-1) var(--ease);
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav {
  position: fixed; inset: 0; top: 65px;
  background: var(--paper);
  padding: var(--sp-4) var(--sp-3);
  transform: translateY(-8px);
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), visibility var(--dur-2);
  z-index: 90;
  overflow-y: auto;
}
.mobile-nav.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.mobile-nav a:not(.btn) {
  display: block; text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-size: var(--fs-600);
  padding-block: var(--sp-2); border-bottom: 1px solid var(--line);
}
.mobile-nav .btn { margin-top: var(--sp-4); width: 100%; }

@media (min-width: 900px) {
  .nav { display: flex; }
  .nav-toggle, .mobile-nav { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding-block: var(--sp-6) var(--sp-7);
}
.hero .wrap {
  display: grid; gap: var(--sp-5);
}
.hero__copy { display: flex; flex-direction: column; gap: var(--sp-3); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.hero__media { position: relative; }
.hero__media img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius);
}
.hero__stat {
  position: absolute; left: var(--sp-3); bottom: calc(-1 * var(--sp-3));
  background: var(--ink); color: var(--paper);
  padding: var(--sp-2) var(--sp-3);
  max-width: 240px;
  font-size: var(--fs-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.hero__stat strong { display: block; font-family: var(--font-display); font-size: var(--fs-500); color: var(--gold-pale); }

@media (min-width: 900px) {
  .hero .wrap { grid-template-columns: 1.05fr 0.95fr; align-items: center; }
}

/* ============================================================
   Value strip
   ============================================================ */
.values-strip { background: var(--surface-alt); border-block: 1px solid var(--line); }
.values-strip ul {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.values-strip li { display: flex; flex-direction: column; gap: 0.4em; }
.values-strip h3 { font-size: var(--fs-400); }
.values-strip p { color: var(--text-muted); font-size: var(--fs-200); }

/* ============================================================
   Cards / grids
   ============================================================ */
.grid { display: grid; gap: var(--sp-3); }
.grid--3 { grid-template-columns: 1fr; }
.grid--2 { grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-3);
  display: flex; flex-direction: column; gap: var(--sp-1);
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
/* Door-swing hover: a thin gold panel "opens" from the hinge edge */
.card::after {
  content: "";
  position: absolute; inset: 0;
  border-left: 3px solid var(--gold);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform var(--dur-2) var(--ease);
  pointer-events: none;
}
.card:hover, .card:focus-within {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
  border-color: var(--paper-deep);
}
.card:hover::after, .card:focus-within::after { transform: scaleX(1); }
.card h3 { font-size: var(--fs-400); }
.card p { color: var(--text-muted); font-size: var(--fs-200); }
.card__icon { color: var(--gold-deep); }

.card--group-label {
  font-family: var(--font-body); font-weight: 700; font-size: var(--fs-100);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-deep);
  margin-bottom: var(--sp-1);
}

/* ============================================================
   Split section (text + photo)
   ============================================================ */
.split { display: grid; gap: var(--sp-4); align-items: center; }
.split__media img { border-radius: var(--radius); aspect-ratio: 5/4; object-fit: cover; }
.split__copy { display: flex; flex-direction: column; gap: var(--sp-2); }
.split__copy p { color: var(--text-muted); }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: var(--sp-6); } }
.split--reverse .split__media { order: -1; }
@media (min-width: 900px) { .split--reverse .split__media { order: 1; } }

/* ============================================================
   Timeline (journey 2026-2031) — a real sequence, so numbering
   is appropriate here (unlike the services grid above).
   ============================================================ */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.timeline li {
  display: grid; grid-template-columns: 64px 1fr; gap: var(--sp-3);
  padding-block: var(--sp-3);
  border-top: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline__year {
  font-family: var(--font-display); font-size: var(--fs-500); color: var(--gold-deep);
}
.timeline h3 { font-size: var(--fs-400); margin-bottom: 0.3em; }
.timeline p { color: var(--text-muted); font-size: var(--fs-200); }

/* ============================================================
   Numbered process (services page — arranging care)
   ============================================================ */
.process { counter-reset: step; display: grid; gap: var(--sp-4); }
.process li { position: relative; padding-left: 3.2rem; }
.process li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -0.15em;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: 1.5px solid var(--gold);
  color: var(--gold-deep); font-family: var(--font-display); font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.process h3 { font-size: var(--fs-400); margin-bottom: 0.3em; }
.process p { color: var(--text-muted); font-size: var(--fs-200); }
@media (min-width: 700px) { .process { grid-template-columns: repeat(3, 1fr); } }

/* ============================================================
   CTA band
   ============================================================ */
.cta-band {
  background: var(--ink); color: var(--paper);
  padding-block: var(--sp-6);
}
.cta-band .wrap { display: flex; flex-direction: column; gap: var(--sp-3); align-items: flex-start; }
.cta-band h2 { color: var(--paper); }
.cta-band p { color: rgba(245,242,234,0.72); max-width: 50ch; }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
@media (min-width: 900px) {
  .cta-band .wrap { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ============================================================
   Callout (name explainer, quality system, etc.)
   ============================================================ */
.callout {
  background: var(--surface-alt);
  border-left: 3px solid var(--gold);
  padding: var(--sp-3) var(--sp-4);
  border-radius: 0 var(--radius) var(--radius) 0;
  display: flex; flex-direction: column; gap: var(--sp-1);
}
.callout h3 { font-size: var(--fs-400); }
.callout p { color: var(--text-muted); }

/* ============================================================
   Contact / people cards
   ============================================================ */
.people { display: grid; gap: var(--sp-3); }
@media (min-width: 700px) { .people { grid-template-columns: repeat(2, 1fr); } }
.person-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--sp-3); display: flex; flex-direction: column; gap: 0.5em;
}
.person-card__role {
  font-size: var(--fs-100); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold-deep); font-weight: 700;
}
.person-card__name { font-family: var(--font-display); font-size: var(--fs-500); }
.person-card a { color: var(--ink-soft); text-decoration: none; font-size: var(--fs-200); }
.person-card a:hover { color: var(--gold-deep); text-decoration: underline; }

.contact-grid { display: grid; gap: var(--sp-5); }
@media (min-width: 1000px) { .contact-grid { grid-template-columns: 0.9fr 1.1fr; } }

.form-field { display: flex; flex-direction: column; gap: 0.4em; margin-bottom: var(--sp-2); }
.form-field label { font-weight: 600; font-size: var(--fs-200); }
.form-field input, .form-field textarea {
  font: inherit; padding: 0.85em 1em;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--white); color: var(--ink);
}
.form-field input:focus, .form-field textarea:focus {
  border-color: var(--gold); outline: none;
}
.form-hint { font-size: var(--fs-100); color: var(--text-muted); margin-top: var(--sp-1); }

.hours-list { display: grid; gap: 0.6em; }
.hours-list li { display: flex; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-200); border-bottom: 1px solid var(--line); padding-block: 0.5em; }
.hours-list span:first-child { color: var(--text-muted); }
.hours-list span:last-child { font-weight: 600; }

/* ============================================================
   Page hero (interior pages)
   ============================================================ */
.page-hero { padding-block: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--line); }
.page-hero .lede { max-width: 60ch; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--ink); color: rgba(245,242,234,0.82); padding-block: var(--sp-6) var(--sp-4); }
.footer-top { display: grid; gap: var(--sp-5); padding-bottom: var(--sp-5); border-bottom: 1px solid rgba(245,242,234,0.15); }
.footer-brand { display: flex; align-items: center; gap: 0.6em; font-family: var(--font-display); font-size: 1.3rem; color: var(--paper); margin-bottom: var(--sp-2); }
.footer-brand svg path { stroke: var(--gold-pale); }
.footer-tagline { color: rgba(245,242,234,0.6); font-size: var(--fs-200); max-width: 34ch; }
.footer-cols { display: grid; gap: var(--sp-4); grid-template-columns: repeat(2, 1fr); }
.footer-col h4 { font-family: var(--font-body); font-size: var(--fs-100); letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-pale); margin-bottom: var(--sp-2); }
.footer-col ul { display: flex; flex-direction: column; gap: 0.6em; }
.footer-col a { text-decoration: none; color: rgba(245,242,234,0.82); font-size: var(--fs-200); }
.footer-col a:hover { color: var(--gold-pale); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: space-between; padding-top: var(--sp-3); font-size: var(--fs-100); color: rgba(245,242,234,0.5); }
@media (min-width: 900px) {
  .footer-top { grid-template-columns: 1.2fr 2fr; }
  .footer-cols { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   Scroll reveal
   ============================================================ */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
}
