:root {
  --paper: #f4f6f3;
  --paper-alt: #e8eeeb;
  --ink: #1e2a31;
  --muted: #52616a;
  --lake: #1f5a73;
  --lake-deep: #143f52;
  --amber: #d9a441;
  --rule: #c9d3cf;
  --white: #ffffff;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;

  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 3.2vw, 2.4rem);
  --step-4: clamp(2.5rem, 5.6vw, 4.1rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.7;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--lake); text-underline-offset: 0.18em; }
a:hover { color: var(--lake-deep); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, dt, summary, .btn, .site-nav, .brand, .header-phone {
  font-family: var(--display);
}
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 0.6em; font-weight: 700; }
h1 { font-size: var(--step-4); max-width: 16ch; }
h2 { font-size: var(--step-3); }
p { margin: 0 0 1em; }

.wrap { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--ink); color: var(--white); padding: 0.5rem 1rem; z-index: 100; }
.skip:focus { left: 0.5rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; align-items: center; gap: 1.5rem; min-height: 4.5rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 16px; height: 30px; color: var(--lake); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 1.05rem; }
.brand-sub { font-size: 0.82rem; color: var(--muted); }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 0.95rem; font-weight: 500; padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--rule); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--lake); }
.header-phone { font-weight: 700; font-size: 0.95rem; text-decoration: none; white-space: nowrap; }
.menu-toggle { display: none; }

/* Buttons & links */
.btn {
  display: inline-block; background: var(--lake); color: var(--white); text-decoration: none;
  font-weight: 700; font-size: 1rem; padding: 0.85rem 1.4rem; border-radius: 6px; border: 2px solid var(--lake);
  cursor: pointer;
}
.btn:hover { background: var(--lake-deep); border-color: var(--lake-deep); color: var(--white); }
.btn-quiet { background: transparent; color: var(--lake); }
.btn-quiet:hover { background: var(--lake); color: var(--white); }
.btn-light { background: var(--white); color: var(--lake-deep); border-color: var(--white); }
.btn-light:hover { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.text-link { font-family: var(--display); font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; }

/* Hero: the anatomical plate */
.hero { padding: clamp(3rem, 7vw, 6rem) 0 clamp(2.5rem, 5vw, 4.5rem); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.lead { font-size: var(--step-1); color: var(--muted); max-width: 36em; }
.plate { margin: 0; border-left: 1px solid var(--rule); padding-left: clamp(1rem, 3vw, 2.5rem); }
.spine { width: 100%; max-width: 300px; margin-inline: auto; overflow: visible; }
.spine-line { fill: none; stroke: var(--lake); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.vertebrae rect { fill: var(--amber); }
.plate-labels line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.plate-labels text { font-family: var(--display); font-size: 13px; fill: var(--muted); }
.plate figcaption { font-size: 0.95rem; color: var(--muted); font-style: italic; max-width: 30em; margin-top: 1rem; }

@media (prefers-reduced-motion: no-preference) {
  .js .spine-line { stroke-dashoffset: 1; animation: draw 1.8s cubic-bezier(.6,.1,.3,1) forwards; }
  .js .vertebrae rect { opacity: 0; animation: settle 0.4s ease-out forwards; }
  .js .plate-labels { opacity: 0; animation: settle 0.6s ease-out 1.9s forwards; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes settle { to { opacity: 1; } }

/* Sections */
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-alt { background: var(--paper-alt); }
.band { background: var(--white); border-block: 1px solid var(--rule); padding: clamp(3rem, 6vw, 5rem) 0; }
.page-head { padding: clamp(3rem, 6vw, 5rem) 0 clamp(1.5rem, 3vw, 2.5rem); border-bottom: 1px solid var(--rule); }
.page-head h1 { max-width: 20ch; }
.split { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(1.5rem, 5vw, 5rem); align-items: start; }
.prose { max-width: 38em; }
.prose-intro { color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); }
.two-col p { max-width: 34em; }

/* Topic index on home */
.topic-list { list-style: none; margin: 0 0 1.5rem; padding: 0; border-top: 1px solid var(--rule); }
.topic-list a { display: grid; grid-template-columns: 18rem 1fr; gap: 1.5rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.topic-list strong { font-family: var(--display); font-size: var(--step-1); color: var(--lake-deep); }
.topic-list span { color: var(--muted); align-self: center; }
.topic-list a:hover strong { color: var(--lake); text-decoration: underline; text-underline-offset: 0.18em; }

/* Steps (a real sequence) */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.3rem 3.2rem; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0.1rem; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  border: 2px solid var(--lake); color: var(--lake); font-family: var(--display); font-weight: 700;
  display: grid; place-items: center; font-size: 0.95rem; background: var(--paper-alt);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 1.05rem; top: 2.3rem; bottom: 0.2rem; width: 2px; background: var(--rule); }

.timeline { list-style: none; margin: 0; padding: 0; counter-reset: step; max-width: 46rem; }
.timeline li { counter-increment: step; position: relative; padding: 0 0 2.2rem 4.2rem; }
.timeline li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 2.8rem; height: 2.8rem; border-radius: 50%;
  background: var(--lake); color: var(--white); font-family: var(--display); font-weight: 700; display: grid; place-items: center;
}
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 1.35rem; top: 3rem; bottom: 0.3rem; width: 2px; background: var(--rule); }
.timeline h2 { font-size: var(--step-2); margin-bottom: 0.35em; padding-top: 0.35rem; }

/* Principles */
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; border-top: 2px solid var(--ink); }
.principles div { padding: 1.3rem 1.5rem 0 0; }
.principles div + div { padding-left: 1.5rem; border-left: 1px solid var(--rule); }
.principles dt { font-size: var(--step-1); font-weight: 700; margin-bottom: 0.4rem; }
.principles dd { margin: 0; color: var(--muted); }

.plain-list { padding-left: 1.2rem; }
.plain-list li { margin-bottom: 0.5rem; }

/* FAQ */
.faq { max-width: 48rem; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; font-weight: 700; font-size: var(--step-1); padding: 1.1rem 2rem 1.1rem 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.2rem; top: 0.95rem; font-size: 1.5rem; color: var(--lake); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--muted); max-width: 40em; }

/* Body map */
.body-map-grid { display: grid; grid-template-columns: 240px 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.body-map { margin: 0; position: sticky; top: 6.5rem; }
.region rect, .region circle { fill: var(--paper-alt); stroke: var(--rule); stroke-width: 1.5; transition: fill 0.2s; }
.region.is-active rect, .region.is-active circle { fill: var(--amber); stroke: var(--lake-deep); }
.condition { padding: 1.4rem 0 1.4rem 1.4rem; border-left: 3px solid transparent; transition: border-color 0.2s; }
.condition + .condition { border-top: 1px solid var(--rule); }
.condition.is-active { border-left-color: var(--amber); }
.condition h2 { font-size: var(--step-2); }
.condition ul { margin: 0; padding-left: 1.2rem; }
.condition li { margin-bottom: 0.3rem; }

/* CTA band */
.cta-band { background: var(--lake-deep); color: #dfe8e6; padding: clamp(2.5rem, 5vw, 4rem) 0; }
.cta-band h2 { color: var(--white); margin: 0; }
.cta-band a:not(.btn) { color: var(--white); font-weight: 600; }
.cta-row { display: grid; grid-template-columns: auto 1fr auto; gap: 2rem; align-items: center; }
.cta-row p { margin: 0; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem, 5vw, 5rem); }
.contact-direct h2 { font-size: var(--step-1); margin-top: 1.8rem; }
.contact-direct h2:first-child { margin-top: 0; }
.big-phone { font-family: var(--display); font-size: var(--step-3); font-weight: 700; margin: 0 0 0.3rem; }
.big-phone a { text-decoration: none; }
.contact-form { background: var(--white); border: 1px solid var(--rule); border-radius: 10px; padding: clamp(1.5rem, 3vw, 2.5rem); display: grid; gap: 0.35rem; }
.contact-form h2 { font-size: var(--step-2); }
.contact-form label { font-family: var(--display); font-weight: 500; margin-top: 0.8rem; }
.optional { color: var(--muted); font-weight: 400; }
.contact-form input, .contact-form textarea {
  font: inherit; font-size: 1rem; padding: 0.7rem 0.85rem; border: 1.5px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink);
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--lake); outline: none; box-shadow: 0 0 0 3px rgba(31, 90, 115, 0.2); }
.contact-form .btn { justify-self: start; margin-top: 1rem; }
.form-note { font-size: 0.9rem; color: var(--muted); margin: 0.8rem 0 0; }
.form-status { padding: 0.8rem 1rem; border-radius: 6px; font-family: var(--display); }
.form-status.ok { background: #e2f0e8; color: #1d5a3a; }
.form-status.err { background: #f7e6e1; color: #7a2e1d; }
.hp { position: absolute; left: -9999px; }

/* Footer */
.site-footer { background: var(--ink); color: #c5cfd3; padding-top: 3rem; font-size: 0.95rem; }
.site-footer a:not(.btn) { color: var(--white); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 2rem; padding-bottom: 2rem; }
.footer-name { font-family: var(--display); font-weight: 700; color: var(--white); font-size: 1.1rem; }
.footer-links { list-style: none; margin: 0; padding: 0; columns: 2; }
.footer-links li { margin-bottom: 0.4rem; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-small { border-top: 1px solid #34434b; padding: 1.2rem 0 1.6rem; font-size: 0.85rem; color: #93a2a9; }
.footer-small p { margin: 0; }

/* Responsive */
@media (max-width: 960px) {
  .menu-toggle {
    display: inline-block; margin-left: auto; font: 700 0.95rem var(--display); background: none;
    border: 1.5px solid var(--ink); border-radius: 6px; padding: 0.45rem 0.9rem; color: var(--ink); cursor: pointer;
  }
  .header-phone { display: none; }
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--rule); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 0.5rem 1.25rem 1rem; }
  .site-nav a { display: block; padding: 0.75rem 0; border-bottom: 1px solid var(--rule); }
  .site-nav a[aria-current="page"] { color: var(--lake); border-bottom-color: var(--rule); }
  .hero-grid, .split, .two-col, .contact-grid, .footer-grid { grid-template-columns: 1fr; }
  .plate { border-left: 0; border-top: 1px solid var(--rule); padding: 2rem 0 0; }
  .spine { max-width: 220px; }
  .cta-row { grid-template-columns: 1fr; gap: 1rem; }
  .cta-row .btn { justify-self: start; }
  .body-map-grid { grid-template-columns: 1fr; }
  .body-map { display: none; }
  .condition { padding-left: 0; }
}
@media (max-width: 700px) {
  .topic-list a { grid-template-columns: 1fr; gap: 0.2rem; }
  .principles { grid-template-columns: 1fr; }
  .principles div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); margin-top: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
