/* ============================================================
   Remity — shared design system
   Institutional, quantitative aesthetic (ref: Citadel Securities):
   disciplined container, hairline rules, generous fluid spacing,
   confident serif display type. Color palette unchanged.
   ============================================================ */

:root {
    --navy: #08225A;
    --blue: #144AA5;
    --blue-light: #3860BE;
    --blue-soft: #85A3E0;
    --white: #FFFFFF;
    --off-white: #F2F3F3;
    --gray-bg: #F6F6F6;
    --text-body: #373A3C;
    --text-muted: #68717A;
    --text-dark: #101213;
    --border-light: #E5E7E8;

    /* Layout: 1280px container with fluid gutters */
    --gutter: clamp(20px, 5vw, 48px);
    --pad-x: max(var(--gutter), calc(50vw - 640px));

    /* Fluid vertical rhythm: compact on mobile, generous on laptop */
    --space-section: clamp(64px, 5vw + 32px, 120px);
    --space-block: clamp(36px, 4vw, 64px);

    --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    --nav-h: 76px;
    --radius: 2px;
    --radius-media: 6px;

    --shadow-media: 0 16px 56px rgba(8, 34, 90, 0.10), 0 2px 8px rgba(8, 34, 90, 0.05);
    --shadow-hero: 0 24px 80px rgba(8, 34, 90, 0.16), 0 2px 8px rgba(8, 34, 90, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--sans);
    color: var(--text-body);
    background: var(--white);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
[id] { scroll-margin-top: calc(var(--nav-h) + 24px); }

/* ============ NAV ============ */
.site-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 0 var(--pad-x); height: var(--nav-h);
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    transition: box-shadow 0.25s ease;
}
.site-nav.scrolled { box-shadow: 0 4px 24px rgba(8, 34, 90, 0.07); }
.logo {
    font-family: var(--serif);
    font-size: 1.3rem; font-weight: 700; font-style: italic; letter-spacing: 0.5px;
    color: var(--navy); text-decoration: none; line-height: 1;
}
.nav-links { display: flex; gap: clamp(22px, 2.5vw, 38px); align-items: center; }
.nav-links a {
    color: var(--text-muted); text-decoration: none;
    font-size: 0.84rem; font-weight: 600; letter-spacing: 0.02em;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.nav-links a:hover { color: var(--navy); }
.nav-links a.active { color: var(--navy); border-bottom-color: var(--blue); }
.nav-links a.nav-cta {
    color: var(--white); background: var(--navy);
    padding: 10px 22px; border-radius: var(--radius); border-bottom: none;
    transition: background 0.2s;
}
.nav-links a.nav-cta:hover { background: var(--blue); color: var(--white); }

.nav-toggle {
    display: none;
    width: 44px; height: 44px; margin-right: -8px;
    flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    background: none; border: none; cursor: pointer;
}
.nav-toggle span {
    display: block; width: 22px; height: 2px;
    background: var(--navy); border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ BUTTONS ============ */
.btn {
    display: inline-block; padding: 15px 34px;
    background: var(--navy); color: var(--white);
    font-family: var(--sans);
    font-size: 0.86rem; font-weight: 600; letter-spacing: 0.02em;
    text-decoration: none; border-radius: var(--radius); border: 1px solid var(--navy);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { background: var(--blue); border-color: var(--blue); }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: var(--white); }

/* ============ HERO ============ */
.hero {
    padding: calc(var(--nav-h) + clamp(56px, 8vw, 104px)) var(--pad-x) clamp(56px, 7vw, 96px);
    display: grid;
    grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
    gap: clamp(40px, 5vw, 80px);
    align-items: center;
}
.hero h1 {
    font-family: var(--serif);
    font-size: clamp(2.5rem, 3.4vw + 0.9rem, 4.1rem);
    font-weight: 600; line-height: 1.08;
    color: var(--navy); margin-bottom: 28px;
    letter-spacing: -0.02em;
    text-wrap: balance;
}
.hero h1 em { font-style: italic; color: var(--blue); }
.hero p {
    font-size: clamp(1.02rem, 0.4vw + 0.9rem, 1.15rem); color: var(--text-body);
    max-width: 36em; line-height: 1.7; margin-bottom: 36px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-media { position: relative; }
.hero-media::before {
    content: ''; position: absolute; inset: -10% 0 -16% 12%;
    background: radial-gradient(closest-side, rgba(20, 74, 165, 0.08), transparent 70%);
    pointer-events: none;
}
.hero-media img {
    position: relative;
    width: 100%;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-media);
    box-shadow: var(--shadow-hero);
}
@media (min-width: 1281px) {
    /* let the product image bleed toward the viewport edge, capped */
    .hero-media { margin-right: max(calc(640px - 50vw), -110px); }
}

/* ============ SECTIONS ============ */
section { padding: var(--space-section) var(--pad-x); }
.section-label {
    font-size: 0.76rem; font-weight: 700; color: var(--blue);
    text-transform: uppercase; letter-spacing: 0.16em;
    margin-bottom: 22px;
    display: flex; align-items: center; gap: 14px;
}
.section-label::before {
    content: ''; display: block; width: 36px; height: 2px;
    background: var(--blue); flex: none;
}
.section-heading {
    font-family: var(--serif);
    font-size: clamp(1.85rem, 2.1vw + 0.7rem, 2.9rem);
    font-weight: 600; line-height: 1.14;
    color: var(--navy); margin-bottom: 22px; max-width: 21em;
    letter-spacing: -0.015em;
    text-wrap: balance;
}
.section-heading em { font-style: italic; color: var(--blue); }
.section-body {
    font-size: 1.05rem; color: var(--text-body);
    max-width: 44em; line-height: 1.75;
}
.section-alt { background: var(--off-white); }

/* ============ STAT BAND ============ */
.stat-band {
    padding: clamp(44px, 5vw, 76px) var(--pad-x);
    border-top: 1px solid var(--border-light);
}
.stats-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: clamp(28px, 4vw, 64px);
}
.stat-item { border-top: 2px solid var(--navy); padding-top: 22px; }
.stat-value {
    font-family: var(--serif);
    font-size: clamp(2.5rem, 2.4vw + 1rem, 3.6rem);
    font-weight: 600; color: var(--navy); line-height: 1;
}
.stat-value .stat-unit {
    font-size: 0.42em; font-style: italic; color: var(--blue);
    margin-left: 8px; letter-spacing: 0;
}
.stat-label {
    font-size: 0.88rem; color: var(--text-muted);
    line-height: 1.6; margin-top: 12px; max-width: 30em;
}

/* ============ NAVY STATEMENT BAND ============ */
.navy-band {
    background: var(--navy); color: var(--white);
    padding: clamp(48px, 6vw, 84px) var(--pad-x);
}
.navy-band p {
    font-family: var(--serif);
    font-size: clamp(1.2rem, 0.9vw + 0.9rem, 1.55rem);
    line-height: 1.55; color: rgba(255, 255, 255, 0.92);
    max-width: 34em;
}

/* ============ TWO COL ============ */
.two-col {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 96px); align-items: start;
    margin-top: var(--space-block);
}
.two-col h3 {
    font-family: var(--serif);
    font-size: 1.45rem; font-weight: 600; color: var(--navy);
    margin-bottom: 14px; letter-spacing: -0.01em;
}
.two-col p { font-size: 0.98rem; color: var(--text-body); line-height: 1.8; }

/* ============ CAPABILITY GRID (hairline cells) ============ */
.cap-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 1px; background: var(--border-light);
    border: 1px solid var(--border-light);
    margin-top: var(--space-block);
}
.cap-item { background: var(--white); padding: clamp(28px, 3vw, 44px); }
.cap-item h4 {
    font-family: var(--serif);
    font-size: 1.25rem; font-weight: 600; color: var(--navy);
    margin-bottom: 10px; letter-spacing: -0.01em;
}
.cap-item p { font-size: 0.94rem; color: var(--text-muted); line-height: 1.75; }

/* ============ PROCESS (navy) ============ */
.process-section {
    background: var(--navy); color: var(--white);
    background-image: radial-gradient(60% 80% at 85% 0%, rgba(56, 96, 190, 0.25), transparent 70%);
}
.process-section .section-label { color: var(--blue-soft); }
.process-section .section-label::before { background: var(--blue-soft); }
.process-section .section-heading { color: var(--white); }
.process-section .section-heading em { color: var(--blue-soft); }
.process-section .section-body { color: rgba(255, 255, 255, 0.75); }
.process-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: clamp(28px, 3.5vw, 56px); margin-top: var(--space-block);
}
.process-item {
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    padding-top: 26px;
}
.process-item .step-num {
    font-size: 0.8rem; font-weight: 700; letter-spacing: 0.18em;
    color: var(--blue-soft); margin-bottom: 18px;
}
.process-item h4 {
    font-family: var(--serif);
    font-size: 1.3rem; font-weight: 600; margin-bottom: 12px;
}
.process-item p { font-size: 0.93rem; color: rgba(255, 255, 255, 0.68); line-height: 1.75; }

/* ============ SECTOR CARDS ============ */
.sector-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: clamp(20px, 2.5vw, 32px); margin-top: var(--space-block);
}
.sector-card {
    background: var(--white);
    border: 1px solid var(--border-light); border-radius: var(--radius);
    padding: clamp(28px, 3vw, 40px);
    display: flex; flex-direction: column;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.sector-card:hover {
    border-color: var(--blue);
    box-shadow: 0 16px 44px rgba(8, 34, 90, 0.10);
    transform: translateY(-4px);
}
.sector-card h4 {
    font-family: var(--serif);
    font-size: 1.3rem; font-weight: 600; color: var(--navy);
    margin-bottom: 12px;
}
.sector-card p {
    font-size: 0.93rem; color: var(--text-muted); line-height: 1.75;
    margin-bottom: 28px; flex: 1;
}
.sector-card a {
    color: var(--blue); text-decoration: none;
    font-size: 0.87rem; font-weight: 600;
}
.sector-card a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ============ SCOPE CARDS (can / can't) ============ */
.scope-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: clamp(20px, 3vw, 36px); margin-top: var(--space-block);
}
.scope-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-top: 3px solid var(--blue);
    padding: clamp(28px, 3vw, 40px);
}
.scope-card.alt { border-top-color: var(--text-muted); }
.scope-card h4 {
    font-family: var(--serif);
    font-size: 1.3rem; font-weight: 600; color: var(--navy);
    margin-bottom: 12px;
}
.scope-card p { font-size: 0.94rem; color: var(--text-muted); line-height: 1.75; }

/* ============ SCREENSHOTS ============ */
.screenshot-single { margin-top: var(--space-block); }
.screenshot-single img {
    width: 100%; max-width: 1040px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-media);
    box-shadow: var(--shadow-media);
}
.screenshot-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: clamp(20px, 2.5vw, 32px); margin-top: var(--space-block);
}
.screenshot-grid img {
    width: 100%;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-media);
    box-shadow: var(--shadow-media);
}

/* ============ CONTACT ============ */
.contact-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(20px, 2.5vw, 32px); margin-top: var(--space-block);
    max-width: 780px;
}
.contact-card {
    background: var(--white);
    border: 1px solid var(--border-light); border-radius: var(--radius);
    padding: clamp(26px, 3vw, 36px);
}
.contact-card h4 { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.contact-card p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 22px; }
.btn-contact {
    display: inline-block; padding: 12px 26px;
    background: var(--blue); color: var(--white);
    font-family: var(--sans); font-size: 0.84rem; font-weight: 600; letter-spacing: 0.02em;
    text-decoration: none; border-radius: var(--radius); border: none; cursor: pointer;
    transition: background 0.2s;
}
.btn-contact:hover { background: var(--blue-light); }

/* ============ CONTACT MODAL ============ */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(8, 34, 90, 0.55); z-index: 1000;
    justify-content: center; align-items: center; padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--white); border-radius: 4px; padding: clamp(28px, 4vw, 40px);
    max-width: 480px; width: 100%; position: relative;
    box-shadow: 0 24px 64px rgba(8, 34, 90, 0.25);
}
.modal h3 {
    font-family: var(--serif);
    font-size: 1.4rem; font-weight: 600; color: var(--navy); margin-bottom: 8px;
}
.modal p.modal-sub { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 24px; }
.modal-close {
    position: absolute; top: 14px; right: 14px; background: none; border: none;
    font-size: 1.5rem; cursor: pointer; color: var(--text-muted); line-height: 1;
    padding: 6px;
}
.modal-close:hover { color: var(--navy); }
.modal label {
    display: block; font-size: 0.8rem; font-weight: 700; color: var(--navy);
    letter-spacing: 0.03em;
    margin-bottom: 6px; margin-top: 16px;
}
.modal label:first-of-type { margin-top: 0; }
.modal input, .modal textarea {
    width: 100%; padding: 11px 14px; border: 1px solid var(--border-light);
    border-radius: var(--radius); font-family: var(--sans); font-size: 0.9rem;
    color: var(--text-body); outline: none; transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--white);
}
.modal input:focus, .modal textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(20, 74, 165, 0.12);
}
.modal textarea { resize: vertical; min-height: 110px; }
.modal .btn-send {
    display: block; width: 100%; padding: 13px 28px; margin-top: 24px;
    background: var(--blue); color: var(--white);
    font-family: var(--sans); font-size: 0.86rem; font-weight: 600; letter-spacing: 0.02em;
    border-radius: var(--radius); border: none; cursor: pointer;
    transition: background 0.2s;
}
.modal .btn-send:hover { background: var(--blue-light); }

/* ============ FOOTER ============ */
footer {
    background: var(--navy); color: var(--white);
    padding: clamp(56px, 7vw, 88px) var(--pad-x) 44px;
}
.footer-top {
    display: flex; justify-content: space-between; align-items: center;
    gap: 32px; flex-wrap: wrap;
    padding-bottom: 36px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
footer .logo { color: var(--white); font-size: 1.2rem; }
.footer-links { display: flex; gap: clamp(20px, 2.5vw, 34px); flex-wrap: wrap; }
.footer-links a {
    color: rgba(255, 255, 255, 0.82); text-decoration: none;
    font-size: 0.88rem; font-weight: 500;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--white); }
.footer-copy { font-size: 0.78rem; color: rgba(255, 255, 255, 0.45); margin-top: 30px; }

/* ============ REVEAL ON SCROLL ============ */
@media (prefers-reduced-motion: no-preference) {
    html.js .reveal {
        opacity: 0; transform: translateY(18px);
        transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
    }
    html.js .reveal.in { opacity: 1; transform: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
    .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 960px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 44px;
        padding-top: calc(var(--nav-h) + 48px);
    }
    .hero-media { max-width: 620px; }
    .hero-media::before { left: 0; }
    .two-col { grid-template-columns: 1fr; }
    .process-grid { grid-template-columns: 1fr; gap: 32px; }
    .sector-grid { grid-template-columns: 1fr; }
    .scope-grid { grid-template-columns: 1fr; }
    .screenshot-grid { grid-template-columns: 1fr; }
    .stats-grid { gap: 24px; }
}
@media (max-width: 840px) {
    .nav-toggle { display: flex; }
    .nav-links {
        position: absolute; top: var(--nav-h); left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--white);
        border-bottom: 1px solid var(--border-light);
        box-shadow: 0 24px 48px rgba(8, 34, 90, 0.12);
        padding: 8px var(--gutter) 20px;
        display: none;
    }
    .nav-links.open { display: flex; }
    .nav-links a {
        font-size: 0.95rem; padding: 14px 4px;
        border-bottom: 1px solid var(--border-light);
    }
    .nav-links a.active { border-bottom-color: var(--border-light); color: var(--blue); }
    .nav-links a.nav-cta {
        margin-top: 16px; text-align: center; padding: 13px 22px;
        border-bottom: none;
    }
    .cap-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    :root { --nav-h: 64px; }
    .stats-grid { grid-template-columns: 1fr; gap: 28px; }
    .hero-actions .btn { width: 100%; text-align: center; }
    .contact-grid { grid-template-columns: 1fr; }
    .footer-top { flex-direction: column; align-items: flex-start; }
}
