/* --- CORE DESIGN TOKENS --- */
:root { 
    --bg: #ffffff; 
    --text-main: #1d1d1f; /* Deep Apple Black */
    --text-muted: #86868b; /* Apple Report Grey */
    --accent: #22c55e; /* Signature Green */
    --border-light: #d2d2d7; 
    --card-bg: #f5f5f7; /* Apple Card Surface */
    --modal-overlay: rgba(255, 255, 255, 0.98); 
}

/* --- GLOBAL RESETS & TYPOGRAPHY --- */
* { 
    box-sizing: border-box; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: 'Inter', sans-serif;
}

body { 
    background: var(--bg); 
    color: var(--text-main); 
    margin: 0; 
    overflow-x: hidden;
    line-height: 1.47059;
    letter-spacing: -0.015em;
}

/* --- LOGO STYLES --- */
.logo {
    font-weight: 900;
    font-size: 24px;
    letter-spacing: -0.05em;
    text-transform: lowercase;
    display: flex;
    align-items: baseline;
    color: #1d1d1f;
    text-decoration: none;
}

.logo-underscore {
    display: inline-block;
    width: 14px;
    height: 4px;
    background: var(--accent);
    margin-left: 2px;
}

/* --- TYPOGRAPHY HIERARCHY --- */
.report-header {
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-main);
    line-height: 1.05;
}

.report-subhed {
    color: var(--text-muted);
    font-size: 21px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.stat-number {
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--accent);
    line-height: 1;
}

/* --- TABLE OF CONTENTS LINKS --- */
.toc-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: color 0.2s ease;
}

.toc-link:hover { color: var(--accent); }

.toc-page {
    color: var(--text-muted);
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

/* --- APPLE-STYLE CARDS --- */
.report-card {
    background: var(--card-bg);
    border-radius: 28px;
    padding: 48px;
    border: 1px solid transparent;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.report-card:hover {
    background: #ffffff;
    border-color: var(--border-light);
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.04);
}

/* --- MODAL & FORM STYLES --- */
.modal-container {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--modal-overlay);
    z-index: 100;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-container.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 28px; /* Matched to card radius */
    padding: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.08); 
    position: relative;
}

.input-field {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--border-light);
    padding: 12px 0;
    margin-bottom: 24px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-field:focus { border-bottom-color: var(--text-main); }
.input-field::placeholder { color: var(--text-muted); }

.btn-primary {
    background: var(--text-main);
    color: #ffffff;
    width: 100%;
    padding: 16px;
    font-weight: 700;
    text-align: center;
    border: none;
    border-radius: 12px; /* Softer button edges */
    cursor: pointer;
    transition: background 0.2s ease;
}
.btn-primary:hover { background: #000000; }

.btn-close {
    position: absolute;
    top: 32px;
    right: 32px;
    background: #f5f5f7;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 101;
}
.btn-close:hover { 
    background: #e5e5e7;
    color: var(--text-main); 
}

/* --- STICKY NAV --- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.site-nav.scrolled {
    border-bottom-color: var(--border-light);
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}
.nav-items {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

/* NAV TRIGGER BUTTONS */
.nav-trigger {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}
.nav-trigger:hover, .nav-trigger.active {
    background: var(--card-bg);
}
.nav-trigger svg {
    transition: transform 0.2s ease;
    opacity: 0.5;
}
.nav-trigger.active svg {
    transform: rotate(180deg);
    opacity: 1;
}

/* MEGA MENU PANEL */
.mega-menu {
    position: fixed;
    top: 60px;
    left: 0; right: 0;
    background: rgba(255,255,255,0.97);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 16px 40px rgba(0,0,0,0.06);
    z-index: 49;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16,1,0.3,1);
}
.mega-menu.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.mega-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 32px;
    display: grid;
    gap: 48px;
}
.mega-inner.cols-2 { grid-template-columns: 1fr 1fr; }
.mega-inner.cols-3 { grid-template-columns: 1.4fr 1fr 1fr; }

.mega-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.mega-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.15s ease;
    margin: 0 -12px;
}
.mega-item:hover { background: var(--card-bg); }
.mega-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    transition: background 0.15s ease;
}
.mega-item:hover .mega-item-icon { background: #e5e5e7; }
.mega-item-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}
.mega-item-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Featured panel inside mega menu */
.mega-featured {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 28px;
}
.mega-featured-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}
.mega-featured-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}
.mega-featured-body {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}
.mega-stat {
    margin-top: 20px;
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--accent);
    line-height: 1;
}
.mega-stat span { font-size: 24px; }

/* Overlay backdrop */
.mega-backdrop {
    position: fixed;
    inset: 60px 0 0 0;
    background: rgba(0,0,0,0.06);
    z-index: 48;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}
.mega-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.nav-link {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
    cursor: pointer;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 20px;
    background: var(--card-bg);
    border: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.nav-link:hover { 
    background: #e5e5e7;
}

/* --- NAV TRIGGER ANCHOR RESET --- */
a.nav-trigger {
    text-decoration: none;
}

/* --- SEARCH MODAL STYLING --- */
.search-modal-container {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    z-index: 200;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

.search-modal-container.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.search-modal-inner {
    max-width: 680px;
    margin: 80px auto 0 auto;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transform: translateY(-15px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-modal-container.active .search-modal-inner {
    transform: translateY(0) scale(1);
}

.search-modal-header {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    gap: 16px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.search-modal-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

#searchInput {
    width: 100%;
    border: none;
    background: none;
    font-size: 17px;
    font-weight: 500;
    color: var(--text-main);
    outline: none;
}

#searchInput::placeholder {
    color: var(--text-muted);
}

.search-close-btn {
    background: var(--card-bg);
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-close-btn:hover {
    background: #e5e5e7;
    color: var(--text-main);
}

.search-modal-content {
    padding: 24px;
    max-height: 480px;
    overflow-y: auto;
}

.search-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Suggested searches grid */
.suggested-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.suggested-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 16px;
    background: var(--card-bg);
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
}

.suggested-item:hover {
    background: #ffffff;
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.03);
}

.suggested-icon {
    font-size: 20px;
    color: var(--accent);
    background: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.suggested-item:hover .suggested-icon {
    background-color: var(--card-bg);
}

.suggested-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 1px;
}

.suggested-desc {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
}

/* Results list styling */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-item {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-main);
    background: #ffffff;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.result-item:hover, .result-item.selected {
    background: var(--card-bg);
    border-color: var(--border-light);
}

.result-item.selected {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.05);
}

.result-category {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}

.result-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.result-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.result-desc mark {
    background: rgba(34, 197, 94, 0.15);
    color: var(--text-main);
    font-weight: 600;
    border-radius: 2px;
    padding: 0 2px;
}

.result-title mark {
    background: rgba(34, 197, 94, 0.2);
    color: var(--text-main);
    border-radius: 2px;
    padding: 0 2px;
}

.result-empty {
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* --- MOBILE MENU & RESPONSIVENESS --- */

/* Hide mobile trigger by default */
.mobile-menu-trigger {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
    z-index: 101;
}

.mobile-menu-drawer {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    z-index: 48;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    overflow-y: auto;
}

.mobile-menu-drawer.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu-inner {
    padding: 24px 24px 48px 24px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 60px);
    justify-content: space-between;
    box-sizing: border-box;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-menu-link {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    display: block;
}

.mobile-menu-section {
    border-bottom: 1px solid var(--border-light);
}

.mobile-menu-section-trigger {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    padding: 12px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.mobile-menu-section-trigger svg {
    transition: transform 0.2s ease;
    opacity: 0.5;
}

.mobile-menu-section.active .mobile-menu-section-trigger svg {
    transform: rotate(180deg);
    opacity: 1;
}

.mobile-menu-section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 16px;
}

.mobile-menu-section.active .mobile-menu-section-content {
    max-height: 500px;
    padding-bottom: 16px;
}

.mobile-menu-section-content a {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 0;
    transition: color 0.2s ease;
}

.mobile-menu-section-content a:hover {
    color: var(--accent);
}

.mobile-menu-footer {
    margin-top: 40px;
    padding-top: 24px;
}

.mobile-menu-trigger .icon-hamburger {
    display: block;
}
.mobile-menu-trigger .icon-close {
    display: none;
}
.mobile-menu-trigger.open .icon-hamburger {
    display: none;
}
.mobile-menu-trigger.open .icon-close {
    display: block;
}

/* Media query for screens <= 768px */
@media (max-width: 768px) {
    .nav-items, 
    #openModalBtn {
        display: none !important;
    }
    
    .mobile-menu-trigger {
        display: block;
    }
    
    .nav-inner {
        padding: 0 24px;
    }
}

/* Mobile adjustments for search modal to prevent horizontal spillover */
@media (max-width: 640px) {
    .search-modal-container {
        padding: 12px;
    }
    .search-modal-inner {
        margin: 20px auto 0 auto;
        width: 100%;
        max-width: 100%;
        border-radius: 16px;
    }
    .search-modal-header {
        padding: 14px 16px;
        gap: 10px;
    }
    .search-modal-content {
        padding: 16px;
    }
    .suggested-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .suggested-desc {
        max-width: 100%;
    }
}

/* --- ANIMATED HERO SECTION & SLIDER --- */
.hero-slider-container {
  position: relative;
  width: 100%;
  height: 360px;
  border-radius: 28px;
  overflow: hidden;
  background-color: transparent;
  transition: background-color 0.8s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Add a subtle shadow when a solid background is active */
.hero-slider-container.has-bg {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  --slider-padding: 0px;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.hero-slide.leaving {
  opacity: 0;
}

/* Theme setups */
.hero-slide[data-theme="light"] {
  --slider-padding: 0px;
}

.hero-slide[data-theme="dark"] {
  --slider-padding: 48px;
}

/* Image Background with Adjustable Overlay */
.hero-slide[data-bg="image"] {
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  position: relative;
}

.hero-slide[data-bg="image"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--overlay-color, var(--accent));
  opacity: var(--overlay-opacity, 0.6);
  z-index: 1;
  transition: opacity 0.8s ease, background-color 0.8s ease;
}

@keyframes showTopText {
  0% { transform: translate3d(0, 100%, 0); }
  40%, 60% { transform: translate3d(0, 50%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@keyframes showBottomText {
  0% { transform: translate3d(0, -100%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.animated-title {
  color: var(--accent);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  height: 100%;
  position: relative;
  width: 100%;
  --line-thickness: 6px;
  --gap: 12px;
  z-index: 2; /* Sits above any background overlays */
}

.animated-title::after {
  content: '';
  position: absolute;
  left: var(--slider-padding);
  right: var(--slider-padding);
  top: 50%;
  transform: translateY(-50%);
  height: var(--line-thickness);
  background-color: var(--accent);
  z-index: 10;
  transition: background-color 0.8s ease, left 0.8s ease, right 0.8s ease;
}

.animated-title > div {
  overflow: hidden;
  position: absolute;
  left: var(--slider-padding);
  right: var(--slider-padding);
  transition: left 0.8s ease, right 0.8s ease;
}

.animated-title > div div {
  font-size: clamp(1.6rem, 4.2vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  padding: 8px 0;
  position: absolute;
  width: 100%;
}

.animated-title > div div span {
  display: block;
  white-space: nowrap;
}

.animated-title > div.text-top {
  height: calc(50% - var(--gap));
  top: 0;
}

.animated-title > div.text-top div {
  bottom: 0;
  transform: translate3d(0, 100%, 0);
}

.hero-slide.active .animated-title > div.text-top div {
  animation: showTopText 2s cubic-bezier(0.25, 1, 0.5, 1);
  animation-delay: 0.8s;
  animation-fill-mode: forwards;
}

.animated-title > div.text-top div span:first-child,
.animated-title > div.text-top div span:last-child {
  color: var(--text-main);
  transition: color 0.8s ease;
}

.animated-title > div.text-bottom {
  height: calc(50% - var(--gap));
  bottom: 0;
}

.animated-title > div.text-bottom div {
  top: 0;
  transform: translate3d(0, -100%, 0);
  white-space: nowrap;
}

.hero-slide.active .animated-title > div.text-bottom div {
  animation: showBottomText 2s cubic-bezier(0.25, 1, 0.5, 1);
  animation-delay: 2.2s;
  animation-fill-mode: forwards;
}

/* Theme dark colors override */
.hero-slide[data-theme="dark"] .animated-title {
  color: #ffffff;
}

.hero-slide[data-theme="dark"] .animated-title::after {
  background-color: #ffffff;
}

.hero-slide[data-theme="dark"] .animated-title > div.text-top div span:first-child,
.hero-slide[data-theme="dark"] .animated-title > div.text-top div span:last-child {
  color: rgba(255, 255, 255, 0.95);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .hero-slider-container {
    height: 180px;
    border-radius: 16px;
  }
  .hero-slide[data-theme="dark"] {
    --slider-padding: 24px;
  }
  .animated-title {
    --line-thickness: 4px;
    --gap: 8px;
  }
  .animated-title > div div {
    font-size: clamp(1.1rem, 5vw, 1.6rem);
    padding: 4px 0;
  }
}




