/* ==========================================================================
   Vatsalya Paper Industries LLP — site standard
   Loaded LAST on every page. Owns: design tokens, the type scale, the shared
   header / navigation / drawer, the shared footer, and responsive baselines.
   Page-specific layout still lives in site.css or the per-page Tailwind config.
   ========================================================================== */

:root {
  /* --- brand palette ---------------------------------------------------- */
  --v-forest: #24523a;
  --v-forest-deep: #183a29;
  --v-forest-dark: #122b1e;
  --v-sage: #8faf91;
  --v-kraft: #d8c3a5;
  --v-kraft-tint: #ebe5d8;
  --v-ivory: #f5f0e6;
  --v-white: #fffdf9;
  --v-charcoal: #252a27;
  --v-muted: #4c463d;
  --v-line: rgba(216, 195, 165, 0.55);

  /* --- typography ------------------------------------------------------- */
  --v-font-head: "Plus Jakarta Sans", "Segoe UI", Arial, sans-serif;
  --v-font-body: "Inter", "Segoe UI", Arial, sans-serif;
  --v-font-mono: "Inter", ui-monospace, "Segoe UI", monospace;

  /* One scale for the whole site. Fluid, so no per-page breakpoint classes. */
  --v-fs-h1: clamp(2rem, 1.25rem + 3.4vw, 3.5rem); /* 32 -> 56 */
  --v-fs-h2: clamp(1.625rem, 1.15rem + 2.1vw, 2.625rem); /* 26 -> 42 */
  --v-fs-h3: clamp(1.25rem, 1.08rem + 0.75vw, 1.625rem); /* 20 -> 26 */
  --v-fs-h4: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); /* 17 -> 19 */
  --v-fs-body: 1rem;
  --v-fs-small: 0.875rem;
  --v-fs-eyebrow: 0.6875rem;

  /* --- shell ------------------------------------------------------------ */
  --v-header-h: 80px;
  --v-gutter: clamp(1rem, 4vw, 2rem);
  --v-maxw: 1440px;
}

@media (max-width: 900px) {
  :root {
    --v-header-h: 64px;
  }
}

/* ==========================================================================
   1. Baseline — applies on every page regardless of which CSS system it uses
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* anchor targets clear the fixed header */
  scroll-padding-top: calc(var(--v-header-h) + 1rem);
}

body {
  margin: 0;
  /* the header is fixed on every page, so the document is offset once, here */
  padding-top: var(--v-header-h);
  font-family: var(--v-font-body);
  font-size: var(--v-fs-body);
  line-height: 1.6;
  color: var(--v-charcoal);
  /* clip, not hidden: hidden would turn <body> into a scroll container */
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* Nothing may push the page sideways. */
img,
video,
canvas,
svg,
iframe {
  max-width: 100%;
}

img,
video {
  height: auto;
}

/* Long unbroken strings (emails, URLs, part numbers) wrap instead of overflow */
p,
li,
dd,
dt,
td,
th,
h1,
h2,
h3,
h4 {
  overflow-wrap: break-word;
}

/* ==========================================================================
   2. The type scale
   Doubled class selectors (0-2-0) so the scale wins over both Tailwind's
   preflight and site.css descendant rules such as `.home-intro h2`.
   ========================================================================== */

.v-h1.v-h1,
.v-h2.v-h2,
.v-h3.v-h3,
.v-h4.v-h4 {
  font-family: var(--v-font-head);
  margin-top: 0;
  text-wrap: balance;
}

.v-h1.v-h1 {
  font-size: var(--v-fs-h1);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.v-h2.v-h2 {
  font-size: var(--v-fs-h2);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.018em;
}

.v-h3.v-h3 {
  font-size: var(--v-fs-h3);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.012em;
}

.v-h4.v-h4 {
  font-size: var(--v-fs-h4);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

/* Headings keep whatever colour their page gave them; only inherit when the
   page set none, so dark sections stay readable. */

.v-eyebrow.v-eyebrow {
  font-family: var(--v-font-head);
  font-size: var(--v-fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Design-token classes used throughout the Tailwind pages. None of the page
   configs ever defined the fontSize side of these, so `text-body-sm`,
   `text-label-caps` and friends resolved to nothing and every one of them
   rendered at the default 16px. Defining them here once gives all four pages
   the same supporting-text scale.
   -------------------------------------------------------------------------- */

.font-headline-xl,
.font-headline-lg,
.font-headline-sm,
.font-headline-xl-mobile,
.font-display-lg,
.font-display-lg-mobile,
.font-technical-kpi,
.font-label-caps {
  font-family: var(--v-font-head);
}

.font-body-lg,
.font-body-md,
.font-body-sm,
.font-label-md,
.font-caption-code {
  font-family: var(--v-font-body);
}

.text-display-lg,
.text-display-lg-mobile {
  font-size: var(--v-fs-h1);
  line-height: 1.08;
}

.text-headline-xl,
.text-headline-xl-mobile {
  font-size: var(--v-fs-h2);
  line-height: 1.14;
}

.text-headline-lg {
  font-size: var(--v-fs-h3);
  line-height: 1.22;
}

.text-headline-sm {
  font-size: var(--v-fs-h4);
  line-height: 1.3;
}

.text-technical-kpi {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.text-body-lg {
  font-size: 1.0625rem;
  line-height: 1.7;
}

.text-body-md {
  font-size: 1rem;
  line-height: 1.65;
}

.text-body-sm {
  font-size: 0.875rem;
  line-height: 1.6;
}

.text-label-md {
  font-size: 0.8125rem;
  line-height: 1.5;
}

.text-label-caps {
  font-size: var(--v-fs-eyebrow);
  line-height: 1.45;
  letter-spacing: 0.1em;
}

.text-caption-code {
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   3. Shared header + primary navigation
   ========================================================================== */

.v-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--v-header-h);
  background: var(--v-forest-deep);
  border-bottom: 1px solid rgba(216, 195, 165, 0.22);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.14);
}

.v-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  height: 100%;
  max-width: var(--v-maxw);
  margin: 0 auto;
  padding: 0 var(--v-gutter);
}

/* --- brand --- */
.v-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: var(--v-white);
  text-decoration: none;
}

.v-brand img {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  object-fit: contain;
  padding: 3px;
  background: rgba(216, 195, 165, 0.14);
  border: 1px solid rgba(216, 195, 165, 0.4);
  border-radius: 6px;
}

.v-brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.v-brand__name {
  font-family: var(--v-font-head);
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--v-white);
}

.v-brand__tag {
  font-family: var(--v-font-head);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--v-kraft);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .v-brand__tag {
    display: none;
  }
  .v-brand img {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }
}

/* --- desktop nav --- */
.v-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
}

.v-nav a {
  padding: 0.5rem 0.7rem;
  border-radius: 4px;
  font-family: var(--v-font-head);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: rgba(245, 240, 230, 0.82);
  transition:
    color 150ms ease,
    background 150ms ease;
}

.v-nav a:hover,
.v-nav a:focus-visible {
  color: var(--v-white);
  background: rgba(255, 255, 255, 0.08);
}

.v-nav a[aria-current="page"] {
  color: var(--v-white);
  font-weight: 700;
  background: var(--v-forest);
  border: 1px solid rgba(216, 195, 165, 0.35);
  padding: calc(0.5rem - 1px) calc(0.7rem - 1px);
}

/* --- header actions --- */
.v-header__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 0 0 auto;
}

.v-header__cta {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.95rem;
  background: var(--v-kraft);
  color: var(--v-forest-deep);
  border-radius: 4px;
  font-family: var(--v-font-head);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms ease;
}

.v-header__cta:hover,
.v-header__cta:focus-visible {
  background: #c9b394;
}

.v-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(216, 195, 165, 0.4);
  border-radius: 4px;
  color: var(--v-white);
  cursor: pointer;
}

.v-burger:hover,
.v-burger:focus-visible {
  background: var(--v-forest);
}

.v-burger span {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
}

.v-burger span::before,
.v-burger span::after {
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  content: "";
  background: currentColor;
}

.v-burger span::before {
  top: -6px;
}

.v-burger span::after {
  top: 6px;
}

/* Seven nav items need room; collapse to the drawer below 1140px. */
@media (max-width: 1139px) {
  .v-nav {
    display: none;
  }
  .v-burger {
    display: inline-flex;
  }
}

@media (max-width: 620px) {
  .v-header__cta {
    display: none;
  }
}

/* ==========================================================================
   4. Mobile drawer
   ========================================================================== */

.v-scrim {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(18, 43, 30, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 220ms ease,
    visibility 220ms ease;
}

.v-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(320px, 86vw);
  padding: 1.25rem;
  overflow-y: auto;
  background: var(--v-forest-deep);
  color: var(--v-white);
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  transition: transform 240ms ease;
}

body.v-drawer-open .v-drawer {
  transform: translateX(0);
}

body.v-drawer-open .v-scrim {
  opacity: 1;
  visibility: visible;
}

body.v-drawer-open {
  overflow: hidden;
}

.v-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(216, 195, 165, 0.25);
}

.v-drawer__title {
  font-family: var(--v-font-head);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--v-kraft);
}

.v-drawer__close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
  background: transparent;
  border: 1px solid rgba(216, 195, 165, 0.4);
  border-radius: 4px;
  color: var(--v-white);
  cursor: pointer;
}

.v-drawer__close:hover,
.v-drawer__close:focus-visible {
  background: var(--v-forest);
}

.v-drawer nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 1.1rem;
}

.v-drawer nav a {
  padding: 0.8rem 0.9rem;
  border-radius: 4px;
  font-family: var(--v-font-head);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(245, 240, 230, 0.85);
}

.v-drawer nav a:hover,
.v-drawer nav a:focus-visible {
  color: var(--v-white);
  background: var(--v-forest);
}

.v-drawer nav a[aria-current="page"] {
  color: var(--v-white);
  font-weight: 700;
  background: var(--v-forest);
  border-left: 3px solid var(--v-kraft);
}

.v-drawer__foot {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: center;
}

.v-drawer__foot a {
  padding: 0.8rem 1rem;
  background: var(--v-kraft);
  color: var(--v-forest-deep);
  border-radius: 4px;
  font-family: var(--v-font-head);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.v-drawer__foot small {
  font-size: 0.6875rem;
  color: rgba(245, 240, 230, 0.65);
}

/* ==========================================================================
   5. Shared footer
   ========================================================================== */

.v-footer {
  background: var(--v-forest-dark);
  color: var(--v-white);
  border-top: 1px solid var(--v-forest);
}

.v-footer__inner {
  max-width: var(--v-maxw);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) var(--v-gutter) 1.5rem;
}

.v-footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1.1fr 1fr 1.1fr;
  gap: clamp(1.5rem, 4vw, 2.5rem);
}

@media (max-width: 1000px) {
  .v-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .v-footer__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.v-footer__col {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}

.v-footer__name {
  font-family: var(--v-font-head);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--v-white);
  margin: 0;
}

.v-footer__col > span {
  font-family: var(--v-font-head);
  font-size: var(--v-fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--v-kraft);
  margin-bottom: 0.15rem;
}

.v-footer p {
  margin: 0;
  font-size: var(--v-fs-small);
  line-height: 1.6;
  color: rgba(245, 240, 230, 0.72);
}

.v-footer b {
  font-size: var(--v-fs-small);
  font-weight: 700;
  color: var(--v-white);
}

.v-footer a {
  font-size: var(--v-fs-small);
  color: rgba(245, 240, 230, 0.82);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.v-footer a:hover,
.v-footer a:focus-visible {
  color: var(--v-kraft);
  text-decoration: underline;
}

.v-footer__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.v-footer__badges span {
  padding: 0.25rem 0.5rem;
  background: var(--v-forest);
  color: var(--v-kraft);
  border-radius: 3px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.v-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
  padding-top: 1.25rem;
  border-top: 1px solid rgba(36, 82, 58, 0.8);
  font-size: 0.6875rem;
  color: rgba(245, 240, 230, 0.6);
}

.v-footer__bottom p {
  margin: 0;
  font-size: 0.6875rem;
  color: inherit;
}

/* Build credit: legible but deliberately quieter than the site's own links. */
.v-credit {
  color: rgba(245, 240, 230, 0.78);
  text-decoration: none;
  border-bottom: 1px solid rgba(216, 195, 165, 0.35);
}

.v-credit:hover,
.v-credit:focus-visible {
  color: var(--v-kraft);
  border-bottom-color: var(--v-kraft);
}

/* The old site.css footer decoration must not leak onto the shared footer. */
footer.v-footer::after {
  content: none !important;
}

/* ==========================================================================
   5b. Error page
   ========================================================================== */

.v-404 {
  display: flex;
  align-items: center;
  min-height: calc(100vh - var(--v-header-h) - 4rem);
  padding: clamp(3rem, 10vw, 6rem) var(--v-gutter);
  background: var(--v-ivory);
}

.v-404__inner {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  text-align: center;
}

.v-404__inner p {
  max-width: 34rem;
  margin: 1rem auto 0;
  color: var(--v-muted);
  font-size: 1.0625rem;
}

.v-404__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  margin-top: clamp(2rem, 5vw, 2.75rem);
}

.v-404__links a {
  color: var(--v-forest);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(36, 82, 58, 0.35);
}

.v-404__links a:hover {
  border-bottom-color: var(--v-forest);
}

.v-404__cta.v-404__cta {
  padding: 0.85rem 1.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--v-forest-deep);
  color: var(--v-white);
}

.v-404__cta.v-404__cta:hover {
  background: var(--v-forest);
}

.v-404__mark {
  display: block;
  width: 96px;
  height: auto;
  margin: 0 auto 1.5rem;
}

/* ==========================================================================
   5c. Brand marks

   The Vatsalya Papers mark, cut from the original logo artwork by
   tools/make_brand.py: -ivory for dark grounds, -forest for kraft/light ones.
   ========================================================================== */

/* Hero watermark. The doubled class outranks `.ref-hero > *` and
   `.ref-page-hero > *`, which would otherwise pull it back into the flow. */
.v-hero-mark.v-hero-mark {
  position: absolute;
  z-index: 0;
  right: clamp(-5rem, -4vw, -1.5rem);
  bottom: clamp(2.5rem, 7vw, 5rem);
  width: clamp(260px, 38vw, 560px);
  max-width: none;
  height: auto;
  opacity: 0.07;
  pointer-events: none;
  user-select: none;
}

/* Footer: lockup in the first column, plus a large faint mark behind. */
.v-footer {
  position: relative;
  overflow: hidden;
}

.v-footer__inner {
  position: relative;
}

.v-footer__mark {
  position: absolute;
  right: clamp(-6rem, -5vw, -2rem);
  bottom: -4rem;
  width: clamp(280px, 34vw, 480px);
  height: auto;
  opacity: 0.045;
  pointer-events: none;
  user-select: none;
}

.v-footer__brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.35rem;
}

.v-footer__brand img {
  flex: 0 0 auto;
  width: 64px;
  height: auto;
}

.v-footer .v-footer__name {
  font-size: 1.25rem;
  line-height: 1.1;
  color: var(--v-white);
}

.v-footer .v-footer__legal {
  margin-top: 0.3rem;
  font-family: var(--v-font-head);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--v-kraft);
}

/* Mill stamp in each page's closing call to action. Positioned with
   top/margin and the `rotate` property, never `transform`, so the scroll
   reveal (which animates transform) cannot knock it out of place. */
.v-seal {
  --v-seal-size: 96px;
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: var(--v-seal-size);
  height: var(--v-seal-size);
  color: var(--v-forest);
  rotate: -8deg;
}

.v-seal__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.v-seal__ring circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.v-seal__ring circle + circle {
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.v-seal__ring text {
  font-family: var(--v-font-head);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  fill: currentColor;
}

.v-seal img {
  position: relative;
  width: 50%;
  max-width: none;
  height: auto;
}

@media (prefers-reduced-motion: no-preference) {
  .v-seal__ring {
    animation: v-seal-turn 60s linear infinite;
  }
}

@keyframes v-seal-turn {
  to {
    rotate: 360deg;
  }
}

.v-seal--center {
  margin: 0 auto 1.5rem;
}

.v-seal--float {
  margin-bottom: 1.25rem;
}

@media (min-width: 1100px) {
  .ref-cta .ref-wrap {
    position: relative;
  }

  .v-seal--float {
    --v-seal-size: 150px;
    position: absolute;
    top: 50%;
    right: clamp(3rem, 6vw, 6rem);
    margin: calc(var(--v-seal-size) / -2) 0 0;
  }
}

/* Home page: the mark replaces the old ◉ glyph in the commitment card. */
.ref-commit__mark {
  flex: 0 0 auto;
  width: 64px;
  height: auto;
}

/* ==========================================================================
   6. Responsive corrections for existing page content
   ========================================================================== */

/* Wide data tables scroll inside their own box rather than the page. */
.v-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ref-header,
.site-header {
  display: none !important; /* replaced by .v-header */
}

/* site.css heroes reserved their own 80px for the old fixed header; the body
   offset now does that, so the reservation would double-count. */
.ref-hero,
.ref-page-hero {
  padding-top: 0;
}

.ref-hero::before,
.ref-page-hero::before {
  inset: 0;
}

.ref-hero {
  min-height: min(88vh, 780px);
}

.ref-status {
  padding-top: clamp(2rem, 5vw, 3.5rem);
}

/* Tailwind pages: `pt-20` on <main> is likewise redundant now. */
main.pt-20 {
  padding-top: 0;
}

/* Grids that only ever had a two-column rule need a single-column fallback. */
@media (max-width: 700px) {
  .ref-hero-grid,
  .ref-intro-grid,
  .ref-facility-grid,
  .ref-contact-grid,
  .ref-metric-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Every spec table already sits in its own overflow-x-auto wrapper; this only
   guarantees the wrapper can actually scroll on touch. */
.overflow-x-auto,
.v-table-scroll {
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   7. Motion — scroll reveal, header state, read progress

   Everything here is gated on `html.v-motion`, which a tiny inline script in
   each <head> sets and removes again if assets/vatsalya.js never boots. With
   scripting off the class is never added, so no content is ever hidden.
   ========================================================================== */

.v-motion [data-v-reveal] {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition:
    opacity 700ms cubic-bezier(0.22, 0.61, 0.36, 1) var(--v-delay, 0ms),
    transform 700ms cubic-bezier(0.22, 0.61, 0.36, 1) var(--v-delay, 0ms);
  will-change: opacity, transform;
}

/* Pictures get a touch of settle on top of the fade. */
.v-motion img[data-v-reveal],
.v-motion figure[data-v-reveal] {
  transform: translate3d(0, 24px, 0) scale(1.03);
}

/* The end state clears the transform entirely rather than resting on
   translate3d(0,0,0), so no element is left as a containing block. */
.v-motion [data-v-reveal].is-in {
  opacity: 1;
  transform: none;
}

.v-motion [data-v-reveal].is-done {
  transition: none;
  will-change: auto;
}

/* Consecutive blocks in the same run trail each other slightly, so a kicker,
   heading, paragraph and button read as one sequence rather than one flash.
   Wrapped in :where() so every rule here weighs the same: the longest chain an
   element matches is the last one written, and the grid rules below still win.
   */
.v-motion :where([data-v-reveal] + [data-v-reveal]) {
  --v-delay: 60ms;
}
.v-motion :where([data-v-reveal] + [data-v-reveal] + [data-v-reveal]) {
  --v-delay: 120ms;
}
.v-motion
  :where(
    [data-v-reveal] + [data-v-reveal] + [data-v-reveal] + [data-v-reveal]
  ) {
  --v-delay: 180ms;
}
.v-motion
  :where(
    [data-v-reveal]
      + [data-v-reveal]
      + [data-v-reveal]
      + [data-v-reveal]
      + [data-v-reveal]
  ) {
  --v-delay: 240ms;
}

/* Children of a staggered container arrive one after another. */
.v-motion [data-v-stagger] > [data-v-reveal] {
  --v-delay: 0ms;
}
.v-motion [data-v-stagger] > [data-v-reveal]:nth-child(2) {
  --v-delay: 70ms;
}
.v-motion [data-v-stagger] > [data-v-reveal]:nth-child(3) {
  --v-delay: 140ms;
}
.v-motion [data-v-stagger] > [data-v-reveal]:nth-child(4) {
  --v-delay: 210ms;
}
.v-motion [data-v-stagger] > [data-v-reveal]:nth-child(5) {
  --v-delay: 280ms;
}
.v-motion [data-v-stagger] > [data-v-reveal]:nth-child(6) {
  --v-delay: 350ms;
}
.v-motion [data-v-stagger] > [data-v-reveal]:nth-child(n + 7) {
  --v-delay: 420ms;
}

/* --- header reacts to scroll ------------------------------------------- */

.v-header {
  transition:
    background 260ms ease,
    box-shadow 260ms ease,
    border-color 260ms ease;
}

.v-header.is-scrolled {
  background: rgba(18, 43, 30, 0.94);
  backdrop-filter: blur(10px);
  border-bottom-color: rgba(216, 195, 165, 0.4);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}

/* --- reading progress across the bottom edge of the header -------------- */

.v-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
}

.v-progress i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--v-sage), var(--v-kraft));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* --- link and card hover ------------------------------------------------ */

.v-motion a,
.v-motion button {
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .v-drawer,
  .v-scrim,
  .v-header {
    transition: none;
  }
  /* Reduced motion means no travel and no fade — the content is simply there. */
  .v-motion [data-v-reveal],
  .v-motion img[data-v-reveal],
  .v-motion figure[data-v-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .v-progress {
    display: none;
  }
  *[class*="animate-"] {
    animation: none !important;
  }
}
