/* ==========================================================================
   ZYL Law — Homepage design system (shared by index.php / cnindex.php)
   Loaded after style2.css; scoped under body.home-page
   ========================================================================== */

:root {
    --zyl-navy: #16243d;
    --zyl-navy-deep: #0e1828;
    --zyl-red: #a83232;
    --zyl-red-dark: #8c2727;
    --zyl-gold: #c9a227;
    --zyl-ink: #1a202c;
    --zyl-ink-soft: #4a5568;
    --zyl-paper: #f7f5f1;
    --zyl-white: #ffffff;
    --zyl-line: #e2e8f0;

    --font-serif: Georgia, 'Times New Roman', 'Songti SC', 'Noto Serif SC', 'SimSun', serif;
    --font-sans: 'Roboto', 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;

    --space-section: clamp(3.5rem, 2.5rem + 4vw, 6.5rem);
    --radius: 10px;
    --shadow-sm: 0 1px 3px rgba(22, 36, 61, 0.08);
    --shadow-md: 0 10px 30px rgba(22, 36, 61, 0.12);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

body.home-page {
    padding: 0;
    margin: 0;
    background-color: var(--zyl-paper);
    font-family: var(--font-sans);
    color: var(--zyl-ink);
}

body.home-page main {
    padding: 0;
}

body.home-page #header {
    margin: 0;
}

.home-section {
    padding: var(--space-section) 20px;
}

.home-shell {
    max-width: 1140px;
    margin: 0 auto;
}

/* ---------- Section headings ---------- */
.home-kicker {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--zyl-red);
    margin-bottom: 12px;
}

.home-h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem);
    font-weight: 700;
    color: var(--zyl-navy);
    margin: 0 0 14px;
    line-height: 1.25;
}

.home-section-intro {
    max-width: 640px;
    color: var(--zyl-ink-soft);
    font-size: 17px;
    line-height: 1.7;
    margin: 0 0 40px;
}

/* ---------- Hero ---------- */
.hero {
    background:
        radial-gradient(1100px 500px at 85% -10%, rgba(168, 50, 50, 0.25), transparent 60%),
        radial-gradient(900px 600px at -10% 110%, rgba(201, 162, 39, 0.12), transparent 55%),
        linear-gradient(160deg, var(--zyl-navy-deep) 0%, var(--zyl-navy) 60%, #1d3050 100%);
    color: #f1f4f9;
    padding: clamp(4rem, 3rem + 5vw, 7.5rem) 20px;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '§';
    position: absolute;
    right: -40px;
    bottom: -90px;
    font-family: var(--font-serif);
    font-size: 420px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.hero-inner {
    max-width: 1140px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 48px;
    align-items: center;
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 1.4rem + 2.8vw, 3.3rem);
    line-height: 1.18;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--zyl-white);
}

.hero h1 em {
    font-style: normal;
    color: #e9b9b9;
}

.hero-sub {
    font-size: clamp(1.02rem, 1rem + 0.3vw, 1.2rem);
    line-height: 1.75;
    color: #c5cedd;
    max-width: 560px;
    margin: 0 0 32px;
}

.hero-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.btn-primary,
.btn-ghost {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s var(--ease);
}

.btn-primary {
    background-color: var(--zyl-red);
    color: #fff;
    box-shadow: 0 6px 18px rgba(168, 50, 50, 0.35);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background-color: var(--zyl-red-dark);
    transform: translateY(-2px);
    color: #fff;
}

.btn-ghost {
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: #fff;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    color: #fff;
}

/* Hero side panel: credential card */
.hero-panel {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius);
    padding: 28px;
    backdrop-filter: blur(6px);
}

.hero-panel h2 {
    font-family: var(--font-serif);
    font-size: 18px;
    color: var(--zyl-gold);
    margin: 0 0 16px;
    letter-spacing: 0.04em;
}

.hero-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hero-panel li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #dbe2ee;
    font-size: 15px;
    line-height: 1.5;
}

.hero-panel li:last-child {
    border-bottom: none;
}

.hero-panel li::before {
    content: '✓';
    color: var(--zyl-gold);
    font-weight: 700;
    flex-shrink: 0;
}

/* ---------- Trust bar ---------- */
.trust-bar {
    background-color: var(--zyl-navy-deep);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 20px;
}

.trust-bar-inner {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 36px;
    color: #9fb0c8;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.trust-bar-inner span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.trust-bar-inner span::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--zyl-red);
}

/* ---------- Services ---------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
    gap: 24px;
}

.service-card {
    background-color: var(--zyl-white);
    border: 1px solid var(--zyl-line);
    border-top: 4px solid var(--zyl-navy);
    border-radius: var(--radius);
    padding: 30px 26px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-top-color: var(--zyl-red);
}

.service-card .svc-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background-color: #fdf2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.service-card .svc-icon svg {
    width: 26px;
    height: 26px;
    stroke: var(--zyl-red);
}

.service-card h3 {
    font-family: var(--font-serif);
    font-size: 20px;
    color: var(--zyl-navy);
    margin: 0 0 12px;
}

.service-card p {
    color: var(--zyl-ink-soft);
    font-size: 15px;
    line-height: 1.7;
    margin: 0 0 14px;
}

.service-card ul {
    margin: 0 0 18px;
    padding-left: 18px;
    color: var(--zyl-ink-soft);
    font-size: 14.5px;
    line-height: 1.8;
}

.service-card .svc-link {
    margin-top: auto;
    color: var(--zyl-red);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
}

.service-card .svc-link:hover {
    color: var(--zyl-red-dark);
    text-decoration: underline;
}

/* ---------- Stats / why us ---------- */
.stats-section {
    background-color: var(--zyl-navy);
    color: #e6ebf4;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 28px;
}

.stat-item h3 {
    font-family: var(--font-serif);
    font-size: clamp(1.9rem, 1.5rem + 1.4vw, 2.6rem);
    color: var(--zyl-gold);
    margin: 0 0 8px;
}

.stat-item p {
    margin: 0;
    color: #b6c2d6;
    font-size: 15px;
    line-height: 1.6;
}

.stats-section .home-h2 {
    color: var(--zyl-white);
}

.stats-section .home-section-intro {
    color: #b6c2d6;
}

/* ---------- Case studies / insights cards ---------- */
.cards-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 24px;
}

.insight-card {
    background-color: var(--zyl-white);
    border: 1px solid var(--zyl-line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.insight-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.insight-card a.card-media {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background-color: #e8ecf2;
}

.insight-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s var(--ease);
}

.insight-card:hover img {
    transform: scale(1.04);
}

.insight-card .card-body {
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.insight-card h3 {
    font-family: var(--font-serif);
    font-size: 17.5px;
    line-height: 1.45;
    margin: 0 0 14px;
    color: var(--zyl-navy);
}

.insight-card h3 a {
    color: inherit;
    text-decoration: none;
}

.insight-card h3 a:hover {
    color: var(--zyl-red);
}

.insight-card .card-link {
    margin-top: auto;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--zyl-red);
    text-decoration: none;
}

.insight-card .card-link:hover {
    text-decoration: underline;
}

/* News list (server-rendered) */
.news-flex {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 40px;
    align-items: start;
}

.home-news-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.home-news-list li {
    border-bottom: 1px solid var(--zyl-line);
}

.home-news-list a {
    display: flex;
    gap: 16px;
    align-items: baseline;
    padding: 13px 6px;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.25s var(--ease);
}

.home-news-list a:hover {
    background-color: rgba(168, 50, 50, 0.05);
}

.home-news-list .news-date {
    flex-shrink: 0;
    font-size: 13.5px;
    color: var(--zyl-ink-soft);
    font-variant-numeric: tabular-nums;
}

.home-news-list .news-text {
    font-size: 15.5px;
    color: var(--zyl-ink);
    font-weight: 500;
    line-height: 1.5;
}

.home-news-list a:hover .news-text {
    color: var(--zyl-red);
}

.news-more-link {
    display: inline-block;
    margin-top: 16px;
    font-weight: 700;
    color: var(--zyl-red);
    text-decoration: none;
}

.news-more-link:hover {
    text-decoration: underline;
}

/* ---------- Team snapshot ---------- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.team-card {
    background-color: var(--zyl-white);
    border: 1px solid var(--zyl-line);
    border-radius: var(--radius);
    padding: 26px 24px;
    box-shadow: var(--shadow-sm);
}

.team-card h3 {
    font-family: var(--font-serif);
    font-size: 19px;
    color: var(--zyl-navy);
    margin: 0 0 4px;
}

.team-card .team-role {
    color: var(--zyl-red);
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 12px;
}

.team-card p {
    color: var(--zyl-ink-soft);
    font-size: 14.5px;
    line-height: 1.7;
    margin: 0;
}

/* ---------- FAQ ---------- */
.faq-list {
    max-width: 820px;
}

.faq-item {
    background-color: var(--zyl-white);
    border: 1px solid var(--zyl-line);
    border-radius: var(--radius);
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}

.faq-item summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 700;
    color: var(--zyl-navy);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 22px;
    color: var(--zyl-red);
    flex-shrink: 0;
    transition: transform 0.25s var(--ease);
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item .faq-answer {
    padding: 0 22px 20px;
    color: var(--zyl-ink-soft);
    font-size: 15.5px;
    line-height: 1.75;
}

/* ---------- Resources ---------- */
.resource-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.resource-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--zyl-white);
    border: 1px solid var(--zyl-line);
    border-radius: 999px;
    padding: 11px 20px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--zyl-navy);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

.resource-pill:hover {
    border-color: var(--zyl-red);
    color: var(--zyl-red);
    transform: translateY(-2px);
}

/* ---------- Final CTA band ---------- */
.cta-band {
    background:
        radial-gradient(800px 300px at 90% 0%, rgba(201, 162, 39, 0.18), transparent 60%),
        linear-gradient(135deg, var(--zyl-red-dark), var(--zyl-red));
    color: #fff;
    text-align: center;
}

.cta-band .home-h2 {
    color: #fff;
}

.cta-band p {
    color: rgba(255, 255, 255, 0.88);
    max-width: 620px;
    margin: 0 auto 30px;
    font-size: 17px;
    line-height: 1.7;
}

.cta-band .btn-primary {
    background-color: #fff;
    color: var(--zyl-red-dark);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.cta-band .btn-primary:hover {
    background-color: var(--zyl-paper);
    color: var(--zyl-red-dark);
}

.cta-band .btn-ghost {
    border-color: rgba(255, 255, 255, 0.6);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .hero-inner,
    .news-flex {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        max-width: 560px;
    }
}

@media (max-width: 600px) {
    .home-section {
        padding-left: 16px;
        padding-right: 16px;
    }

    .hero-cta-row .btn-primary,
    .hero-cta-row .btn-ghost {
        width: 100%;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .service-card,
    .insight-card,
    .insight-card img,
    .btn-primary,
    .btn-ghost,
    .resource-pill {
        transition: none;
    }
}

/* ==========================================================================
   Homepage header integration — full-width sticky navy bar (home only)
   ========================================================================== */
body.home-page #header {
    position: sticky;
    top: 0;
    z-index: 10000;
    margin: 0;
    background-color: rgba(14, 24, 40, 0.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

body.home-page #header.is-scrolled {
    background-color: rgba(14, 24, 40, 0.98);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

body.home-page #header > .container {
    max-width: 1140px;
    overflow: visible;
}

body.home-page .header-content {
    background-color: transparent;
    padding: 12px 20px;
}

body.home-page .nav-menu a {
    color: #c2cddd;
    font-size: 15px;
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
    transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

body.home-page .nav-menu a:hover,
body.home-page .nav-menu a.active {
    color: #ffffff;
    border-bottom-color: var(--zyl-red);
}

body.home-page .hamburger span {
    background-color: #ffffff;
    transition: transform 0.3s ease-in-out, opacity 0.2s ease-in-out;
}

@media (max-width: 768px) {
    body.home-page .nav-menu {
        background-color: var(--zyl-navy-deep);
        top: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Hero merges with the sticky header above it */
body.home-page .hero {
    border-top: none;
}

/* ==========================================================================
   Scroll motion: progress bar, reveal-on-scroll, hero entrance
   ========================================================================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    z-index: 1300;
    background: linear-gradient(90deg, var(--zyl-red), var(--zyl-gold));
    pointer-events: none;
}

.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal.in-view {
    opacity: 1;
    transform: none;
}

@keyframes heroRise {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

body.home-page .hero h1 {
    animation: heroRise 0.8s var(--ease) 0.05s both;
}

body.home-page .hero-sub {
    animation: heroRise 0.8s var(--ease) 0.22s both;
}

body.home-page .hero-cta-row {
    animation: heroRise 0.8s var(--ease) 0.38s both;
}

body.home-page .hero-panel {
    animation: heroRise 0.9s var(--ease) 0.52s both;
}

body.home-page .trust-bar-inner span {
    animation: heroRise 0.7s var(--ease) both;
}

body.home-page .trust-bar-inner span:nth-child(1) { animation-delay: 0.55s; }
body.home-page .trust-bar-inner span:nth-child(2) { animation-delay: 0.65s; }
body.home-page .trust-bar-inner span:nth-child(3) { animation-delay: 0.75s; }
body.home-page .trust-bar-inner span:nth-child(4) { animation-delay: 0.85s; }
body.home-page .trust-bar-inner span:nth-child(5) { animation-delay: 0.95s; }

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    body.home-page .hero h1,
    body.home-page .hero-sub,
    body.home-page .hero-cta-row,
    body.home-page .hero-panel,
    body.home-page .trust-bar-inner span {
        animation: none;
    }

    .scroll-progress {
        display: none;
    }
}

/* Print: show all content, no motion chrome */
@media print {
    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }

    .scroll-progress {
        display: none;
    }

    body.home-page #header {
        position: static;
    }
}
