/* ==========================================================================
   Sri Vinayaga Chimney Work — Base
   Design tokens, reset, typography scale, layout primitives, motion utilities.

   Palette: slate blue + copper. No pure black and no red anywhere — the
   darkest surface is a deep slate, so the site reads cool and engineered
   rather than harsh.
   ========================================================================== */

:root {
  /* --- Dark surfaces: deep slate blue, never black ------------------- */
  --ink:        #12222F;
  --ink-2:      #16293A;
  --ink-3:      #1D3548;
  --ink-4:      #26425A;

  /* --- Brand slate ---------------------------------------------------- */
  --brand:      #23394C;
  --brand-lt:   #3D6A8A;
  --brand-lift: #5A8CAE;
  --brand-deep: #16283A;

  /* --- Accent: copper ------------------------------------------------- */
  --accent:      #C2703F;
  --accent-lt:   #E0925F;
  --accent-deep: #9E5730;
  --accent-soft: rgba(194, 112, 63, .12);

  /* --- Light surfaces -------------------------------------------------- */
  --paper:      #F4F6F7;
  --paper-2:    #E9EDEF;
  --paper-3:    #DCE3E6;

  /* --- Text ------------------------------------------------------------ */
  --on-dark:       #E9F0F4;
  --on-dark-dim:   #A2B6C4;
  --on-dark-faint: #75909F;
  --on-light:      #16242F;
  --on-light-dim:  #566470;

  /* --- Lines & shadows -------------------------------------------------- */
  --line-dark:    rgba(233, 240, 244, .11);
  --line-dark-2:  rgba(233, 240, 244, .22);
  --line-light:   rgba(22, 36, 47, .11);
  --line-light-2: rgba(22, 36, 47, .21);

  --shadow-sm: 0 1px 2px rgba(18, 34, 47, .08), 0 4px 14px rgba(18, 34, 47, .06);
  --shadow-md: 0 2px 6px rgba(18, 34, 47, .09), 0 18px 44px rgba(18, 34, 47, .12);
  --shadow-lg: 0 4px 14px rgba(18, 34, 47, .13), 0 34px 74px rgba(18, 34, 47, .20);
  --shadow-nav: 0 10px 34px rgba(18, 34, 47, .16);

  /* --- Radii ------------------------------------------------------------ */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;

  /* --- Type -------------------------------------------------------------- */
  --font-display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* --- Rhythm ------------------------------------------------------------ */
  --shell: 1280px;
  --gut: clamp(20px, 5vw, 56px);
  --sec-y: clamp(72px, 9vw, 140px);
  --top-h: 122px;   /* info bar + header at rest */

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .5, 1);
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 130px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--on-light);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.66;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.nav-open { overflow: hidden; }

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

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

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

h1, h2, h3, h4, h5 { margin: 0; font-family: var(--font-display); font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ==========================================================================
   Typography scale
   ========================================================================== */

.t-display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 6.4vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -.036em;
}

.t-h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.15rem, 4.7vw, 3.7rem);
  line-height: 1.07;
  letter-spacing: -.032em;
}

.t-h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1.12;
  letter-spacing: -.028em;
}

.t-h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.22rem, 1.95vw, 1.55rem);
  line-height: 1.24;
  letter-spacing: -.02em;
}

.t-h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  line-height: 1.34;
  letter-spacing: -.014em;
}

.t-lead {
  font-size: clamp(1.03rem, 1.35vw, 1.2rem);
  line-height: 1.62;
  color: var(--on-light-dim);
}

.t-body { font-size: 1rem; line-height: 1.72; color: var(--on-light-dim); }
.t-sm { font-size: .9rem; line-height: 1.62; }
.t-xs { font-size: .8rem; line-height: 1.55; }

/* Eyebrow — technical label with an accent tick */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--on-light-dim);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  flex: none;
  transform-origin: left;
  animation: tickIn .8s var(--ease-out) both;
}
@keyframes tickIn { from { transform: scaleX(0); } }
.eyebrow--plain::before { display: none; }

/* Dark-surface text colours */
.on-dark { color: var(--on-dark); }
.on-dark .t-lead,
.on-dark .t-body { color: var(--on-dark-dim); }
.on-dark .eyebrow { color: var(--on-dark-dim); }

/* ==========================================================================
   Layout primitives
   ========================================================================== */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gut);
}
.shell--wide { max-width: 1600px; }
.shell--narrow { max-width: 880px; }

.section { padding-block: var(--sec-y); position: relative; }
.section--tight { padding-block: clamp(52px, 6vw, 86px); }
.section--dark { background: var(--ink); color: var(--on-dark); }
.section--dark-2 { background: var(--ink-2); color: var(--on-dark); }
.section--paper-2 { background: var(--paper-2); }

.sec-head { max-width: 720px; }
.sec-head .eyebrow { margin-bottom: 20px; }
.sec-head .t-lead { margin-top: 18px; }

.sec-head--split {
  display: grid;
  gap: clamp(20px, 3vw, 56px);
  align-items: end;
  max-width: none;
}
@media (min-width: 900px) {
  .sec-head--split { grid-template-columns: minmax(0, 1.05fr) minmax(0, .85fr); }
  .sec-head--split .t-lead { margin-top: 0; padding-bottom: 6px; }
}

.grid { display: grid; gap: clamp(16px, 2vw, 28px); }

.rule { height: 1px; background: var(--line-light); border: 0; margin: 0; }
.section--dark .rule, .rule--dark { background: var(--line-dark); }

/* Animated section divider — a hairline that draws itself in */
.divider {
  position: relative;
  height: 1px;
  background: var(--line-light);
  overflow: visible;
}
.divider::after {
  content: "";
  position: absolute; left: 0; top: -1px; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--brand-lt));
  border-radius: 3px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.3s var(--ease-out);
}
.divider.is-in::after { transform: scaleX(1); }
.section--dark .divider { background: var(--line-dark); }

/* Utilities */
.u-center { text-align: center; }
.u-nowrap { white-space: nowrap; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; top: 8px; left: 8px; z-index: 300;
  transform: translateY(-250%);
  background: var(--brand); color: #fff; padding: 10px 18px; border-radius: var(--r-sm);
  font-size: .85rem; font-weight: 600;
}
.skip-link:focus { transform: none; }

.grid-lines {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(to right, var(--line-dark) 1px, transparent 1px);
  background-size: 25% 100%;
  opacity: .55;
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

/* ==========================================================================
   Motion
   ========================================================================== */

/* Page-load / page-leave fade */
body { opacity: 1; transition: opacity .34s var(--ease); }
body.is-leaving { opacity: 0; }

/* Scroll progress bar */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 300;
  background: linear-gradient(90deg, var(--accent), var(--brand-lift));
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  pointer-events: none;
}

/* Generic reveal */
.reveal {
  opacity: 0;
  transform: translate3d(0, 30px, 0);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

.reveal--left { transform: translate3d(-34px, 0, 0); }
.reveal--right { transform: translate3d(34px, 0, 0); }
.reveal--zoom { transform: scale(.94); }

/* Image mask reveal */
.mask-reveal { position: relative; overflow: hidden; }
.mask-reveal > img,
.mask-reveal > video {
  transform: scale(1.16);
  transition: transform 1.6s var(--ease-out), opacity 1.1s var(--ease-out);
  opacity: .2;
}
.mask-reveal.is-in > img,
.mask-reveal.is-in > video { transform: none; opacity: 1; }
.mask-reveal::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--accent);
  transform-origin: right;
  transform: scaleX(1);
  transition: transform 1s var(--ease-out);
  pointer-events: none;
}
.mask-reveal.is-in::after { transform: scaleX(0); }

/* Word-by-word headline reveal (JS splits the text).
   No per-word overflow clipping — that breaks the baseline and cuts glyphs. */
.wsplit-word { display: inline-block; }
.wsplit-word > i {
  display: inline-block;
  font-style: inherit;
  opacity: 0;
  transform: translateY(.42em) rotate(1.2deg);
  transition: opacity .7s var(--ease-out), transform .85s var(--ease-out);
  transition-delay: var(--wd, 0ms);
  will-change: opacity, transform;
}
.wsplit.is-in .wsplit-word > i { opacity: 1; transform: none; }

/* Count-up numbers */
.count { font-variant-numeric: tabular-nums; }

/* Magnetic buttons + card tilt are driven by JS custom properties */
.magnetic { transition: transform .45s var(--ease-out); }
.tilt { transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .mask-reveal > img, .mask-reveal > video, .wsplit-word > i {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
  .mask-reveal::after { display: none; }
  .divider::after { transform: scaleX(1) !important; }
  body.is-leaving { opacity: 1; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
