/* ============================================================
   Qadri Zaiqa Haleem — Theme tokens (mirrors app/globals.css)
   CSS variables are stored as raw `L C H` triples so Tailwind
   can apply alpha via oklch(var(--token) / <alpha-value>).
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@400;500;600;700;800;900&display=swap');

:root {
    --background: 0.98 0.005 60;
    --foreground: 0.2 0.02 30;
    --card: 1 0 0;
    --card-foreground: 0.2 0.02 30;
    --popover: 1 0 0;
    --popover-foreground: 0.2 0.02 30;
    --primary: 0.55 0.18 35;
    --primary-foreground: 0.98 0.005 60;
    --secondary: 0.94 0.02 70;
    --secondary-foreground: 0.35 0.08 35;
    --muted: 0.95 0.01 60;
    --muted-foreground: 0.5 0.02 30;
    --accent: 0.75 0.15 55;
    --accent-foreground: 0.25 0.05 30;
    --destructive: 0.577 0.245 27.325;
    --destructive-foreground: 0.577 0.245 27.325;
    --border: 0.9 0.02 60;
    --input: 0.92 0.01 60;
    --ring: 0.55 0.18 35;
    --radius: 0.75rem;

    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
}

.dark {
    --background: 0.15 0.02 30;
    --foreground: 0.95 0.01 60;
    --card: 0.18 0.02 30;
    --card-foreground: 0.95 0.01 60;
    --popover: 0.18 0.02 30;
    --popover-foreground: 0.95 0.01 60;
    --primary: 0.65 0.18 40;
    --primary-foreground: 0.15 0.02 30;
    --secondary: 0.25 0.03 30;
    --secondary-foreground: 0.9 0.01 60;
    --muted: 0.25 0.02 30;
    --muted-foreground: 0.65 0.02 60;
    --accent: 0.45 0.12 45;
    --accent-foreground: 0.95 0.01 60;
    --destructive: 0.396 0.141 25.723;
    --destructive-foreground: 0.637 0.237 25.331;
    --border: 0.28 0.02 30;
    --input: 0.25 0.02 30;
    --ring: 0.65 0.18 40;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: oklch(var(--background));
    color: oklch(var(--foreground));
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.font-serif { font-family: var(--font-serif) !important; }
.font-sans { font-family: var(--font-sans) !important; }

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   Animation keyframes (mirror framer-motion behaviors)
   ============================================================ */
@keyframes qz-spin-cw   { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes qz-spin-ccw  { from { transform: rotate(0); } to { transform: rotate(-360deg); } }
@keyframes qz-float-up  { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes qz-float-dn  { 0%,100% { transform: translateY(0); } 50% { transform: translateY(10px); } }
@keyframes qz-pulse-soft { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes qz-fade-in   { from { opacity: 0; } to { opacity: 1; } }
@keyframes qz-fade-up   { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes qz-fade-up-sm { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes qz-fade-scale { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes qz-blur-fade { from { opacity: 0; } to { opacity: 0.1; } }
@keyframes qz-particle  {
    0%   { transform: translateY(100vh); opacity: 0; }
    20%  { opacity: 0.8; }
    100% { transform: translateY(-10vh); opacity: 0; }
}
@keyframes qz-header-down {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
}

.anim-spin-slow    { animation: qz-spin-cw 60s linear infinite; }
.anim-spin-medium  { animation: qz-spin-ccw 45s linear infinite; }
.anim-spin-ring    { animation: qz-spin-cw 20s linear infinite; }
.anim-float-up     { animation: qz-float-up 3s ease-in-out infinite; }
.anim-float-dn     { animation: qz-float-dn 3s ease-in-out infinite; animation-delay: 1.5s; }
.anim-pulse-soft   { animation: qz-pulse-soft 2s cubic-bezier(0.4,0,0.6,1) infinite; }
.anim-header       { animation: qz-header-down .6s ease-out both; }
.anim-arrow-down   { animation: qz-float-up 2s ease-in-out infinite; }
.anim-fade         { animation: qz-fade-in .8s ease-out both; }
.anim-fade-up      { animation: qz-fade-up .8s ease-out both; }
.anim-fade-up-sm   { animation: qz-fade-up-sm .8s ease-out both; }
.anim-fade-scale   { animation: qz-fade-scale .8s ease-out both; }
.anim-blur         { animation: qz-blur-fade 2s ease-out both; }

/* Initial-load fade-in chain for hero text */
.fade-d1 { animation-delay: .2s; }
.fade-d2 { animation-delay: .4s; }
.fade-d3 { animation-delay: .6s; }
.fade-d4 { animation-delay: .8s; }
.fade-d5 { animation-delay: 1s; }

/* Scroll-reveal (used by IntersectionObserver in main.js) */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .7s ease-out, transform .7s ease-out;
    transition-delay: var(--reveal-delay, 0s);
}
[data-reveal="left"]   { transform: translateX(-50px); }
[data-reveal="right"]  { transform: translateX(50px); }
[data-reveal="scale"]  { transform: scale(0.8); }
[data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* Floating particles for branch selector */
.qz-particle {
    position: absolute;
    width: .5rem;
    height: .5rem;
    border-radius: 9999px;
    background: oklch(var(--primary) / 0.3);
    opacity: 0;
    animation: qz-particle 10s ease-out infinite;
}

/* Shine effect on branch card hover */
.qz-shine {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity .5s;
    pointer-events: none;
    border-radius: inherit;
}
.qz-shine::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 1s;
}
.branch-card:hover .qz-shine { opacity: 1; }
.branch-card:hover .qz-shine::before { transform: translateX(100%); }

/* Branch card hover-lift */
.branch-card { transition: transform .3s ease, box-shadow .3s ease; }
.branch-card:hover { transform: translateY(-6px) scale(1.03); }
.branch-card:active { transform: scale(0.98); }

/* Selected branch ring */
.branch-card.is-selected .branch-card-bg {
    background: oklch(var(--primary) / 0.2) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.branch-card.is-selected {
    box-shadow: 0 0 0 2px oklch(var(--primary)), 0 0 0 4px rgba(0,0,0,0.5);
}
.branch-card.is-selected .branch-card-arrow {
    background: oklch(var(--primary)) !important;
    color: oklch(var(--primary-foreground)) !important;
}
.branch-card.is-selected .branch-card-icon {
    background: oklch(var(--primary)) !important;
    color: oklch(var(--primary-foreground)) !important;
    box-shadow: 0 10px 15px -3px oklch(var(--primary) / 0.3);
}
.branch-card.is-selected .branch-card-selected-label { display: inline !important; }

/* Hover lift for generic cards */
.hover-lift { transition: transform .25s ease, box-shadow .25s ease; }
.hover-lift:hover { transform: translateY(-5px); }

.btn-scale { transition: transform .15s ease; }
.btn-scale:hover { transform: scale(1.05); }
.btn-scale:active { transform: scale(0.95); }

.tap-scale { transition: transform .15s ease; }
.tap-scale:hover { transform: scale(1.02); }
.tap-scale:active { transform: scale(0.98); }

.nav-link { transition: transform .2s ease, color .2s ease; }
.nav-link:hover { transform: translateY(-2px); color: oklch(var(--primary)); }

/* Collapse anim for mobile nav */
#mobile-nav {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height .35s ease, opacity .25s ease;
}
#mobile-nav.open {
    max-height: 600px;
    opacity: 1;
}

/* Drawer + modal helpers */
.qz-backdrop {
    position: fixed;
    inset: 0;
    background: oklch(var(--foreground) / 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 50;
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}
.qz-backdrop.open { opacity: 1; pointer-events: auto; }

.qz-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 28rem;
    background: oklch(var(--card));
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    z-index: 51;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(0.32,0.72,0,1);
}
.qz-drawer.open { transform: translateX(0); }

/* Branch selector modal (full screen) */
.qz-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    overflow: hidden;
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}
.qz-modal.open {
    opacity: 1;
    pointer-events: auto;
}

/* Product card lift */
.product-card { transition: transform .3s ease, box-shadow .3s ease; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1); }
.product-card .product-img { transition: transform .5s ease; }
.product-card:hover .product-img { transform: scale(1.1); }

/* Lucide placeholders are zero-content <i> elements; no sizing needed. */

/* Page-locked body */
body.no-scroll { overflow: hidden; }

/* ============================================================
   Custom responsive helpers — do NOT depend on Tailwind CDN.
   These cover layout-critical visibility so the page works
   even if Tailwind responsive variants fail to compile.
   ============================================================ */
.qz-nav-desktop { display: none !important; }
.qz-nav-mobile-btn { display: inline-flex !important; align-items: center; }
.qz-about-card { display: none; }
@media (min-width: 768px) {
    .qz-nav-desktop { display: flex !important; align-items: center; gap: 2rem; }
    .qz-nav-mobile-btn { display: none !important; }
    .qz-about-card { display: block; }
}

/* Floating "Years of Excellence" card pop-up — linked to parent reveal,
   uses a back-easing curve so the bounce is noticeable. */
.qz-about-card {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: opacity .6s ease-out, transform .6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: .35s;
}
[data-reveal="left"].is-visible .qz-about-card,
[data-reveal].is-visible.qz-about-card {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Footer social svg icons — force inheritance & visibility */
.qz-social svg {
    display: block;
    width: 20px;
    height: 20px;
    color: oklch(var(--background));
    stroke: currentColor;
    fill: none;
}

/* NOTE: do NOT define .hidden here — Tailwind provides it.
   Defining with !important breaks responsive variants like md:flex / md:block. */

/* Container fallback (Tailwind also provides) */
.container { width: 100%; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }
@media (min-width: 640px)  { .container { max-width: 640px; } }
@media (min-width: 768px)  { .container { max-width: 768px; } }
@media (min-width: 1024px) { .container { max-width: 1024px; } }
@media (min-width: 1280px) { .container { max-width: 1280px; } }
@media (min-width: 1536px) { .container { max-width: 1536px; } }
