/* =====================================================================
   JGuard Desktop — Design System
   ---------------------------------------------------------------------
   Modern, fluid, animated. Warm cream brand palette with orange accent
   carried over from the mobile site. All design decisions live here.
===================================================================== */

:root {
    /* ── Palette ── */
    --bg:               #fdfaf6;          /* primary surface */
    --bg-soft:          #f5ede2;
    --bg-card:          #ffffff;
    --bg-dark:          #1a1410;          /* dark sections */
    --bg-dark-soft:     #2a1f17;

    --ink:              #1c140d;          /* primary text */
    --ink-soft:         #594538;
    --ink-mute:         #8a7565;
    --ink-faint:        #c4b8aa;

    --ink-on-dark:      #fdfaf6;
    --ink-on-dark-soft: #c4b8aa;

    /* Brand */
    --primary:          #f37021;          /* JGuard orange */
    --primary-soft:     #ff8d4a;
    --primary-deep:     #c2521a;
    --primary-glow:     rgba(243, 112, 33, 0.18);

    --accent:           #2a9d8f;          /* teal accent (trust) */
    --success:          #16a34a;
    --danger:           #dc2626;
    --warning:          #eab308;

    /* Surfaces & Lines */
    --line:             rgba(28, 20, 13, 0.08);
    --line-strong:      rgba(28, 20, 13, 0.18);
    --shadow-sm:        0 1px 2px rgba(28, 20, 13, 0.04), 0 1px 3px rgba(28, 20, 13, 0.06);
    --shadow-md:        0 4px 12px rgba(28, 20, 13, 0.06), 0 8px 24px rgba(28, 20, 13, 0.08);
    --shadow-lg:        0 12px 32px rgba(28, 20, 13, 0.10), 0 24px 64px rgba(28, 20, 13, 0.12);
    --shadow-glow:      0 12px 40px rgba(243, 112, 33, 0.25);

    /* Radii */
    --r-sm:             8px;
    --r-md:             14px;
    --r-lg:             22px;
    --r-xl:             32px;
    --r-pill:           999px;

    /* Spacing scale (fluid) */
    --s-1:  4px;
    --s-2:  8px;
    --s-3:  12px;
    --s-4:  16px;
    --s-5:  24px;
    --s-6:  32px;
    --s-7:  48px;
    --s-8:  64px;
    --s-9:  96px;
    --s-10: 128px;

    /* Layout */
    --container:        1440px;
    --container-narrow: 1080px;
    --gutter:           clamp(24px, 4vw, 64px);

    /* Type — fluid via clamp() */
    --font-display:     'Manrope', 'Inter', system-ui, -apple-system, sans-serif;
    --font-serif:       'Fraunces', 'Georgia', 'Times New Roman', serif;
    --font-body:        'Inter', system-ui, -apple-system, sans-serif;

    --t-eyebrow:        clamp(11px, 0.75vw + 8px, 13px);
    --t-body-sm:        clamp(13px, 0.4vw + 11px, 15px);
    --t-body:           clamp(15px, 0.4vw + 13px, 17px);
    --t-body-lg:        clamp(17px, 0.5vw + 14px, 20px);
    --t-h3:             clamp(20px, 1vw + 16px, 28px);
    --t-h2:             clamp(28px, 2vw + 18px, 44px);
    --t-h1:             clamp(40px, 3.5vw + 20px, 72px);
    --t-display:        clamp(56px, 5vw + 24px, 104px);

    --leading-tight:    1.05;
    --leading-snug:     1.2;
    --leading-base:     1.55;
    --leading-loose:    1.75;

    --tracking-tight:   -0.02em;
    --tracking-base:    0;
    --tracking-wide:    0.04em;
    --tracking-widest:  0.16em;

    /* Motion */
    --ease-standard:    cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-out:         cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out:      cubic-bezier(0.65, 0, 0.35, 1);
    --ease-bounce:      cubic-bezier(0.34, 1.56, 0.64, 1);
    --d-fast:           180ms;
    --d-base:           320ms;
    --d-slow:           560ms;
    --d-slower:         920ms;
}

/* ── Reset / Base ─────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--t-body);
    line-height: var(--leading-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color var(--d-fast) var(--ease-standard), opacity var(--d-fast) var(--ease-standard); }

button { font: inherit; cursor: pointer; border: none; background: transparent; color: inherit; }
input, textarea, select { font: inherit; }

/* Hide scrollbar tracks but keep scroll */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--ink-faint); border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-mute); }

/* ── Typography ───────────────────────────────────────────────────── */

.display, h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-tight);
    color: var(--ink);
    margin: 0;
}

/* Editorial serif voice for the big statements — echoes the slab-serif
   J GUARD® logo. UI headings (h3, tiles, buttons) stay Manrope. */
.display, h1, .h1, h2, .h2 {
    font-family: var(--font-serif);
    font-weight: 600;
    letter-spacing: -0.015em;
    font-variation-settings: 'opsz' 100;
}
.display em, h1 em, h2 em,
.display .gradient-text, h1 .gradient-text, h2 .gradient-text {
    font-style: italic;
    font-weight: 500;
}

.display      { font-size: var(--t-display); line-height: 1.02; }
h1, .h1       { font-size: var(--t-h1); line-height: 1.06; }
h2, .h2       { font-size: var(--t-h2); line-height: 1.14; }
h3, .h3       { font-size: var(--t-h3); line-height: var(--leading-snug); font-weight: 700; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    font-size: var(--t-eyebrow);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--primary);
}
/* Small editorial rule before the label — skipped when a live-dot leads. */
.eyebrow::before {
    content: '';
    width: 26px;
    height: 1.5px;
    background: currentColor;
    opacity: 0.55;
    flex-shrink: 0;
}
.eyebrow:has(.live-dot)::before { display: none; }

.lead {
    font-size: var(--t-body-lg);
    color: var(--ink-soft);
    line-height: var(--leading-base);
    max-width: 56ch;
}

.muted { color: var(--ink-mute); }
.faint { color: var(--ink-faint); }

/* Gradient text for hero accents */
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-soft) 60%, #ffba83 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ── Layout containers ───────────────────────────────────────────── */

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.container-narrow {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.section {
    padding-top: clamp(64px, 8vw, 144px);
    padding-bottom: clamp(64px, 8vw, 144px);
    position: relative;
}

.section--soft  { background: var(--bg-soft); }
.section--dark  { background: var(--bg-dark); color: var(--ink-on-dark); }
.section--dark h1, .section--dark h2, .section--dark h3 { color: var(--ink-on-dark); }

/* ── Buttons ──────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    padding: 14px 28px;
    border-radius: var(--r-pill);
    font-weight: 700;
    font-size: var(--t-body);
    line-height: 1;
    transition: all var(--d-base) var(--ease-standard);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn-lg {
    padding: 20px 40px;
    font-size: var(--t-body-lg);
}

.btn-sm {
    padding: 10px 20px;
    font-size: var(--t-body-sm);
}

.btn-primary {
    background: linear-gradient(180deg, #ff8340 0%, var(--primary) 52%, #e5620f 100%);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28),
                inset 0 -1px 0 rgba(0, 0, 0, 0.12),
                var(--shadow-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg, #ff9052 0%, var(--primary-soft) 52%, var(--primary) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32),
                0 18px 44px rgba(243, 112, 33, 0.35);
    opacity: 1;
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--line-strong);
}
.btn-ghost:hover {
    background: var(--bg-card);
    border-color: var(--ink);
    opacity: 1;
}

.btn-dark {
    background: var(--bg-dark);
    color: #fff;
}
.btn-dark:hover { background: var(--bg-dark-soft); opacity: 1; }

.btn-glass {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.22); opacity: 1; }

.btn .arrow {
    display: inline-block;
    transition: transform var(--d-base) var(--ease-out);
}
.btn:hover .arrow { transform: translateX(4px); }

/* ── Cards ────────────────────────────────────────────────────────── */

.card {
    background: var(--bg-card);
    border-radius: var(--r-lg);
    padding: var(--s-7);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
    transition: all var(--d-base) var(--ease-standard);
}
.card:hover {
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--primary-glow);
    transform: translateY(-4px);
    border-color: transparent;
}

.card-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Service tile — used in services grid */
.service-tile {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--r-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--d-slow) var(--ease-out);
    border: 1px solid var(--line);
    isolation: isolate;
}
.service-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 80% at 100% 0%, var(--primary-glow), transparent 60%);
    opacity: 0;
    transition: opacity var(--d-slow) var(--ease-out);
    z-index: 0;
}
.service-tile:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}
.service-tile:hover::before { opacity: 1; }
.service-tile > * { position: relative; z-index: 1; }

.service-tile__image {
    aspect-ratio: 16 / 10;
    background: var(--bg-soft);
    overflow: hidden;
}
.service-tile__image img,
.service-tile__image > div {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--d-slower) var(--ease-out);
}
.service-tile:hover .service-tile__image img,
.service-tile:hover .service-tile__image > div { transform: scale(1.06); }

.service-tile__body { padding: var(--s-6) var(--s-6) var(--s-7); }
.service-tile__title { font-family: var(--font-display); font-weight: 800; font-size: var(--t-h3); color: var(--ink); margin: 0 0 var(--s-2); }
.service-tile__excerpt { color: var(--ink-mute); font-size: var(--t-body-sm); margin: 0 0 var(--s-5); }
.service-tile__cta { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 700; font-size: var(--t-body-sm); }

/* ── Form controls ───────────────────────────────────────────────── */

.field {
    display: block;
    width: 100%;
    padding: 18px 22px;
    background: var(--bg-card);
    border: 1.5px solid var(--line-strong);
    border-radius: var(--r-md);
    color: var(--ink);
    font-size: var(--t-body);
    transition: border-color var(--d-fast), box-shadow var(--d-fast);
}
.field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}
.field::placeholder { color: var(--ink-faint); }

.field-label {
    display: block;
    font-size: var(--t-body-sm);
    font-weight: 600;
    margin-bottom: var(--s-2);
    color: var(--ink-soft);
}

.field-group { margin-bottom: var(--s-5); }

/* Pill switch (e.g., SMS/WhatsApp toggle) */
.pill-switch {
    display: inline-flex;
    padding: 4px;
    background: var(--bg-soft);
    border-radius: var(--r-pill);
    border: 1px solid var(--line);
}
.pill-switch__btn {
    padding: 10px 22px;
    border-radius: var(--r-pill);
    font-size: var(--t-body-sm);
    font-weight: 600;
    color: var(--ink-mute);
    transition: all var(--d-base) var(--ease-standard);
}
.pill-switch__btn[aria-pressed="true"] {
    background: var(--bg-card);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

/* Chip selectors (used for variant pickers like 2BHK / 3BHK) */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: var(--r-pill);
    background: var(--bg-card);
    border: 1.5px solid var(--line-strong);
    color: var(--ink);
    font-size: var(--t-body-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--d-base) var(--ease-standard);
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}

/* ── Sticky transparent → solid header ──────────────────────────── */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: var(--s-4) 0;
    transition: background var(--d-base) var(--ease-standard),
                box-shadow var(--d-base) var(--ease-standard),
                padding var(--d-base) var(--ease-standard);
}
.site-header--scrolled {
    background: rgba(253, 250, 246, 0.88);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(28, 20, 13, 0.07), var(--shadow-sm);
    padding: var(--s-3) 0;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-7);
}

.nav-logo {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 22px;
    color: var(--ink);
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.nav-logo__mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--s-6);
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-links a {
    font-size: var(--t-body-sm);
    font-weight: 600;
    color: var(--ink-soft);
    position: relative;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform var(--d-base) var(--ease-out);
}
.nav-links a:hover { color: var(--ink); opacity: 1; }
.nav-links a:hover::after,
.nav-links a.is-active::after { transform: scaleX(1); }

/* Mega-menu for Services link */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, 12px);
    width: min(880px, 96vw);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(24px);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--line);
    padding: var(--s-6);
    opacity: 0;
    pointer-events: none;
    transition: all var(--d-base) var(--ease-out);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-3);
    z-index: 10;
}
.mega-menu.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 4px);
}
.mega-menu__item {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    transition: background var(--d-fast);
}
.mega-menu__item:hover { background: var(--bg-soft); opacity: 1; }
.mega-menu__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-glow);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.mega-menu__icon img { width: 24px; height: 24px; }
.mega-menu__label { font-weight: 700; font-size: var(--t-body-sm); }
.mega-menu__excerpt { color: var(--ink-mute); font-size: 12px; }

/* ── Footer ──────────────────────────────────────────────────────── */

.site-footer {
    background: var(--bg-dark);
    color: var(--ink-on-dark-soft);
    padding: var(--s-9) 0 var(--s-6);
}
.site-footer h4 {
    color: var(--ink-on-dark);
    font-size: var(--t-body);
    font-weight: 700;
    margin: 0 0 var(--s-4);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.site-footer li a { font-size: var(--t-body-sm); color: var(--ink-on-dark-soft); }
.site-footer li a:hover { color: var(--ink-on-dark); opacity: 1; }

/* ── Utility classes ─────────────────────────────────────────────── */

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.gap-5 { gap: var(--s-5); }
.gap-6 { gap: var(--s-6); }

.mt-2 { margin-top: var(--s-2); }
.mt-4 { margin-top: var(--s-4); }
.mt-6 { margin-top: var(--s-6); }
.mt-8 { margin-top: var(--s-8); }

.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-prose { max-width: 65ch; }
.max-w-2xl { max-width: 640px; }
.max-w-3xl { max-width: 780px; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1023px) {
    .grid-cols-3, .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 639px) {
    .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
}

/* ── Paper grain — a whisper of print texture over everything ──── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 500;
    pointer-events: none;
    opacity: 0.026;
    background-image: 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='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Parallax media (JS drives translate; base zoom keeps coverage) */
.parallax-media {
    --pz: 1.12;
    transform: translate3d(0, 0, 0) scale(var(--pz));
    will-change: transform;
}

/* ── Hide outline only for mouse users, keep for keyboard ──────── */
:focus { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }
