/* Bhagat Companies — homepage
   Hand-written CSS. Two breakpoints: 900px (page shell), 1200px (contact section).
   Easing used throughout: cubic-bezier(.2,.7,.2,1) */

:root {
  --pad: 34px;
  --ink: #000;
  --cream: #f7f5f0;
  --rule-cream: #d8d3c8;
  --rule-dark: #262626;
  --rule-darker: #1c1c1c;
  --rule-mid: #2e2e2e;
  --muted-cream: #8b8b8b;
  --body-cream: #3a3a3a;
  --muted-dark: #bdbdbd;
  --dim-dark: #9a9a9a;
  --dimmer: #6e6e6e;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Inter Tight', Helvetica, Arial, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: inherit; }
img { display: block; width: auto; }
button { font-family: var(--sans); }

@keyframes bc-in    { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes bc-wipe  { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes bc-rise  { from { transform: translateY(105%); } to { transform: translateY(0); } }
@keyframes bc-line  { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes bc-prog  { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes bc-ticker{ from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes bc-breathe { 0%, 100% { opacity: .5; } 50% { opacity: .85; } }
@keyframes bc-drift { 0%, 100% { transform: translate3d(0,0,0) rotate(0deg); } 50% { transform: translate3d(3%,-4%,0) rotate(8deg); } }

/* ---------- shell ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 34vw) minmax(0, 1fr);
  align-items: start;
  min-height: 100vh;
  min-height: 100svh;
}

main { min-width: 0; }

/* ---------- sidebar ---------- */

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100svh;
  background: var(--ink);
  color: #fff;
  padding: 32px 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
}

.sidebar-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(38% 32% at calc(50% + var(--bc-mx, 0) * 22%) calc(46% + var(--bc-my, 0) * 18%), rgba(255,255,255,.14), transparent 70%);
  animation: bc-breathe 9s ease-in-out infinite;
}

.brand-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand img { height: 32px; }
.brand-text {
  font: 500 11px/1.35 var(--sans);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #fff;
}
.brand-text span { color: var(--dim-dark); }

.hero {
  position: relative;
  transform: translate3d(calc(var(--bc-mx, 0) * 9px), calc(var(--bc-my, 0) * 7px), 0);
  transition: transform .45s var(--ease);
}

/* -.02em optical correction: the serif I reads as indented when mathematically flush */
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4.9vw, 64px);
  line-height: 1;
  letter-spacing: -.025em;
  margin: 0 0 20px -.02em;
}

/* padding/margin pair keeps descenders from being clipped by the reveal mask */
.mask { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.rise { display: block; animation: bc-rise 1.05s var(--ease) both; }
.rise-2 { animation-delay: .09s; }
.rise-slow { display: block; animation: bc-rise 1s var(--ease) both; }

.engraved {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin: 0 0 20px;
}
/* oldstyle figures: digits sit at lowercase height, as on engraved stationery */
.engraved-year {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .24em;
  color: var(--muted-cream);
  font-variant-numeric: oldstyle-nums;
  animation: bc-in .9s .3s var(--ease) both;
}
.engraved-rule {
  height: 1px;
  background: linear-gradient(90deg, #3a3a3a, rgba(58,58,58,0));
  transform-origin: left;
  animation: bc-line 1.2s .34s var(--ease) both;
}

.hero-sub {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--muted-dark);
  max-width: 32ch;
  text-wrap: pretty;
  animation: bc-in .9s .4s var(--ease) both;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 28px;
  flex-wrap: wrap;
  animation: bc-in .9s .5s var(--ease) both;
}

.pill-solid {
  background: #fff;
  color: #000;
  border-radius: 999px;
  padding: 13px 25px;
  font-size: 14.5px;
  transition: transform .35s var(--ease), box-shadow .35s;
}
.pill-solid:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(255,255,255,.14); }

/* underline drawn with background-size — no pseudo-element, no layout shift */
.link-wipe {
  color: #bcbcbc;
  font-size: 14.5px;
  background-image: linear-gradient(#fff, #fff);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  padding-bottom: 3px;
  transition: background-size .45s var(--ease), color .3s;
}
.link-wipe:hover { color: #fff; background-size: 100% 1px; }

.nav { position: relative; display: flex; gap: 24px; font-size: 13.5px; }
.nav .link-wipe { color: rgba(255,255,255,.6); font-size: 13.5px; transition-duration: .4s, .3s; }

/* ---------- featured panel ---------- */

.featured-section { padding: var(--pad) var(--pad) 0; }

.featured-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0;
  font: 400 10px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-cream);
}
.eyebrow-dark { letter-spacing: .16em; margin-bottom: 22px; }

.dots { display: flex; gap: 6px; align-items: center; }
.dot {
  width: 26px; height: 3px;
  border: 0; padding: 0;
  cursor: pointer;
  background: #d3cec3;
  transition: background .3s, transform .35s var(--ease);
}
.dot.is-active { background: #000; }
.dot:hover { transform: scaleY(2.4); }

.panel {
  position: relative;
  background: var(--ink);
  color: #fff;
  overflow: hidden;
  min-height: clamp(300px, 42vh, 440px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}

.panel-hatch {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 2px, transparent 2px 11px);
  transform: translate3d(calc(var(--bc-mx, 0) * -14px), calc(var(--bc-my, 0) * -10px), 0) scale(1.06);
  transition: transform .5s var(--ease);
}

.panel-main { position: relative; padding: clamp(22px, 3.5vw, 32px) clamp(20px, 3vw, 30px); }

.slide { display: none; }
.slide.is-active {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}

.slide-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.slide-num {
  font: 400 10.5px/1 var(--mono);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
}
.slide-mark { width: 78px; height: 78px; flex: none; }
.slide-mark svg { width: 100%; height: 100%; display: block; }
.slide.is-active .slide-mark { animation: bc-wipe 1.1s .12s cubic-bezier(.35,.6,.2,1) both; }
.slide.is-active .slide-body { animation: bc-wipe .7s var(--ease) both; }

.slide-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 5vw, 66px);
  line-height: .98;
  letter-spacing: -.02em;
  margin: 0;
}
.slide-meta {
  margin: 10px 0 0;
  font-size: 15.5px;
  color: var(--dim-dark);
  max-width: 34ch;
  text-wrap: pretty;
}

.panel-index {
  position: relative;
  border-left: 1px solid var(--rule-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.idx {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule-darker);
  padding: 18px clamp(20px, 3vw, 30px);
  cursor: pointer;
  font-size: 15.5px;
  color: #7a7a7a;
  transition: color .35s, background .45s, padding-left .45s var(--ease);
}
.idx.is-active { color: #fff; }
.idx:hover {
  background: linear-gradient(90deg, rgba(255,255,255,.07), transparent 70%);
  padding-left: calc(clamp(20px, 3vw, 30px) + 8px);
}
.idx-num { font: 400 10px/1 var(--mono); letter-spacing: .12em; color: #4a4a4a; transition: color .35s; }
.idx.is-active .idx-num { color: var(--dim-dark); }

/* rotation clock — hairline fills across exactly the dwell time */
.idx-prog {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: rgba(255,255,255,.55);
  transform-origin: left;
  display: none;
}
.panel:not(.rotation-off) .idx.is-active .idx-prog {
  display: block;
  animation: bc-prog var(--rot, 5s) linear both;
}

/* ---------- the companies ---------- */

.companies { padding: clamp(40px, 5vw, 56px) var(--pad) 0; }

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 44px);
  letter-spacing: -.02em;
  margin: 0 0 4px;
}
.section-intro {
  margin: 0 0 26px;
  font-size: 16px;
  color: var(--muted-cream);
  max-width: 56ch;
}

/* proximity-lit rule: soft dark spot tracks the cursor's horizontal position */
.lit-rule {
  height: 1px;
  background: radial-gradient(90px 1px at calc(50% + var(--bc-mx, 0) * 50%) 50%, #000, var(--rule-cream) 75%);
}

.row { border-bottom: 1px solid var(--rule-cream); }

.row-head {
  position: relative;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 26px 0;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: baseline;
  color: #000;
}

/* number and name both move by transform, so at rest the names stay flush left */
.row-num {
  position: absolute;
  left: 0;
  top: 34px;
  font: 400 10px/1 var(--mono);
  letter-spacing: .12em;
  color: #b3ada0;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .45s, transform .45s var(--ease);
}
.row-head:hover .row-num { opacity: 1; transform: translateX(0); }

.row-title { transform: translateX(0); transition: transform .45s var(--ease); }
.row-head:hover .row-title { transform: translateX(30px); }

.row-name { font-family: var(--serif); font-size: clamp(26px, 2.6vw, 36px); letter-spacing: -.01em; }
.row-tagline { display: block; font-size: 14px; color: var(--muted-cream); margin-top: 6px; }

.row-action {
  font: 400 11px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-cream);
  transition: letter-spacing .45s var(--ease), color .35s;
}
.row-head:hover .row-action { letter-spacing: .24em; color: #000; }

.row-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 36px;
  padding: 0 0 30px;
}
.row-body.is-open { animation: bc-in .45s var(--ease) both; }
.row-body[hidden] { display: none; }

.row-copy { margin: 0; font-size: 16.5px; line-height: 1.6; color: var(--body-cream); text-wrap: pretty; }
.row-list { margin: 0; padding: 0; list-style: none; font-size: 14.5px; color: #5c5c5c; line-height: 1.85; }

.row-invite {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  border-left: 1px solid var(--rule-cream);
  padding-left: 20px;
}
.row-invite-line {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(21px, 2vw, 27px);
  line-height: 1.2;
  color: #000;
  letter-spacing: -.01em;
}
.pill-dark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #000;
  color: #fff;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 14.5px;
  transition: transform .3s var(--ease);
}
.pill-dark:hover { transform: translateY(-2px); }

/* ---------- site plan ---------- */

.plan-section {
  margin-top: 72px;
  background: var(--ink);
  color: #fff;
  padding: clamp(32px, 4vw, 44px) var(--pad) 40px;
}
.plan-canvas-wrap { position: relative; height: clamp(240px, 34vh, 320px); }
#sitePlan { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.plan-title-row { display: flex; justify-content: flex-end; margin-top: 16px; }
/* title block: how a surveyor signs a drawing sheet */
.title-block {
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--rule-dark);
  padding: 9px 14px;
}
.title-block img { height: 15px; opacity: .45; }
.title-block-div { width: 1px; height: 15px; background: var(--rule-dark); }
.title-block-label {
  font: 400 9px/1 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted-cream);
}

/* ---------- contact ---------- */

.contact {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
  padding: clamp(48px, 7vw, 72px) var(--pad);
}
.contact-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(38% 55% at calc(50% + var(--bc-mx, 0) * 18%) calc(50% + var(--bc-my, 0) * 22%), rgba(255,255,255,.13), transparent 70%);
}
.contact-drift {
  position: absolute;
  top: -18%; right: -6%;
  width: 38vw; height: 38vw;
  max-width: 520px; max-height: 520px;
  pointer-events: none;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255,255,255,.06), transparent 45%, rgba(255,255,255,.04));
  filter: blur(28px);
  animation: bc-drift 22s ease-in-out infinite;
}

.contact-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr);
  gap: 48px 64px;
  align-items: end;
}

.contact-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(46px, 7vw, 104px);
  line-height: .9;
  letter-spacing: -.03em;
  margin: 0 0 30px;
}

.contact-address { border-top: 1px solid var(--rule-mid); padding-top: 22px; }
.micro {
  display: block;
  margin: 0 0 16px;
  font: 400 10px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-cream);
}
.micro-dim { font-size: 9.5px; letter-spacing: .16em; color: var(--dimmer); margin-bottom: 9px; }

/* address is typography, not a control — no button chrome */
.address-link {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(24px, 3.2vw, 44px);
  line-height: 1.12;
  letter-spacing: -.015em;
  color: #fff;
  background-image: linear-gradient(#fff, #fff);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  padding-bottom: 6px;
  transition: background-size .55s var(--ease);
}
.address-link:hover { background-size: 100% 1px; }

.contact-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 28px; }

.pill-ghost {
  background: none;
  border: 1px solid var(--rule-mid);
  border-radius: 999px;
  color: var(--muted-dark);
  padding: 13px 22px;
  font: 400 11px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .35s, color .35s, background .35s;
}
.pill-ghost:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.05); }

.contact-side {
  border-left: 1px solid var(--rule-dark);
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.contact-office {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted-dark);
  max-width: 26ch;
  text-wrap: pretty;
}
.side-rule {
  height: 1px;
  background: var(--rule-mid);
  transform-origin: left;
  animation: bc-line 1.1s .3s var(--ease) both;
}
.contact-year {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 2.6vw, 36px);
  line-height: 1;
  letter-spacing: -.01em;
}

/* ---------- ticker + footer ---------- */

.ticker { background: var(--ink); border-top: 1px solid var(--rule-darker); padding: 16px 0; overflow: hidden; }
.ticker-mask {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: bc-ticker 42s linear infinite;
  font: 400 11.5px/1 var(--mono);
  letter-spacing: .12em;
  color: var(--dimmer);
}
.ticker-run { display: flex; gap: 30px; padding-right: 30px; }

.footer {
  background: var(--ink);
  color: var(--dimmer);
  border-top: 1px solid var(--rule-darker);
  padding: 24px var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px 32px;
  flex-wrap: wrap;
  font: 400 11px/1.6 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.footer-left { display: flex; align-items: center; gap: 14px; }
.footer-left img { height: 18px; opacity: .55; transition: opacity .3s; }
.footer-left:hover img { opacity: 1; }

/* ---------- scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- 1200px: contact section only ----------
   The right column holds a 26ch address; below this width the second track
   is too narrow and the address shreds. Grid and divider switch together. */

@media (max-width: 1200px) {
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    align-items: start;
  }
  .contact-side {
    border-left: 0;
    border-top: 1px solid var(--rule-dark);
    padding-left: 0;
    padding-top: 26px;
  }
}

/* ---------- 900px: page shell ---------- */

@media (max-width: 900px) {
  :root { --pad: 20px; }

  .layout { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: relative;
    height: auto;
    padding: 24px 20px 26px;
    gap: 30px;
  }

  .panel {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
  }
  .panel-index {
    border-left: 0;
    border-top: 1px solid var(--rule-dark);
  }

  .plan-canvas-wrap { height: 220px; }
  .plan-section { margin-top: 56px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
}
