/* ============================================================
   MEDA MIVA — Royal Tech Design System
   Agency-Grade Stylesheet v3.0
   Concept: Magha Nakshatra / Imperial Authority / Deep Tech
   ============================================================ */

/* ────────────────────────────────────────────────────────────
   1. DESIGN TOKENS
   ──────────────────────────────────────────────────────────── */
:root {
    /* Core Palette */
    --imperial-gold:     #D4AF37;
    --imperial-gold-lt:  #e8cc6a;
    --imperial-gold-dk:  #a8891f;
    --emerald:           #1a6b52;
    --emerald-dark:      #0d4235;
    --emerald-glow:      rgba(26, 107, 82, 0.25);
    --navy:              #080f1c;
    --navy-mid:          #0d1b2e;
    --navy-surface:      #111e30;

    /* Text */
    --text-primary:      #1a1f2e;
    --text-body:         #4a5568;
    --text-muted:        #8892a4;
    --text-on-dark:      rgba(255, 255, 255, 0.88);
    --text-on-dark-dim:  rgba(255, 255, 255, 0.55);

    /* Surfaces */
    --surface-white:     #ffffff;
    --surface-off:       #f8f9fb;
    --surface-card:      #ffffff;

    /* Borders */
    --border-light:      rgba(10, 25, 47, 0.08);
    --border-dark:       rgba(255, 255, 255, 0.07);
    --border-gold:       rgba(212, 175, 55, 0.35);

    /* Glows */
    --gold-glow:         rgba(212, 175, 55, 0.14);
    --gold-glow-strong:  rgba(212, 175, 55, 0.28);

    /* Typography Scale */
    --fs-display:  clamp(2.8rem, 5vw, 4.5rem);
    --fs-h1:       clamp(2.2rem, 4vw, 3.5rem);
    --fs-h2:       clamp(1.75rem, 2.5vw, 2.4rem);
    --fs-h3:       1.35rem;
    --fs-body:     1.0625rem;
    --fs-sm:       0.9rem;
    --fs-xs:       0.78rem;

    /* Spacing */
    --section-pad:       clamp(80px, 10vw, 130px);
    --container-width:   1380px;
    --container-gutter:  clamp(24px, 8%, 140px);

    /* Radius */
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   16px;
    --radius-xl:   24px;

    /* Transitions */
    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out:    cubic-bezier(0.0, 0.0, 0.2, 1);
}

/* ────────────────────────────────────────────────────────────
   2. BASE RESET & GLOBAL
   ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: var(--fs-body);
    color: var(--text-body);
    line-height: 1.75;
    background: var(--surface-white);
    overflow-x: hidden;
}

/* ────────────────────────────────────────────────────────────
   3. TYPOGRAPHY SCALE
   ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

h1 { font-size: var(--fs-h1); font-weight: 800; }
h2 { font-size: var(--fs-h2); font-weight: 700; }
h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -0.01em; }
h4 { font-size: 1.05rem; font-weight: 600; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* Section label pill — e.g. "AI Services" above a heading */
.section-label {
    display: inline-block;
    font-family: 'Outfit', sans-serif;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--imperial-gold);
    background: var(--gold-glow);
    border: 1px solid var(--border-gold);
    border-radius: 100px;
    padding: 5px 14px;
    margin-bottom: 20px;
}

/* ────────────────────────────────────────────────────────────
   4. LAYOUT CONTAINERS
   ──────────────────────────────────────────────────────────── */
.section-container {
    padding: var(--section-pad) var(--container-gutter);
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
}

/* Dark proof / stats sections */
.section-container.section--proof {
    background: var(--navy);
    max-width: 100%;
    padding: var(--section-pad) var(--container-gutter);
    position: relative;
    overflow: hidden;
}

/* Emerald glow orb behind proof sections */
.section--proof::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -10%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, var(--emerald-glow) 0%, transparent 65%);
    pointer-events: none;
}

.section--proof::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -5%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--gold-glow) 0%, transparent 60%);
    pointer-events: none;
}

.section--proof h2 {
    color: #ffffff;
    position: relative;
    z-index: 1;
}

.section--proof p {
    color: var(--text-on-dark-dim);
    position: relative;
    z-index: 1;
}

/* ────────────────────────────────────────────────────────────
   5. NAVIGATION — Royal Glassmorphism
   ──────────────────────────────────────────────────────────── */
.main-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--container-gutter);
    height: 72px;
    background: rgba(8, 15, 28, 0.82);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-dark);
    transition: background 0.4s ease, border-color 0.4s ease;
}

/* Logo mark + wordmark */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo .logo-mark svg { display: block; }

.nav-logo .logo-wordmark {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 0.08em;
    /* Metallic gold gradient text */
    background: linear-gradient(135deg, var(--imperial-gold-dk) 0%, var(--imperial-gold) 40%, var(--imperial-gold-lt) 60%, var(--imperial-gold) 80%, var(--imperial-gold-dk) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Weighted M base achieved via font-variation or strong weight */
    line-height: 1;
}

/* Nav links group */
.nav-links {
    display: flex;
    gap: 6px;
    align-items: center;
}

.nav-link, .nav-dropdown-trigger {
    color: var(--text-on-dark);
    text-decoration: none;
    font-size: var(--fs-sm);
    font-weight: 500;
    cursor: pointer;
    position: relative;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover, .nav-dropdown-trigger:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}

/* Chevron on dropdown triggers */
.nav-dropdown-trigger::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    margin-left: 6px;
    opacity: 0.6;
    transition: transform 0.25s ease;
}

.nav-dropdown-trigger:hover::after {
    transform: rotate(225deg) translateY(2px);
    opacity: 1;
}

/* Dropdown panel */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    background: rgba(13, 27, 46, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-dark);
    border-top: 1px solid var(--border-gold);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(212,175,55,0.06);
    border-radius: var(--radius-md);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.98);
    transform-origin: top left;
    transition: all 0.28s var(--ease-smooth);
    z-index: 200;
}

.nav-dropdown::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
}

.nav-dropdown-trigger:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.nav-dropdown-item {
    display: block;
    padding: 9px 16px;
    color: var(--text-on-dark-dim);
    text-decoration: none;
    font-size: var(--fs-sm);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.nav-dropdown-item:hover {
    color: var(--imperial-gold);
    background: rgba(212, 175, 55, 0.07);
    border-left-color: var(--imperial-gold);
    padding-left: 20px;
}

/* ────────────────────────────────────────────────────────────
   6. HERO SECTION — Royal Command
   ──────────────────────────────────────────────────────────── */
.hero-section {
    position: relative;
    padding: clamp(120px, 16vw, 180px) var(--container-gutter) clamp(100px, 14vw, 160px);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

/* Fine hexagonal dot grid overlay */
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(212, 175, 55, 0.12) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

/* Emerald ambient orb — top right */
.hero-section .hero-orb-emerald {
    position: absolute;
    top: -15%;
    right: -8%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(26, 107, 82, 0.35) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

/* Gold ambient orb — bottom left */
.hero-section .hero-orb-gold {
    position: absolute;
    bottom: -20%;
    left: -5%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.hero-section > section {
    position: relative;
    z-index: 1;
    max-width: 820px;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--imperial-gold);
    margin-bottom: 22px;
}

.hero-eyebrow::before {
    content: '';
    display: block;
    width: 28px;
    height: 1.5px;
    background: var(--imperial-gold);
    opacity: 0.7;
}

.hero-h1 {
    color: #ffffff;
    font-size: var(--fs-display);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
}

.hero-section p {
    color: var(--text-on-dark);
    font-size: clamp(1.05rem, 1.5vw, 1.22rem);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 620px;
}

/* ────────────────────────────────────────────────────────────
   7. BUTTONS
   ──────────────────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: var(--fs-sm);
    letter-spacing: 0.02em;
    color: var(--navy);
    background: #ffffff;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    text-decoration: none;
    border: none;
    transition: all 0.3s var(--ease-smooth);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    background: var(--surface-off);
}

.btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: var(--fs-sm);
    letter-spacing: 0.02em;
    color: var(--navy);
    background: var(--imperial-gold);
    padding: 13px 28px;
    border-radius: var(--radius-md);
    text-decoration: none;
    border: none;
    transition: all 0.3s var(--ease-smooth);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.25);
}

.btn-accent:hover {
    transform: translateY(-3px);
    background: var(--imperial-gold-lt);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
}

.btn-emergency {
    display: inline-flex;
    align-items: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: var(--fs-sm);
    color: #ffffff;
    background: #c0392b;
    padding: 13px 28px;
    border-radius: var(--radius-md);
    text-decoration: none;
    animation: pulse 2.2s ease infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.6); }
    60%  { box-shadow: 0 0 0 12px rgba(192, 57, 43, 0); }
    100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0); }
}

/* ────────────────────────────────────────────────────────────
   8. CARDS — Premium Depth
   ──────────────────────────────────────────────────────────── */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 22px;
    margin-top: 50px;
}

.card {
    position: relative;
    background: var(--surface-card);
    border: 1px solid rgba(10, 25, 47, 0.07);
    border-radius: var(--radius-lg);
    padding: 34px 30px 30px;
    overflow: hidden;
    transition: all 0.45s var(--ease-smooth);
    box-shadow: 0 2px 8px rgba(10,25,47,0.04), 0 8px 24px rgba(10,25,47,0.03);
}

/* Gold accent dot in top-left corner */
.card::before {
    content: '';
    position: absolute;
    top: 24px;
    right: 24px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--imperial-gold);
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Slide-in bottom accent bar */
.card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--emerald), var(--imperial-gold));
    transition: width 0.5s var(--ease-smooth);
}

.card:hover {
    transform: translateY(-10px);
    border-color: transparent;
    box-shadow:
        0 2px 8px rgba(10,25,47,0.04),
        0 16px 40px rgba(10,25,47,0.08),
        0 0 0 1px rgba(212,175,55,0.12),
        0 0 60px rgba(212,175,55,0.05);
}

.card:hover::before {
    opacity: 1;
    transform: scale(1.5);
}

.card:hover::after { width: 100%; }

.card h3 {
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 12px;
    font-size: var(--fs-h3);
}

.card p {
    color: var(--text-body);
    font-size: var(--fs-sm);
    line-height: 1.7;
    margin-bottom: 0;
}

.card .card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    font-weight: 600;
    font-size: var(--fs-sm);
    color: var(--imperial-gold);
    text-decoration: none;
    transition: gap 0.25s ease, color 0.25s ease;
}

.card:hover .card-link { gap: 10px; color: var(--imperial-gold-dk); }

/* ────────────────────────────────────────────────────────────
   9. STAT BLOCKS — Dark Proof Strip (Royal Command)
   ──────────────────────────────────────────────────────────── */
.stat-grid {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 40px;
    position: relative;
    z-index: 1;
}

.stat-block {
    flex: 1;
    min-width: 220px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-dark);
    border-top: 2px solid var(--imperial-gold);
    border-radius: var(--radius-md);
    padding: 30px 28px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.stat-block:hover {
    background: rgba(212,175,55,0.05);
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--imperial-gold);
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.stat-desc {
    font-size: var(--fs-sm);
    color: var(--text-on-dark-dim);
    line-height: 1.5;
    margin: 0;
}

/* ────────────────────────────────────────────────────────────
   10. CHECKLIST BLOCKS
   ──────────────────────────────────────────────────────────── */
.checklist-block {
    background: var(--surface-off);
    border-left: 4px solid var(--imperial-gold);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 30px 36px;
    margin-top: 28px;
}

.checklist-block ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checklist-block li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text-body);
    font-size: var(--fs-sm);
    line-height: 1.6;
}

.checklist-block li::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23D4AF37'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ────────────────────────────────────────────────────────────
   11. FOOTER — Royal Architecture
   ──────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--navy);
    color: var(--text-on-dark);
    margin-top: 0;
    /* Thin gold top rule */
    border-top: 1px solid var(--border-gold);
    position: relative;
    overflow: hidden;
}

/* Ambient emerald glow in footer */
.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 400px;
    background: radial-gradient(ellipse at top, rgba(26,107,82,0.15) 0%, transparent 65%);
    pointer-events: none;
}

.footer-main {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: space-between;
    padding: 70px var(--container-gutter) 50px;
    border-bottom: 1px solid var(--border-dark);
    position: relative;
    z-index: 1;
}

.footer-brand { flex: 1; min-width: 260px; max-width: 320px; }

.footer-brand .footer-logo-wordmark {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, var(--imperial-gold-dk), var(--imperial-gold), var(--imperial-gold-lt), var(--imperial-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    margin-bottom: 16px;
}

.footer-brand p {
    font-size: var(--fs-sm);
    color: var(--text-on-dark-dim);
    line-height: 1.7;
    margin-bottom: 22px;
}

.footer-social {
    display: flex;
    gap: 12px;
}

.footer-social a {
    color: var(--text-on-dark-dim);
    text-decoration: none;
    font-size: var(--fs-sm);
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-social a:hover { color: var(--imperial-gold); }

.footer-col { flex: 1; min-width: 160px; }

.footer-col-heading {
    font-family: 'Outfit', sans-serif;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--imperial-gold);
    margin-bottom: 18px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col ul li a {
    color: var(--text-on-dark-dim);
    text-decoration: none;
    font-size: var(--fs-sm);
    transition: color 0.2s ease, padding-left 0.2s ease;
    display: inline-block;
}

.footer-col ul li a:hover {
    color: var(--text-on-dark);
    padding-left: 4px;
}

/* Newsletter strip */
.footer-newsletter {
    padding: 48px var(--container-gutter);
    border-bottom: 1px solid var(--border-dark);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 36px;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.footer-newsletter-copy h3 {
    color: #ffffff;
    font-size: 1.3rem;
    margin-bottom: 6px;
}

.footer-newsletter-copy p {
    color: var(--text-on-dark-dim);
    font-size: var(--fs-sm);
    margin: 0;
}

.newsletter-form {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 280px;
    max-width: 480px;
}

.newsletter-form input[type="email"] {
    flex: 1;
    padding: 13px 18px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    color: #ffffff;
    font-size: var(--fs-sm);
    outline: none;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.newsletter-form input[type="email"]:focus {
    border-color: var(--imperial-gold);
    background: rgba(212,175,55,0.05);
}

.newsletter-form input::placeholder { color: var(--text-on-dark-dim); }

.footer-bottom {
    padding: 24px var(--container-gutter);
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.footer-bottom p {
    font-size: var(--fs-xs);
    color: var(--text-on-dark-dim);
    margin: 0;
}

/* ────────────────────────────────────────────────────────────
   12. SCROLL REVEAL ANIMATION
   ──────────────────────────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
    will-change: transform, opacity;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ────────────────────────────────────────────────────────────
   13. SECTION HEADINGS — contextual
   ──────────────────────────────────────────────────────────── */
.section-heading-group {
    margin-bottom: 10px;
}

.section-heading-group h2 {
    margin-bottom: 16px;
}

.section-heading-group p {
    font-size: 1.05rem;
    color: var(--text-body);
    max-width: 680px;
    line-height: 1.75;
}

/* On dark sections, override text colors */
.section--proof .section-heading-group p { color: var(--text-on-dark-dim); }

/* ────────────────────────────────────────────────────────────
   14. RESPONSIVE
   ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .nav-links { display: none; }

    .service-grid {
        grid-template-columns: 1fr;
    }

    .stat-grid { flex-direction: column; }

    .hero-section .hero-orb-emerald,
    .hero-section .hero-orb-gold { display: none; }

    .footer-main { flex-direction: column; }
    .footer-newsletter { flex-direction: column; align-items: flex-start; }
    .newsletter-form { max-width: 100%; width: 100%; }
}
