/* ==========================================================================
   Kuber Esthana LLP — Base styles
   Brand tokens live here. Every other stylesheet references these variables
   instead of hardcoded colors/fonts, so the palette/typography is a
   one-place edit.

   Palette/type reference: warm cream ground, navy ink, gold + green accent,
   Cormorant Garamond (serif display) + Jost (light sans body) + JetBrains
   Mono (labels/eyebrows) — matches the approved design reference.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,400&family=Jost:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Brand colors */
  --color-navy:            #0F1C36;   /* dark card / footer / dark-section background */
  --color-navy-soft:       #16243d;
  --color-navy-deep:       #0B1424;   /* deepest — footer, modals */
  --color-ink:             #14213D;   /* body/heading text color (not a background) */
  --color-gold:            #A8802C;
  --color-gold-mid:        #C69A3C;
  --color-gold-light:      #D8A93F;
  --color-gold-pale:       #EBD08A;
  --color-green:           #2E5B43;   /* accent green, used sparingly (e.g. plantation brand) */

  --color-text:            var(--color-ink);
  --color-text-muted:      rgba(20, 33, 61, 0.7);
  --color-text-on-dark:    #FBFAF7;
  --color-text-muted-on-dark: rgba(251, 250, 247, 0.7);

  --color-background:      #FAF8F4;   /* warm cream page ground */
  --color-background-alt:  #F2EFE8;   /* slightly deeper cream for alt sections/cards */
  --color-surface:         #FBFAF7;   /* "Esthana White" card surface — never pure #fff per brand kit */
  --color-border:          rgba(20, 33, 61, 0.12);
  --color-border-on-dark:  rgba(251, 250, 247, 0.16);

  /* Typography */
  --font-heading: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Spacing / layout */
  --container-max: 1200px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  --radius: 0px;
  --shadow-card: 0 24px 50px -28px rgba(15, 28, 54, 0.4);
}

/* Reset ------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

::selection {
  background: var(--color-gold-pale);
  color: var(--color-navy-deep);
}

/* Typography --------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 var(--space-sm);
  color: var(--color-ink);
}

h1 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); font-weight: 300; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

/* Section-opening statement line — larger and lighter than a normal h2. */
.display-heading {
  font-size: clamp(2.4rem, 5.2vw, 4.4rem);
  font-weight: 300;
  line-height: 1.08;
  margin-bottom: var(--space-lg);
}

p {
  margin: 0 0 var(--space-sm);
  font-weight: 300;
  color: var(--color-text-muted);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-xs);
}

/* Layout helpers ------------------------------------------------------------ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  position: relative;
  padding: var(--space-2xl) 0;
  scroll-margin-top: 88px;
}

.section--alt {
  background: var(--color-background-alt);
}

.section--dark {
  background: var(--color-navy);
  color: var(--color-text-on-dark);
}

.section--dark h1,
.section--dark h2,
.section--dark h3 {
  color: var(--color-text-on-dark);
}

.section--dark p {
  color: var(--color-text-muted-on-dark);
}

.section-heading {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-xl);
}

/* Ambient blur decoration -----------------------------------------------------
   Soft animated gradient blobs used behind hero-type section content —
   the design reference's signature ambient touch. Purely decorative,
   pointer-events:none, clipped by the section's own overflow:hidden. */

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.ambient-blob--spin {
  animation: holo-spin 60s linear infinite;
}

.ambient-blob--float-a {
  animation: float-a 22s ease-in-out infinite;
}

.ambient-blob--float-b {
  animation: float-b 17s ease-in-out infinite;
}

@keyframes holo-spin {
  to { transform: rotate(360deg); }
}

@keyframes float-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(3%, -4%, 0) scale(1.09); }
}

@keyframes float-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.04); }
  50% { transform: translate3d(-4%, 3%, 0) scale(0.95); }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-blob--spin,
  .ambient-blob--float-a,
  .ambient-blob--float-b {
    animation: none;
  }
}

/* Grid heading ---------------------------------------------------------------
   The recurring numbered section header: a mono index against a hairline. */

.grid-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-lg);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.grid-heading__index {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding-bottom: 0.4em;
}

.grid-heading__index strong {
  color: var(--color-gold);
  font-weight: 500;
}

.grid-heading__text {
  max-width: 640px;
}

.grid-heading .eyebrow,
.grid-heading h2,
.grid-heading h3 {
  margin-bottom: 0;
}

/* Sub-heading inside a section that already has a numbered grid-heading:
   no divider rule of its own, so it reads as a step down, not a new section. */
.grid-heading--sub {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: var(--space-lg);
}

.grid-heading--sub h3 {
  font-size: 1.9rem;
}

.grid-heading .eyebrow {
  display: block;
  margin-bottom: 0.4em;
}

.section--dark .grid-heading,
.section--dark .grid-heading__index {
  border-color: var(--color-border-on-dark);
  color: var(--color-text-muted-on-dark);
}

@media (max-width: 640px) {
  .grid-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }
}

/* Info grid — numbered bordered cards, used for value drivers, sectors, etc. --- */

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-md);
  counter-reset: info;
}

.info-card {
  position: relative;
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  counter-increment: info;
}

/* Sector cards carry a mono index in the corner, same decimal-leading-zero
   language as .grid-heading__index and the project/business card badges. */
.info-grid--numbered .info-card {
  padding-top: var(--space-2xl);
}

/* Five across needs a tighter floor than the default 260px, which would wrap
   the fifth card onto its own row at container width. */
.info-grid--five {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.info-grid--numbered .info-card::before {
  content: counter(info, decimal-leading-zero);
  position: absolute;
  top: var(--space-lg);
  left: var(--space-lg);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--color-gold);
}

.info-card--dark {
  background: var(--color-navy);
  border-color: var(--color-navy);
  color: var(--color-text-on-dark);
}

.info-card--dark h3 {
  color: var(--color-text-on-dark);
}

.info-card--dark p {
  color: var(--color-text-muted-on-dark);
}

/* A plain (light-surface) .info-card sitting inside a .section--dark parent
   needs its own glass treatment -- otherwise .section--dark's own h3/p color
   overrides (meant for text sitting directly on the dark background) win the
   cascade tie against .info-card's un-colored h3/p rules and force on-dark
   text onto the card's light surface, killing contrast. */
.section--dark .info-card:not(.info-card--dark) {
  background: rgba(251, 250, 247, 0.06);
  border-color: var(--color-border-on-dark);
}

.section--dark .info-card:not(.info-card--dark) h3 {
  color: var(--color-text-on-dark);
}

.section--dark .info-card:not(.info-card--dark) > p {
  color: var(--color-text-muted-on-dark);
}

.info-card::before {
  content: counter(info, decimal-leading-zero);
  display: block;
  margin-bottom: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--color-gold);
}

.info-card--dark::before {
  color: var(--color-gold-pale);
}

.info-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.6em;
}

.info-card > p {
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 0;
}

.info-card ul {
  margin: 0;
}

.info-card li {
  padding: 0.5em 0;
  border-top: 1px solid var(--color-border);
  font-size: 0.86rem;
  color: var(--color-text-muted);
}

.info-card li:first-child {
  border-top: none;
  padding-top: 0;
}

/* Corner frame -----------------------------------------------------------------
   Blueprint-style crop marks used on framed imagery. */

.corner-frame {
  position: relative;
}

.corner-frame::before {
  content: '';
  position: absolute;
  inset: 10px;
  pointer-events: none;
  background:
    linear-gradient(var(--color-gold), var(--color-gold)) top left / 14px 1px no-repeat,
    linear-gradient(var(--color-gold), var(--color-gold)) top left / 1px 14px no-repeat,
    linear-gradient(var(--color-gold), var(--color-gold)) top right / 14px 1px no-repeat,
    linear-gradient(var(--color-gold), var(--color-gold)) top right / 1px 14px no-repeat,
    linear-gradient(var(--color-gold), var(--color-gold)) bottom left / 14px 1px no-repeat,
    linear-gradient(var(--color-gold), var(--color-gold)) bottom left / 1px 14px no-repeat,
    linear-gradient(var(--color-gold), var(--color-gold)) bottom right / 14px 1px no-repeat,
    linear-gradient(var(--color-gold), var(--color-gold)) bottom right / 1px 14px no-repeat;
  opacity: 0.75;
}

/* Figure caption -----------------------------------------------------------------
   Small mono caption used under placeholder/real imagery, drafting-note style. */

.figure-caption {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  margin-top: var(--space-xs);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}

.figure-caption span:first-child {
  color: var(--color-gold);
}

/* Buttons ------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.95em 1.7em;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn-primary {
  background: linear-gradient(145deg, var(--color-gold), var(--color-gold-light) 55%, var(--color-gold-pale));
  color: var(--color-navy-deep);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -12px rgba(198, 154, 60, 0.5);
}

.btn-outline {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}

.btn-outline:hover {
  background: rgba(20, 33, 61, 0.05);
}

.btn-dark {
  background: var(--color-navy);
  color: var(--color-text-on-dark);
}

.btn-dark:hover {
  background: var(--color-navy-soft);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

/* Scroll reveal --------------------------------------------------------------
   Small, deliberate on-scroll entrance — not a generic fade-up-40px blob.
   .reveal fades/lifts a single element; .reveal-group staggers its direct
   children. JS (main.js) toggles .is-visible via IntersectionObserver.
   Skipped entirely under prefers-reduced-motion. */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--reveal-delay, 0ms);
  }

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

  .reveal-group > * {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }

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

  .reveal-group.is-visible > *:nth-child(1) { transition-delay: 0ms; }
  .reveal-group.is-visible > *:nth-child(2) { transition-delay: 65ms; }
  .reveal-group.is-visible > *:nth-child(3) { transition-delay: 130ms; }
  .reveal-group.is-visible > *:nth-child(4) { transition-delay: 195ms; }
  .reveal-group.is-visible > *:nth-child(5) { transition-delay: 260ms; }
  .reveal-group.is-visible > *:nth-child(6) { transition-delay: 325ms; }
}

/* Page panels ------------------------------------------------------------------
   Instant tab-style navigation: sections tagged [data-page] are shown/hidden
   by main.js based on the clicked nav item's hash, instead of scrolling down
   one long page. No-JS fallback: nothing is hidden, page reads top-to-bottom
   as before. */

[data-page].page-hidden {
  display: none;
}

/* Placeholder marker -------------------------------------------------------- */
/* Anything wrapped in .placeholder is content to be swapped for real
   copy/photos later — kept visually obvious during development. */

.placeholder-note {
  font-size: 0.75rem;
  color: var(--color-gold);
  font-style: italic;
}
