/* Dhaga Interactive — Comprehensive Utility Stylesheet */
/* Replaces Tailwind CDN for offline/file:// usage */

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg, video {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

ul, ol {
    list-style: none;
}

address {
    font-style: normal;
}

/* ===== CUSTOM PROPERTIES ===== */
:root {
    --color-bg: #1A1612;
    --color-surface: #2A2420;
    --color-card: #342E28;
    --color-cream: #EDE4D3;
    --color-muted: #A89D8F;
    --color-indigo: #3D5A9E;
    --color-turmeric: #E8B82A;
    --color-madder: #C44040;
    --color-neem: #5A8B4A;
}

/* ===== FONT FAMILIES ===== */
.font-sans { font-family: 'Work Sans', sans-serif; }
.font-garamond { font-family: 'EB Garamond', serif; }
.font-hindi { font-family: 'Tiro Devanagari Hindi', serif; }

/* ===== ANTIALIASED ===== */
.antialiased {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== DISPLAY ===== */
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }

/* ===== POSITION ===== */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

/* ===== INSET ===== */
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.top-6 { top: 1.5rem; }
.right-6 { right: 1.5rem; }
.bottom-8 { bottom: 2rem; }
.left-1\/2 { left: 50%; }

/* ===== Z-INDEX ===== */
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }
.z-\[100\] { z-index: 100; }

/* ===== OVERFLOW ===== */
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* ===== FLEXBOX ===== */
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

/* ===== GAP ===== */
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }

/* ===== WIDTH ===== */
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-16 { width: 4rem; }
.w-32 { width: 8rem; }
.w-full { width: 100%; }

/* ===== HEIGHT ===== */
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-16 { height: 4rem; }
.h-32 { height: 8rem; }
.h-px { height: 1px; }
.h-full { height: 100%; }

/* ===== MIN/MAX SIZING ===== */
.min-h-screen { min-height: 100vh; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-6xl { max-width: 72rem; }

/* ===== ASPECT RATIO ===== */
.aspect-\[16\/10\] { aspect-ratio: 16/10; }
.aspect-\[4\/3\] { aspect-ratio: 4/3; }
.aspect-video { aspect-ratio: 16/9; }

/* ===== MARGIN ===== */
.mx-auto { margin-left: auto; margin-right: auto; }
.mx-4 { margin-left: 1rem; margin-right: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mt-24 { margin-top: 6rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }

/* ===== PADDING ===== */
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-24 { padding-top: 6rem; padding-bottom: 6rem; }
.pt-32 { padding-top: 8rem; }
.pb-16 { padding-bottom: 4rem; }

/* ===== SPACE ===== */
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* ===== TYPOGRAPHY — SIZE ===== */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }

/* ===== TYPOGRAPHY — WEIGHT ===== */
.font-medium { font-weight: 500; }

/* ===== TYPOGRAPHY — STYLE ===== */
.italic { font-style: italic; }
.not-italic { font-style: normal; }

/* ===== TYPOGRAPHY — LINE HEIGHT ===== */
.leading-none { line-height: 1; }
.leading-relaxed { line-height: 1.625; }
.leading-loose { line-height: 2; }

/* ===== TYPOGRAPHY — TRACKING ===== */
.tracking-wide { letter-spacing: 0.025em; }

/* ===== TYPOGRAPHY — TRANSFORM ===== */
.uppercase { text-transform: uppercase; }

/* ===== TYPOGRAPHY — ALIGNMENT ===== */
.text-center { text-align: center; }

/* ===== TEXT COLORS ===== */
.text-cream { color: #EDE4D3; }
.text-muted { color: #A89D8F; }
.text-turmeric { color: #E8B82A; }
.text-madder { color: #C44040; }
.text-neem { color: #5A8B4A; }
.text-cream\/60 { color: rgba(237, 228, 211, 0.6); }
.text-cream\/70 { color: rgba(237, 228, 211, 0.7); }
.text-cream\/80 { color: rgba(237, 228, 211, 0.8); }
.text-cream\/90 { color: rgba(237, 228, 211, 0.9); }
.text-muted\/30 { color: rgba(168, 157, 143, 0.3); }
.text-muted\/40 { color: rgba(168, 157, 143, 0.4); }
.text-turmeric\/60 { color: rgba(232, 184, 42, 0.6); }
.text-turmeric\/70 { color: rgba(232, 184, 42, 0.7); }
.text-turmeric\/80 { color: rgba(232, 184, 42, 0.8); }

/* ===== BACKGROUND COLORS ===== */
.bg-bg { background-color: #1A1612; }
.bg-surface { background-color: #2A2420; }
.bg-card { background-color: #342E28; }
.bg-bg\/90 { background-color: rgba(26, 22, 18, 0.9); }
.bg-bg\/95 { background-color: rgba(26, 22, 18, 0.95); }
.bg-bg\/40 { background-color: rgba(26, 22, 18, 0.4); }
.bg-bg\/70 { background-color: rgba(26, 22, 18, 0.7); }
.bg-turmeric\/10 { background-color: rgba(232, 184, 42, 0.1); }
.bg-turmeric\/40 { background-color: rgba(232, 184, 42, 0.4); }

/* ===== BORDER COLORS ===== */
.border-surface { border-color: #2A2420; }
.border-card { border-color: #342E28; }
.border-turmeric\/30 { border-color: rgba(232, 184, 42, 0.3); }
.border-turmeric\/40 { border-color: rgba(232, 184, 42, 0.4); }
.border-neem\/30 { border-color: rgba(90, 139, 74, 0.3); }
.border-muted\/30 { border-color: rgba(168, 157, 143, 0.3); }

/* ===== BORDERS ===== */
.border { border-width: 1px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }

/* ===== BORDER RADIUS ===== */
.rounded-sm { border-radius: 0.125rem; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* ===== SHADOWS ===== */
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }

/* ===== OPACITY ===== */
.opacity-20 { opacity: 0.2; }

/* ===== BACKDROP ===== */
.backdrop-blur-md { -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.backdrop-blur-sm { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

/* ===== TRANSFORMS ===== */
.-translate-x-1\/2 { transform: translateX(-50%); }

/* ===== TRANSITIONS ===== */
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

/* ===== HOVER STATES ===== */
.hover\:text-turmeric:hover { color: #E8B82A; }
.hover\:text-cream:hover { color: #EDE4D3; }
.hover\:text-turmeric\/80:hover { color: rgba(232, 184, 42, 0.8); }
.hover\:bg-turmeric\/10:hover { background-color: rgba(232, 184, 42, 0.1); }
.hover\:border-turmeric\/30:hover { border-color: rgba(232, 184, 42, 0.3); }

/* ===== GROUP HOVER ===== */
.group:hover .group-hover\:text-turmeric { color: #E8B82A; }

/* ===== ANIMATION ===== */
.animate-bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(-25%) translateX(-50%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0) translateX(-50%);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

/* ===== GRADIENT UTILITY ===== */
.bg-gradient-to-b {
    background-image: linear-gradient(to bottom, var(--tw-gradient-stops, transparent, transparent));
}

/* The hero uses inline-style gradient via from/via/to which Tailwind generates.
   We handle it with a specific rule for the hero overlay */
.from-bg\/40 { --tw-gradient-from: rgba(26, 22, 18, 0.4); }
.via-bg\/70 { --tw-gradient-via: rgba(26, 22, 18, 0.7); }
.to-bg { --tw-gradient-to: #1A1612; }

/* Combined gradient class support */
.bg-gradient-to-b.from-bg\/40.via-bg\/70.to-bg {
    background-image: linear-gradient(to bottom, rgba(26, 22, 18, 0.4), rgba(26, 22, 18, 0.7), #1A1612);
}

/* ===== RESPONSIVE: SM (640px) ===== */
@media (min-width: 640px) {
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .sm\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
    .sm\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .sm\:text-5xl { font-size: 3rem; line-height: 1; }
    .sm\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sm\:flex-row { flex-direction: row; }
}

/* ===== RESPONSIVE: MD (768px) ===== */
@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:text-5xl { font-size: 3rem; line-height: 1; }
    .md\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
}

/* ===== RESPONSIVE: LG (1024px) ===== */
@media (min-width: 1024px) {
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:gap-8 { gap: 2rem; }
    .lg\:order-1 { order: 1; }
    .lg\:order-2 { order: 2; }
}

/* ===== CUSTOM: THREAD LINE ===== */
.thread-line {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3D5A9E, #E8B82A, #C44040, #5A8B4A, #3D5A9E);
    background-size: 300% 100%;
    animation: thread-shimmer 8s ease-in-out infinite;
    z-index: 100;
}

@keyframes thread-shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== CUSTOM: THREAD DIVIDER ===== */
.thread-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(232, 184, 42, 0.25), transparent);
    margin: 2rem 0;
}

/* ===== CUSTOM: SCROLL ANIMATIONS ===== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== CUSTOM: PAGE ENTER ===== */
/* Disabled — loader handles page reveal now */

/* ===== CUSTOM: LIGHTBOX ===== */
#lightbox {
    transition: opacity 0.3s ease;
}

#lightbox.is-active {
    display: flex;
    opacity: 1;
}

#lightbox:not(.is-active) {
    opacity: 0;
    pointer-events: none;
}

/* ===== CUSTOM: SELECTION ===== */
::selection {
    background: rgba(232, 184, 42, 0.19);
    color: #EDE4D3;
}

/* ===== CUSTOM: FOCUS STYLES ===== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #E8B82A;
    outline-offset: 2px;
}

/* ===== CUSTOM: HAMBURGER ===== */
.hamburger-close {
    display: none;
}

.nav-open .hamburger-open {
    display: none;
}

.nav-open .hamburger-close {
    display: block;
}

/* ===== GRID COLS (default / base) ===== */
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ===== CUSTOM: HERO LOOM BACKGROUND ===== */
.hero-loom-bg {
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 20px,
      rgba(232,184,42,0.03) 20px,
      rgba(232,184,42,0.03) 21px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 20px,
      rgba(61,90,158,0.03) 20px,
      rgba(61,90,158,0.03) 21px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 40px,
      rgba(232,184,42,0.02) 40px,
      rgba(232,184,42,0.02) 41px
    ),
    linear-gradient(180deg, rgba(42,36,32,0.8) 0%, rgba(26,22,18,1) 100%);
}

/* ===== LOADER — Spinner ===== */
#site-loader {
    will-change: opacity;
}

.dhaga-spinner {
    animation: dhaga-spin 1s linear infinite;
}

@keyframes dhaga-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dhaga-loading-dots span {
    animation: dhaga-dots-pulse 1.4s ease-in-out infinite;
}

.dhaga-loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.dhaga-loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dhaga-dots-pulse {
    0%, 80%, 100% { opacity: 0.2; }
    40% { opacity: 1; }
}
