/* ================================================================
   ABHRNILDAS17 — Frontend Stylesheet
   Mobile-first | Glassmorphism | Premium Design
================================================================ */

/* ----------------------------------------------------------------
   1. CSS Custom Properties (defaults; overridden by PHP inline style)
---------------------------------------------------------------- */
:root {
    --clr-primary:   #9333ea;
    --clr-secondary: #ec4899;
    --clr-accent:    #f59e0b;
    --clr-bg:        #080010;
    --clr-bg-alt:    #0f0020;
    --clr-surface:   #130030;
    --clr-text:      #f0eeff;
    --clr-muted:     #9090b8;
    --clr-light:     #c8c8e8;

    --glass-bg:     rgba(255,255,255,0.045);
    --glass-border: rgba(255,255,255,0.1);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.45);
    --glass-blur:   blur(18px);

    --grad-primary: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary));
    --grad-accent:  linear-gradient(135deg, var(--clr-accent), #f97316);

    --font-heading: 'Playfair Display', Georgia, serif;
    --font-script:  'Dancing Script', cursive;
    --font-body:    'Inter', system-ui, -apple-system, sans-serif;

    --radius-sm:   0.5rem;
    --radius-md:   1rem;
    --radius-lg:   1.5rem;
    --radius-full: 999px;

    --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
    --trans-base:  0.4s var(--ease-out);
    --trans-fast:  0.2s var(--ease-out);
}

/* ----------------------------------------------------------------
   2. Reset
---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-body);
    background: var(--clr-bg);
    color: var(--clr-text);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul { list-style: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
           overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ----------------------------------------------------------------
   3. Utilities
---------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.95rem 2.2rem;
    border-radius: var(--radius-full);
    background: var(--grad-primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform var(--trans-base), box-shadow var(--trans-base);
    box-shadow: 0 4px 28px rgba(147, 51, 234, 0.4);
    -webkit-tap-highlight-color: transparent;
}
.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.15);
    opacity: 0;
    transition: opacity var(--trans-fast);
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 40px rgba(147,51,234,0.55); }
.btn-primary:active { transform: translateY(0); }

/* Section common */
.section { padding: 6rem 0; position: relative; overflow: hidden; }
.section:nth-child(even) { background: var(--clr-bg-alt); }

.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--clr-primary);
    background: rgba(147,51,234,0.12);
    border: 1px solid rgba(147,51,234,0.25);
    padding: 0.35rem 1rem;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
}
.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0.9rem;
}
.section-sub {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: var(--clr-muted);
    max-width: 560px;
    margin: 0 auto 1.25rem;
    line-height: 1.8;
}
.section-line {
    width: 56px;
    height: 3px;
    background: var(--grad-primary);
    border-radius: var(--radius-full);
    margin: 1.25rem auto 0;
}

/* Reveal states */
.reveal-el, .reveal-badge {
    opacity: 0;
    transform: translateY(36px);
    will-change: opacity, transform;
}

/* ----------------------------------------------------------------
   4. Navigation
---------------------------------------------------------------- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 1.1rem 0;
    transition: padding var(--trans-base), background var(--trans-base), box-shadow var(--trans-base);
}
.navbar.scrolled {
    padding: 0.65rem 0;
    background: rgba(8, 0, 16, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 24px rgba(0,0,0,0.6);
}
.nav-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.nav-logo { flex-shrink: 0; }
.logo-text {
    font-family: var(--font-script);
    font-size: 1.6rem;
    font-weight: 700;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo-img { max-height: 40px; width: auto; }
.logo-dark { display: none; }
.navbar.scrolled .logo-light { display: none; }
.navbar.scrolled .logo-dark  { display: block; }

.nav-links { display: none; align-items: center; gap: 0.2rem; }
.nav-link {
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--clr-muted);
    transition: color var(--trans-fast), background var(--trans-fast);
}
.nav-link:hover, .nav-link.active { color: var(--clr-text); background: rgba(255,255,255,0.07); }

.nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: background var(--trans-fast);
}
.nav-toggle:hover { background: rgba(255,255,255,0.07); }
.bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--clr-text);
    border-radius: 2px;
    transition: transform var(--trans-base), opacity var(--trans-base);
    transform-origin: center;
}
.nav-toggle.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open .bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: rgba(8,0,16,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 1.25rem;
    gap: 0.2rem;
    animation: slideDown 0.3s var(--ease-out) forwards;
}
.nav-links.open .nav-link { padding: 0.75rem 1rem; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ----------------------------------------------------------------
   5. Hero
---------------------------------------------------------------- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #1a0040 0%, var(--clr-bg) 70%);
}
/* Desktop: constrain hero to 16:9 so background video/image shows at native ratio */
@media (min-width: 768px) {
    .hero {
        height: auto;
        aspect-ratio: 16 / 9;
        min-height: 500px;
        max-height: 100vh;
    }
}

.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.hero-bg-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
    animation: kenBurns 18s ease-in-out infinite alternate;
    transform-origin: center;
}
@keyframes kenBurns {
    from { transform: scale(1.0); }
    to   { transform: scale(1.08); }
}
.hero-bg-gradient { position: absolute; inset: 0; z-index: 0; }

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(8,0,16,0.3) 0%,
        rgba(8,0,16,0.5) 50%,
        rgba(8,0,16,0.8) 100%
    );
    z-index: 1;
    pointer-events: none;
}

.particles-canvas {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.threejs-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 0 1.25rem;
    max-width: 800px;
    width: 100%;
}

.hero-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--clr-accent);
    background: rgba(245,158,11,0.12);
    border: 1px solid rgba(245,158,11,0.28);
    padding: 0.38rem 1.2rem;
    border-radius: var(--radius-full);
    margin-bottom: 1.4rem;
}
.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(3.2rem, 11vw, 7.5rem);
    font-weight: 900;
    line-height: 1.0;
    margin-bottom: 1.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1em;
}
.hero-word {
    display: block;
    opacity: 0;
    transform: translateY(50px);
    background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.72) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 40px rgba(147,51,234,0.5));
}
.hero-word-accent {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 50px rgba(236,72,153,0.6));
}
.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--clr-light);
    max-width: 520px;
    margin: 0 auto 2.25rem;
    line-height: 1.85;
    opacity: 0;
    transform: translateY(20px);
}
.hero-cta {
    opacity: 0;
    transform: translateY(18px);
}
.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    opacity: 0;
    animation: fadeIn 1s var(--ease-out) 2.8s forwards;
}
.scroll-track {
    width: 1px;
    height: 55px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.6), transparent);
    animation: scrollAnim 2s ease-in-out infinite;
}
@keyframes scrollAnim {
    0%,100% { transform: scaleY(1); opacity: 0.6; }
    50%      { transform: scaleY(1.3); opacity: 1; }
}
@keyframes fadeIn { to { opacity: 1; } }

/* ----------------------------------------------------------------
   6. Gallery — Auto-Scroll Carousel
---------------------------------------------------------------- */
.gallery-section { background: var(--clr-bg); }

.carousel-viewport {
    width: 100%;
    overflow: hidden;
    padding: 0.7rem 0;
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.carousel-row {
    display: flex;
    gap: 0.75rem;
    width: max-content;
    animation: carouselLeft var(--scroll-dur, 40s) linear infinite;
    will-change: transform;
    padding: 0.5rem 0;
}
.carousel-row.row-right {
    animation-name: carouselRight;
}
.carousel-viewport:hover .carousel-row {
    animation-play-state: paused;
}

@keyframes carouselLeft {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@keyframes carouselRight {
    0%   { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

/* Carousel card — portrait 9:16
   clamp: min 160px (tiny phone) → ~42vw fluid → max 240px (desktop)
   At 375px phone:  42vw = 157px → clamped to 160px  → height ~284px  (shows ~2 cards)
   At 768px tablet: 42vw = 322px → clamped to 240px  → height ~427px
   At 1280px desk:  42vw = 537px → clamped to 240px  → height ~427px  (shows 4+ cards) */
.c-card {
    flex-shrink: 0;
    width: clamp(160px, 42vw, 240px);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--clr-surface);
    border: 1px solid var(--glass-border);
    position: relative;
    cursor: pointer;
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
    outline: none;
    user-select: none;
}
.c-card:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 18px 50px rgba(0,0,0,0.6), 0 0 0 1px rgba(147,51,234,0.35);
    z-index: 2;
}
.c-card:focus-visible {
    box-shadow: 0 0 0 2px var(--clr-primary);
}

.c-media {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--clr-surface);
}
/* padding-top trick: universally supported, works even without aspect-ratio CSS support */
.c-media::before {
    content: '';
    display: block;
    padding-top: 177.78%; /* 9:16 portrait ratio — height ≈ 1.78× width */
}
.c-media.video-c::before {
    padding-top: 56.25%; /* 16:9 landscape for videos */
}

.c-media img,
.c-media video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    transition: transform 0.55s var(--ease-out);
}
.c-card:hover .c-media img,
.c-card:hover .c-media video { transform: scale(1.08); }

.c-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    pointer-events: none;
}

.c-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8,0,16,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
    color: #fff;
    pointer-events: none;
}
.c-card:hover .c-overlay { opacity: 1; }

.c-label {
    padding: 0.55rem 0.9rem;
    font-size: 0.78rem;
    color: var(--clr-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--clr-surface);
}

/* ----------------------------------------------------------------
   7. Lightbox
---------------------------------------------------------------- */
.lightbox { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.lightbox[hidden] { display: none; }

.lb-backdrop { position: absolute; inset: 0; background: rgba(4,0,10,0.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.lb-stage { position: relative; z-index: 1; max-width: 90vw; max-height: 85vh; text-align: center; }
.lb-img { max-width: 100%; max-height: 80vh; border-radius: var(--radius-md); box-shadow: 0 20px 80px rgba(0,0,0,0.8); object-fit: contain; background: var(--clr-surface); }
.lb-video { max-width: 90vw; max-height: 80vh; border-radius: var(--radius-md); }
.lb-caption { margin-top: 1rem; color: var(--clr-muted); font-size: 0.88rem; }
.lb-close {
    position: absolute; top: 1rem; right: 1rem; z-index: 2;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,0.1); border: 1px solid var(--glass-border);
    color: var(--clr-text); display: flex; align-items: center; justify-content: center;
    transition: background var(--trans-fast);
}
.lb-close:hover { background: rgba(255,255,255,0.2); }
.lb-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 50px; height: 50px; border-radius: 50%;
    background: rgba(255,255,255,0.1); border: 1px solid var(--glass-border);
    color: var(--clr-text); display: flex; align-items: center; justify-content: center;
    transition: background var(--trans-fast);
}
.lb-nav:hover { background: var(--clr-primary); }
.lb-prev { left: 0.75rem; }
.lb-next { right: 0.75rem; }
.lb-counter {
    position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 2;
    font-size: 0.8rem; color: var(--clr-muted); background: rgba(255,255,255,0.07);
    padding: 0.35rem 0.9rem; border-radius: var(--radius-full);
}

/* ----------------------------------------------------------------
   8. Messages Section
---------------------------------------------------------------- */
.messages-section { background: var(--clr-bg-alt); }
.messages-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.message-card { padding: 2.25rem 2rem; position: relative; overflow: hidden; transition: transform var(--trans-base); }
.message-card:hover { transform: translateY(-4px); }
.msg-deco {
    font-family: var(--font-heading);
    font-size: 7rem;
    line-height: 0.5;
    color: rgba(147,51,234,0.12);
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    pointer-events: none;
    user-select: none;
}
.msg-title { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--clr-text); position: relative; z-index: 1; }
.msg-content { font-size: 1rem; color: var(--clr-light); line-height: 1.9; position: relative; z-index: 1; }
.msg-author { margin-top: 1.25rem; font-family: var(--font-script); font-size: 1.3rem; color: var(--clr-accent); position: relative; z-index: 1; }

/* ----------------------------------------------------------------
   9. Timeline Section
---------------------------------------------------------------- */
.timeline-section { background: var(--clr-bg); }
.timeline-track { position: relative; padding-left: 2rem; }
.timeline-track::before {
    content: '';
    position: absolute;
    left: 0.9rem;
    top: 0; bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--clr-primary), var(--clr-secondary), transparent);
    border-radius: 2px;
}
.timeline-item { position: relative; padding-bottom: 2.5rem; }
.tl-connector { position: absolute; left: -2rem; top: 0; display: flex; flex-direction: column; align-items: center; }
.tl-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--grad-primary);
    border: 3px solid var(--clr-bg);
    box-shadow: 0 0 12px rgba(147,51,234,0.6);
    flex-shrink: 0;
}
.tl-card { padding: 1.5rem; transition: transform var(--trans-base); }
.tl-card:hover { transform: translateX(4px); }
.tl-year {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--clr-accent);
    margin-bottom: 0.5rem;
}
.tl-title { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 700; margin-bottom: 0.6rem; }
.tl-desc { font-size: 0.92rem; color: var(--clr-muted); line-height: 1.8; }
.tl-img-wrap { margin-top: 1rem; border-radius: var(--radius-sm); overflow: hidden; }
.tl-img { width: 100%; height: auto; object-fit: cover; }

/* ----------------------------------------------------------------
   10. Footer
---------------------------------------------------------------- */
.footer { position: relative; background: var(--clr-bg); border-top: 1px solid var(--glass-border); padding: 3.5rem 0 1.5rem; overflow: hidden; }
.footer-glow { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 600px; height: 150px; background: radial-gradient(ellipse, rgba(147,51,234,0.07) 0%, transparent 70%); pointer-events: none; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 2rem; margin-bottom: 2rem; text-align: center; }
.footer-logo-text { font-family: var(--font-script); font-size: 1.8rem; font-weight: 700; background: var(--grad-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; display: block; margin-bottom: 0.5rem; }
.footer-logo-img { height: 36px; width: auto; }
.footer-tagline { font-size: 0.88rem; color: var(--clr-muted); margin-top: 0.4rem; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.footer-link { padding: 0.4rem 0.8rem; font-size: 0.85rem; color: var(--clr-muted); border-radius: var(--radius-full); transition: color var(--trans-fast), background var(--trans-fast); }
.footer-link:hover { color: var(--clr-text); background: rgba(255,255,255,0.06); }
.footer-bottom { border-top: 1px solid var(--glass-border); padding-top: 1.25rem; text-align: center; }
.footer-bottom p { font-size: 0.8rem; color: var(--clr-muted); }

/* ----------------------------------------------------------------
   11. Responsive — 640px+
---------------------------------------------------------------- */
@media (min-width: 640px) {
    .messages-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ----------------------------------------------------------------
   12. Responsive — 768px+
---------------------------------------------------------------- */
@media (min-width: 768px) {
    .nav-links { display: flex; }
    .nav-toggle { display: none; }
    .container { padding: 0 2rem; }
    .section { padding: 8rem 0; }
    .timeline-track { padding-left: 3rem; }
    .timeline-track::before { left: 1.4rem; }
    .tl-connector { left: -3rem; }
    .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
    .lb-prev { left: 1.5rem; }
    .lb-next { right: 1.5rem; }
}

/* ----------------------------------------------------------------
   13. Responsive — 1024px+
---------------------------------------------------------------- */
@media (min-width: 1024px) {
    .messages-grid { grid-template-columns: repeat(3, 1fr); }
    .tl-card.tl-right { margin-left: auto; }
}

/* ----------------------------------------------------------------
   14. Reduced Motion
---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    html { scroll-behavior: auto; }
}

/* ----------------------------------------------------------------
   15. Focus
---------------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--clr-primary); outline-offset: 3px; border-radius: 4px; }
