/* ==========================================================================
   Rapport & Routines LLC
   Design tokens first, then layout. Change --accent to reskin the site.
   ========================================================================== */

:root {
  /* Brand */
  --accent:        #9C6B3C;   /* alternates from the design: #2F6B54, #7A4A3A, #3A5A82 */
  --ink:           #15242F;
  --ink-deep:      #0C1720;
  --paper:         #F7F4EE;
  --paper-warm:    #FFFDF8;
  --paper-shade:   #EDE8DE;

  /* Text on light */
  --text:          #15242F;
  --text-body:     #3E4F58;
  --text-muted:    #4B5A53;
  --text-soft:     #5C6A63;
  --text-faint:    #6F7C74;
  --placeholder:   #8B968F;

  /* Text on dark */
  --on-dark:       #F7F4EE;
  --on-dark-body:  #C3CCC7;
  --on-dark-muted: #A9B4AF;
  --on-dark-warm:  #C8BEA9;

  /* Lines */
  --line:          rgba(21, 36, 47, 0.10);
  --line-strong:   rgba(21, 36, 47, 0.14);
  --line-input:    rgba(21, 36, 47, 0.22);
  --line-light:    rgba(247, 244, 238, 0.14);
  --line-light-2:  rgba(247, 244, 238, 0.25);

  /* Type */
  --serif: Newsreader, Georgia, "Times New Roman", serif;
  --sans:  Archivo, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Layout */
  --shell:  1200px;
  --gutter: clamp(18px, 4vw, 32px);
  --radius: 2px;
  --header-h: 74px;
}

/* ── Reset & base ───────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--text); text-decoration: none; transition: color 0.18s ease; }
a:hover { color: var(--accent); }

h1, h2, h3 { font-weight: 400; margin: 0; text-wrap: pretty; }
p { margin: 0; text-wrap: pretty; }

input, textarea, select, button { font: inherit; color: inherit; }
::placeholder { color: var(--placeholder); opacity: 1; }

/* Visible keyboard focus everywhere, without the mouse-click ring. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--paper);
}
.skip-link:focus { left: 0; color: var(--paper); }

/* Sticky header must not cover the heading we just jumped to. */
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

.container {
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ── Shared type ────────────────────────────────────────────────────────── */

.eyebrow {
  margin: 0 0 18px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.eyebrow-accent { color: var(--accent); }

.eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  padding: 7px 14px;
  border: 1px solid var(--line-light-2);
  border-radius: var(--radius);
  letter-spacing: 0.14em;
  color: var(--on-dark-warm);
}
.eyebrow-badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.amp { color: var(--accent); }

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 30px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn-sm { padding: 11px 20px; font-size: 13px; letter-spacing: 0.02em; }
.btn-block { width: 100%; margin-top: 4px; }

.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--ink-deep); color: var(--paper); }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--ink); color: var(--paper); }

.btn-outline-light {
  border-color: rgba(247, 244, 238, 0.3);
  color: var(--on-dark);
  padding-inline: 26px;
}
.btn-outline-light:hover {
  background: rgba(247, 244, 238, 0.08);
  color: var(--on-dark);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding-block: 18px;
}

.wordmark { display: flex; align-items: baseline; gap: 10px; }
.wordmark-name {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.01em;
}
.wordmark-suffix {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 26px;
  font-size: 14px;
  color: var(--text-body);
}
.site-nav a { color: inherit; }
.site-nav a.btn { color: var(--paper); }

/* Hamburger: hidden until the nav no longer fits on one line. */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 40px;
  padding: 0 10px;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 800px) {
  .nav-toggle { display: flex; }

  .site-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    font-size: 16px;
  }
  .site-nav.is-open { display: flex; }
  .site-nav > a { padding: 14px 2px; }
  .site-nav > a + a { border-top: 1px solid var(--line); }
  .site-nav a.btn { margin-top: 12px; margin-bottom: 4px; padding: 14px 20px; border-top: 0; }
}

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: var(--on-dark);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
  padding-top: clamp(64px, 9vw, 112px);
  padding-bottom: clamp(60px, 8vw, 104px);
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin-bottom: 26px;
}

.hero-lede {
  max-width: 52ch;
  margin-bottom: 40px;
  font-size: 18px;
  line-height: 1.65;
  color: var(--on-dark-body);
}

.hero-card {
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid rgba(247, 244, 238, 0.16);
  background: rgba(247, 244, 238, 0.04);
}
.hero-card .eyebrow { margin-bottom: 24px; }

.hero-card-list { margin: 0; }
.hero-card-item { padding: 18px 0; border-bottom: 1px solid rgba(247, 244, 238, 0.12); }
.hero-card-item:last-child { padding-bottom: 0; border-bottom: 0; }
.hero-card-item dt {
  font-family: var(--serif);
  font-size: 19px;
  margin-bottom: 5px;
}
.hero-card-item dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--on-dark-muted);
}

/* ── Trust bar ──────────────────────────────────────────────────────────── */

.trustbar { border-bottom: 1px solid var(--line); }
.trustbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 44px;
  padding-block: 24px;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text-soft);
}

/* ── Section scaffolding ────────────────────────────────────────────────── */

.section { padding-block: clamp(60px, 8vw, 100px); }
.section-tight { padding: 20px var(--gutter) clamp(60px, 8vw, 100px); }

#services { padding-top: clamp(64px, 9vw, 108px); padding-bottom: 40px; }

.section-head {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(28px, 4vw, 60px);
  align-items: end;
  margin-bottom: 56px;
}
.section-intro {
  max-width: 52ch;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-muted);
}

/* ── Services ───────────────────────────────────────────────────────────── */

/* 1px grid gap over a dark background draws the hairline rules between cards. */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 1px;
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
}

.service {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 230px;
  padding: 34px clamp(22px, 3vw, 32px) 30px;
  background: var(--paper);
  transition: background-color 0.18s ease;
}
.service:hover { background: var(--paper-warm); }

.service-num {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.service-title {
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.2;
}
.service-body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
}

/* ── Process ────────────────────────────────────────────────────────────── */

.panel-dark {
  background: var(--ink);
  color: var(--on-dark);
  padding: clamp(40px, 6vw, 76px) clamp(24px, 5vw, 64px);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(36px, 5vw, 64px);
}
.process-grid .section-title {
  font-size: clamp(30px, 4.2vw, 42px);
  line-height: 1.12;
  margin-bottom: 20px;
}

.panel-lede {
  max-width: 40ch;
  margin-bottom: 32px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--on-dark-muted);
}

.steps {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
.step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 20px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line-light);
}
.step:last-child { border-bottom: 0; }
.step-num {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1;
  color: rgba(247, 244, 238, 0.35);
}
.step-title {
  font-family: var(--serif);
  font-size: 24px;
  margin-bottom: 8px;
}
.step-body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--on-dark-muted);
}

/* ── About ──────────────────────────────────────────────────────────────── */

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}
.about-grid .section-title {
  font-size: clamp(30px, 4.3vw, 44px);
  margin-bottom: 26px;
}

.prose {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-body);
}
.prose + .prose { margin-top: 18px; }

.principles {
  display: flex;
  flex-direction: column;
  gap: 26px;
  margin: 0;
  padding-top: 32px;
  border-top: 2px solid var(--ink);
}
.principle dt { font-family: var(--serif); font-size: 21px; margin-bottom: 7px; }
.principle dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
}

/* ── Consultation ───────────────────────────────────────────────────────── */

.consult {
  background: var(--paper-shade);
  border-top: 1px solid rgba(21, 36, 47, 0.12);
}
.consult-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(40px, 5vw, 72px);
  align-items: start;
  padding-block: clamp(60px, 8vw, 96px);
}
.consult-grid .section-title {
  font-size: clamp(30px, 4.2vw, 42px);
  line-height: 1.12;
  margin-bottom: 22px;
}
.consult-lede {
  max-width: 42ch;
  margin-bottom: 34px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-muted);
}

.consult-email {
  padding-top: 24px;
  border-top: 1px solid rgba(21, 36, 47, 0.18);
}
.consult-email .eyebrow { margin-bottom: 8px; letter-spacing: 0.14em; }
.consult-email a {
  font-family: var(--serif);
  font-size: clamp(16px, 3.4vw, 20px);
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  word-break: break-word;
}

.consult-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: clamp(24px, 4vw, 40px);
  background: var(--paper);
  border: 1px solid var(--line-strong);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 22px;
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.consult-form input,
.consult-form select,
.consult-form textarea {
  padding: 13px 14px;
  background: var(--paper-warm);
  border: 1px solid var(--line-input);
  border-radius: var(--radius);
  font-size: 15px;
  outline: none;
  transition: border-color 0.16s ease;
}
.consult-form input:focus,
.consult-form select:focus,
.consult-form textarea:focus {
  border-color: var(--accent);
  outline: none;
}
.consult-form textarea { resize: vertical; font-family: var(--sans); }

/* Only flag an invalid field once JS has marked the form as submitted. */
.consult-form.was-validated input:invalid,
.consult-form.was-validated select:invalid,
.consult-form.was-validated textarea:invalid {
  border-color: #A6432F;
}

.consult-form button[disabled] { opacity: 0.65; cursor: progress; }

.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.form-status {
  margin: -8px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}
.form-status:empty { display: none; }
.form-status.is-ok { color: #2F6B54; }
.form-status.is-error { color: #A6432F; }

.disclaimer {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-faint);
}

/* ── Legal pages ────────────────────────────────────────────────────────── */

.legal {
  max-width: 760px;
  padding-top: clamp(48px, 7vw, 80px);
  padding-bottom: clamp(56px, 8vw, 96px);
}

.legal-title {
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.legal-meta {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line-strong);
}

.legal-lede {
  margin: 32px 0 8px;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-body);
}

.legal h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 3.2vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 48px 0 14px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.legal h3 {
  font-family: var(--serif);
  font-size: 20px;
  margin: 30px 0 10px;
}

.legal p,
.legal li {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-body);
}
.legal p + p { margin-top: 14px; }

.legal ul {
  margin: 14px 0 0;
  padding-left: 22px;
}
.legal li { margin-bottom: 9px; }
.legal li::marker { color: var(--accent); }

.legal a {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}
.legal a:hover { color: var(--accent); }

.legal strong { font-weight: 600; color: var(--text); }

/* Unfilled placeholders. Deliberately loud — these must not reach production
   unnoticed. Delete the surrounding <span class="todo"> once filled in. */
.todo {
  background: #FBE9C8;
  border-bottom: 2px solid var(--accent);
  padding: 1px 5px;
  font-size: 0.94em;
  color: #6B4A22;
}

.legal-back {
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--line-strong);
  font-size: 15px;
}
.legal-back a { border-bottom: 0; }

/* ── Footer ─────────────────────────────────────────────────────────────── */

.site-footer { background: var(--ink); color: var(--on-dark-body); }

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(32px, 4vw, 56px);
  padding-top: clamp(48px, 7vw, 64px);
  padding-bottom: 34px;
}

.footer-wordmark {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--on-dark);
  margin-bottom: 14px;
}
.footer-blurb {
  max-width: 38ch;
  font-size: 15px;
  line-height: 1.7;
  color: var(--on-dark-muted);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
}
.footer-col .eyebrow { margin: 0 0 -4px; letter-spacing: 0.14em; }
.footer-col a { color: var(--on-dark-body); word-break: break-word; }
.footer-col a:hover { color: var(--accent); }

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  padding-top: 22px;
  padding-bottom: 44px;
  border-top: 1px solid var(--line-light);
  font-size: 13px;
  color: var(--text-faint);
}

/* ── Motion preferences ─────────────────────────────────────────────────── */

@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;
  }
}

/* ── Print ──────────────────────────────────────────────────────────────── */

@media print {
  .site-header, .nav-toggle, .consult-form, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .hero, .panel-dark, .site-footer { background: #fff !important; color: #000 !important; }
}
