/* K. S. Gupta & Co. — one face, one ground, one ink, one accent. */
:root {
  --ground: #f1f2ee;
  --tone: #e4e7e1;
  --ink: #0f1a15;
  --accent: #1d5a42;
  --accent-ink: #f1f2ee;
  --dark: #10271e;
  --dark-tone: #183429;
  --on-dark: #eef1ec;

  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --size-display: clamp(3.25rem, 9.2vw, 9.5rem);
  --size-h2: clamp(2.5rem, 5.6vw, 5.5rem);
  --size-h3: clamp(1.5rem, 2.2vw, 2rem);
  --size-body: 1.125rem;
  --size-small: 0.9375rem;

  --margin: clamp(1.25rem, 3.2vw, 2.5rem);
  --gap-section: clamp(6rem, 13vw, 13rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --split-gap: clamp(2rem, 6vw, 7rem); /* shared by every two-column section so the second column lines up */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--size-body)/1.55 var(--font);
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .14em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.field-dark :focus-visible, .field-accent :focus-visible { outline-color: var(--on-dark); }

h1, h2 { font-weight: 500; letter-spacing: -0.035em; line-height: .95; }
h1 { font-size: var(--size-display); }
h2 { font-size: var(--size-h2); max-width: 14ch; text-wrap: balance; }
h3 { font-size: var(--size-h3); font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--ground); padding: .75rem 1rem; z-index: 20; }
.skip:focus { left: var(--margin); }

.wrap { padding-inline: var(--margin); max-width: 1680px; margin-inline: auto; }

/* Fields: a section may change the whole field colour */
.field-dark { background: var(--dark); color: var(--on-dark); }
.field-accent { background: var(--accent); color: var(--accent-ink); }
.tone { background: var(--tone); }

/* Bar */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 2rem;
  padding: .875rem var(--margin);
  padding-inline: max(var(--margin), calc((100% - 1680px) / 2 + var(--margin)));
  background: var(--dark); color: var(--on-dark);
}
.wordmark { font-weight: 600; text-decoration: none; letter-spacing: -0.01em; font-size: 1.125rem; margin-right: auto; }
.bar nav { display: flex; gap: 1.75rem; }
.bar nav a { text-decoration: none; font-size: var(--size-small); }
.bar nav a:hover { text-decoration: underline; }

/* Buttons: flat, one fill, square */
.btn {
  display: inline-block; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  font: 500 var(--size-body)/1 var(--font);
  padding: 1.05rem 1.5rem; text-decoration: none;
  transition: background-color .2s var(--ease), transform .15s var(--ease);
}
.btn:hover { background: #164a36; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-small { font-size: var(--size-small); padding: .7rem 1rem; background: var(--on-dark); color: var(--dark); }
.btn-small:hover { background: #d6ddd6; }
.btn-light { background: var(--on-dark); color: var(--dark); }
.btn-light:hover { background: #d6ddd6; }
.field-dark .btn:not(.btn-light):not(.btn-small) { background: #2c7a5a; }
.field-dark .btn:not(.btn-light):not(.btn-small):hover { background: #348a67; }

/* Hero */
.hero {
  min-height: calc(100svh - 3.5rem);
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--split-gap);
  align-items: end;
  padding: clamp(4rem, 9vw, 8rem) var(--margin) clamp(2.5rem, 5vw, 4.5rem);
  padding-inline: max(var(--margin), calc((100% - 1680px) / 2 + var(--margin)));
}
.hero h1 { font-size: clamp(2.2rem, 6.2vw, 7.5rem); }
.hero h1 .line { display: block; white-space: nowrap; margin-left: -.035em; } /* optical: pull big type onto the text edge */
.hero h1 .line + .line { font-size: .6em; letter-spacing: -0.03em; margin-top: .12em; margin-left: -.03em; }
.hero-text { min-width: 0; }
.lede { max-width: 34ch; font-size: clamp(1.125rem, 1.6vw, 1.5rem); line-height: 1.4; margin: 2rem 0 2.5rem; }
.hero-ledger { align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; background: var(--dark-tone); padding: clamp(1.5rem, 3vw, 2.5rem); }
.year { font-size: clamp(7rem, 17vw, 19rem); font-weight: 500; letter-spacing: -0.06em; line-height: .8; margin-left: -.07em; }
.year { white-space: nowrap; margin-block: auto; padding-top: .08em; }
.plus { display: inline-block; margin-left: .04em; }
.year-caption { max-width: 30ch; font-size: clamp(1.125rem, 1.6vw, 1.5rem); line-height: 1.4; margin-top: 2rem; }

/* Section rhythm */
section:not(.hero) { padding-block: var(--gap-section); }
.section-lede, .lede, .panel-intro { text-wrap: pretty; }
.year-caption { text-wrap: balance; }
.section-lede { max-width: 46ch; font-size: clamp(1.125rem, 1.6vw, 1.5rem); line-height: 1.4; margin-top: 1.75rem; }

/* History */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--split-gap); }
.statement { font-size: clamp(1.375rem, 2.3vw, 2.25rem); line-height: 1.25; letter-spacing: -0.01em; max-width: 22ch; margin-top: 2.5rem; color: var(--accent); }
.timeline { display: grid; gap: .5rem; align-content: start; }
.two > div:first-child { position: sticky; top: 6rem; align-self: start; }
.timeline li { display: grid; grid-template-columns: 11rem 1fr; gap: 1.25rem; padding: 1.5rem; background: var(--tone); }
.t-year { font-size: var(--size-h3); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; color: var(--accent); }
.timeline p { max-width: 44ch; padding-top: .3rem; }
.wide-photo { margin-top: clamp(4rem, 8vw, 8rem); padding-inline: var(--margin); max-width: 1680px; margin-inline: auto; }
.wide-photo img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; object-position: center 40%; }
figcaption { font-size: var(--size-small); margin-top: .75rem; }
.roots { margin-top: clamp(1.75rem, 3vw, 2.75rem); display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem var(--split-gap); align-items: start; }
.roots-line { font-size: clamp(1.5rem, 2.5vw, 2.25rem); letter-spacing: -0.02em; line-height: 1.2; max-width: 30ch; color: var(--accent); }
.roots small { font-size: var(--size-small); line-height: 1.5; max-width: 44ch; padding-top: .6rem; }

/* Photo treatment: same for every picture */
.wide-photo img, .person img, .office img { filter: grayscale(1) contrast(1.06); }

/* Services */
.service-list { margin-top: clamp(3rem, 6vw, 5.5rem); display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--margin); }
.service { grid-column: span 6; background: var(--ground); padding: clamp(1.5rem, 2.6vw, 2.5rem); transition: background-color .25s var(--ease); }
.service:hover { background: #f8f9f6; }
.svc-audit, .svc-fund { grid-column: span 5; }
.svc-tax, .svc-advisory { grid-column: span 7; }
.svc-back { grid-column: span 12; display: grid; grid-template-columns: 5fr 7fr; gap: 0 var(--margin); align-items: start; }
.service h3 { font-size: clamp(1.75rem, 2.7vw, 2.75rem); letter-spacing: -0.03em; line-height: 1.05; }
.service > p { margin: 1rem 0 1.75rem; max-width: 40ch; }
.svc-back > p { margin-bottom: 0; }
.service ul { display: grid; gap: .7rem; }
.svc-tax ul, .svc-advisory ul { grid-template-columns: 1fr 1fr; gap: .7rem 2rem; }
.svc-back ul { grid-column: 2; grid-row: 1 / span 2; }
.service li { padding-left: 1.1rem; position: relative; }
.service li::before { content: ""; position: absolute; left: 0; top: .62em; width: .4rem; height: .4rem; background: var(--accent); }

/* Filings checklist */
.filings-head { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem var(--split-gap); align-items: end; align-items: last baseline; }
.filings-head .section-lede { margin-top: 0; }
.tabs { margin-top: clamp(3rem, 6vw, 4.5rem); display: flex; flex-wrap: wrap; gap: .5rem; }
.tabs[hidden] { display: none; }
.tabs button { border: 0; cursor: pointer; padding: .85rem 1.25rem; background: var(--dark-tone); color: var(--on-dark); font: 500 var(--size-body)/1 var(--font); transition: background-color .2s var(--ease), transform .15s var(--ease); }
.tabs button:hover { background: #224436; }
.tabs button:active { transform: scale(.98); }
.tabs button[aria-selected="true"] { background: var(--on-dark); color: var(--dark); }
.panels { margin-top: 2rem; }
.panel { display: grid; gap: .5rem; }
.panel[hidden] { display: none; }
.panel + .panel { margin-top: 4rem; }
.js .panel + .panel { margin-top: 0; }
.panel.enter { animation: rise .45s var(--ease) both; }
.panel-title { font-size: var(--size-h3); margin-bottom: .25rem; }
.js .panel-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.panel-intro { font-size: clamp(1.125rem, 1.6vw, 1.5rem); line-height: 1.4; max-width: 46ch; margin-bottom: 1rem; }
.bucket { display: grid; grid-template-columns: 3fr 9fr; gap: 1rem var(--margin); padding: clamp(1.25rem, 2.2vw, 2rem); background: var(--dark-tone); }
.bucket h4 { margin: 0; font-size: var(--size-h3); font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; }
.bucket ul { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 2.5rem; align-content: start; }
.bucket li { position: relative; padding-left: 1.1rem; }
.bucket li::before { content: ""; position: absolute; left: 0; top: .62em; width: .4rem; height: .4rem; background: #4aa37e; }
.filings-cta { margin-top: 3.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2rem; }
.filings-cta p { font-size: clamp(1.125rem, 1.6vw, 1.5rem); line-height: 1.4; max-width: 34ch; flex-basis: 100%; }
.link-light { font-weight: 500; }

/* Partners: a roster, read like a ledger */
.partners .wrap { display: grid; grid-template-columns: 4fr 8fr; gap: var(--margin); align-items: start; }
.partners h2 { position: sticky; top: 6rem; }
.roster { display: grid; gap: .5rem; }
.person {
  display: grid; grid-template-columns: 9rem 1fr; column-gap: clamp(1.25rem, 2.5vw, 2.25rem); row-gap: 1rem;
  padding: clamp(1.25rem, 2.2vw, 2rem); background: var(--tone);
  transition: background-color .25s var(--ease);
}
.person:hover { background: #d9ded6; }
.person figure { grid-column: 1; grid-row: 1 / span 2; width: 9rem; aspect-ratio: 1; overflow: hidden; align-self: start; }
.person img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; transition: transform .8s var(--ease); }
.person:hover img { transform: scale(1.05); }
.ident { grid-column: 2; grid-row: 1; }
.person img.crop-tight { object-view-box: inset(0 9% 0 6%); }
.person h3 { font-size: clamp(1.75rem, 2.8vw, 2.75rem); letter-spacing: -0.03em; line-height: 1; }
.role { margin-top: .75rem; color: var(--accent); font-weight: 600; }
.creds { font-size: var(--size-small); }
.bio { grid-column: 2; grid-row: 2; display: grid; gap: .6rem; max-width: 56ch; }

/* Industries */
.sector-words { margin-top: clamp(2.5rem, 5vw, 4.5rem); display: flex; flex-wrap: wrap; gap: .25em .6em; font-size: clamp(2rem, 4.6vw, 4.5rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }
.sector-words li { padding: .15em .35em; background: #236a4e; }

/* Offices */
.office-grid { margin-top: clamp(3rem, 6vw, 5.5rem); display: grid; grid-template-columns: 1fr 1fr; gap: var(--split-gap); }
.office figure { overflow: hidden; margin-bottom: 1.75rem; }
.office img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform 1.2s var(--ease); }
.office:hover img { transform: scale(1.03); }
.office img.gate { object-position: center 12%; }
.office h3 { margin-bottom: 1rem; }
.office p + p { margin-top: .6rem; }
.link { font-weight: 500; color: var(--accent); }

.contact { margin-top: clamp(5rem, 10vw, 9rem); display: grid; grid-template-columns: 1fr 1fr; gap: var(--margin); background: var(--tone); padding: clamp(1.5rem, 4vw, 4rem); }
.contact-title { font-size: clamp(2rem, 3.6vw, 3.5rem); letter-spacing: -0.03em; line-height: 1; margin-bottom: 1.5rem; }
.contact-intro p { max-width: 36ch; }
.form { display: grid; gap: 1.25rem; }
.form label { display: grid; gap: .4rem; font-size: var(--size-small); font-weight: 500; }
.form input, .form textarea {
  font: 400 var(--size-body)/1.4 var(--font); color: var(--ink);
  background: var(--ground); border: 0; border-bottom: 2px solid #9aa59e; padding: .85rem 1rem; border-radius: 0;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.form input:hover, .form textarea:hover { background: #fff; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); background: #fff; }
.form .btn { justify-self: start; }
.form-note { font-size: var(--size-small); }

/* Footer */
.foot { padding: 0; }
.foot-main { max-width: 1680px; margin-inline: auto; padding: clamp(4rem, 7vw, 6rem) var(--margin); display: grid; grid-template-columns: 1.4fr 1fr 1.2fr 1.2fr; gap: 3rem var(--margin); font-size: var(--size-small); line-height: 1.6; }
.foot-main p + p { margin-top: .75rem; }
.foot-logo { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.foot-brand p:nth-child(2) { margin-top: .35rem; }
.foot-h { font-size: 1.0625rem; font-weight: 600; margin-bottom: .9rem; }
.foot-col ul { display: grid; gap: .5rem; }
.foot a { text-decoration-thickness: .06em; }
.foot-col ul a { text-decoration: none; }
.foot-col ul a:hover { text-decoration: underline; }
.foot-base { background: var(--dark-tone); padding: 1.5rem var(--margin) 2rem; font-size: var(--size-small); }
.foot-base-row { max-width: 1680px; margin-inline: auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
.credits { max-width: 1680px; margin: 1rem auto 0; font-size: .875rem; line-height: 1.5; }

/* Colour: green leads; muted clay, sand, terracotta, dusty blue and sage join it */
:root {
  --saffron: #d9a58e; --saffron-tint: #ece3d0;
  --coral: #a95c48;   --coral-tint: #ecd5cb;
  --indigo: #4f6a8c;  --indigo-tint: #d7e0ea;
  --teal: #4f7f7a;    --teal-tint: #d4e4e1;
  --leaf-tint: #dae5d8;
}
.wide-photo img, .person img, .office img { filter: none; }
.bar { border-bottom: 4px solid var(--saffron); }
.btn-small { background: var(--saffron); color: var(--dark); }
.btn-small:hover { background: #e6b5a0; }
.btn-light { background: var(--saffron); color: var(--dark); }
.btn-light:hover { background: #e6b5a0; }
.hero-ledger { background: var(--saffron); color: var(--dark); }
.statement, .roots-line, .t-year, .role, .link { color: var(--accent); }

.timeline li:nth-child(1) { background: var(--saffron-tint); }
.timeline li:nth-child(2) { background: var(--teal-tint); }
.timeline li:nth-child(3) { background: var(--coral-tint); }
.timeline li:nth-child(4) { background: var(--indigo-tint); }
.timeline li:nth-child(1) .t-year { color: #7a6330; }
.timeline li:nth-child(2) .t-year { color: var(--teal); }
.timeline li:nth-child(3) .t-year { color: #8f4a37; }
.timeline li:nth-child(4) .t-year { color: var(--indigo); }

.service { background: var(--leaf-tint); }
.service:hover { background: #cddbca; }
.svc-tax { background: var(--saffron-tint); }   .svc-tax:hover { background: #e3d8bd; }
.svc-advisory { background: var(--indigo-tint); } .svc-advisory:hover { background: #c8d4e2; }
.svc-fund { background: var(--coral-tint); }    .svc-fund:hover { background: #e4c7ba; }
.svc-back { background: var(--teal-tint); }     .svc-back:hover { background: #c5dad6; }
.svc-tax h3 { color: #7a6330; } .svc-advisory h3 { color: var(--indigo); }
.svc-fund h3 { color: #8f4a37; } .svc-back h3 { color: var(--teal); } .svc-audit h3 { color: var(--accent); }
.svc-tax li::before { background: #a38a4a; } .svc-advisory li::before { background: var(--indigo); }
.svc-fund li::before { background: var(--coral); } .svc-back li::before { background: var(--teal); }

.tabs button[aria-selected="true"] { background: var(--saffron); color: var(--dark); }
.bucket:nth-of-type(1) { background: #3f6b66; }
.bucket:nth-of-type(2) { background: #46607f; }
.bucket:nth-of-type(3) { background: #8f5240; }
.bucket:nth-of-type(4) { background: #6f5d3a; }
.bucket li::before { background: var(--saffron); }

.person:nth-child(1) { background: var(--saffron-tint); } .person:nth-child(1):hover { background: #e3d8bd; }
.person:nth-child(2) { background: var(--teal-tint); }    .person:nth-child(2):hover { background: #c5dad6; }
.person:nth-child(3) { background: var(--indigo-tint); }  .person:nth-child(3):hover { background: #c8d4e2; }
.person:nth-child(1) .role { color: #7a6330; } .person:nth-child(2) .role { color: var(--teal); } .person:nth-child(3) .role { color: var(--indigo); }

.sector-words li:nth-child(6n+1) { background: var(--saffron); color: var(--dark); }
.sector-words li:nth-child(6n+2) { background: var(--coral); }
.sector-words li:nth-child(6n+3) { background: var(--indigo); }
.sector-words li:nth-child(6n+4) { background: var(--teal); }
.sector-words li:nth-child(6n+5) { background: #f1f2ee; color: var(--dark); }
.sector-words li:nth-child(6n) { background: #3d6b55; }

.contact { background: var(--saffron-tint); }
.foot-base { border-top: 4px solid var(--saffron); }

/* Motion: entrances once on entry; content stays visible without script */
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
.js .hero h1, .js .hero .lede, .js .hero .btn, .js .hero-ledger { animation: rise .9s var(--ease) both; }
.js .hero .lede { animation-delay: 80ms; }
.js .hero .btn { animation-delay: 160ms; }
.js .hero-ledger { animation-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .reveal.in { opacity: 1; transform: none; transition: opacity .3s linear; }
  .js .hero h1, .js .hero .lede, .js .hero .btn, .js .hero-ledger, .panel.enter { animation: none; }
  .person img, .office img { transition: none; }
  .person:hover img, .office:hover img { transform: none; }
}

/* Tablet */
@media (max-width: 1000px) {
  .bar nav { display: none; }
  .foot-main { grid-template-columns: 1fr 1fr; }
  .bucket { grid-template-columns: 1fr; }
  .partners .wrap { grid-template-columns: 1fr; }
  .partners h2 { position: static; }
  .hero { grid-template-columns: 1fr; align-items: start; gap: 2rem; }
  .hero h1 { font-size: 10.5vw; }
  .hero-ledger { min-height: 18rem; }
  .two, .filings-head, .contact { grid-template-columns: 1fr; }
  .two > div:first-child { position: static; }
  .roots { grid-template-columns: 1fr; }
  .roots small { padding-top: 0; }
  .service, .svc-audit, .svc-tax, .svc-advisory, .svc-fund, .svc-back { grid-column: span 12; }
  .svc-audit ul, .svc-fund ul { grid-template-columns: 1fr 1fr; gap: .7rem 2rem; }
  .svc-back { display: block; }
  .svc-back > p { margin-bottom: 1.75rem; }
}

/* Phone */
@media (max-width: 640px) {
  .bar { gap: 1rem; }
  .foot-main { grid-template-columns: 1fr; gap: 2.25rem; }
  .hero { padding-top: 3rem; min-height: auto; }
  .hero h1 { font-size: 11.6vw; }
  .service ul, .svc-audit ul, .svc-tax ul, .svc-advisory ul, .svc-fund ul, .svc-back ul { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: .5rem; }
  .person { grid-template-columns: 5.5rem 1fr; }
  .bucket { grid-template-columns: 1fr; }
  .bucket ul { grid-template-columns: 1fr; }
  .person figure { width: 5.5rem; grid-row: 1; }
  .bio { grid-column: 1 / -1; grid-row: 2; }
  .office-grid { grid-template-columns: 1fr; gap: 4rem; }
  .wide-photo img { aspect-ratio: 4 / 3; }
}
