:root {
  --paper: #F6F7F4;
  --ink: #1C2733;
  --slate: #5A6978;
  --rule: #D5DAD6;
  --pen: #B5362A;
  --pen-soft: #F6E4E1;
  --measure: 66ch;
  --font-head: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pen); }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.4rem, 5.6vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin-top: 0; }
h3 { font-size: 1.35rem; font-weight: 600; }
p { margin: 0 0 1.1em; max-width: var(--measure); }
ul, ol { max-width: var(--measure); padding-left: 1.3em; }
li { margin-bottom: 0.4em; }
strong { font-weight: 600; }
small { color: var(--slate); }

.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1rem 0; flex-wrap: wrap;
}
.brand {
  font-family: var(--font-head); font-size: 1.35rem; font-weight: 600;
  text-decoration: none; letter-spacing: -0.01em;
}
.brand span { color: var(--pen); }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.4rem; flex-wrap: wrap; }
nav a { text-decoration: none; font-size: 0.97rem; }
nav a[aria-current="page"] { border-bottom: 2px solid var(--pen); }
.nav-toggle { display: none; }
/* Services dropdown */
nav li.has-sub { position: relative; }
nav .sub-toggle { background: none; border: 0; padding: 0 0.2rem; font: inherit; font-size: 0.8rem; color: var(--slate); cursor: pointer; }
nav ul.sub {
  display: none; position: absolute; left: -0.9rem; top: 100%; margin-top: 0.6rem; z-index: 20;
  flex-direction: column; gap: 0; min-width: 23rem; padding: 0.5rem 0;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 6px;
  box-shadow: 0 12px 30px rgba(28,39,51,0.14);
}
nav ul.sub li a { display: block; padding: 0.55rem 0.9rem; font-size: 0.93rem; border-bottom: 0; }
nav ul.sub li a:hover { background: rgba(28,39,51,0.05); }
nav ul.sub li a[aria-current="page"] { color: var(--pen); }
nav li.has-sub:hover ul.sub, nav li.has-sub:focus-within ul.sub, nav li.has-sub.open ul.sub { display: flex; }
@media (max-width: 760px) {
  nav li.has-sub:hover ul.sub, nav li.has-sub:focus-within ul.sub { display: none; }
  nav li.has-sub.open ul.sub { display: flex; }
  nav ul.sub { position: static; margin: 0.4rem 0 0 0.8rem; min-width: 0; border: 0; box-shadow: none; padding: 0; background: transparent; }
  nav ul.sub li a { padding: 0.35rem 0; }
}
@media (max-width: 760px) {
  .nav-toggle {
    display: inline-block; background: none; border: 1px solid var(--rule);
    padding: 0.4rem 0.8rem; font: inherit; color: var(--ink); border-radius: 4px;
  }
  nav { width: 100%; display: none; }
  nav.open { display: block; }
  nav ul { flex-direction: column; gap: 0.8rem; padding: 0.6rem 0 0.2rem; }
}

/* Buttons */
.btn {
  display: inline-block; padding: 0.8rem 1.3rem; border-radius: 4px;
  text-decoration: none; font-weight: 600; font-size: 1rem;
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper);
}
.btn:hover { background: var(--pen); border-color: var(--pen); color: #fff; }
.btn-quiet { background: transparent; color: var(--ink); }
.btn-quiet:hover { background: var(--pen-soft); color: var(--ink); border-color: var(--ink); }

/* Sections */
section { padding: 3.5rem 0; }
section + section { border-top: 1px solid var(--rule); }
.hero { padding: 4rem 0 3.5rem; }
.hero-grid { display: grid; gap: 3rem; grid-template-columns: 1.15fr 1fr; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
.hero p.lead { font-size: 1.2rem; color: var(--slate); }
.hero .actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.4rem; }

/* The scoring sheet (signature element) */
.sheet {
  background: #fff; border: 1px solid var(--rule); padding: 1.4rem 1.6rem 1.2rem;
  box-shadow: 0 1px 0 var(--rule), 0 14px 30px -24px rgba(28,39,51,.45);
  font-size: 0.95rem; max-width: 460px; margin-inline: auto;
  transform: rotate(-0.6deg);
}
.sheet-title {
  font-family: var(--font-head); font-size: 1.15rem; font-weight: 600;
  display: flex; justify-content: space-between; border-bottom: 1.5px solid var(--ink);
  padding-bottom: 0.5rem; margin-bottom: 0.6rem;
}
.sheet table { width: 100%; border-collapse: collapse; }
.sheet th, .sheet td { text-align: left; padding: 0.45rem 0.2rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.sheet th { font-weight: 600; color: var(--slate); font-size: 0.82rem; }
.sheet td.score { text-align: right; font-variant-numeric: tabular-nums; width: 3.2rem; }
.sheet .note {
  color: var(--pen); font-family: var(--font-head); font-style: italic; font-size: 1rem;
}
.sheet .total td { border-bottom: none; font-weight: 600; padding-top: 0.7rem; }
.sheet .stamp {
  display: inline-block; margin-top: 0.8rem; padding: 0.15rem 0.5rem;
  border: 2px solid var(--pen); color: var(--pen); font-weight: 700;
  letter-spacing: 0.04em; font-size: 0.85rem; transform: rotate(-3deg);
}

/* Offer rows */
.offers { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.offer {
  display: grid; grid-template-columns: 1.3fr 1.6fr 0.7fr; gap: 1.5rem; align-items: start;
  padding: 1.6rem 0; border-bottom: 1px solid var(--rule);
}
@media (max-width: 760px) { .offer { grid-template-columns: 1fr; gap: 0.5rem; } }
.offer h3 { margin: 0 0 0.3rem; }
.offer h3 a { text-decoration: none; }
.offer h3 a:hover { text-decoration: underline; }
.offer .price { font-family: var(--font-head); font-size: 1.5rem; font-weight: 500; white-space: nowrap; }
.offer .price small { display: block; font-family: var(--font-body); font-size: 0.85rem; font-weight: 400; color: var(--slate); }

/* Two column prose */
.cols { display: grid; gap: 2.5rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }

/* Process (real sequence) */
.steps { list-style: none; padding: 0; margin: 0; max-width: 760px; counter-reset: step; }
.steps li { position: relative; padding: 1rem 0 1rem 3.2rem; border-top: 1px solid var(--rule); }
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0.95rem;
  width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 1.5px solid var(--ink);
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 600;
}
.steps h3 { margin: 0 0 0.2rem; }
.steps p { margin: 0; }

/* Case list */
.cases { list-style: none; padding: 0; margin: 0; }
.cases li { padding: 1rem 0; border-top: 1px solid var(--rule); max-width: 760px; }
.cases li:last-child { border-bottom: 1px solid var(--rule); }
.cases .result { color: var(--pen); font-weight: 600; }

/* Callout */
.callout { background: #fff; border-left: 4px solid var(--pen); padding: 1.2rem 1.4rem; max-width: 760px; }
.callout p:last-child { margin-bottom: 0; }

/* Forms */
form.lead { max-width: 560px; }
label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
input, select, textarea {
  width: 100%; font: inherit; padding: 0.7rem 0.8rem; border: 1.5px solid var(--rule);
  border-radius: 4px; background: #fff; color: var(--ink); margin-bottom: 1rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
.form-note { color: var(--slate); font-size: 0.9rem; }
.form-status { margin-top: 1rem; font-weight: 600; }
.form-status.err { color: var(--pen); }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 2.5rem 0 3rem; color: var(--slate); font-size: 0.95rem; }
.site-footer .wrap { display: grid; gap: 2rem; grid-template-columns: 1.2fr 1fr 1fr; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.site-footer a { color: var(--ink); }
.site-footer .brand { color: var(--ink); }

/* Portraits */
.about-grid { display: grid; gap: 3rem; grid-template-columns: 1fr minmax(220px, 300px); align-items: start; }
.about-grid .portrait { order: 2; }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; gap: 1.5rem; } .about-grid .portrait { order: 0; max-width: 260px; } }
.portrait { margin: 0; }
.portrait img { width: 100%; height: auto; display: block; border-radius: 6px; box-shadow: 0 10px 30px rgba(28,39,51,0.18); }
.portrait figcaption { font-size: 0.82rem; color: var(--slate); margin-top: 0.6rem; }
.with-portrait { position: relative; }
.portrait-inline { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: block; margin-bottom: 1rem; box-shadow: 0 6px 18px rgba(28,39,51,0.18); }

/* Site chat */
.sitechat-open {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 50;
  background: var(--ink); color: #fff; border: 0; border-radius: 999px;
  padding: 0.75rem 1.2rem; font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer;
  box-shadow: 0 10px 24px rgba(28,39,51,0.25);
}
.sitechat-open:hover { background: var(--pen); }
.sitechat {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 60; width: min(380px, calc(100vw - 2.2rem));
  background: var(--paper); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 18px 44px rgba(28,39,51,0.22); display: flex; flex-direction: column; overflow: hidden;
}
.sitechat-head { display: flex; align-items: center; justify-content: space-between; padding: 0.8rem 1rem; border-bottom: 1px solid var(--rule); font-size: 0.95rem; }
.sitechat-close { background: none; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--slate); padding: 0 0.2rem; }
.sitechat-log { padding: 0.9rem 1rem; max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 0.6rem; }
.sitechat .msg { font-size: 0.93rem; line-height: 1.45; padding: 0.55rem 0.8rem; border-radius: 8px; max-width: 92%; white-space: pre-wrap; }
.sitechat .msg.bot { background: #fff; border: 1px solid var(--rule); align-self: flex-start; }
.sitechat .msg.user { background: var(--pen-soft); align-self: flex-end; }
.sitechat-form { display: flex; gap: 0.5rem; padding: 0.7rem 1rem; border-top: 1px solid var(--rule); }
.sitechat-form input { flex: 1; font: inherit; font-size: 0.95rem; padding: 0.6rem 0.7rem; border: 1px solid var(--rule); border-radius: 6px; background: #fff; color: var(--ink); min-width: 0; }
.sitechat-form .btn { padding: 0.6rem 0.9rem; font-size: 0.9rem; }
.sitechat-note { display: block; padding: 0 1rem 0.8rem; font-size: 0.75rem; }
.sitechat[hidden], .sitechat-open[hidden] { display: none; }
