/* ==========================================================================
   SwapnRaj — base.css
   Design tokens, reset, accessibility helpers, and progressive-enhancement
   reveal animations. Section-specific styles live in sections.css and page
   layout (nav, footer, floats) in layout.css.
   ========================================================================== */

:root {
    /* Brand palette. NOTE: --kokum-deep must be a DARK maroon: it is used for
       headings, hovers, and gradients. The original spec had it set to #FFFFFF
       which made hero headings invisible on light backgrounds. */
    --kokum-brown: #6A213A;
    --kokum-deep: #4A1522;
    --forest-green: #2D5A3D;
    --forest-light: #4A7C59;
    --sand: #D4A574;
    --sand-light: #E8D4B8;
    --cream: #F7EBE8;
    --paper: #F5F0E8;
    --warm-white: #FFFCF7;
    --text: #2C2416;
    --text-muted: #6B5D4D;
    --jambhul: #4A1259;
    --butter: #B47F3F;
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-marathi: 'Noto Serif Devanagari', serif;
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    /* Snap feels good on wide, tall screens; see responsive.css for when it
       becomes mandatory vs. proximity. */
    scroll-snap-type: y proximity;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--cream);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Visible keyboard focus everywhere, including on rounded elements. */
:focus-visible { outline: 3px solid rgba(107, 58, 42, 0.55); outline-offset: 2px; }

/* Skip link */
.skip-link {
    position: fixed;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--kokum-brown);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    transition: top 0.3s;
    text-decoration: none;
}
.skip-link:focus { top: 0; }

/* Scroll progress (decorative) */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, var(--kokum-brown), var(--forest-green));
    z-index: 10001;
    transform-origin: left;
    transform: scaleX(0);
}

/* --------------------------------------------------------------------------
   Reveal animations.
   Content is VISIBLE by default. Only once JS runs (html.js) do elements get
   hidden and re-revealed by IntersectionObserver, so the page never blanks
   out for users without JavaScript.
   -------------------------------------------------------------------------- */

html.js .reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s var(--transition-smooth), transform 0.8s var(--transition-smooth);
}
html.js .reveal.visible { opacity: 1; transform: translateY(0); }

html.js .reveal-left {
    opacity: 0;
    transform: translateX(-80px);
    transition: opacity 0.8s var(--transition-smooth), transform 0.8s var(--transition-smooth);
}
html.js .reveal-left.visible { opacity: 1; transform: translateX(0); }

html.js .reveal-right {
    opacity: 0;
    transform: translateX(80px);
    transition: opacity 0.8s var(--transition-smooth), transform 0.8s var(--transition-smooth);
}
html.js .reveal-right.visible { opacity: 1; transform: translateX(0); }

html.js .stagger-children > * {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s var(--transition-smooth), transform 0.6s var(--transition-smooth);
}
html.js .stagger-children.visible > *:nth-child(1) { transition-delay: 0.1s; }
html.js .stagger-children.visible > *:nth-child(2) { transition-delay: 0.2s; }
html.js .stagger-children.visible > *:nth-child(3) { transition-delay: 0.3s; }
html.js .stagger-children.visible > *:nth-child(4) { transition-delay: 0.4s; }
html.js .stagger-children.visible > *:nth-child(5) { transition-delay: 0.5s; }
html.js .stagger-children.visible > *:nth-child(6) { transition-delay: 0.6s; }
html.js .stagger-children.visible > *:nth-child(7) { transition-delay: 0.7s; }
html.js .stagger-children.visible > *:nth-child(8) { transition-delay: 0.8s; }
html.js .stagger-children.visible > * { opacity: 1; transform: translateY(0); }

/* Hero entrance plays on page load with plain CSS — no JS needed, so the
   most important content animates even before the module script runs. */
.hero-anim { opacity: 0; animation: hero-rise 0.9s var(--transition-smooth) forwards; }
.hero-anim--1 { animation-delay: 0.05s; }
.hero-anim--2 { animation-delay: 0.15s; }
.hero-anim--3 { animation-delay: 0.25s; }
.hero-anim--4 { animation-delay: 0.35s; }
.hero-anim--5 { animation-delay: 0.45s; }

.hero-anim-right { opacity: 0; animation: hero-rise-right 0.9s var(--transition-smooth) 0.2s forwards; }

@keyframes hero-rise {
    from { opacity: 0; transform: translateY(48px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes hero-rise-right {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Reusable float/pulse keyframes (used by the hero glow and badge). */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.7; }
}
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

/* Reduced motion: honor the OS preference everywhere. */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero-anim, .hero-anim-right { animation: none; opacity: 1; }
    .hero-product__glow, .hero-product__badge { animation: none; }
    html.js .reveal, html.js .reveal-left, html.js .reveal-right,
    html.js .stagger-children > * {
        opacity: 1;
        transform: none;
        transition: none;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
