/* ============================================================
   JIL Technology — Services Page
   Loaded after styles.css, only on pages/services.html.
   All classes are sv-* to avoid touching shared styles.
   Shares the design language of the landing page (landing.css).
   ============================================================ */

:root {
    --sv-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    --sv-font-accent: 'Fraunces', Georgia, serif;
    --sv-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --sv-gray: #6b645c;       /* AA-contrast body gray on cream/white */
    --sv-gold-text: #8a6a20;  /* AA-contrast gold for small text on cream/white */
}

/* ============ SHARED PRIMITIVES ============ */

.sv-kicker {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--sv-gold-text);
    margin-bottom: 18px;
}

.sv-kicker-gold { color: var(--gold); }

.sv-actually {
    font-family: var(--sv-font-accent);
    font-style: italic;
    font-weight: 500;
    color: var(--gold-light);
    letter-spacing: -0.01em;
    padding-right: 0.04em;
}

/* Buttons (same system as the landing page) */
.sv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border-radius: 12px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: transform 0.25s var(--sv-ease), box-shadow 0.25s var(--sv-ease), background-color 0.25s, border-color 0.25s, color 0.25s;
    white-space: nowrap;
}

.sv-btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.sv-btn-lg { padding: 18px 36px; font-size: 1.05rem; }

.sv-btn-gold {
    background: linear-gradient(160deg, var(--gold-light), var(--gold));
    color: var(--navy-dark);
    box-shadow: 0 6px 24px rgba(196, 154, 60, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.sv-btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(196, 154, 60, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.sv-btn-navy {
    background: var(--navy-dark);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.sv-btn-navy:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--navy);
}

.sv-btn-navy svg,
.sv-btn-gold svg { transition: transform 0.25s var(--sv-ease); }
.sv-btn-navy:hover svg,
.sv-btn-gold:hover svg { transform: translateX(4px); }

.sv-btn-ghost {
    background: rgba(255, 255, 255, 0.02);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.35);
}

.sv-btn-ghost:hover {
    background: var(--white);
    color: var(--navy-dark);
    border-color: var(--white);
    transform: translateY(-2px);
}

.sv-btn:focus-visible,
.sv-subnav a:focus-visible,
.sv-toc-list a:focus-visible,
.sv-final-link:focus-visible {
    outline: 2px solid var(--navy-dark);
    outline-offset: 3px;
}

.sv-chapter-dark .sv-btn:focus-visible,
.sv-final .sv-btn:focus-visible,
.sv-final .sv-final-link:focus-visible {
    outline-color: var(--gold-light);
}

/* Landing-matched: warm terracotta dog button on this page too */
body.sv .btn-sparkle {
    background: #c2703f;
    box-shadow: 0 2px 12px rgba(194, 112, 63, 0.25);
}

body.sv .btn-sparkle:hover {
    background: #a85c2e;
    box-shadow: 0 4px 20px rgba(194, 112, 63, 0.35);
}

/* ============ HERO ============ */

.sv-hero {
    position: relative;
    background:
        radial-gradient(1000px 480px at 80% -10%, rgba(196, 154, 60, 0.13), transparent 65%),
        radial-gradient(800px 600px at -10% 110%, rgba(30, 68, 113, 0.55), transparent 60%),
        var(--navy-dark);
    color: var(--white);
    padding: 165px 0 90px;
    overflow: hidden;
}

.sv-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(196, 154, 60, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(196, 154, 60, 0.05) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, black 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, black 30%, transparent 75%);
    pointer-events: none;
}

.sv-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--sv-grain);
    opacity: 0.05;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.sv-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 64px;
    align-items: center;
}

.sv-h1 {
    font-size: clamp(2.6rem, 5vw, 4.1rem);
    font-weight: 800;
    color: var(--white);
    line-height: 1.05;
    letter-spacing: -0.035em;
    margin-bottom: 24px;
    text-wrap: balance;
}

.sv-lede {
    font-size: 1.12rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.68);
    max-width: 480px;
    margin-bottom: 40px;
}

.sv-hero-facts {
    display: flex;
    gap: 44px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 28px;
    max-width: 480px;
}

.sv-fact-num {
    display: block;
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--gold);
    line-height: 1;
    letter-spacing: -0.02em;
}

.sv-fact-label {
    display: block;
    margin-top: 7px;
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.55);
}

/* Hero entrance */
.sv-hero-anim {
    opacity: 0;
    animation: svRise 0.8s var(--sv-ease) forwards;
    animation-delay: calc(var(--d, 0) * 0.11s + 0.05s);
}

@keyframes svRise {
    from { opacity: 0; transform: translateY(26px); }
    to { opacity: 1; transform: translateY(0); }
}

.sv-h1.sv-hero-anim {
    opacity: 1;
    animation-name: svRiseSlide;
    animation-fill-mode: both;
}

@keyframes svRiseSlide {
    from { transform: translateY(26px); }
    to { transform: translateY(0); }
}

/* --- Contents card --- */

.sv-toc {
    background: var(--off-white);
    border-radius: 20px;
    padding: 30px 32px 26px;
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.45),
        0 12px 28px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    /* standalone rotate composes with the entrance animation's transform */
    rotate: 1.2deg;
}

.sv-toc-title {
    font-family: var(--sv-font-accent);
    font-style: italic;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--navy-dark);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-light);
}

.sv-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sv-toc-list li + li { margin-top: 2px; }

.sv-toc-list a {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 6px 4px;
    border-radius: 6px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--navy-dark);
    transition: background 0.2s, color 0.2s;
}

.sv-toc-list a:hover { color: var(--gold-dark); }

.sv-toc-list a span { flex-shrink: 0; }

.sv-toc-list a i {
    flex: 1;
    border-bottom: 2px dotted var(--gray-light);
    transform: translateY(-4px);
}

.sv-toc-list a em {
    font-style: normal;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--sv-gold-text);
}

.sv-toc-build a span { color: var(--sv-gold-text); }

.sv-toc-build:first-of-type { margin-top: 10px; }

li.sv-toc-build a span::after {
    content: ' ✦';
    font-size: 0.75em;
}

/* ============ STICKY SUB-NAV ============ */

.sv-subnav {
    position: sticky;
    top: 58px; /* clears the fixed site header (58px tall once scrolled) */
    z-index: 900;
    background: rgba(250, 246, 239, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(196, 154, 60, 0.18);
}

.sv-subnav-track {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 24px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, black 24px, black calc(100% - 24px), transparent);
    mask-image: linear-gradient(90deg, transparent, black 24px, black calc(100% - 24px), transparent);
}

.sv-subnav-track::-webkit-scrollbar { display: none; }

.sv-subnav-track a {
    flex-shrink: 0;
    scroll-snap-align: start;
    padding: 14px 14px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sv-gray);
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.sv-subnav-track a:hover { color: var(--navy-dark); }

.sv-subnav-track a.active {
    color: var(--navy-dark);
    border-bottom-color: var(--gold);
}

/* ============ CHAPTERS ============ */

.sv-chapters {
    background: var(--cream);
}

.sv-chapter {
    padding: 84px 0;
    scroll-margin-top: 130px;
}

.sv-chapters .sv-chapter + .sv-chapter {
    border-top: 1px solid var(--gray-light);
}

.sv-chapter-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: clamp(32px, 5vw, 72px);
    align-items: start;
}

.sv-chapter-side {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
}

.sv-num {
    font-family: var(--sv-font-accent);
    font-style: italic;
    font-size: clamp(8rem, 9vw, 11rem);
    font-weight: 500;
    line-height: 0.9;
    color: transparent;
    -webkit-text-stroke: 2px rgba(196, 154, 60, 0.45);
    text-stroke: 2px rgba(196, 154, 60, 0.45);
    margin: -0.06em -60px 0 -0.04em;
}

/* Spot illustrations — line-art etchings that fill the chapter rail */
.sv-illus {
    display: block;
    width: 184px;
    max-width: 100%;
    color: var(--navy-dark);
}

.sv-illus svg {
    display: block;
    width: 100%;
    height: auto;
}

.sv-illus .il-ring {
    stroke: var(--gold);
    opacity: 0.4;
    stroke-width: 2;
    stroke-dasharray: 3 9;
}

.sv-illus .il-gold { stroke: var(--gold); }

.sv-illus .il-dot {
    fill: var(--gold);
    stroke: none;
}

.sv-chapter-body h2 {
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.sv-tagline {
    font-family: var(--sv-font-accent);
    font-style: italic;
    font-size: 1.22rem;
    color: var(--sv-gold-text);
    margin-bottom: 16px;
}

.sv-desc {
    color: var(--sv-gray);
    line-height: 1.75;
    max-width: 640px;
    margin-bottom: 26px;
}

.sv-features {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0;
    margin: 0 0 30px;
    max-width: 760px;
}

.sv-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.93rem;
    line-height: 1.5;
    color: var(--gray-dark);
    transition: border-color 0.25s, transform 0.25s var(--sv-ease);
}

.sv-features li:hover {
    border-color: rgba(196, 154, 60, 0.5);
    transform: translateX(3px);
}

.sv-features svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--gold-dark);
}

/* odd feature counts: stretch the last chip so the grid never ends on a hole */
.sv-features li:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Even chapters: mirrored spread + deeper cream, so each fold reads as a new page */
.sv-chapters .sv-chapter:nth-of-type(even) {
    background: var(--cream-dark);
}

@media (min-width: 861px) {
    .sv-chapters .sv-chapter:nth-of-type(even) .sv-chapter-grid {
        grid-template-columns: 1fr 200px;
    }

    .sv-chapters .sv-chapter:nth-of-type(even) .sv-chapter-side {
        grid-column: 2;
        grid-row: 1;
        align-items: flex-end;
    }

    .sv-chapters .sv-chapter:nth-of-type(even) .sv-chapter-body {
        grid-column: 1;
        grid-row: 1;
    }

    /* flip the numeral bleed toward the content gap on mirrored chapters */
    .sv-chapters .sv-chapter:nth-of-type(even) .sv-num {
        margin: -0.06em -0.04em 0 -60px;
    }
}

/* ============ BUILD BAND (dark chapters) ============ */

.sv-build {
    position: relative;
    background:
        radial-gradient(900px 500px at 85% 0%, rgba(196, 154, 60, 0.1), transparent 60%),
        var(--navy-dark);
    color: var(--white);
    overflow: hidden;
}

.sv-build::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--sv-grain);
    opacity: 0.045;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.sv-build > * { position: relative; z-index: 1; }

.sv-build-head {
    text-align: center;
    padding: 100px 0 10px;
    max-width: 640px;
    margin: 0 auto;
}

.sv-build-title {
    font-size: clamp(2.1rem, 4vw, 3.1rem);
    color: var(--white);
    letter-spacing: -0.025em;
    margin-bottom: 16px;
}

.sv-build-sub {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.08rem;
    line-height: 1.7;
}

.sv-chapter-dark {
    padding: 80px 0;
}

.sv-chapter-dark + .sv-chapter-dark {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sv-chapter-dark .sv-chapter-body h2 { color: var(--white); }

.sv-chapter-dark .sv-tagline { color: var(--gold-light); }

.sv-chapter-dark .sv-desc { color: rgba(255, 255, 255, 0.62); }

.sv-chapter-dark .sv-num {
    -webkit-text-stroke: 2px rgba(219, 182, 106, 0.4);
    text-stroke: 2px rgba(219, 182, 106, 0.4);
}

.sv-chapter-dark .sv-illus { color: rgba(255, 255, 255, 0.85); }
.sv-chapter-dark .sv-illus .il-gold { stroke: var(--gold-light); }
.sv-chapter-dark .sv-illus .il-dot { fill: var(--gold-light); }

.sv-chapter-dark .sv-features li {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.82);
}

.sv-chapter-dark .sv-features li:hover {
    border-color: rgba(196, 154, 60, 0.5);
}

.sv-chapter-dark .sv-features svg { color: var(--gold); }

/* ============ FINAL CTA ============ */

.sv-final {
    background: var(--cream);
    padding: 100px 0 120px;
}

.sv-final-card {
    position: relative;
    background:
        radial-gradient(700px 320px at 50% -20%, rgba(196, 154, 60, 0.18), transparent 65%),
        var(--navy-dark);
    border: 1px solid rgba(196, 154, 60, 0.35);
    border-radius: 26px;
    padding: clamp(48px, 7vw, 80px) clamp(24px, 5vw, 80px);
    text-align: center;
    overflow: hidden;
}

.sv-final-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--sv-grain);
    opacity: 0.05;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.sv-final-card > * { position: relative; z-index: 1; }

.sv-final-title {
    font-size: clamp(1.9rem, 3.6vw, 2.75rem);
    color: var(--white);
    letter-spacing: -0.025em;
    margin-bottom: 18px;
}

.sv-final-card p {
    color: rgba(255, 255, 255, 0.65);
    max-width: 640px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

.sv-final-link {
    color: var(--gold-light);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(219, 182, 106, 0.5);
    text-underline-offset: 3px;
}

.sv-final-link:hover { color: var(--gold); }

.sv-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}

/* ============ SCROLL REVEAL ============ */

[data-reveal],
[data-reveal-group] > * {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s var(--sv-ease), transform 0.7s var(--sv-ease);
}

[data-reveal].is-in,
[data-reveal-group].is-in > * {
    opacity: 1;
    transform: none;
}

/* No-JS fallback: if services.js never runs, everything stays visible */
html:not(.js) [data-reveal],
html:not(.js) [data-reveal-group] > * {
    opacity: 1;
    transform: none;
    transition: none;
}

[data-reveal-group] > *:nth-child(1) { transition-delay: 0.05s; }
[data-reveal-group] > *:nth-child(2) { transition-delay: 0.11s; }
[data-reveal-group] > *:nth-child(3) { transition-delay: 0.17s; }
[data-reveal-group] > *:nth-child(4) { transition-delay: 0.23s; }
[data-reveal-group] > *:nth-child(5) { transition-delay: 0.29s; }
[data-reveal-group] > *:nth-child(6) { transition-delay: 0.35s; }

/* ============ REDUCED MOTION ============ */

@media (prefers-reduced-motion: reduce) {
    .sv-hero-anim {
        animation: none;
        opacity: 1;
    }

    [data-reveal],
    [data-reveal-group] > * {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ============ RESPONSIVE ============ */

@media (max-width: 1024px) {
    .sv-hero { padding: 140px 0 80px; }

    .sv-hero-grid {
        grid-template-columns: 1fr;
        gap: 56px;
    }

    .sv-hero-copy { text-align: center; }
    .sv-lede { margin-left: auto; margin-right: auto; }
    .sv-hero-facts { justify-content: center; margin: 0 auto; }

    .sv-toc {
        max-width: 480px;
        margin: 0 auto;
        rotate: none;
    }
}

@media (max-width: 860px) {
    .sv-chapter { padding: 64px 0; scroll-margin-top: 110px; }

    .sv-chapter-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .sv-chapter-side {
        flex-direction: row;
        align-items: center;
    }

    .sv-num {
        font-size: 4rem;
        margin: 0;
        -webkit-text-stroke: 1.5px rgba(196, 154, 60, 0.6);
        text-stroke: 1.5px rgba(196, 154, 60, 0.6);
    }

    .sv-chapter-dark .sv-num {
        -webkit-text-stroke: 1.5px rgba(219, 182, 106, 0.55);
        text-stroke: 1.5px rgba(219, 182, 106, 0.55);
    }

    .sv-illus { width: 96px; }

    .sv-features { grid-template-columns: 1fr; max-width: 560px; }

    .sv-build-head { padding: 80px 0 0; }

    .sv-chapter-dark { padding: 64px 0; }
}

@media (max-width: 600px) {
    .sv-hero { padding: 120px 0 64px; }

    .sv-hero-facts { gap: 28px; }
    .sv-fact-num { font-size: 2rem; }

    .sv-toc { padding: 24px 22px 20px; }
    .sv-toc-list a { padding: 10px 4px; }

    /* leave a visibly truncated pill at the right edge so the overflow is discoverable */
    .sv-subnav-track {
        padding: 0 16px;
        gap: 4px;
        scroll-padding-inline: 16px;
        -webkit-mask-image: linear-gradient(90deg, transparent, black 16px, black calc(100% - 40px), transparent);
        mask-image: linear-gradient(90deg, transparent, black 16px, black calc(100% - 40px), transparent);
    }

    .sv-subnav-track a { padding: 14px 10px 12px; }

    .sv-chapter, .sv-chapter-dark { padding: 48px 0; }
    .sv-features { gap: 8px; margin-bottom: 22px; }
    .sv-features li { padding: 10px 14px; }

    .sv-cta-row .sv-btn { width: 100%; }

    .sv-final { padding: 80px 0 90px; }
}
