/* =============================================
   eProfile Cinematic Layer for AGL
   Adds: grain, ambient orbs, foot giant, floating rail,
   BizChat drawer, refined section rhythm.
   Loaded AFTER public.css so it can override.
   ============================================= */

/* === Grain texture overlay (subtle film noise) === */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.5'/></svg>");
    opacity: 0.035;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 999;
}
[data-theme="light"] body::before { opacity: 0.045; mix-blend-mode: multiply; }

/* === Ambient orbs (soft gradient lights) === */
.ambient-orbs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}
.ambient-orbs .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.14;
    animation: orbDrift 24s ease-in-out infinite;
    will-change: transform;
}
.ambient-orbs .orb-1 {
    width: 420px; height: 420px;
    background: radial-gradient(circle, var(--red), transparent 70%);
    top: -100px; left: -80px;
    animation-delay: 0s;
}
.ambient-orbs .orb-2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #c5a572, transparent 70%);
    top: 40%; right: -120px;
    animation-delay: -8s;
}
.ambient-orbs .orb-3 {
    width: 360px; height: 360px;
    background: radial-gradient(circle, var(--red), transparent 70%);
    bottom: -80px; left: 30%;
    animation-delay: -16s;
}
@keyframes orbDrift {
    0%,100% { transform: translate(0,0); }
    33%      { transform: translate(60px, -40px); }
    66%      { transform: translate(-40px, 40px); }
}
[data-theme="light"] .ambient-orbs .orb { opacity: 0.09; }
@media (prefers-reduced-motion: reduce) {
    .ambient-orbs .orb { animation: none !important; }
}

/* === Signature quote block (large italic serif) === */
.signature-quote {
    max-width: 880px;
    margin: 80px auto;
    text-align: center;
    padding: 0 24px;
    position: relative;
}
.signature-quote::before {
    content: '\201C';
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Playfair Display', serif;
    font-size: 180px;
    line-height: 1;
    color: var(--red);
    opacity: 0.12;
    pointer-events: none;
}
.signature-quote p {
    font-family: 'Playfair Display', 'Times New Roman', serif;
    font-size: clamp(22px, 3vw, 34px);
    font-style: italic;
    font-weight: 400;
    line-height: 1.4;
    color: var(--text);
    letter-spacing: -0.01em;
    margin: 0 0 18px;
}
.signature-quote cite {
    display: block;
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-size: 12px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

/* === Foot giant wordmark (huge AGL text near footer) === */
.foot-giant {
    text-align: center;
    padding: 60px 20px 20px;
    font-family: 'Playfair Display', serif;
    font-size: clamp(72px, 18vw, 240px);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: -0.04em;
    background: linear-gradient(
        180deg,
        rgba(237,28,36,0.12) 0%,
        rgba(237,28,36,0.06) 50%,
        transparent 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    overflow: hidden;
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
    margin-top: -20px;
}
[data-theme="light"] .foot-giant {
    background: linear-gradient(
        180deg,
        rgba(237,28,36,0.15) 0%,
        rgba(237,28,36,0.05) 50%,
        transparent 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
}

/* === Hero card badge (bottom-right of hero) === */
.hero-card {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px 12px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    font-size: 13px;
    margin-top: 40px;
}
.hero-card .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red), var(--red-light));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 14px;
}
.hero-card .avatar img { width: 22px; height: 22px; }
.hero-card .role {
    font-size: 11.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 600;
}
.hero-card .name { font-weight: 600; }
[data-theme="light"] .hero-card {
    background: rgba(0,0,0,0.02);
    border-color: rgba(0,0,0,0.08);
}

/* === Refined section heading with eyebrow + accent word + suffix === */
.eh {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 60px;
}
.eh .eb {
    display: inline-block;
    color: var(--red);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    letter-spacing: 0.30em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 18px;
    padding: 0 24px;
    position: relative;
}
.eh .eb::before, .eh .eb::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 14px;
    height: 1px;
    background: var(--red);
    opacity: 0.5;
}
.eh .eb::before { left: 0; }
.eh .eb::after { right: 0; }
.eh h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(30px, 4.4vw, 56px);
    font-weight: 500;
    letter-spacing: -0.025em;
    line-height: 1.08;
    margin: 0 0 18px;
    color: var(--text);
}
.eh h2 em {
    font-style: italic;
    font-weight: 400;
    background: linear-gradient(135deg, var(--red-light), var(--red));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding-right: 4px;
}
.eh > p {
    color: var(--text-soft);
    font-size: 17px;
    line-height: 1.7;
    max-width: 580px;
    margin: 0 auto;
}

/* === Floating action rail (WhatsApp + chat + top) === */
.float-rail {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 200;
    pointer-events: none;
}
.float-btn {
    pointer-events: auto;
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.28);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
}
.float-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.36); }
.float-btn:active { transform: translateY(-1px); }
.float-wa   { background: #25D366; }
.float-chat { background: var(--red); }
.float-top  { background: var(--gold, #c5a572); opacity: 0; transform: translateY(10px); pointer-events: none; transition: all 0.3s; }
.float-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.float-btn .tooltip {
    position: absolute;
    right: 62px;
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: var(--dark-3);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    border: 1px solid var(--border);
}
.float-btn:hover .tooltip { opacity: 1; transform: translateY(-50%) translateX(0); }

/* === BizChat drawer === */
.bizchat {
    position: fixed;
    right: 20px;
    bottom: 90px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 560px;
    max-height: calc(100vh - 110px);
    background: var(--dark-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 300;
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.bizchat.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.bizchat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-soft);
    background: linear-gradient(135deg, rgba(237,28,36,0.06), transparent);
}
.bizchat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(237,28,36,0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(237,28,36,0.2);
}
.bizchat-name { font-weight: 700; font-size: 15px; color: var(--text); }
.bizchat-status {
    font-size: 11.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
.bizchat-status .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #2dd4a0;
    box-shadow: 0 0 8px #2dd4a0;
}
.bizchat-close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    transition: all 0.2s;
}
.bizchat-close:hover { color: var(--text); background: var(--border-soft); }
.bizchat-body {
    flex: 1;
    padding: 18px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.bizchat-msg {
    max-width: 82%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.55;
}
.bizchat-msg.bot {
    align-self: flex-start;
    background: var(--dark-3);
    color: var(--text);
    border-bottom-left-radius: 4px;
}
.bizchat-msg.user {
    align-self: flex-end;
    background: var(--red);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.bizchat-msg p { margin: 0; }
.bizchat-msg a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.bizchat-msg.user a { color: #ffe5e6; }
.bizchat-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.bc-chip {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-soft);
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.bc-chip:hover { border-color: var(--red); color: var(--red); background: rgba(237,28,36,0.05); }
.bizchat-input {
    display: flex;
    gap: 8px;
    padding: 14px 16px;
    border-top: 1px solid var(--border-soft);
    background: var(--dark-3);
}
.bizchat-input input {
    flex: 1;
    background: var(--dark-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.bizchat-input input:focus { border-color: var(--red); }
.bizchat-input button {
    width: 42px;
    height: 42px;
    background: var(--red);
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.bizchat-input button:hover { background: var(--red-dark); }
.bizchat-foot {
    padding: 10px 20px 14px;
    text-align: center;
    background: var(--dark-3);
    border-top: 1px solid var(--border-soft);
}
.bizchat-foot a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s;
}
.bizchat-foot a:hover { color: #25D366; }

[data-theme="light"] .bizchat {
    background: #fff;
    box-shadow: 0 24px 60px rgba(40,30,15,0.18);
}
[data-theme="light"] .bizchat-msg.bot { background: #f6f4ef; }
[data-theme="light"] .bizchat-input { background: #faf9f6; }
[data-theme="light"] .bizchat-foot { background: #faf9f6; }

/* === Hide legacy scroll-top (replaced by float-rail) === */
.scroll-top { display: none !important; }

/* === Responsive === */
@media (max-width: 720px) {
    .float-rail { right: 12px; bottom: 12px; gap: 10px; }
    .float-btn { width: 46px; height: 46px; }
    .float-btn .tooltip { display: none; }
    .bizchat { right: 12px; bottom: 76px; height: calc(100vh - 100px); max-height: 540px; }
    .signature-quote { margin: 60px auto; }
    .foot-giant { font-size: clamp(48px, 20vw, 120px); padding: 40px 12px 10px; }
}

/* === Print === */
@media print {
    .float-rail, .bizchat, .ambient-orbs, .foot-giant { display: none !important; }
    body::before { display: none !important; }
}
