/* ============================================================
   GLOBAL.CSS — BVardhan Group
   Variables, Reset, Typography, Utilities
   ============================================================ */

/* Google Fonts are loaded in each HTML file */

/* ── CSS Custom Properties ──────────────────────────────── */
:root {
  /* Brand accents — amber & red, used sparingly */
  --gold:         #BC7A1A;   /* honeyed amber — legible on white (labels, links) */
  --gold-light:   #DD9933;   /* brand bright amber — for dark backgrounds / decorative */
  --gold-dark:    #8A5A12;   /* deep amber — hover / borders */
  --red:          #DD3333;   /* vermillion — whisper accent only */
  --red-logo:     #CC2929;   /* chevron red (matches logo) */

  /* Base — jet black & pure white */
  --charcoal:     #000000;   /* jet black */
  --ivory:        #FFFFFF;   /* pure white */
  --ivory-deep:   #F5F4F2;   /* off-white — distinguishes adjacent light sections */
  --stone:        #6E6E6E;
  --espresso:     #1A1A1A;   /* body ink — matches logo wordmark */
  --white:        #FFFFFF;
  --border:       rgba(188,122,26,0.18);   /* warm hairline — shows on black & white */
  --border-solid: rgba(188,122,26,0.34);
  --green:        #2E7D52;

  /* Typography */
  --font-serif:   'Marcellus SC', Georgia, serif;   /* display — inscriptional caps */
  --font-sans:    'Montserrat', system-ui, sans-serif;

  /* Spacing */
  --section-py:   clamp(64px, 8vw, 120px);
  --container:    1280px;
  --nav-h:        80px;

  /* Transitions */
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --dur:          600ms;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--espresso);
  background-color: var(--ivory);
  line-height: 1.7;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

ul, ol {
  list-style: none;
}

button {
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: var(--font-sans);
  font-size: 1rem;
}

/* ── Typography Scale ───────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;          /* Marcellus SC ships a single weight */
  line-height: 1.18;
  color: var(--charcoal);
}

h1 {
  font-size: clamp(46px, 6.6vw, 92px);
  letter-spacing: 0.01em;    /* positive tracking suits inscriptional caps */
}

h2 {
  font-size: clamp(34px, 4.3vw, 60px);
  letter-spacing: 0.012em;
}

h3 {
  font-size: clamp(24px, 3vw, 40px);
}

h4 {
  font-size: clamp(20px, 2.2vw, 28px);
}

h5 {
  font-size: clamp(16px, 1.5vw, 20px);
}

p {
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--espresso);
  line-height: 1.8;
  font-size: clamp(15px, 1.1vw, 17px);
}

/* Section label — small caps utility */
.label {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 16px;
}

/* Gold rule divider */
.gold-rule {
  width: 48px;
  height: 1px;
  background: var(--gold);
  margin: 24px 0;
}

.gold-rule--center {
  margin-left: auto;
  margin-right: auto;
}

/* Visually hidden — kept in the DOM for screen readers, removed from view.
   (This utility was referenced in markup but never defined, so these
   headings were leaking onto the page.) */
.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;
}

/* ── Layout Utilities ───────────────────────────────────── */
.container {
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(20px, 5vw, 80px);
  padding-right: clamp(20px, 5vw, 80px);
}

.section {
  padding-top: var(--section-py);
  padding-bottom: var(--section-py);
}

.section--ivory     { background-color: var(--ivory); }
.section--ivory-deep{ background-color: var(--ivory-deep); }
.section--charcoal  { background-color: var(--charcoal); }
.section--espresso  { background-color: var(--espresso); }
.section--white     { background-color: var(--white); }

/* Text colour utilities for dark sections */
.section--charcoal h1,
.section--charcoal h2,
.section--charcoal h3,
.section--charcoal h4,
.section--charcoal h5 {
  color: var(--ivory);
}

.section--charcoal p,
.section--charcoal .label {
  color: var(--stone);
}

.section--espresso h1,
.section--espresso h2,
.section--espresso h3,
.section--espresso h4,
.section--espresso h5 {
  color: var(--ivory);
}

.section--espresso p {
  color: var(--stone);
}

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }

/* Flex utilities */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-c    { align-items: center; }
.justify-c  { justify-content: center; }
.justify-sb { justify-content: space-between; }
.gap-2      { gap: 8px; }
.gap-4      { gap: 16px; }
.gap-6      { gap: 24px; }
.gap-8      { gap: 32px; }

/* Text align */
.text-center { text-align: center; }
.text-left   { text-align: left; }

/* Spacing */
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 32px;
  border-radius: 1px;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

/* Primary button — default sits on LIGHT sections: black fill, white text.
   Amber appears only on hover (sparing accent). */
.btn--gold {
  background: var(--charcoal);
  color: var(--white);
  border: 1px solid var(--charcoal);
}

.btn--gold:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  color: var(--white);
}

/* On DARK sections the primary button inverts: white fill, black text,
   bright amber on hover. */
.hero .btn--gold,
.section--charcoal .btn--gold,
.section--espresso .btn--gold,
.footer-cta-banner .btn--gold,
.page-hero .btn--gold,
.showcase .btn--gold,
.nav-mobile-overlay .btn--gold {
  background: var(--white);
  color: var(--charcoal);
  border-color: var(--white);
}

.hero .btn--gold:hover,
.section--charcoal .btn--gold:hover,
.section--espresso .btn--gold:hover,
.footer-cta-banner .btn--gold:hover,
.page-hero .btn--gold:hover,
.showcase .btn--gold:hover,
.nav-mobile-overlay .btn--gold:hover {
  background: var(--gold-light);
  color: var(--charcoal);
  border-color: var(--gold-light);
}

.btn--ghost {
  background: transparent;
  color: var(--ivory);
  border: 1px solid rgba(255,255,255,0.35);
}

.btn--ghost:hover {
  border-color: var(--gold-light);
  color: var(--gold-light);
}

.btn--ghost-gold {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}

.btn--ghost-gold:hover {
  background: var(--gold);
  color: var(--ivory);
}

.btn--ghost-dark {
  background: transparent;
  color: var(--espresso);
  border: 1px solid var(--border-solid);
}

.btn--ghost-dark:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ── Image Placeholders ─────────────────────────────────── */
.img-placeholder {
  background-color: var(--ivory-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.img-placeholder::after {
  content: attr(data-label);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
  text-align: center;
  padding: 16px;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-placeholder--dark {
  background-color: #2A2525;
}

.img-placeholder--dark::after {
  color: var(--stone);
}

/* ── Status Badges ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 1px;
}

.badge--gold {
  border: 1px solid var(--gold);
  color: var(--gold);
  background: transparent;
}

.badge--green {
  border: 1px solid var(--green);
  color: var(--green);
  background: transparent;
}

.badge--stone {
  border: 1px solid var(--stone);
  color: var(--stone);
  background: transparent;
}

/* ── Scroll Reveal Animations ───────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--dur) var(--ease-out),
                transform var(--dur) var(--ease-out);
  }

  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .reveal-delay-1 { transition-delay: 80ms; }
  .reveal-delay-2 { transition-delay: 160ms; }
  .reveal-delay-3 { transition-delay: 240ms; }
  .reveal-delay-4 { transition-delay: 320ms; }

  /* Gold rule "draws" itself horizontally instead of sliding up */
  .gold-rule.reveal {
    transform: scaleX(0);
    transform-origin: left center;
    transition: opacity var(--dur) var(--ease-out),
                transform 0.7s var(--ease-out);
  }
  .gold-rule--center.reveal { transform-origin: center; }
  .gold-rule.reveal.is-visible { transform: scaleX(1); }

}

/* ── Chevron Signature Motif (matches the logo's solid chevrons) ── */
.chevron-motif {
  margin-bottom: 18px;
  line-height: 0;
}
.chevron-motif img {
  display: block;
  width: 30px;
  height: auto;
}
.chevron-motif--center img { margin-left: auto; margin-right: auto; }

/* ── Section Divider ────────────────────────────────────── */
.section-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
}

/* ── Responsive Breakpoints ─────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; gap: 32px; }
  .grid-3 { grid-template-columns: 1fr; gap: 28px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
}

/* ── Tactile interactions (desktop only, enabled by interactions.js) ── */
@media (hover: hover) and (pointer: fine) {
  /* smoother transforms while tilting / magnetising */
  .project-card.fx-tilt, .team-card.fx-tilt, .vm-card.fx-tilt {
    transition: transform 0.2s var(--ease-out), box-shadow 0.3s ease, border-color 0.3s ease;
  }
  .btn.fx-magnetic {
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease,
                transform 0.25s var(--ease-out);
  }
}

/* ── Image settle-zoom on reveal (project cards) ────────── */
@media (prefers-reduced-motion: no-preference) {
  .project-card.reveal .project-card__image {
    transition: transform 1s var(--ease-out);
    transform: scale(1.06);
  }
  .project-card.reveal.is-visible .project-card__image {
    transform: scale(1);
  }
}

/* ── Film-grain texture ─────────────────────────────────────
   Barely-there generated noise over the whole frame for an
   "expensive print" feel. No image file, no motion, click-through. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='180'%20height='180'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.85'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3C/filter%3E%3Crect%20width='100%25'%20height='100%25'%20filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ── Engraved "in-stone" headings ───────────────────────────
   Opt-in via .engraved (dark text on light stone) or
   .engraved--dark (light text on dark). A restrained letterpress:
   the glyphs read as carved into the surface, not embossed.   */
.engraved {
  color: #2a2723;
  text-shadow:
    0 1px 0 rgba(255,255,255,0.65),
    0 -1px 1px rgba(0,0,0,0.22);
}
.engraved--dark {
  color: #e8e4dc;
  text-shadow:
    0 1px 1px rgba(0,0,0,0.55),
    0 -1px 0 rgba(255,255,255,0.10);
}

/* ── Slow Ken Burns drift for static project-page heroes ──── */
@media (prefers-reduced-motion: no-preference) {
  .hero-kb {
    animation: heroKenBurns 22s ease-in-out infinite alternate;
    transform-origin: 50% 42%;
    will-change: transform;
  }
  @keyframes heroKenBurns {
    from { transform: scale(1.0); }
    to   { transform: scale(1.07); }
  }
}
