/* ============================================
   CaML — Warm Desert Light Theme
   Cream, terracotta, earth tones
   ============================================ */

:root {
    --bg-cream:      #f5efe6;
    --bg-warm:       #ede4d8;
    --bg-dark:       #3b2a1a;
    --bg-dark-brown: #2c1e12;
    --bg-card:       #ffffff;
    --bg-card-warm:  rgba(255,255,255,0.85);

    --sand:          #e2d5c1;
    --sandstone:     #c17346;
    --terracotta:    #b85a2b;
    --terracotta-light: #d4854f;
    --brown-dark:    #4a2e18;
    --brown-text:    #5c3a20;
    --sage:          #7aab94;

    --text-dark:     #2c1e12;
    --text-body:     #5c4a38;
    --text-light:    #8a7a68;
    --text-on-dark:  #e2d5c1;
    --text-on-dark-secondary: #a09484;

    --border:        #d9cfc2;
    --border-dark:   #4a3828;

    --font-heading:  'Cormorant Garamond', Georgia, serif;
    --font-body:     'Inter', -apple-system, sans-serif;

    --max-width:     1100px;
    --section-pad:   100px;
}

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

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

body {
    font-family: var(--font-body);
    background: var(--bg-cream);
    color: var(--text-body);
    line-height: 1.7;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

a:visited {
    color: inherit;
}

/* ---- Navigation ---- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 40px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(245, 239, 230, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(217, 207, 194, 0.6);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.nav-brand img {
    height: 32px;
    width: 32px;
    object-fit: contain;
    border-radius: 6px;
}

.nav-brand span {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--brown-dark);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 24px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--terracotta);
}

.nav-cta {
    background: var(--terracotta);
    color: #fff !important;
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: 500 !important;
    transition: background 0.3s !important;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-cta:hover {
    background: var(--terracotta-light) !important;
}

/* ---- Mobile Nav Toggle ---- */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--brown-dark);
    margin: 5px 0;
    transition: 0.3s;
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 14px 32px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-decoration: none;
    border-radius: 40px;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--terracotta);
    color: #fff;
}

.btn-primary:hover {
    background: var(--terracotta-light);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--brown-dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--terracotta);
    color: var(--terracotta);
}

/* On dark backgrounds */
.bg-dark .btn-secondary {
    color: var(--sand);
    border-color: var(--border-dark);
}

.bg-dark .btn-secondary:hover {
    border-color: var(--sandstone);
    color: var(--sandstone);
}

/* ---- Section Base ---- */
section {
    padding: var(--section-pad) 40px;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--terracotta);
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 600;
    color: var(--brown-dark);
    line-height: 1.2;
    margin-bottom: 20px;
}

.section-desc {
    font-size: 16px;
    color: var(--text-body);
    max-width: 600px;
    line-height: 1.8;
}

/* ---- Backgrounds ---- */
.bg-cream { background: var(--bg-cream); }
.bg-warm { background: var(--bg-warm); }
.bg-dark {
    background: var(--bg-dark);
    color: var(--text-on-dark);
}
.bg-dark .section-title { color: var(--sand); }
.bg-dark .section-desc { color: var(--text-on-dark-secondary); }

/* Legacy classes used by inner pages — mapped to light theme */
.bg-deep { background: var(--bg-cream); }
.bg-primary { background: var(--bg-cream); }
.bg-secondary { background: var(--bg-warm); }

/* ---- Page Header (for inner pages) ---- */
.page-header,
.hero-section {
    padding: 140px 40px 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section .page-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 70%;
    opacity: 0.35;
    pointer-events: none;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.page-header .section-title,
.hero-section .section-title {
    margin-bottom: 12px;
}

.page-header .section-desc,
.hero-section .section-desc {
    margin: 0 auto;
    max-width: 640px;
}

/* Inner page content headings */
section h2 {
    font-family: var(--font-heading);
    font-size: clamp(28px, 3.5vw, 40px);
    font-weight: 600;
    color: var(--brown-dark);
    line-height: 1.2;
    margin-bottom: 20px;
}

section p {
    color: var(--text-body);
}

section a {
    color: var(--terracotta);
}

section a:hover {
    color: var(--terracotta-light);
}

/* ---- Content Links ---- */
a.content-link {
    color: var(--terracotta);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

a.content-link:hover {
    border-color: var(--terracotta);
}

/* ---- Cards (shared) ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    transition: border-color 0.3s, transform 0.3s;
}

.card:hover {
    border-color: var(--terracotta-light);
}

/* ---- Timeline / Results ---- */
.timeline-entry {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 36px 40px;
    margin-bottom: 24px;
    transition: border-color 0.3s;
}

.timeline-entry:hover {
    border-color: var(--terracotta-light);
}

.timeline-date {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--terracotta);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.timeline-entry h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 600;
    color: var(--brown-dark);
    margin-bottom: 12px;
    line-height: 1.3;
}

.timeline-entry p {
    font-size: 15px;
    color: var(--text-body);
    line-height: 1.8;
}

.timeline-entry a {
    color: var(--terracotta);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

.timeline-entry a:hover {
    border-color: var(--terracotta);
}

.timeline-entry a.btn-primary {
    color: #fff;
    border-bottom: none;
}

/* Timeline entry with image */
.timeline-entry.has-img {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
    align-items: start;
}

.timeline-entry .entry-img {
    width: 100%;
    margin-top: 4px;
}

.timeline-entry .entry-img + .entry-img {
    margin-top: 12px;
}

.timeline-entry .entry-images {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-entry .entry-images img {
    width: 100%;
}

@media (max-width: 768px) {
    .timeline-entry.has-img {
        grid-template-columns: 1fr;
    }

    .timeline-entry .entry-images {
        order: -1;
    }
}

/* ---- Team Grid ---- */
.team-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 48px;
}

.team-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 36px;
    transition: border-color 0.3s;
}

.team-card:hover {
    border-color: var(--terracotta-light);
}

.team-card .role {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--terracotta);
    margin-bottom: 8px;
}

.team-card h3 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 600;
    color: var(--brown-dark);
    margin-bottom: 12px;
}

.team-card p {
    font-size: 14px;
    color: var(--text-body);
    line-height: 1.8;
}

.team-card a {
    color: var(--terracotta);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.team-card a:hover {
    border-bottom: 1px solid var(--terracotta);
}

/* ---- Endorsement Quote ---- */
.endorsement {
    border-left: 3px solid var(--terracotta);
    padding: 24px 32px;
    margin-bottom: 32px;
    background: var(--bg-card);
    border-radius: 0 12px 12px 0;
}

.endorsement blockquote {
    font-family: var(--font-heading);
    font-size: 18px;
    font-style: italic;
    color: var(--brown-dark);
    line-height: 1.7;
    margin-bottom: 16px;
}

.endorsement cite {
    font-family: var(--font-body);
    font-size: 13px;
    font-style: normal;
    font-weight: 500;
    color: var(--terracotta);
    letter-spacing: 0.3px;
}

/* ---- Principles ---- */
.principle {
    padding: 32px 0;
    border-bottom: 1px solid var(--border);
}

.principle:last-child {
    border-bottom: none;
}

.principle h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 600;
    color: var(--brown-dark);
    margin-bottom: 12px;
}

.principle p {
    font-size: 15px;
    color: var(--text-body);
    line-height: 1.8;
    max-width: 720px;
}

/* ---- CTA Banner (reusable) ---- */
.cta-banner {
    text-align: center;
    padding: 80px 40px;
    position: relative;
}

.cta-banner h2 {
    font-family: var(--font-heading);
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 600;
    color: var(--brown-dark);
    margin-bottom: 16px;
}

.cta-banner p {
    font-size: 16px;
    color: var(--text-body);
    max-width: 500px;
    margin: 0 auto 32px;
    line-height: 1.8;
}

/* ---- Footer ---- */
.footer-section {
    border-top: 1px solid var(--border);
    background: var(--bg-cream);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.footer-brand h3 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 600;
    color: var(--brown-dark);
    margin-bottom: 12px;
}

.footer-brand h3 img {
    height: 28px;
    width: 28px;
    vertical-align: middle;
    margin-right: 8px;
    border-radius: 4px;
}

.footer-brand p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 24px;
}

.footer-links h4 {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 16px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-body);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--terracotta);
}

.footer-bottom {
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
}

.footer-legal {
    margin-top: 16px;
    font-size: 11px;
    color: var(--text-light);
    opacity: 0.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ---- Scroll Reveal ---- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    :root {
        --section-pad: 64px;
    }

    nav {
        padding: 0 20px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-cream);
        flex-direction: column;
        padding: 24px;
        gap: 16px;
        border-bottom: 1px solid var(--border);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    section {
        padding: var(--section-pad) 20px;
    }

    .page-header {
        padding: 100px 20px 40px;
    }

    .team-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* ---- Carousels (research + home) ---- */
html { scroll-behavior: smooth; }

.carousel-section {
    scroll-margin-top: 90px;
    padding: 70px 0 60px;
}

.carousel-wrap {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 40px;
}

.carousel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.carousel-head h2 {
    font-family: var(--font-heading);
    font-size: clamp(26px, 3.4vw, 38px);
    font-weight: 600;
    color: var(--brown-dark);
}

.carousel-nav {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.carousel-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--brown-dark);
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, border-color 0.25s, color 0.25s, opacity 0.25s;
}

.carousel-btn:hover:not(:disabled) {
    background: var(--terracotta);
    border-color: var(--terracotta);
    color: #fff;
}

.carousel-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.carousel-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 4px 4px 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-card {
    flex: 0 0 calc((100% - 48px) / 3);
    scroll-snap-align: start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.carousel-fig {
    height: 200px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.carousel-fig img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-fig.chart {
    padding: 12px;
}

.carousel-fig.chart img {
    object-fit: contain;
}

.carousel-body {
    padding: 22px 24px 26px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.carousel-eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--terracotta);
    font-weight: 600;
    margin-bottom: 10px;
}

.carousel-body h3 {
    font-family: var(--font-heading);
    font-size: 21px;
    font-weight: 600;
    color: var(--brown-dark);
    line-height: 1.25;
    margin-bottom: 10px;
}

.carousel-body p {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.carousel-note {
    font-size: 12px;
    opacity: 0.7;
}

.carousel-body .btn {
    margin-top: auto;
}

.carousel-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 22px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    border: none;
    padding: 0;
    background: var(--border);
    cursor: pointer;
    transition: background 0.25s, width 0.25s;
}

.carousel-dot.active {
    background: var(--terracotta);
    width: 24px;
}

@media (max-width: 1024px) {
    .carousel-card {
        flex-basis: calc((100% - 24px) / 2);
    }
}

@media (max-width: 640px) {
    .carousel-wrap {
        padding: 0 20px;
    }
    .carousel-card {
        flex-basis: 100%;
    }
}
