@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,300;0,400;0,600;0,700;0,900;1,300;1,600&family=Mulish:wght@300;400;500;600;700&display=swap');

:root {
    --ivory:    #FDFAF4;
    --cream:    #F5F0E4;
    --parchment:#EDE6D3;
    --sand:     #D9CEBC;
    --teal:     #1A6B5A;
    --teal-mid: #2A8A72;
    --teal-light:#3DAA8C;
    --teal-pale:#D4EDE7;
    --teal-mist:#EBF6F3;
    --ink:      #1C1C1C;
    --body:     #3D3A34;
    --muted:    #7A7265;
    --light:    #A89E90;
    --border:   #DDD5C4;
    --orange:   #C06B28;
    --nav-w:    260px;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }

body {
    font-family: 'Mulish', sans-serif;
    background: var(--ivory);
    color: var(--body);
    line-height: 1.75;
    display: flex;
    min-height: 100vh;
}

/* ═══════════════════════════════
   LEFT SIDEBAR NAV
═══════════════════════════════ */
.side-nav {
    width: var(--nav-w);
    min-height: 100vh;
    background: var(--teal);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    padding: 0;
}

.side-brand {
    padding: 40px 28px 32px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.side-brand-name {
    font-family: 'Fraunces', serif;
    font-size: 1.45rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -0.3px;
    display: block;
    text-decoration: none;
}

.side-brand-tag {
    font-size: 0.68rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    margin-top: 6px;
    display: block;
    font-weight: 600;
}

.side-links {
    list-style: none;
    padding: 24px 0;
    flex: 1;
}

.side-links li { margin: 2px 16px; }

.side-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 11px 16px;
    border-radius: 10px;
    transition: all 0.2s;
    letter-spacing: 0.2px;
}
.side-links a .nav-icon { font-size: 1rem; }
.side-links a:hover, .side-links a.active {
    background: rgba(255,255,255,0.14);
    color: #fff;
}
.side-links a.active { background: rgba(255,255,255,0.18); }

.side-footer {
    padding: 24px 28px;
    border-top: 1px solid rgba(255,255,255,0.12);
    font-size: 0.72rem;
    color: rgba(255,255,255,0.4);
    line-height: 1.6;
}

.side-footer a { color: rgba(255,255,255,0.6); text-decoration: none; }

/* ═══════════════════════════════
   MAIN CONTENT AREA
═══════════════════════════════ */
.main-content {
    margin-left: var(--nav-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ═══════════════════════════════
   HERO
═══════════════════════════════ */
.hero {
    background: var(--cream);
    padding: 80px 72px 72px;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: 'CHAIN';
    position: absolute;
    right: -20px; bottom: -40px;
    font-family: 'Fraunces', serif;
    font-size: 14rem;
    font-weight: 900;
    color: rgba(26,107,90,0.04);
    line-height: 1;
    pointer-events: none;
    user-select: none;
}
.hero-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.hero-kicker::before {
    content: '';
    display: block;
    width: 28px; height: 2px;
    background: var(--teal);
}
.hero h1 {
    font-family: 'Fraunces', serif;
    font-size: clamp(3rem, 5vw, 5.5rem);
    font-weight: 900;
    color: var(--ink);
    line-height: 1.0;
    letter-spacing: -2px;
    margin-bottom: 24px;
    max-width: 700px;
}
.hero h1 em { font-style: italic; color: var(--teal); }
.hero-sub {
    font-size: 1.05rem;
    color: var(--muted);
    max-width: 560px;
    line-height: 1.82;
    font-weight: 300;
    margin-bottom: 40px;
}
.hero-stats {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    background: var(--ivory);
    max-width: 640px;
}
.h-stat {
    padding: 20px 28px;
    border-right: 1px solid var(--border);
    flex: 1;
}
.h-stat:last-child { border-right: none; }
.h-stat-n {
    font-family: 'Fraunces', serif;
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--teal);
    display: block;
    line-height: 1;
    margin-bottom: 4px;
}
.h-stat-l {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ═══════════════════════════════
   CONTENT WRAPPER
═══════════════════════════════ */
.content {
    padding: 64px 72px;
    flex: 1;
}

/* ═══════════════════════════════
   PAGE HEROES (inner pages)
═══════════════════════════════ */
.page-hero {
    background: var(--cream);
    padding: 72px 72px 56px;
    border-bottom: 1px solid var(--border);
}
.chapter-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--teal-mist);
    border: 1px solid var(--teal-pale);
    color: var(--teal);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
}
.page-hero h1 {
    font-family: 'Fraunces', serif;
    font-size: clamp(2.2rem, 4vw, 3.6rem);
    font-weight: 900;
    color: var(--ink);
    line-height: 1.08;
    letter-spacing: -1px;
    margin-bottom: 16px;
    max-width: 700px;
}
.page-hero h1 em { font-style: italic; color: var(--teal); }
.page-hero p {
    font-size: 1rem;
    color: var(--muted);
    max-width: 580px;
    line-height: 1.82;
    font-weight: 300;
}

/* BREADCRUMB */
.breadcrumb {
    font-size: 0.78rem;
    color: var(--light);
    margin-bottom: 36px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.breadcrumb a { color: var(--teal); text-decoration: none; }

/* SECTION LABELS */
.eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.eyebrow::before { content:''; width:16px; height:2px; background:var(--teal); }

/* HEADINGS */
.sect-h {
    font-family: 'Fraunces', serif;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.1;
    margin-bottom: 32px;
    letter-spacing: -0.5px;
}
.sect-h em { font-style: italic; color: var(--teal); }

h2.ch {
    font-family: 'Fraunces', serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--parchment);
}

h3.sh {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--teal);
    margin: 24px 0 10px;
}

/* PANELS */
.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 20px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}
.panel p { font-size: 0.96rem; line-height: 1.85; margin-bottom: 14px; color: var(--body); }
.panel p:last-child { margin-bottom: 0; }

/* GRIDS */
.two-col { display: grid; grid-template-columns:1fr 1fr; gap:20px; margin-bottom:20px; }
.three-col { display: grid; grid-template-columns:repeat(3,1fr); gap:20px; margin-bottom:20px; }

/* TOPIC CARDS */
.t-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.t-card:hover { transform: translateY(-4px); box-shadow: 0 10px 32px rgba(0,0,0,0.1); }
.t-card-img {
    width: 100%; height: 180px;
    object-fit: cover; display: block;
    background: var(--parchment);
}
.t-card-body {
    padding: 22px 24px;
    border-top: 3px solid var(--teal);
}
.t-num {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--light);
    margin-bottom: 7px;
}
.t-card-body h3 {
    font-family: 'Fraunces', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 7px;
}
.t-card-body p { font-size: 0.84rem; color: var(--muted); line-height: 1.6; }
.t-arrow {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--teal);
    letter-spacing: 0.3px;
}

/* CALLOUT */
.callout {
    background: var(--teal-mist);
    border: 1px solid var(--teal-pale);
    border-left: 4px solid var(--teal);
    border-radius: 8px;
    padding: 22px 26px;
    margin: 20px 0;
}
.callout-lbl {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 7px;
}
.callout p { font-size: 0.93rem; color: var(--body); line-height: 1.78; margin: 0; }

/* LISTS */
ul.bl, ol.bl { list-style:none; padding:0; margin:14px 0; }
ul.bl li, ol.bl li {
    padding: 10px 0 10px 28px;
    border-bottom: 1px solid var(--border);
    font-size: 0.93rem; color: var(--body);
    position: relative; line-height: 1.7;
}
ul.bl li:last-child, ol.bl li:last-child { border-bottom:none; }
ul.bl li::before {
    content:''; position:absolute; left:0; top:18px;
    width:10px; height:10px; border-radius:50%; background:var(--teal-light);
}
ol.bl { counter-reset:olb; }
ol.bl li { counter-increment:olb; }
ol.bl li::before {
    content: counter(olb);
    position:absolute; left:0; top:10px;
    width:20px; height:20px;
    background:var(--teal); color:#fff;
    font-size:0.68rem; font-weight:700;
    border-radius:50%; line-height:20px; text-align:center;
}

/* TABLES */
.tw { overflow-x:auto; border:1px solid var(--border); border-radius:10px; margin:20px 0; box-shadow:0 1px 6px rgba(0,0,0,0.04); }
table { width:100%; border-collapse:collapse; font-size:0.88rem; }
table caption {
    font-family:'Fraunces',serif; font-size:0.95rem; font-weight:700;
    color:var(--ink); text-align:left;
    padding:14px 20px 10px; background:var(--cream);
    border-bottom:1px solid var(--border);
}
thead th {
    background:var(--teal); color:#fff;
    padding:12px 20px; text-align:left;
    font-size:0.76rem; letter-spacing:0.8px; text-transform:uppercase; font-weight:700;
}
tbody td { padding:11px 20px; border-bottom:1px solid var(--border); color:var(--body); vertical-align:top; }
tbody tr:last-child td { border-bottom:none; }
tbody tr:nth-child(even) { background:var(--cream); }
tbody tr:hover { background:var(--teal-mist); }

/* IMAGES */
.img-full {
    width:100%; border-radius:10px; display:block;
    object-fit:cover; aspect-ratio:16/8;
    border:1px solid var(--border); margin:20px 0;
    background:var(--parchment);
}
.img-cap {
    font-size:0.76rem; color:var(--muted);
    font-style:italic; text-align:center;
    margin-top:-12px; margin-bottom:20px;
}
.img-pair { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:20px 0; }
.img-pair img {
    width:100%; aspect-ratio:4/3; object-fit:cover; display:block;
    border-radius:8px; border:1px solid var(--border);
    background:var(--parchment);
}
.img-pair figcaption { font-size:0.73rem; color:var(--muted); font-style:italic; margin-top:5px; text-align:center; }

/* EXT ROWS */
.ext-row {
    display:flex; align-items:stretch;
    border:1px solid var(--border); border-radius:10px;
    overflow:hidden; margin-bottom:14px;
    transition: border-color 0.2s;
    background:#fff;
}
.ext-row:hover { border-color:var(--teal); }
.ext-num {
    font-family:'Fraunces',serif; font-size:1.8rem; font-weight:900;
    color:var(--teal); padding:20px 22px;
    border-right:1px solid var(--border);
    display:flex; align-items:center; justify-content:center;
    background:var(--teal-mist); min-width:68px;
}
.ext-body { padding:18px 22px; flex:1; }
.ext-body h4 { font-family:'Fraunces',serif; font-size:1.05rem; font-weight:700; color:var(--ink); margin-bottom:5px; }
.ext-body p { font-size:0.84rem; color:var(--muted); line-height:1.6; margin-bottom:8px; }
.ext-url { font-size:0.78rem; color:var(--teal); text-decoration:none; }
.ext-url:hover { text-decoration:underline; }
.visit-btn {
    display:inline-flex; align-items:center; gap:6px;
    background:var(--teal); color:#fff;
    padding:7px 16px; border-radius:6px;
    font-size:0.78rem; font-weight:700;
    text-decoration:none; margin-top:8px;
    transition:background 0.2s;
}
.visit-btn:hover { background:var(--teal-mid); }

/* NAV FWD */
.nav-fwd {
    display:flex; align-items:center; justify-content:space-between;
    background:var(--cream); border:1px solid var(--border); border-radius:10px;
    padding:22px 28px; text-decoration:none; color:inherit;
    margin-top:40px; transition:border-color 0.2s;
}
.nav-fwd:hover { border-color:var(--teal); }
.nav-fwd-lbl { font-size:0.7rem; font-weight:700; letter-spacing:2px; text-transform:uppercase; color:var(--muted); margin-bottom:3px; }
.nav-fwd-title { font-family:'Fraunces',serif; font-size:1.3rem; font-weight:700; color:var(--ink); }
.nav-fwd-arr {
    width:40px; height:40px; border-radius:50%;
    background:var(--teal); color:#fff;
    display:flex; align-items:center; justify-content:center;
    font-size:1rem; flex-shrink:0;
}

/* REFS */
ol.rl { counter-reset:r; list-style:none; padding:0; }
.rl li {
    counter-increment:r;
    padding:13px 0 13px 44px; border-bottom:1px solid var(--border);
    font-size:0.87rem; line-height:1.75; color:var(--body); position:relative;
}
.rl li:last-child { border-bottom:none; }
.rl li::before {
    content:counter(r);
    position:absolute; left:0; top:13px;
    width:24px; height:24px; background:var(--teal); color:#fff;
    font-size:0.68rem; font-weight:700; border-radius:50%; line-height:24px; text-align:center;
}
.rl a { color:var(--teal); }
.rl a:hover { text-decoration:underline; }

/* TOC PILLS */
.toc-pills { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:28px; }
.toc-pills a {
    background:var(--cream); border:1px solid var(--border);
    color:var(--body); padding:7px 16px; border-radius:6px;
    font-size:0.8rem; font-weight:600; text-decoration:none;
    transition:all 0.2s;
}
.toc-pills a:hover { background:var(--teal); color:#fff; border-color:var(--teal); }

/* CONTACT */
.contact-bar {
    background:var(--teal); border-radius:12px;
    padding:36px 40px; color:#fff;
    display:grid; grid-template-columns:1fr 1fr; gap:32px;
}
.contact-bar h3 { font-family:'Fraunces',serif; font-size:1.1rem; color:#fff; margin-bottom:16px; }
.ci { display:flex; gap:10px; margin-bottom:9px; font-size:0.88rem; }
.ci-l { font-size:0.68rem; font-weight:700; letter-spacing:1.5px; text-transform:uppercase; color:rgba(255,255,255,0.55); min-width:86px; padding-top:2px; }
.ci-v { color:rgba(255,255,255,0.9); }
.ci-v a { color:rgba(255,255,255,0.8); text-decoration:none; }
.ci-v a:hover { color:#fff; }

.bmark { scroll-margin-top:24px; }

/* FOOTER */
footer {
    background:var(--parchment);
    border-top:1px solid var(--border);
    padding:20px 72px;
    font-size:0.8rem; color:var(--muted);
    display:flex; justify-content:space-between; align-items:center;
}
footer a { color:var(--teal); text-decoration:none; }

/* RESPONSIVE */
@media (max-width:960px) {
    body { display:block; }
    .side-nav { position:relative; width:100%; min-height:auto; flex-direction:row; flex-wrap:wrap; }
    .main-content { margin-left:0; }
    .two-col,.three-col,.img-pair,.contact-bar { grid-template-columns:1fr; }
    .content,.hero,.page-hero { padding: 40px 24px; }
    footer { padding:16px 24px; flex-direction:column; gap:6px; }
}
