/* Windsor Court Properties, standalone legal pages (/privacy, /terms).
   Deliberately NOT part of the React bundle: carrier and crawler review tooling
   does not always run JavaScript, and a policy that renders client-side reads as
   a missing page. Brand tokens are copied from apps/_brand/tokens.css so these
   files stand alone; keep them in sync when the palette moves. The typefaces
   are the same self-hosted files as src/fonts.css. */

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('/fonts/dm-sans-latin.woff2') format('woff2');
}

:root {
  --surface: #F9F8F6;
  --surface-elevated: #FFFFFF;
  --cream: #FFFCF0;
  --on-surface: #1A1C1B;
  --muted: #4A4845;
  --secondary: #6B6662;
  --primary: #A33729;
  --primary-container: #C44F3D;
  --primary-light: #D4756A;
  --primary-subtle: #F6EEEC;
  --accent: #B8860B;
  --tertiary: #00685E;
  --outline: #80665E;
  --border: #E2DFD9;
  --border-subtle: #EBE9E4;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-settle: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-paper:
    0 0 0 1px rgba(128, 102, 94, 0.1),
    0 1px 2px rgba(74, 46, 34, 0.05),
    0 8px 20px -8px rgba(74, 46, 34, 0.1),
    0 28px 56px -32px rgba(74, 46, 34, 0.16);
  --rule: linear-gradient(90deg, transparent, rgba(128, 102, 94, 0.28) 12%, rgba(128, 102, 94, 0.28) 88%, transparent);
}

* {
  box-sizing: border-box;
  margin: 0;
}

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

body {
  background: var(--cream);
  /* Two very wide, very faint washes: a paper surface is never one value. */
  background-image:
    radial-gradient(ellipse 80% 50% at 15% 0%, rgba(184, 134, 11, 0.05), transparent 60%),
    radial-gradient(ellipse 70% 60% at 100% 30%, rgba(163, 55, 41, 0.035), transparent 62%);
  background-attachment: fixed;
  color: var(--on-surface);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.25s var(--ease-out-expo);
}

a:hover {
  color: var(--primary-container);
}

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 2px;
}

strong {
  color: var(--on-surface);
  font-weight: 600;
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--surface-elevated);
  border-radius: 4px;
  box-shadow: var(--shadow-paper);
  font-family: var(--sans);
  font-size: 0.9rem;
}

.skip:focus {
  top: 16px;
}

/* ─── Top bar: the same bar About uses ─── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 252, 240, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--on-surface);
  min-height: 44px;
}

.brand-mark {
  height: 30px;
  width: auto;
  display: block;
}

.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 4px;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.back-arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease-out-expo);
}

/* "Back to home" on a desk, "Home" on a phone: the full label plus the
   wordmark overran a 390px viewport by eight pixels. */
.back-short {
  display: none;
}

.back:hover {
  color: var(--primary);
}

.back:hover .back-arrow {
  transform: translateX(4px);
}

/* ─── Document header ─── */
main {
  padding: 56px 0 120px;
}

.section-label {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  font-variation-settings: 'opsz' 9;
}

.section-label::before {
  content: '';
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4.6vw, 3.3rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 18ch;
}

.effective {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--secondary);
}

.lede {
  margin-top: 28px;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  line-height: 1.55;
  color: var(--muted);
  max-width: 58ch;
  text-wrap: pretty;
}

/* ─── The two-column document ─── */
.doc-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 72px;
  margin-top: clamp(56px, 7vw, 88px);
  align-items: start;
}

/* ── Rail. Follows the reader on desktop; a jump list under the header on a
   phone. The active link is marked by the script; without it the list is
   simply a list of links, which is still a table of contents. ── */
.toc {
  position: sticky;
  top: 92px;
}

.toc-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 14px;
  font-variation-settings: 'opsz' 9;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  padding: 7px 0 7px 16px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-family: var(--sans);
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s var(--ease-out-expo), border-color 0.25s var(--ease-out-expo);
}

.toc a:hover {
  color: var(--on-surface);
}

.toc a.is-active {
  color: var(--primary);
  border-left-color: var(--primary);
}

/* ── Body ── */
.doc section + section {
  margin-top: clamp(44px, 5vw, 60px);
  padding-top: clamp(40px, 4.5vw, 52px);
}

.doc section + section::before {
  content: '';
  display: block;
  height: 1px;
  margin-bottom: clamp(40px, 4.5vw, 52px);
  margin-top: calc(-1 * clamp(40px, 4.5vw, 52px));
  background: var(--rule);
}

h2 {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.2vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.012em;
  margin-bottom: 16px;
  max-width: 24ch;
}

h3 {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
  font-variation-settings: 'opsz' 9;
}

.doc p,
.doc li {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 65ch;
}

.doc p + p {
  margin-top: 1.05em;
}

.doc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc li {
  position: relative;
  padding-left: 26px;
}

.doc li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tertiary);
}

.doc ul + p {
  margin-top: 1.05em;
}

/* ── The panel. A sheet of paper set into the page, with a hairline of the
   mark's oxblood along the top: the same treatment as the cards on About and
   the form on the landing page. It marks the passage that matters most. ── */
.sms-panel {
  position: relative;
  margin-top: 22px;
  padding: clamp(26px, 3.2vw, 38px) clamp(24px, 3vw, 38px) clamp(28px, 3.4vw, 40px);
  background: var(--surface-elevated);
  border-radius: 4px;
  box-shadow: var(--shadow-paper);
  overflow: hidden;
}

.sms-panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--primary);
}

.sms-panel > p + p {
  margin-top: 1.05em;
}

.callout {
  font-family: var(--serif);
  font-size: clamp(1.18rem, 1.9vw, 1.4rem);
  line-height: 1.4;
  letter-spacing: -0.008em;
  color: var(--on-surface);
  max-width: 34ch;
  text-wrap: balance;
  padding-left: 20px;
  border-left: 3px solid var(--primary);
}

.sms-grid {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 40px;
}

.sms-grid p {
  font-size: 1rem;
  line-height: 1.6;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 40px;
  max-width: 65ch;
}

.addr {
  font-style: normal;
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--muted);
}

.addr a {
  text-decoration: none;
  font-weight: 600;
}

.addr a:hover {
  text-decoration: underline;
}

/* ─── Footer: the landing page's, so the two read as one house ─── */
.site-footer {
  background: #211f1c;
  color: rgba(255, 252, 240, 0.85);
}

.footer-body {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  padding-top: 88px;
  padding-bottom: 64px;
}

.footer-mark {
  height: 52px;
  width: auto;
  margin-bottom: 24px;
}

.footer-brandline {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--cream);
  margin-bottom: 16px;
}

.footer-sub {
  max-width: 420px;
  font-size: 0.95rem;
  line-height: 1.65;
  color: rgba(255, 252, 240, 0.62);
}

.footer-contact h3 {
  font-family: var(--sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 252, 240, 0.5);
  margin-bottom: 12px;
}

.footer-contact-gap {
  margin-top: 32px;
}

.footer-contact a {
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 500;
  text-decoration: none;
  font-size: 1rem;
}

.footer-contact a:hover {
  color: var(--primary-light);
}

.footer-address {
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(255, 252, 240, 0.62);
}

.footer-row {
  border-top: 1px solid rgba(255, 252, 240, 0.14);
  padding-top: 28px;
  padding-bottom: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-row p {
  font-size: 0.82rem;
  color: rgba(255, 252, 240, 0.55);
}

.footer-legal {
  color: rgba(255, 252, 240, 0.78);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-legal:hover {
  color: var(--primary-light);
}

/* The page you are on is named, not linked to itself. */
.footer-legal.is-current {
  color: var(--cream);
  text-decoration: none;
}

.footer-wordmark {
  font-family: var(--mono);
  letter-spacing: 0.18em;
  font-size: 0.75rem;
}

/* ─── Motion: the site's staged arrival. Nothing travels more than 18px and
   nothing fires twice. Content is visible by default; the script opts it out
   behind .reveal-ready, so no JS means the finished page. ─── */
.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s var(--ease-settle) var(--reveal-delay, 0ms),
    transform 0.9s var(--ease-settle) var(--reveal-delay, 0ms);
}

.reveal-ready [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .doc-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* The rail becomes a jump list: pills that wrap, under the header. */
  .toc {
    position: static;
  }

  .toc ol {
    border-left: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .toc a {
    margin: 0;
    padding: 8px 14px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-left-width: 1px;
    border-radius: 9999px;
    background: var(--surface-elevated);
    font-size: 0.84rem;
  }

  .toc a.is-active {
    border-color: var(--primary);
    background: var(--primary-subtle);
  }

  .footer-body {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 56px;
    padding-bottom: 40px;
  }

  .footer-row {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 640px) {
  main {
    padding: 40px 0 80px;
  }

  .sms-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .back {
    font-size: 0.86rem;
  }
}

@media (max-width: 480px) {
  .brand-name {
    font-size: 0.95rem;
    white-space: nowrap;
  }

  .brand-mark {
    height: 24px;
  }

  .back-long {
    display: none;
  }

  .back-short {
    display: inline;
  }
}

/* ─── Reduced motion: everything in its finished place ─── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal-ready [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .back-arrow,
  .toc a,
  a {
    transition: none;
  }
}

/* ─── Print: black on white, no chrome, every link shows where it goes ─── */
@media print {
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .skip,
  .topbar,
  .toc,
  .site-footer,
  .back {
    display: none !important;
  }

  main {
    padding: 0;
  }

  .doc-grid {
    display: block;
    margin-top: 28pt;
  }

  .doc p,
  .doc li,
  .lede,
  .addr,
  .callout {
    color: #000;
    max-width: none;
  }

  .section-label,
  h3 {
    color: #000;
  }

  .sms-panel {
    box-shadow: none;
    border: 1px solid #000;
    border-radius: 0;
    break-inside: avoid;
  }

  .sms-panel::before {
    display: none;
  }

  .doc section {
    break-inside: avoid;
  }

  .doc section + section::before {
    background: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href^='http']::after,
  a[href^='mailto:']::after,
  a[href^='tel:']::after {
    content: ' (' attr(href) ')';
    font-family: var(--mono);
    font-size: 0.8em;
  }

  a[href^='/']::after {
    content: ' (windsorcourtcapital.com' attr(href) ')';
    font-family: var(--mono);
    font-size: 0.8em;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}
