/* =================================================================
   CoChalet Brand — Legal Brief Stylesheet
   Palette: Alpine Night #122335 · Aurora Cyan #00C2D1 · Summit Gold #D4E100 · Hearth Orange #FF8C42
   Type stack: Montserrat (body/UI) · JetBrains Mono (data) · Caveat (signatures/founder notes)
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Caveat:wght@500;600&display=swap');

:root {
  --alpine-night:   #122335;
  --alpine-deep:    #0A1628;
  --aurora-cyan:    #0A7A86;   /* Deep Aurora Teal — readable on white (WCAG AA 5.3:1). Darkened from original #00C2D1 for legal-brief use */
  --aurora-bright:  #00C2D1;   /* Retained original bright cyan for decorative-only uses (gradient strip, large heading underlines) */
  --summit-gold:    #D4E100;
  --hearth-orange:  #FF8C42;
  --ink:            #1a2030;
  --muted:          #5a6680;
  --rule:           #d5dae5;
  --paper:          #fafbfc;
  --panel:          #ffffff;
}

* { box-sizing: border-box; }

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------
   Layout — letter-paper feel
--------------------------------------- */
main, .container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 60px 80px;
  background: var(--panel);
  box-shadow: 0 0 40px rgba(18, 35, 53, 0.06);
}

/* --------------------------------------
   Letterhead / header band
--------------------------------------- */
body::before {
  content: "";
  display: block;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, var(--alpine-night) 0%, var(--aurora-bright) 45%, var(--summit-gold) 75%, var(--hearth-orange) 100%);
}

.letterhead {
  padding: 48px 60px 32px;
  max-width: 880px;
  margin: 0 auto;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.letterhead .logo {
  max-width: 180px;
  height: auto;
}

.letterhead .identity {
  text-align: right;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--alpine-night);
}

.letterhead .identity .name {
  font-weight: 600;
  color: var(--alpine-night);
  letter-spacing: 0.5px;
  font-size: 0.9rem;
}

.letterhead .identity .tagline {
  font-family: 'Caveat', cursive;
  color: var(--aurora-cyan);
  font-size: 1.3rem;
  font-weight: 500;
  margin-top: 2px;
  letter-spacing: 1px;
}

.letterhead .identity a {
  color: var(--alpine-night);
  text-decoration: none;
}

/* --------------------------------------
   Headings
--------------------------------------- */
h1, h2, h3, h4, h5 {
  font-family: 'Montserrat', sans-serif;
  color: var(--alpine-night);
  letter-spacing: -0.3px;
  margin-top: 2em;
  margin-bottom: 0.5em;
}

h1 {
  font-size: 2.0rem;
  font-weight: 700;
  letter-spacing: -0.8px;
  margin-top: 1.2em;
  padding-bottom: 0.4em;
  border-bottom: 3px solid var(--alpine-night);
  position: relative;
}
h1::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 80px; height: 3px;
  background: var(--aurora-cyan);
}

h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--alpine-night);
  margin-top: 2.5em;
  padding-left: 14px;
  border-left: 4px solid var(--aurora-cyan);
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--alpine-night);
  margin-top: 1.8em;
}

h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 1.4em;
}

/* --------------------------------------
   Paragraphs, lists
--------------------------------------- */
p { margin: 0.9em 0; }

strong {
  color: var(--alpine-night);
  font-weight: 600;
}

em { color: var(--ink); }

ul, ol {
  padding-left: 22px;
  margin: 0.8em 0;
}

li {
  margin-bottom: 0.4em;
}

li::marker { color: var(--aurora-cyan); }

/* --------------------------------------
   Links
--------------------------------------- */
a {
  color: var(--aurora-cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 194, 209, 0.3);
  transition: border-color 0.2s;
}
a:hover {
  border-bottom-color: var(--aurora-cyan);
}

/* --------------------------------------
   Code / mono
--------------------------------------- */
code, pre {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.85em;
}

code {
  background: rgba(0, 194, 209, 0.08);
  color: var(--alpine-night);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(0, 194, 209, 0.18);
}

pre {
  background: var(--alpine-deep);
  color: #cbd6e6;
  padding: 20px 24px;
  border-radius: 4px;
  border-left: 3px solid var(--aurora-cyan);
  overflow-x: auto;
  font-size: 0.8em;
  line-height: 1.6;
}

pre code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
}

/* --------------------------------------
   Blockquotes — pulls / callouts
--------------------------------------- */
blockquote {
  margin: 1.4em 0;
  padding: 18px 26px;
  background: rgba(18, 35, 53, 0.03);
  border-left: 4px solid var(--summit-gold);
  color: var(--ink);
  font-style: italic;
  font-size: 0.98em;
}

blockquote strong {
  font-style: normal;
  color: var(--alpine-night);
}

/* --------------------------------------
   Tables — data-dense, legal-brief quality
--------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 0.88em;
  background: var(--panel);
}

thead th {
  background: var(--alpine-night);
  color: #ffffff;
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
  font-size: 0.82em;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border: none;
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  line-height: 1.5;
}

tbody tr:nth-child(even) {
  background: rgba(18, 35, 53, 0.02);
}

tbody tr:hover {
  background: rgba(0, 194, 209, 0.04);
}

td:first-child,
th:first-child {
  font-weight: 500;
}

/* numeric alignment */
td[align="right"], th[align="right"] { text-align: right; }
td[align="center"], th[align="center"] { text-align: center; }

/* --------------------------------------
   Horizontal rule
--------------------------------------- */
hr {
  border: none;
  height: 1px;
  background: var(--rule);
  margin: 3em 0;
  position: relative;
}
hr::after {
  content: "◆";
  position: absolute;
  left: 50%;
  top: -10px;
  transform: translateX(-50%);
  background: var(--panel);
  color: var(--aurora-cyan);
  padding: 0 12px;
  font-size: 0.7em;
}

/* --------------------------------------
   Table of Contents
--------------------------------------- */
#TOC, nav#TOC {
  background: rgba(18, 35, 53, 0.03);
  border-left: 4px solid var(--alpine-night);
  padding: 20px 30px;
  margin: 2em 0;
  font-size: 0.9em;
}

#TOC ul, nav#TOC ul {
  list-style: none;
  padding-left: 16px;
}

#TOC > ul, nav#TOC > ul {
  padding-left: 0;
}

#TOC a {
  color: var(--alpine-night);
  border-bottom: none;
}

#TOC a:hover {
  color: var(--aurora-cyan);
  border-bottom: 1px solid var(--aurora-cyan);
}

/* --------------------------------------
   Priority tags (P0, P1, P2 styling via inline)
--------------------------------------- */
strong:contains("P0"), .p0 {
  background: var(--hearth-orange);
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 2px;
}

/* --------------------------------------
   Footer
--------------------------------------- */
.footer {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 60px 50px;
  text-align: center;
  border-top: 3px solid var(--alpine-night);
  position: relative;
  background: var(--panel);
}
.footer::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  width: 120px; height: 3px;
  transform: translateX(-50%);
  background: var(--aurora-cyan);
}

.footer .signature {
  font-family: 'Caveat', cursive;
  font-size: 1.8rem;
  color: var(--alpine-night);
  margin: 16px 0 6px;
}

.footer .meta {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

/* --------------------------------------
   Print styling — export-ready PDF
--------------------------------------- */
@media print {
  body { background: white; font-size: 11pt; }
  body::before { display: none; }
  .letterhead, main, .container, .footer {
    box-shadow: none;
    max-width: 100%;
    padding: 0 0 20px;
  }
  h1 { page-break-before: auto; page-break-after: avoid; }
  h2, h3 { page-break-after: avoid; }
  table { page-break-inside: avoid; }
  pre { page-break-inside: avoid; }
  blockquote { page-break-inside: avoid; }
  a { color: var(--alpine-night); border-bottom: none; }
}

/* --------------------------------------
   Confidentiality banner (optional)
--------------------------------------- */
.confidential {
  background: var(--alpine-night);
  color: var(--summit-gold);
  padding: 10px 60px;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
}
