/* =========================================================
   Nidhatri Fiscal Nexus — Direction D "Mesh" design system
   ========================================================= */

:root{
  --ink:#1a2233;
  --ink-soft:#4b5768;
  --ink-faint:#7c869a;
  --line:#e4e0d6;
  --paper:#fbfaf6;
  --glass:rgba(255,255,255,0.58);
  --glass-strong:rgba(255,255,255,0.78);
  --glass-border:rgba(255,255,255,0.75);
  --accent-orange:#e8862f;
  --accent-blue:#2f9fd8;
  --accent-mint:#3fae87;
  --shadow-sm:0 1px 2px rgba(26,34,51,.06);
  --shadow-md:0 10px 26px -14px rgba(26,34,51,.28);
  --shadow-lg:0 24px 60px -24px rgba(26,34,51,.35);
  --radius-lg:22px;
  --radius-md:14px;
  --radius-sm:8px;
  --maxw:1180px;
}

*,*::before,*::after{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  font-family:'Manrope',system-ui,-apple-system,'Segoe UI',sans-serif;
  color:var(--ink);
  background:
    radial-gradient(58% 46% at 10% -6%, #ffe3c0 0%, transparent 60%),
    radial-gradient(52% 50% at 92% 6%, #b7ecff 0%, transparent 60%),
    radial-gradient(60% 60% at 46% 112%, #d3f3e6 0%, transparent 65%),
    linear-gradient(170deg,#fefaf4,#f2f9fc 55%,#f2faf5);
  background-attachment:fixed;
  line-height:1.6;
  font-size:16px;
  -webkit-font-smoothing:antialiased;
}
img{max-width:100%; display:block;}
a{color:inherit; text-decoration:none;}
.container{max-width:var(--maxw); margin:0 auto; padding-inline:24px;}
@media (max-width:640px){ .container{padding-inline:18px;} }

h1,h2,h3,h4{margin:0; font-weight:800; line-height:1.12; text-wrap:balance; letter-spacing:-0.01em;}
p{margin:0;}
.mono{font-family:'IBM Plex Mono',ui-monospace,monospace;}
.kicker{
  font-family:'IBM Plex Mono',monospace; font-size:12px; font-weight:600; letter-spacing:.09em;
  text-transform:uppercase; color:var(--accent-blue); margin-bottom:14px; display:inline-block;
}
.kicker.warm{color:var(--accent-orange);}
.grad-text{background:linear-gradient(90deg,var(--accent-orange),var(--accent-blue)); -webkit-background-clip:text; background-clip:text; color:transparent;}

/* ---------- Top utility bar ---------- */
.topbar{background:var(--ink); color:#fef6ea; text-align:center; font-family:'IBM Plex Mono',monospace; font-size:11.5px; letter-spacing:.08em; padding:9px 16px; text-transform:uppercase;}
.topbar-inner{display:inline-flex; align-items:center; gap:8px; vertical-align:middle;}
.topbar-inner img{height:24px; width:24px; border-radius:6px; display:inline-block;}
@media (max-width:640px){ .topbar{font-size:10px;} .topbar-inner img{height:19px; width:19px;} }

/* ---------- Nav ---------- */
.navwrap{padding:18px 0 0; position:sticky; top:14px; z-index:50; transition:padding .25s ease;}
.nav{
  max-width:var(--maxw); margin:0 auto; display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:8px 12px 8px 18px; background:var(--glass); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px);
  border:1px solid var(--glass-border); border-radius:99px; box-shadow:var(--shadow-md);
  transition:box-shadow .25s ease, background .25s ease;
}
.nav.scrolled{background:var(--glass-strong); box-shadow:var(--shadow-lg);}
.nav .logo{display:flex; align-items:center;}
.nav .logo img{height:50px; width:50px; object-fit:contain; display:block;}
@media (max-width:640px){ .nav .logo img{height:40px; width:40px;} }
.nav .links{display:flex; align-items:center; gap:19px; font-size:13.5px; font-weight:600; color:var(--ink-soft); white-space:nowrap;}
.nav .links a:hover{color:var(--ink);}
.nav .links a.active{color:var(--ink);}
.nav .cta{background:var(--ink); color:#fff; padding:10px 20px; border-radius:99px; font-size:13.5px; font-weight:700; white-space:nowrap;}
.nav .burger{display:none; background:none; border:none; padding:8px; cursor:pointer;}
.nav .burger span{display:block; width:20px; height:2px; background:var(--ink); margin:4px 0; border-radius:2px;}
@media (max-width:1040px){
  .nav .links{gap:14px; font-size:13px;}
  .nav .cta{padding:9px 16px; font-size:13px;}
}
@media (max-width:940px){
  .nav .links{display:none;}
  .nav .burger{display:block;}
  .nav.mobile-open{border-radius:22px; flex-wrap:wrap;}
  .nav.mobile-open .logo{order:1;}
  .nav.mobile-open .cta{order:2;}
  .nav.mobile-open .burger{order:3;}
  .nav.mobile-open .links{
    display:flex; flex-direction:column; align-items:flex-start; gap:2px; white-space:normal;
    order:4; flex-basis:100%; width:100%;
    padding-top:14px; margin-top:10px; border-top:1px solid var(--line);
  }
  .nav.mobile-open .links a{padding:9px 4px; width:100%; font-size:14.5px;}
}

/* ---------- Hero ---------- */
.hero{padding:64px 0 20px; text-align:center;}
.hero .inner{max-width:760px; margin:0 auto;}
.hero h1{font-size:clamp(30px,5vw,54px);}
.hero p.lead{margin-top:18px; font-size:17px; color:var(--ink-soft); max-width:52ch; margin-inline:auto;}
.hero .ctas{display:flex; gap:14px; justify-content:center; margin-top:30px; flex-wrap:wrap;}
.btn{
  display:inline-flex; align-items:center; gap:8px; padding:13px 26px; border-radius:99px; font-size:14px; font-weight:700;
  transition:transform .15s ease;
}
.btn:hover{transform:translateY(-1px);}
.btn-primary{background:var(--ink); color:#fff; box-shadow:var(--shadow-md);}
.btn-ghost{background:var(--glass-strong); color:var(--ink); border:1px solid var(--glass-border); backdrop-filter:blur(10px);}

/* ---------- Glass card system ---------- */
.card{
  background:var(--glass); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
  border:1px solid var(--glass-border); border-radius:var(--radius-lg); padding:26px; box-shadow:var(--shadow-sm);
}
.card .num{font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--accent-orange); font-weight:700; margin-bottom:10px;}
.card h3{font-size:17px; margin-bottom:8px;}
.card p{font-size:14px; color:var(--ink-soft);}
.card a.more{display:inline-block; margin-top:14px; font-size:13px; font-weight:700; color:var(--accent-blue);}

/* ---------- Grids ---------- */
.section{padding:64px 0;}
.section.tight{padding:40px 0;}
.section-head{max-width:640px; margin:0 auto 40px; text-align:center;}
.section-head h2{font-size:clamp(24px,3.4vw,36px);}
.section-head p{margin-top:14px; color:var(--ink-soft); font-size:15.5px;}
.grid-3{display:grid; grid-template-columns:repeat(3,1fr); gap:20px;}
.grid-2{display:grid; grid-template-columns:1fr 1fr; gap:20px;}
@media (max-width:860px){ .grid-3{grid-template-columns:1fr 1fr;} }
@media (max-width:640px){ .grid-3,.grid-2{grid-template-columns:1fr;} }

/* ---------- Steps (Understand/Align/Act) ---------- */
.steps{display:grid; grid-template-columns:repeat(3,1fr); gap:16px;}
@media (max-width:720px){ .steps{grid-template-columns:1fr;} }
.step{background:var(--glass); border:1px solid var(--glass-border); border-radius:var(--radius-md); padding:20px 22px; backdrop-filter:blur(10px);}
.step .n{font-family:'IBM Plex Mono',monospace; color:var(--accent-orange); font-weight:700; font-size:12.5px;}
.step h4{font-size:16px; margin:8px 0 4px;}
.step p{font-size:13.5px; color:var(--ink-soft);}

/* ---------- Segment list (Who We Help) ---------- */
.segment{
  display:grid; grid-template-columns:60px 1fr 1fr; gap:20px; align-items:start; padding:26px 0; border-bottom:1px solid var(--line);
}
@media (max-width:900px){ .segment{grid-template-columns:1fr; gap:8px;} }
.segment .idx{font-family:'IBM Plex Mono',monospace; color:var(--accent-orange); font-weight:700; font-size:14px;}
.segment h3{font-size:19px; margin-bottom:6px;}
.segment .lbl{font-family:'IBM Plex Mono',monospace; font-size:10.5px; letter-spacing:.07em; text-transform:uppercase; color:var(--ink-faint); margin-bottom:6px;}
.segment p{font-size:14.5px; color:var(--ink-soft);}

/* ---------- FAQ ---------- */
.faq-item{border-bottom:1px solid var(--line); padding:18px 0;}
.faq-q{display:flex; justify-content:space-between; align-items:center; cursor:pointer; font-weight:700; font-size:15.5px; gap:16px;}
.faq-q .plus{font-family:'IBM Plex Mono',monospace; color:var(--accent-orange); font-size:18px; flex:none;}
.faq-a{max-height:0; overflow:hidden; transition:max-height .25s ease;}
.faq-a p{padding-top:10px; font-size:14.5px; color:var(--ink-soft); max-width:65ch;}
.faq-item.open .faq-a{max-height:200px;}
.faq-item.open .plus{transform:rotate(45deg);}

/* ---------- Bento (services) ---------- */
.bento{display:grid; grid-template-columns:repeat(3,1fr); gap:16px;}
@media (max-width:860px){ .bento{grid-template-columns:1fr 1fr;} }
@media (max-width:640px){ .bento{grid-template-columns:1fr;} }

/* ---------- CTA band ---------- */
.cta-band{
  margin:0 auto; max-width:var(--maxw); border-radius:28px; padding:56px 32px; text-align:center;
  background:linear-gradient(120deg,#fde7cf,#d9f1fb 55%,#d9f3e6);
  border:1px solid var(--glass-border);
}
.cta-band h2{font-size:clamp(22px,3.4vw,32px); max-width:20ch; margin:0 auto 16px;}
.cta-band p{color:var(--ink-soft); max-width:48ch; margin:0 auto 26px;}

/* ---------- Footer ---------- */
footer{padding:60px 0 40px; margin-top:40px;}
footer .fgrid{display:grid; grid-template-columns:1.4fr 1fr 1fr; gap:32px; padding-bottom:36px; border-bottom:1px solid var(--line);}
@media (max-width:760px){ footer .fgrid{grid-template-columns:1fr; gap:28px;} }
footer .fgrid img{height:44px; width:auto; margin-bottom:16px;}
footer .fgrid p{color:var(--ink-soft); font-size:13.5px; max-width:36ch;}
footer h5{font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-faint); margin-bottom:14px;}
footer ul{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:9px;}
footer ul a{font-size:14px; color:var(--ink-soft);}
footer ul a:hover{color:var(--ink);}
footer .bottom{display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; padding-top:22px; font-size:12.5px; color:var(--ink-faint);}
footer .bottom .stamp{display:inline-flex; align-items:center; gap:10px;}
footer .bottom .stamp img{height:28px; width:auto; border-radius:6px;}
@media (max-width:480px){ footer .fgrid img{height:36px;} footer .bottom .stamp img{height:23px;} }

/* ---------- Page header (inner pages) ---------- */
.page-hero{padding:56px 0 8px; text-align:center;}
.page-hero .inner{max-width:720px; margin:0 auto;}
.page-hero h1{font-size:clamp(28px,4.4vw,46px);}
.page-hero p.lead{margin-top:16px; color:var(--ink-soft); font-size:16px; max-width:56ch; margin-inline:auto;}

/* ---------- Article ---------- */
.article{max-width:720px; margin:0 auto; padding:20px 0 60px;}
.article .meta{font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--ink-faint); margin-bottom:10px;}
.article h1{font-size:clamp(26px,4vw,38px); margin-bottom:18px;}
.article p{font-size:16px; color:var(--ink-soft); margin-bottom:16px;}
.article h2{font-size:21px; margin:30px 0 12px;}
.article ul{color:var(--ink-soft); font-size:15.5px; padding-left:20px;}
.article li{margin-bottom:8px;}

/* ---------- YouTube featured player (lazy: thumbnail until clicked) ---------- */
.yt-thumb-wrap{
  position:relative; display:block; aspect-ratio:16/9; border-radius:var(--radius-lg); overflow:hidden;
  background:var(--ink); box-shadow:var(--shadow-sm); border:1px solid var(--glass-border); width:100%; padding:0;
}
.yt-thumb-wrap img{width:100%; height:100%; object-fit:cover; transition:transform .4s ease;}
.yt-thumb-wrap:hover img{transform:scale(1.03);}
.yt-play{
  position:absolute; inset:0; margin:auto; width:56px; height:56px; border-radius:50%;
  background:rgba(26,34,51,.72); color:#fff; display:flex; align-items:center; justify-content:center;
  transition:transform .2s ease, background .2s ease;
}
.yt-thumb-wrap:hover .yt-play{transform:scale(1.08); background:var(--accent-orange);}
.yt-thumb-wrap iframe{position:absolute; inset:0; width:100%; height:100%; border:0;}
.yt-arrow{
  flex:none; width:44px; height:44px; border-radius:50%; border:1px solid var(--glass-border);
  background:var(--glass-strong); backdrop-filter:blur(10px); color:var(--ink); cursor:pointer;
  display:flex; align-items:center; justify-content:center; box-shadow:var(--shadow-sm);
  transition:background .2s ease, transform .15s ease;
}
.yt-arrow:hover{background:var(--ink); color:#fff; transform:translateY(-1px);}
.yt-arrow:disabled{opacity:.35; cursor:default; pointer-events:none;}
.yt-arrow svg{width:18px; height:18px;}
@media (max-width:640px){ .yt-arrow{width:38px; height:38px;} }

/* One big player on top, a scrollable rail of thumbnails below it —
   click a thumbnail to load + autoplay it in the big player. */
.yt-feature{max-width:860px; margin:0 auto;}
.yt-feature-main{max-width:640px; margin:0 auto;}
.yt-feature-player{cursor:pointer; box-shadow:var(--shadow-md);}
.yt-feature-play{width:64px; height:64px;}
.yt-feature-title{margin-top:16px; font-size:17px; font-weight:800; line-height:1.35; text-align:center;}
.yt-feature-rail{display:flex; align-items:center; gap:10px; margin-top:28px;}
.yt-rail-track{
  display:flex; gap:14px; overflow-x:auto; scroll-snap-type:x proximity; scroll-behavior:smooth;
  padding:4px 4px 6px; margin:0 -4px; scrollbar-width:none; -ms-overflow-style:none; flex:1; min-width:0;
}
.yt-rail-track::-webkit-scrollbar{display:none;}
.yt-rail-item{
  display:block; text-align:left; padding:0; border:none; background:none; cursor:pointer;
  font-family:inherit; color:inherit; flex:0 0 calc((100% - 42px)/4); scroll-snap-align:start; min-width:0;
}
.yt-rail-thumb{
  position:relative; display:block; aspect-ratio:16/9; border-radius:12px; overflow:hidden;
  background:var(--ink); border:2px solid transparent; transition:border-color .2s ease, opacity .2s ease;
}
.yt-rail-thumb img{width:100%; height:100%; object-fit:cover;}
.yt-rail-item:hover .yt-rail-thumb{border-color:var(--glass-border);}
.yt-rail-item.active .yt-rail-thumb{border-color:var(--accent-orange);}
.yt-rail-play{
  position:absolute; inset:0; margin:auto; width:26px; height:26px; border-radius:50%;
  background:rgba(26,34,51,.72); color:#fff; display:flex; align-items:center; justify-content:center;
}
.yt-rail-item.active .yt-rail-play{background:var(--accent-orange);}
.yt-rail-title{
  display:block; margin-top:8px; font-size:12.5px; font-weight:600; line-height:1.35; color:var(--ink-soft);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.yt-rail-item.active .yt-rail-title{color:var(--ink);}
@media (max-width:760px){ .yt-rail-item{flex-basis:calc((100% - 14px)/2);} }
@media (max-width:480px){ .yt-rail-item{flex-basis:78%;} }

/* ---------- Misc ---------- */
.badge-row{display:flex; gap:10px; flex-wrap:wrap; justify-content:center; margin-top:22px;}
.badge{font-family:'IBM Plex Mono',monospace; font-size:11.5px; font-weight:600; color:var(--ink-soft); background:var(--glass-strong); border:1px solid var(--glass-border); padding:7px 14px; border-radius:99px;}
.note-pending{background:#fff7e6; border:1px dashed #d9a441; color:#7a5a12; font-size:13px; padding:14px 16px; border-radius:10px; margin-top:18px;}
:focus-visible{outline:2px solid var(--accent-blue); outline-offset:2px;}

/* =========================================================
   Extra responsive fine-tuning (very small phones / large desktops)
   ========================================================= */
@media (max-width:420px){
  .hero{padding:44px 0 12px;}
  .hero .ctas{flex-direction:column; align-items:stretch;}
  .hero .ctas .btn{justify-content:center;}
  .badge-row{gap:8px;}
  .badge{font-size:10.5px; padding:6px 11px;}
  .section{padding:44px 0;}
  .cta-band{padding:40px 20px; border-radius:20px;}
  footer .fgrid{gap:24px;}
  footer .bottom{flex-direction:column; align-items:flex-start;}
}
@media (min-width:1600px){
  :root{--maxw:1320px;}
  body{font-size:17px;}
}

/* ---------- Scroll-reveal animation (progressive enhancement: only when JS runs) ---------- */
html.js .reveal{opacity:0; transform:translateY(22px); transition:opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1);}
html.js .reveal.in-view{opacity:1; transform:translateY(0);}
html.js .reveal-stagger.in-view .r-item{opacity:1; transform:translateY(0);}
html.js .reveal-stagger .r-item{opacity:0; transform:translateY(18px); transition:opacity .6s ease, transform .6s ease;}
.reveal-stagger.in-view .r-item:nth-child(1){transition-delay:.04s;}
.reveal-stagger.in-view .r-item:nth-child(2){transition-delay:.12s;}
.reveal-stagger.in-view .r-item:nth-child(3){transition-delay:.2s;}
.reveal-stagger.in-view .r-item:nth-child(4){transition-delay:.28s;}
.reveal-stagger.in-view .r-item:nth-child(5){transition-delay:.36s;}
.reveal-stagger.in-view .r-item:nth-child(6){transition-delay:.44s;}

@keyframes heroFadeUp{ from{opacity:0; transform:translateY(16px);} to{opacity:1; transform:translateY(0);} }
.hero .kicker{animation:heroFadeUp .6s ease both;}
.hero h1{animation:heroFadeUp .7s ease .08s both;}
.hero p.lead{animation:heroFadeUp .7s ease .16s both;}
.hero .ctas{animation:heroFadeUp .7s ease .24s both;}
.hero .badge-row{animation:heroFadeUp .7s ease .32s both;}

.btn{will-change:transform;}
.card{transition:transform .3s ease, box-shadow .3s ease, background .3s ease;}
.card:hover{transform:translateY(-4px); box-shadow:var(--shadow-md); background:var(--glass-strong);}
.step{transition:transform .3s ease, box-shadow .3s ease;}
.step:hover{transform:translateY(-3px); box-shadow:var(--shadow-sm);}

/* Touch devices never fire :hover, so the card/step "lift" above never
   shows on a phone. Give touch its own tactile press feedback instead —
   scoped to (hover:none) so it never fires alongside the desktop hover. */
@media (hover:none){
  .card:active{transform:translateY(-2px) scale(.985); box-shadow:var(--shadow-sm);}
  .step:active{transform:translateY(-1px) scale(.99);}
  .btn:active{transform:scale(.96);}
}

/* ---------- Floating CTA dock — all screen sizes ---------- */
.mobile-cta-dock{
  display:flex; align-items:center; gap:10px;
  position:fixed; left:14px; right:14px; bottom:14px; z-index:60;
  padding-bottom:env(safe-area-inset-bottom, 0px);
  transform:translateY(140%); opacity:0; pointer-events:none;
  transition:transform .5s cubic-bezier(.34,1.56,.64,1), opacity .35s ease;
}
.mobile-cta-dock.dock-visible{transform:translateY(0); opacity:1; pointer-events:auto;}

.dock-icon{
  flex:none; width:48px; height:48px; border-radius:50%;
  background:var(--glass-strong); backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px);
  border:1px solid var(--glass-border); box-shadow:var(--shadow-md);
  display:flex; align-items:center; justify-content:center; color:var(--ink);
  transition:transform .15s ease;
}
.dock-icon:hover{transform:scale(1.05);}
.dock-icon:active{transform:scale(.92);}
.dock-icon svg{width:19px; height:19px;}

.dock-primary{
  position:relative; flex:1; min-width:0; display:flex; align-items:center; justify-content:center; gap:8px;
  height:48px; border-radius:99px; font-size:14px; font-weight:700; color:#fff; overflow:visible;
  background:linear-gradient(120deg,var(--accent-orange),#d9691c);
  box-shadow:0 14px 30px -12px rgba(232,134,47,.55);
  transition:transform .15s ease; white-space:nowrap; padding:0 6px;
}
.dock-primary:hover{transform:scale(1.02);}
.dock-primary:active{transform:scale(.97);}
.dock-primary .full-label{display:inline;}
.dock-primary .short-label{display:none;}

/* Desktop / tablet — center the dock and cap its width */
@media (min-width:761px){
  .mobile-cta-dock{
    left:50%; right:auto; width:480px; bottom:24px;
    transform:translateX(-50%) translateY(140%);
  }
  .mobile-cta-dock.dock-visible{transform:translateX(-50%) translateY(0);}
}

/* Very narrow phones */
@media (max-width:370px){
  .mobile-cta-dock{left:10px; right:10px; gap:8px;}
  .dock-icon{width:44px; height:44px;}
  .dock-primary{font-size:13.5px;}
  .dock-primary .full-label{display:none;}
  .dock-primary .short-label{display:inline;}
}

.dock-pulse{
  position:absolute; inset:0; z-index:-1; border-radius:99px; background:var(--accent-orange);
  animation:dockPulse 2.2s cubic-bezier(.3,.6,.4,1) 1s 4;
}
@keyframes dockPulse{
  0%{opacity:.55; transform:scale(1);}
  100%{opacity:0; transform:scale(1.55);}
}

@media (prefers-reduced-motion: reduce){
  .reveal, .reveal .r-item, .reveal-stagger .r-item, .hero .kicker, .hero h1, .hero p.lead, .hero .ctas, .hero .badge-row{
    animation:none !important; transition:none !important; opacity:1 !important; transform:none !important;
  }
  .card:hover, .step:hover{transform:none;}
  html{scroll-behavior:auto;}
  .mobile-cta-dock{transition:opacity .3s ease !important; transform:none !important;}
  .dock-pulse{animation:none !important; display:none;}
}
