/* ============================================================================
   THE LIVING ARCHIVE OF KALAMANDALAM SANKARANARAYANAN
   styles.css — Museum-grade design system
   Palette inspired by Kerala temple lacquer, palm-leaf manuscripts,
   Kathakali pacha & chutti, and the red laterite of Malabar.
   ============================================================================ */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
    /* Heritage palette */
    --clr-green:       #063A26;   /* temple lacquer green */
    --clr-green-dark:  #032215;   /* deep sanctum */
    --clr-green-deep:  #021A10;
    --clr-terracotta:  #9B392E;   /* laterite / chutti red */
    --clr-gold:        #C5A059;   /* brass lamp */
    --clr-gold-light:  #E3C588;
    --clr-ivory:       #F9F7F1;   /* palm-leaf cream */
    --clr-ivory-2:     #F2EEE3;
    --clr-parchment:   #F4F1E8;
    --clr-ink:         #1A1A1A;
    --clr-text:        #2A2A26;
    --clr-text-muted:  #555148;

    /* Typography */
    --font-display: 'Cormorant Garamond', 'Georgia', serif;
    --font-body:    'Outfit', 'Helvetica Neue', system-ui, sans-serif;

    /* Rhythm */
    --maxw: 1320px;
    --maxw-prose: 760px;
    --transition: all 0.45s cubic-bezier(0.22, 0.8, 0.28, 1);
    --ease: cubic-bezier(0.22, 0.8, 0.28, 1);

    /* Elevation */
    --shadow-sm: 0 4px 16px rgba(3, 34, 21, 0.08);
    --shadow-md: 0 14px 40px rgba(3, 34, 21, 0.12);
    --shadow-lg: 0 24px 60px rgba(3, 34, 21, 0.22);

    --nav-h: 78px;
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--clr-ivory);
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: var(--nav-h);
}

body {
    font-family: var(--font-body);
    color: var(--clr-text);
    line-height: 1.7;
    background-color: var(--clr-ivory);
    /* Subtle palm-leaf weave */
    background-image: url("data:image/svg+xml,%3Csvg width='28' height='28' viewBox='0 0 28 28' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23c5a059' fill-opacity='0.045' fill-rule='evenodd'%3E%3Ccircle cx='4' cy='4' r='1'/%3E%3C/g%3E%3C/svg%3E");
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.12;
    color: var(--clr-green);
    letter-spacing: 0.01em;
}

p { color: var(--clr-text-muted); }

a { color: inherit; text-decoration: none; }
img, svg, video { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

::selection { background: var(--clr-gold); color: var(--clr-green-dark); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--clr-ivory-2); }
::-webkit-scrollbar-thumb { background: var(--clr-gold); border-radius: 5px; border: 2px solid var(--clr-ivory-2); }

/* Focus visibility (WCAG 2.4.7) */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible, summary:focus-visible {
    outline: 3px solid var(--clr-terracotta);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    left: 50%;
    top: -120px;
    transform: translateX(-50%);
    background: var(--clr-green-dark);
    color: var(--clr-ivory);
    padding: 0.85rem 1.6rem;
    border: 1px solid var(--clr-gold);
    border-radius: 0 0 6px 6px;
    z-index: 4000;
    letter-spacing: 1px;
    font-size: 0.85rem;
    transition: top 0.3s ease;
}
.skip-link:focus { top: 0; }

/* --------------------------------------------------------------------------
   3. LAYOUT PRIMITIVES
   -------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.2rem, 5vw, 4rem); }
.section { padding-block: clamp(3.5rem, 9vh, 7rem); position: relative; }
.section--tight { padding-block: clamp(2.5rem, 6vh, 4.5rem); }
.prose { max-width: var(--maxw-prose); }

.eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.32em;
    font-size: clamp(0.7rem, 1.6vw, 0.82rem);
    color: var(--clr-terracotta);
    margin-bottom: 1rem;
    font-weight: 500;
}
.hero .eyebrow, .page-hero .eyebrow { color: var(--clr-gold); }

.section-header { margin-bottom: clamp(2rem, 5vh, 3.5rem); }
.section-header.center { text-align: center; max-width: 760px; margin-inline: auto; }
.section-title { font-size: clamp(2rem, 5vw, 3.4rem); color: var(--clr-green); }
.section-intro { margin-top: 1rem; font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: var(--clr-text-muted); }

/* Ornamental rule — brass lamp / temple finial motif */
.rule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.4rem 0;
    color: var(--clr-gold);
}
.rule::before, .rule::after {
    content: '';
    height: 1px;
    flex: 1;
    max-width: 120px;
    background: linear-gradient(to right, transparent, var(--clr-gold));
}
.rule::after { background: linear-gradient(to left, transparent, var(--clr-gold)); }
.rule svg { width: 26px; height: 26px; flex: none; }
.rule.left { justify-content: flex-start; }
.rule.left::before { display: none; }
.rule.left::after { max-width: 180px; }

/* --------------------------------------------------------------------------
   4. SKIP-NAV / TOP BAR
   -------------------------------------------------------------------------- */
.site-nav {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    z-index: 1000;
    transition: background 0.4s ease, box-shadow 0.4s ease, height 0.4s ease;
}
.site-nav .wrap { display: flex; align-items: center; justify-content: space-between; }
.site-nav.scrolled {
    background: rgba(249, 247, 241, 0.97);
    box-shadow: 0 1px 0 rgba(197,160,89,0.35), var(--shadow-sm);
    height: 66px;
}
/* Solid variant for interior pages (so text is always legible) */
.site-nav.solid {
    background: rgba(3, 34, 21, 0.98);
}
.site-nav.solid.scrolled { background: rgba(249, 247, 241, 0.96); }

.brand { display: flex; flex-direction: column; line-height: 1; }
.brand .brand-name {
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2.6vw, 1.45rem);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--clr-ivory);
}
.brand .brand-sub {
    font-size: 0.6rem;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--clr-gold);
    margin-top: 5px;
}
.site-nav.scrolled .brand .brand-name { color: var(--clr-green); }
.site-nav.scrolled .brand .brand-sub { color: var(--clr-terracotta); }

.nav-links { display: flex; align-items: center; gap: clamp(0.8rem, 1.4vw, 1.5rem); }
.nav-links a {
    position: relative;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    white-space: nowrap;
    color: var(--clr-ivory);
    padding: 4px 0;
    opacity: 0.92;
}
.site-nav.scrolled .nav-links a { color: var(--clr-green); }
.nav-links a::after {
    content: '';
    position: absolute;
    left: 0; bottom: -2px;
    width: 0; height: 1.5px;
    background: var(--clr-gold);
    transition: width 0.35s var(--ease);
}
.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.nav-links a[aria-current="page"]::after { width: 100%; }
.nav-links a[aria-current="page"] { color: var(--clr-gold); }
.site-nav.scrolled .nav-links a[aria-current="page"] { color: var(--clr-terracotta); }

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    z-index: 1100;
}
.menu-toggle span {
    width: 28px; height: 2px; display: block;
    background: var(--clr-ivory);
    transition: var(--transition);
}
.site-nav.scrolled .menu-toggle span { background: var(--clr-green); }

/* --------------------------------------------------------------------------
   5. HERO (home)
   -------------------------------------------------------------------------- */
.hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    background:
        radial-gradient(circle at 72% 38%, rgba(155, 57, 46, 0.22), transparent 55%),
        linear-gradient(160deg, var(--clr-green-dark), var(--clr-green-deep));
    color: var(--clr-ivory);
    padding-top: var(--nav-h);
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23c5a059' fill-opacity='0.05'%3E%3Cpath d='M0 20 L20 0 L40 20 L20 40 Z'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5; pointer-events: none;
}
.hero .wrap {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: clamp(2rem, 6vw, 5rem);
    position: relative; z-index: 2;
}
.hero h1 {
    font-size: clamp(2.6rem, 7vw, 6rem);
    color: var(--clr-ivory);
    margin-bottom: 1.2rem;
}
.hero h1 .accent {
    display: block;
    font-style: italic;
    font-weight: 300;
    color: var(--clr-gold-light);
}
.hero-lead {
    font-size: clamp(1.05rem, 1.7vw, 1.3rem);
    font-weight: 300;
    max-width: 540px;
    color: rgba(249, 247, 241, 0.88);
    margin-bottom: 2rem;
}
.hero-portrait {
    justify-self: center;
    width: 100%;
    max-width: clamp(260px, 38vw, 420px);
    aspect-ratio: 3 / 4;
    border-radius: 220px 220px 8px 8px;
    overflow: hidden;
    border: 1px solid var(--clr-gold);
    border-bottom: 7px solid var(--clr-gold);
    box-shadow: var(--shadow-lg);
    background: #1f2b24;
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-body);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    padding: 0.95rem 1.9rem;
    border: 1px solid var(--clr-gold);
    color: var(--clr-gold);
    background: transparent;
    border-radius: 2px;
    cursor: pointer;
    transition: var(--transition);
}
.btn:hover { background: var(--clr-gold); color: var(--clr-green-dark); transform: translateY(-2px); }
.btn--solid { background: var(--clr-gold); color: var(--clr-green-dark); }
.btn--solid:hover { background: var(--clr-gold-light); }
.btn--dark { border-color: var(--clr-green); color: var(--clr-green); }
.btn--dark:hover { background: var(--clr-green); color: var(--clr-ivory); }
.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; }

/* --------------------------------------------------------------------------
   6. PAGE HERO (interior pages)
   -------------------------------------------------------------------------- */
.page-hero {
    background:
        linear-gradient(180deg, rgba(3,34,21,0.78), rgba(3,34,21,0.92)),
        var(--clr-green-dark);
    background-size: cover;
    background-position: center top;
    color: var(--clr-ivory);
    padding-top: calc(var(--nav-h) + clamp(2.5rem, 7vh, 5rem));
    padding-bottom: clamp(2.5rem, 7vh, 5rem);
    text-align: center;
}
.page-hero h1 { color: var(--clr-ivory); font-size: clamp(2.3rem, 6vw, 4.2rem); }
.page-hero p { color: rgba(249,247,241,0.85); max-width: 620px; margin: 1rem auto 0; }
.page-hero .rule { color: var(--clr-gold); }

/* Breadcrumb */
.breadcrumb { font-size: 0.78rem; letter-spacing: 0.08em; color: var(--clr-text-muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.breadcrumb a:hover { color: var(--clr-terracotta); }
.breadcrumb li:not(:last-child)::after { content: '/'; margin-left: 0.5rem; color: var(--clr-gold); }
.breadcrumb [aria-current="page"] { color: var(--clr-green); }
.page-hero .breadcrumb, .page-hero .breadcrumb a { color: rgba(249,247,241,0.7); }
.page-hero .breadcrumb [aria-current="page"] { color: var(--clr-gold); }

/* --------------------------------------------------------------------------
   7. EDITORIAL / TWO-COLUMN
   -------------------------------------------------------------------------- */
.split {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
}
.split.reverse { grid-template-columns: 1.15fr 0.85fr; }
.split-media { position: relative; }
.framed { position: relative; }
.framed::before {
    content: '';
    position: absolute;
    inset: -18px -18px auto auto;
    width: 100%; height: 100%;
    border: 1px solid var(--clr-gold);
    z-index: 0;
    pointer-events: none;
}
.framed img {
    position: relative; z-index: 1;
    width: 100%; aspect-ratio: 3/4; object-fit: cover; object-position: top center;
    box-shadow: var(--shadow-md);
}
.prose p + p { margin-top: 1.1rem; }
.prose p { font-size: clamp(1rem, 1.5vw, 1.12rem); }
.lead-quote {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.3rem, 2.4vw, 1.7rem);
    color: var(--clr-terracotta);
    border-left: 2px solid var(--clr-gold);
    padding-left: 1.5rem;
    margin: 1.6rem 0;
    line-height: 1.4;
}

/* Drop cap for long-form */
.dropcap::first-letter {
    font-family: var(--font-display);
    font-size: 3.6em;
    float: left;
    line-height: 0.78;
    padding: 0.08em 0.12em 0 0;
    color: var(--clr-terracotta);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   8. TIMELINE
   -------------------------------------------------------------------------- */
.timeline { max-width: 1000px; margin-inline: auto; }
.t-item {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: clamp(1.5rem, 4vw, 3.5rem);
    padding-bottom: clamp(2rem, 5vh, 3.5rem);
    position: relative;
}
.t-meta { text-align: right; padding-right: 2.5rem; border-right: 1px solid rgba(197,160,89,0.4); position: relative; }
.t-meta::after {
    content: ''; position: absolute; right: -5px; top: 12px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--clr-terracotta); border: 2px solid var(--clr-ivory);
    transition: var(--transition);
}
.t-item:hover .t-meta::after { background: var(--clr-gold); transform: scale(1.5); }
.t-year { font-family: var(--font-display); font-style: italic; font-size: clamp(1.5rem, 3vw, 2.1rem); color: var(--clr-terracotta); }
.t-place { display: block; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--clr-text-muted); margin-top: 0.4rem; }
.t-body h3 { font-size: clamp(1.25rem, 2.4vw, 1.7rem); margin-bottom: 0.7rem; }
.t-body p { font-size: clamp(0.96rem, 1.4vw, 1.08rem); }

/* --------------------------------------------------------------------------
   9. CARD GRIDS (legacy / awards / writings / media / feature)
   -------------------------------------------------------------------------- */
.grid { display: grid; gap: clamp(1.2rem, 2.5vw, 2rem); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.card {
    background: var(--clr-ivory);
    border: 1px solid rgba(197,160,89,0.4);
    border-radius: 4px;
    padding: clamp(1.6rem, 3vw, 2.4rem);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    height: 100%;
}
.card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 0;
    background: var(--clr-gold); transition: height 0.4s var(--ease);
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--clr-gold); }
.card:hover::before { height: 100%; }
.card-num { font-family: var(--font-display); font-style: italic; font-size: 2.4rem; color: var(--clr-gold); line-height: 1; margin-bottom: 0.8rem; }
.card h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); margin-bottom: 0.7rem; }
.card p { font-size: 0.98rem; }

/* Award card (dark) */
.award-card {
    background: linear-gradient(160deg, var(--clr-green), var(--clr-green-dark));
    border: 1px solid rgba(197,160,89,0.5);
    color: var(--clr-ivory);
    text-align: center;
    padding: clamp(1.8rem, 4vw, 2.8rem) clamp(1.2rem, 3vw, 2rem);
    border-radius: 4px;
    transition: var(--transition);
}
.award-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--clr-gold); }
.award-year { font-family: var(--font-display); color: var(--clr-gold); font-size: 1.4rem; display: block; margin-bottom: 0.8rem; }
.award-card h3 { color: var(--clr-ivory); font-size: clamp(1.3rem, 2.4vw, 1.7rem); margin-bottom: 0.8rem; }
.award-card p { color: rgba(249,247,241,0.85); font-size: 0.98rem; }

/* --------------------------------------------------------------------------
   10. GALLERY (archival grid + lightbox)
   -------------------------------------------------------------------------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    grid-auto-rows: 240px;
    gap: 14px;
}
.g-item {
    position: relative;
    overflow: hidden;
    background: var(--clr-ivory-2);
    border: 1px solid rgba(197,160,89,0.3);
    cursor: pointer;
    border-radius: 3px;
}
.g-item.tall { grid-row: span 2; }
.g-item.wide { grid-column: span 2; }
.g-item img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform 0.8s var(--ease), filter 0.6s ease; }
.g-item figcaption {
    position: absolute; inset: auto 0 0 0;
    background: linear-gradient(to top, rgba(3,34,21,0.92), transparent);
    color: var(--clr-ivory);
    font-family: var(--font-display);
    font-size: 1.05rem;
    padding: 1.6rem 1.2rem 1rem;
    transform: translateY(8px);
    opacity: 0;
    transition: var(--transition);
}
.g-item:hover img, .g-item:focus-visible img { transform: scale(1.06); filter: brightness(1.06); }
.g-item:hover figcaption, .g-item:focus-visible figcaption { opacity: 1; transform: translateY(0); }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; z-index: 3000;
    display: none;
    background: rgba(3,34,21,0.96);
    backdrop-filter: blur(10px);
    opacity: 0; transition: opacity 0.4s ease;
}
.lightbox.open { display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 1; }
.lightbox img { max-width: 92vw; max-height: 78vh; border: 2px solid var(--clr-gold); box-shadow: var(--shadow-lg); transform: scale(0.96); transition: transform 0.4s var(--ease); }
.lightbox.open img { transform: scale(1); }
.lightbox-caption { color: var(--clr-ivory); font-family: var(--font-display); font-size: 1.15rem; margin-top: 1.3rem; text-align: center; max-width: 80%; }
.lightbox-close, .lightbox-nav {
    position: absolute; background: transparent; border: none; color: var(--clr-gold);
    cursor: pointer; transition: var(--transition);
}
.lightbox-close { top: clamp(1rem, 3vh, 2rem); right: clamp(1.5rem, 4vw, 3rem); font-size: clamp(2.6rem, 5vw, 3.6rem); line-height: 1; }
.lightbox-close:hover { color: var(--clr-ivory); transform: rotate(90deg); }
.lightbox-nav { top: 50%; transform: translateY(-50%); font-size: 2.6rem; padding: 0.4rem 1rem; }
.lightbox-nav.prev { left: clamp(0.5rem, 2vw, 2rem); }
.lightbox-nav.next { right: clamp(0.5rem, 2vw, 2rem); }
.lightbox-nav:hover { color: var(--clr-ivory); }

/* --------------------------------------------------------------------------
   11. MEDIA (video archive + press)
   -------------------------------------------------------------------------- */
.video-card { background: var(--clr-ivory); border: 1px solid rgba(197,160,89,0.4); border-radius: 4px; overflow: hidden; transition: var(--transition); }
.video-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.video-frame { position: relative; aspect-ratio: 16/9; background: var(--clr-green-dark); }
.video-frame iframe, .video-frame img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; object-position: top center; }
.video-meta { padding: 1.3rem 1.4rem; }
.video-meta h3 { font-size: 1.25rem; margin-bottom: 0.4rem; }
.video-meta p { font-size: 0.92rem; }

.press-card { display: flex; flex-direction: column; }
.press-thumb { width: 100%; height: 190px; object-fit: cover; object-position: top; border-bottom: 1px solid rgba(197,160,89,0.3); }
.press-source { font-family: var(--font-display); font-style: italic; color: var(--clr-terracotta); font-size: 1.05rem; margin-bottom: 0.4rem; }
.press-card h3 { font-size: 1.25rem; margin-bottom: 0.7rem; }
.press-card p { font-size: 0.95rem; flex: 1; margin-bottom: 1.2rem; }
.link-arrow { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--clr-gold); align-self: flex-start; border-bottom: 1px solid transparent; transition: var(--transition); }
.link-arrow:hover { border-bottom-color: var(--clr-gold); color: var(--clr-terracotta); }

/* --------------------------------------------------------------------------
   12. WRITINGS / PUBLICATIONS
   -------------------------------------------------------------------------- */
.pub { display: grid; grid-template-columns: 110px 1fr; gap: 1.6rem; padding: 1.8rem 0; border-top: 1px solid rgba(197,160,89,0.35); align-items: start; }
.pub:last-child { border-bottom: 1px solid rgba(197,160,89,0.35); }
.pub-year { font-family: var(--font-display); font-style: italic; font-size: 1.6rem; color: var(--clr-terracotta); }
.pub-type { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--clr-text-muted); margin-top: 0.3rem; }
.pub h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.pub p { font-size: 0.98rem; }

/* Pull quote / scholar testimonial */
.testimonial { background: linear-gradient(160deg, var(--clr-green), var(--clr-green-dark)); color: var(--clr-ivory); border-radius: 6px; padding: clamp(2rem, 5vw, 3.5rem); position: relative; }
.testimonial blockquote { font-family: var(--font-display); font-size: clamp(1.3rem, 2.6vw, 1.9rem); font-style: italic; line-height: 1.4; color: var(--clr-ivory); }
.testimonial::before { content: '\201C'; font-family: var(--font-display); position: absolute; top: 0.2rem; left: 1.4rem; font-size: 6rem; color: rgba(197,160,89,0.4); line-height: 1; }
.testimonial cite { display: block; margin-top: 1.4rem; font-family: var(--font-body); font-style: normal; font-size: 0.9rem; letter-spacing: 0.06em; color: var(--clr-gold-light); }
.testimonial cite strong { color: var(--clr-gold); display: block; font-size: 1rem; }

/* --------------------------------------------------------------------------
   13. KATHAKALI EXPLAINER
   -------------------------------------------------------------------------- */
.vesham-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.4rem; }
.vesham {
    background: var(--clr-ivory);
    border: 1px solid rgba(197,160,89,0.4);
    border-radius: 4px;
    padding: 1.6rem;
    border-top: 4px solid var(--accent, var(--clr-terracotta));
    transition: var(--transition);
}
.vesham:hover { transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.vesham h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.vesham .mal { font-family: var(--font-display); font-style: italic; color: var(--clr-text-muted); font-size: 0.92rem; margin-bottom: 0.6rem; }
.vesham p { font-size: 0.94rem; }

/* Feature band */
.band { background: linear-gradient(160deg, var(--clr-green-dark), var(--clr-green-deep)); color: var(--clr-ivory); }
.band h2, .band .section-title { color: var(--clr-ivory); }
.band p { color: rgba(249,247,241,0.85); }
.band .eyebrow { color: var(--clr-gold); }
.band--parchment { background: var(--clr-parchment); }
.band--parchment h2, .band--parchment .section-title { color: var(--clr-green); }
.band--parchment p { color: var(--clr-text-muted); }

/* Stat strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.5rem; text-align: center; }
.stat .n { font-family: var(--font-display); font-size: clamp(2.4rem, 5vw, 3.6rem); color: var(--clr-gold); line-height: 1; }
.stat .l { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(249,247,241,0.78); margin-top: 0.5rem; }
.band--parchment .stat .l { color: var(--clr-text-muted); }

/* --------------------------------------------------------------------------
   14. CONTACT
   -------------------------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); }
.contact-detail { display: flex; gap: 1rem; padding: 1.2rem 0; border-bottom: 1px solid rgba(197,160,89,0.3); }
.contact-detail .ico { color: var(--clr-gold); flex: none; width: 26px; }
.contact-detail dt { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--clr-text-muted); margin-bottom: 0.2rem; }
.contact-detail dd a:hover { color: var(--clr-terracotta); }
.contact-link { color: var(--clr-green); font-weight: 500; border-bottom: 1px solid rgba(6,58,38,0.3); transition: var(--transition); }
.contact-link:hover { color: var(--clr-terracotta); border-color: var(--clr-terracotta); }

.form-field { margin-bottom: 1.3rem; }
.form-field label { display: block; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--clr-text-muted); margin-bottom: 0.5rem; }
.form-field input, .form-field textarea {
    width: 100%;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(197,160,89,0.5);
    background: var(--clr-ivory);
    color: var(--clr-text);
    border-radius: 3px;
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--clr-gold); outline-offset: 1px; }

/* --------------------------------------------------------------------------
   15. FOOTER
   -------------------------------------------------------------------------- */
.site-footer { background: var(--clr-green-deep); color: rgba(249,247,241,0.78); padding-block: clamp(3rem, 6vh, 4.5rem) 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
.site-footer h4 { color: var(--clr-gold); font-family: var(--font-body); font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 1.1rem; }
.site-footer .f-brand { font-family: var(--font-display); font-size: 1.6rem; color: var(--clr-ivory); margin-bottom: 0.6rem; }
.site-footer p { color: rgba(249,247,241,0.7); font-size: 0.92rem; }
.footer-links li { margin-bottom: 0.6rem; }
.footer-links a { font-size: 0.92rem; color: rgba(249,247,241,0.78); transition: var(--transition); }
.footer-links a:hover { color: var(--clr-gold); padding-left: 4px; }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(197,160,89,0.2); text-align: center; font-size: 0.82rem; letter-spacing: 0.04em; color: rgba(249,247,241,0.6); }

/* --------------------------------------------------------------------------
   16. BACK TO TOP
   -------------------------------------------------------------------------- */
.to-top {
    position: fixed; bottom: clamp(18px, 4vh, 36px); right: clamp(18px, 4vw, 36px);
    width: 50px; height: 50px;
    display: grid; place-items: center;
    background: rgba(3,34,21,0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--clr-gold);
    color: var(--clr-gold);
    border-radius: 50%;
    z-index: 900;
    opacity: 0; pointer-events: none; transform: translateY(16px);
    transition: var(--transition);
}
.to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { background: var(--clr-gold); color: var(--clr-green-dark); }

/* --------------------------------------------------------------------------
   17. REVEAL ANIMATION
   -------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }

/* --------------------------------------------------------------------------
   18. 404
   -------------------------------------------------------------------------- */
.error-page { min-height: 100svh; display: grid; place-items: center; text-align: center; background: linear-gradient(160deg, var(--clr-green-dark), var(--clr-green-deep)); color: var(--clr-ivory); padding: var(--nav-h) 1.5rem 3rem; }
.error-page h1 { color: var(--clr-gold-light); font-size: clamp(5rem, 18vw, 11rem); line-height: 0.9; }
.error-page h2 { color: var(--clr-ivory); font-size: clamp(1.4rem, 4vw, 2.2rem); margin: 0.5rem 0 1rem; }
.error-page p { color: rgba(249,247,241,0.82); max-width: 480px; margin: 0 auto 2rem; }

/* --------------------------------------------------------------------------
   19. UTILITIES
   -------------------------------------------------------------------------- */
.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; }
.center { text-align: center; }
.mt-2 { margin-top: 2rem; } .mt-3 { margin-top: 3rem; }
.text-gold { color: var(--clr-gold); }

/* --------------------------------------------------------------------------
   20. RESPONSIVE — mobile-first, comprehensive
   -------------------------------------------------------------------------- */

/* ── tablet / mid-range ≤980px ── */
@media (max-width: 980px) {
    .hero .wrap { grid-template-columns: 1fr; text-align: center; gap: 1.8rem; padding-top: 1.5rem; }
    .hero-portrait { order: -1; max-width: 220px; margin-inline: auto; }
    .hero-lead { margin-inline: auto; }
    .hero .btn-row { justify-content: center; }
    .split, .split.reverse { grid-template-columns: 1fr; }
    .split-media { max-width: 400px; margin-inline: auto; }
    .framed::before { display: none; }
    .contact-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ── nav drawer ≤1024px ── */
@media (max-width: 1024px) {
    .menu-toggle { display: flex; }

    /* Overlay backdrop — no blur so it doesn't composite over the drawer */
    .nav-overlay {
        position: fixed; inset: 0; z-index: 998;
        background: rgba(2, 26, 16, 0.72);
        opacity: 0; pointer-events: none;
        transition: opacity 0.38s ease;
    }
    .nav-overlay.open { opacity: 1; pointer-events: auto; }

    /* Drawer — flex-start so links begin from top, never get cut off */
    .nav-links {
        position: fixed;
        top: 0; right: 0; bottom: 0; left: auto;
        width: min(82vw, 300px);
        background: var(--clr-green-dark);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 0;
        padding-top: calc(var(--nav-h) + 1.8rem);
        padding-bottom: 2.5rem;
        padding-inline: 2.2rem;
        transform: translateX(110%);
        transition: transform 0.42s cubic-bezier(0.22, 0.8, 0.28, 1);
        box-shadow: -20px 0 80px rgba(0,0,0,0.55);
        overflow-y: auto;
        z-index: 1001;
        border-left: 1px solid rgba(197,160,89,0.25);
    }
    .nav-links.open { transform: translateX(0); }
    .nav-links a {
        color: rgba(249,247,241,0.85);
        font-size: 1.05rem;
        letter-spacing: 0.2em;
        padding: 0.9rem 0;
        width: 100%;
        border-bottom: 1px solid rgba(197,160,89,0.12);
        transition: color 0.25s ease, padding-left 0.25s ease;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    .nav-links a:last-child { border-bottom: none; }
    .nav-links a::after { display: none; }
    .nav-links a:hover,
    .nav-links a[aria-current="page"] { color: var(--clr-gold); padding-left: 0.6rem; }
    .site-nav.scrolled .nav-links a { color: rgba(249,247,241,0.85); }

    /* Hamburger → X animation */
    .menu-toggle span { transition: transform 0.35s var(--ease), opacity 0.2s ease; }
    .menu-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
    .menu-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* ── tablet portrait ≤768px ── */
@media (max-width: 768px) {
    :root { --nav-h: 64px; }

    .t-item { grid-template-columns: 1fr; gap: 0.8rem; }
    .t-meta { text-align: left; border-right: none; padding-right: 0; padding-left: 1.4rem; border-left: 2px solid var(--clr-gold); }
    .t-meta::after { left: -5px; right: auto; top: 8px; }

    .gallery-grid { grid-auto-rows: 200px; }
    .g-item.wide { grid-column: span 1; }
    .g-item.tall { grid-row: span 1; }

    .pub { grid-template-columns: 1fr; gap: 0.4rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    .lightbox-caption { font-size: 0.95rem; max-width: 92%; }

    .page-hero { padding-top: calc(var(--nav-h) + 1.8rem); padding-bottom: 2.2rem; }
    .page-hero h1 { font-size: clamp(1.9rem, 6vw, 2.8rem); }

    .split-media { max-width: 340px; }
}

/* ── large mobile ≤600px ── */
@media (max-width: 600px) {
    .hero .wrap { gap: 1.2rem; }
    .hero-portrait { max-width: 160px; }
    .hero h1 { font-size: clamp(1.95rem, 7vw, 2.5rem); }
    .hero-lead { font-size: 0.96rem; line-height: 1.6; max-width: 340px; }

    .grid--3, .grid--2 { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

    .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; gap: 8px; }

    .section { padding-block: clamp(2.2rem, 6vh, 4rem); }
    .section-title { font-size: clamp(1.75rem, 5.5vw, 2.6rem); }

    /* Bigger touch targets */
    .btn { padding: 0.9rem 1.5rem; min-height: 48px; font-size: 0.74rem; }
    .btn-row { flex-direction: row; flex-wrap: wrap; gap: 0.7rem; justify-content: center; }
    .btn-row .btn { flex: 1 1 auto; min-width: 130px; max-width: 220px; justify-content: center; }
    .to-top { width: 44px; height: 44px; bottom: 1.2rem; right: 1.2rem; }

    /* Always show gallery captions on touch */
    .g-item figcaption { opacity: 1; transform: translateY(0); font-size: 0.88rem; padding: 0.9rem 0.8rem 0.6rem; }

    /* Lightbox mobile */
    .lightbox img { max-width: 96vw; max-height: 68vh; }
    .lightbox-close {
        top: max(0.6rem, env(safe-area-inset-top, 0px));
        right: 1rem; font-size: 2.4rem;
        min-width: 48px; min-height: 48px;
        display: flex; align-items: center; justify-content: flex-end;
    }
    .lightbox-nav {
        font-size: 2rem; padding: 0.6rem;
        min-width: 48px; min-height: 48px;
        display: flex; align-items: center; justify-content: center;
    }
    .lightbox-caption { font-size: 0.9rem; margin-top: 0.9rem; }

    /* Footer */
    .site-footer { padding-block: 2.2rem 1.2rem; }
    .footer-bottom { font-size: 0.78rem; }

    /* Page hero */
    .page-hero h1 { font-size: clamp(1.7rem, 6vw, 2.2rem); }

    /* Testimonials */
    .testimonial { padding: 1.8rem 1.3rem; }
    .testimonial blockquote { font-size: clamp(1.1rem, 4.5vw, 1.4rem); }
    .testimonial::before { font-size: 4rem; top: 0; left: 0.8rem; }

    /* Awards */
    .award-card { padding: 1.5rem 1.1rem; }

    /* Timeline */
    .t-year { font-size: 1.35rem; }
    .t-body h3 { font-size: 1.1rem; }
}

/* ── standard mobile ≤430px ── */
@media (max-width: 430px) {
    :root { --nav-h: 60px; }

    .hero-portrait { max-width: 140px; border-radius: 100px 100px 6px 6px; }
    .hero h1 { font-size: clamp(1.8rem, 6.5vw, 2.2rem); }
    .hero-lead { font-size: 0.93rem; }
    .hero .eyebrow { font-size: 0.66rem; letter-spacing: 0.22em; }

    .gallery-grid { grid-auto-rows: 140px; gap: 6px; }
    .lightbox img { max-height: 62vh; }

    .wrap { padding-inline: 1rem; }

    .brand .brand-name { font-size: 1.15rem; }
    .brand .brand-sub { font-size: 0.54rem; letter-spacing: 0.28em; }

    .section-title { font-size: clamp(1.6rem, 6vw, 2rem); }
    .section-intro { font-size: 0.96rem; }

    .vesham-grid { grid-template-columns: 1fr; }
    .vesham { padding: 1.3rem; }

    .error-page h1 { font-size: clamp(4rem, 16vw, 8rem); }
    .dropcap::first-letter { font-size: 2.8em; }

    /* tighter side padding inside the drawer on small screens */
    .nav-links { padding-inline: 1.8rem; }
}

/* ── small mobile ≤375px ── */
@media (max-width: 375px) {
    .hero-portrait { max-width: 125px; }
    .hero h1 { font-size: 1.78rem; line-height: 1.15; }
    .hero-lead { font-size: 0.9rem; }

    .gallery-grid { grid-auto-rows: 128px; }
    .btn { padding: 0.8rem 1.1rem; font-size: 0.7rem; }
    .nav-links { padding-inline: 1.5rem; }
    .nav-links a { font-size: 0.98rem; }
}

/* ── very small ≤320px ── */
@media (max-width: 320px) {
    .hero-portrait { max-width: 108px; }
    .hero h1 { font-size: 1.6rem; }
    .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: 200px; }
    .stats { grid-template-columns: 1fr 1fr; }
    .btn-row .btn { min-width: 100px; }
}

/* ── iOS safe areas ── */
@supports (padding: max(0px)) {
    .site-nav .wrap {
        padding-left: max(1.2rem, env(safe-area-inset-left));
        padding-right: max(1.2rem, env(safe-area-inset-right));
    }
    .nav-links { padding-bottom: max(2.5rem, env(safe-area-inset-bottom)); }
    .to-top {
        bottom: max(1.2rem, calc(env(safe-area-inset-bottom) + 0.6rem));
        right: max(1.2rem, env(safe-area-inset-right));
    }
    .site-footer { padding-bottom: max(1.5rem, env(safe-area-inset-bottom)); }
}

/* --------------------------------------------------------------------------
   21. MOTION / PRINT PREFERENCES
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
}

@media print {
    .site-nav, .to-top, .menu-toggle, .lightbox, .site-footer, .nav-overlay { display: none !important; }
    body { background: #fff; color: #000; }
    a { color: #000; text-decoration: underline; }
    .hero, .page-hero, .band { background: #fff !important; color: #000 !important; }
    .hero h1, .page-hero h1 { color: #000 !important; }
    .section { padding-block: 1.5rem; }
}
