/* =====================================================================
   SAMRAGYEE NIRMAN SEWA — Public site
   Premium Swiss / minimalist theme · brand blue #1C4C9C + red #E1231A
   ===================================================================== */

:root {
  /* brand */
  --brand:        #1C4C9C;
  --brand-700:    #163F82;
  --brand-900:    #0F2C5C;
  --brand-050:    #EEF3FB;
  --brand-100:    #DCE7F6;
  --brand-ink:    #1C4C9C;   /* brand as text / icon on a page background */
  --accent:       #E1231A;
  --accent-700:   #B5150E;

  /* ink & surfaces */
  --ink:          #0F1B2D;
  --ink-2:        #33425B;
  --muted:        #5B6B84;
  --bg:           #FFFFFF;
  --bg-alt:       #F4F6FA;
  --bg-dark:      #0C1524;
  --surface:      #FFFFFF;
  --panel-invert: #0C1524;
  --border:       #E4E9F1;
  --border-strong:#CBD5E2;

  --nav-bg:          rgba(255,255,255,.82);
  --nav-bg-scrolled: rgba(255,255,255,.95);

  --danger-ink:    #B5150E;  --danger-bg:  #FDECEB;  --danger-border:  #F7C9C6;
  --success-ink:   #0B7A3B;  --success-bg: #E7F6EE;  --success-border: #B6E3C9;

  /* effects */
  --radius:       12px;
  --radius-sm:    6px;
  --shadow-sm:    0 1px 2px rgba(15,27,45,.06), 0 1px 3px rgba(15,27,45,.05);
  --shadow-md:    0 6px 20px -6px rgba(15,27,45,.14), 0 2px 6px rgba(15,27,45,.06);
  --shadow-lg:    0 24px 60px -18px rgba(15,27,45,.28);
  --ease:         cubic-bezier(.22,.61,.36,1);
  --ease-entrance: cubic-bezier(.16,1,.3,1);  /* confident arrivals: reveals, FLIP, page transitions */

  /* type */
  --font-display: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  --font-body:    'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --nav-h: 76px;
  --maxw: 1200px;

  color-scheme: light;
}

/* ===================== DARK THEME ===================== */
:root[data-theme="dark"] {
  color-scheme: dark;

  --brand-050:    #16233B;
  --brand-100:    #21385C;
  --brand-ink:    #6BA5EC;

  --ink:          #EDF2FA;
  --ink-2:        #C3CFE0;
  --muted:        #8595AD;
  --bg:           #0A111E;
  --bg-alt:       #111C2D;
  --bg-dark:      #05090F;
  --surface:      #131F32;
  --panel-invert: #131F32;
  --border:       #253347;
  --border-strong:#37485F;

  --nav-bg:          rgba(10,17,30,.78);
  --nav-bg-scrolled: rgba(10,17,30,.94);

  --danger-ink:    #FCA5A0;  --danger-bg:  #2A1512;  --danger-border:  #5B2723;
  --success-ink:   #7BD9A5;  --success-bg: #10241A;  --success-border: #23503A;

  --shadow-sm:    0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.3);
  --shadow-md:    0 6px 20px -6px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.4);
  --shadow-lg:    0 24px 60px -18px rgba(0,0,0,.7);
}

/* Follow the OS when the visitor hasn't chosen (no JS / no stored pref). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand-050:    #16233B;
    --brand-100:    #21385C;
    --brand-ink:    #6BA5EC;
    --ink:          #EDF2FA;
    --ink-2:        #C3CFE0;
    --muted:        #8595AD;
    --bg:           #0A111E;
    --bg-alt:       #111C2D;
    --bg-dark:      #05090F;
    --surface:      #131F32;
    --panel-invert: #131F32;
    --border:       #253347;
    --border-strong:#37485F;
    --nav-bg:          rgba(10,17,30,.78);
    --nav-bg-scrolled: rgba(10,17,30,.94);
    --danger-ink:    #FCA5A0;  --danger-bg:  #2A1512;  --danger-border:  #5B2723;
    --success-ink:   #7BD9A5;  --success-bg: #10241A;  --success-border: #23503A;
    --shadow-sm:    0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.3);
    --shadow-md:    0 6px 20px -6px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.4);
    --shadow-lg:    0 24px 60px -18px rgba(0,0,0,.7);
  }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav-h); overflow-x: clip; }

/* ---------- cross-page continuity (View Transitions) ----------
   Progressive enhancement: unsupported browsers just do a normal navigation.
   The fixed chrome (nav, footer, back-to-top) is named so it stays anchored
   while the page content cross-fades and settles. */
@view-transition { navigation: auto; }

#navbar { view-transition-name: site-nav; }
footer  { view-transition-name: site-footer; }
#btt    { view-transition-name: site-btt; }

::view-transition-old(root) { animation: vtOut .24s cubic-bezier(.4,0,1,1) both; }
::view-transition-new(root) { animation: vtIn .36s var(--ease-entrance) both; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn  { from { opacity: 0; transform: translateY(8px); } }

body {
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--brand); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid var(--bg-alt); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

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

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); font-weight: 700; line-height: 1.12; letter-spacing: -.02em; }

/* ---------- layout helpers ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.wrap { width: min(100% - 48px, var(--maxw)); margin-inline: auto; }

.sec-head { max-width: 640px; margin-bottom: clamp(36px, 5vw, 60px); }
.sec-head.center { margin-inline: auto; text-align: center; }

.sec-tag {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body);
  font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--brand-ink);
  margin-bottom: 18px;
}
.sec-tag::before { content: ""; width: 28px; height: 2px; background: var(--accent); display: inline-block; }
.sec-head.center .sec-tag { justify-content: center; }

.sec-title {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  color: var(--ink);
}
.sec-title span { color: var(--brand-ink); }
.sec-sub { margin-top: 16px; color: var(--muted); font-size: 1.05rem; }

/* ---------- buttons ---------- */
.btn-primary, .btn-outline, .btn-dark {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: 15px 30px; border-radius: var(--radius-sm);
  cursor: pointer; border: 1.5px solid transparent;
  transition: transform .18s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease), color .2s var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-700); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--brand-ink); color: var(--brand-ink); transform: translateY(-2px); }
.btn-dark { background: var(--bg-dark); color: #fff; }
.btn-dark:hover { background: #000; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-primary i, .btn-outline i, .btn-dark i { transition: transform .25s var(--ease); }
.btn-primary:hover i, .btn-outline:hover i, .btn-dark:hover i { transform: translateX(4px); }

/* Submit button while a form POST is in flight. */
.btn-primary.is-sending { cursor: progress; opacity: .9; }
.btn-primary.is-sending:hover { transform: none; background: var(--brand); box-shadow: var(--shadow-sm); }
.btn-primary.is-sending i { animation: btnSpin .7s linear infinite; }
@keyframes btnSpin { to { transform: rotate(1turn); } }
.btn-ghost-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; color: var(--brand-ink); font-size: .95rem;
}
.btn-ghost-link i { transition: transform .2s var(--ease); }
.btn-ghost-link:hover i { transform: translateX(4px); }

/* ---------- navbar ---------- */
#navbar {
  position: fixed; inset: 0 0 auto 0; z-index: 900;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(24px, calc((100vw - var(--maxw)) / 2));
  background: var(--nav-bg);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: height .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
#navbar.scrolled {
  height: 62px;
  background: var(--nav-bg-scrolled);
  border-bottom-color: var(--border);
  box-shadow: 0 4px 24px -12px rgba(15,27,45,.18);
}
.nav-logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nav-logo svg, .nav-logo img { height: 42px; width: auto; transition: height .3s var(--ease); }
#navbar.scrolled .nav-logo svg, #navbar.scrolled .nav-logo img { height: 36px; }

.nav-wordmark {
  display: flex; flex-direction: column; justify-content: center;
  padding-left: 13px; border-left: 1px solid var(--border-strong);
  line-height: 1; transition: padding .3s var(--ease);
}
.nw-main {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.12rem; letter-spacing: -.015em; color: var(--ink);
  transition: font-size .3s var(--ease), color .2s var(--ease);
}
.nw-sub {
  font-family: var(--font-body); font-weight: 600;
  font-size: .58rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--brand-ink); margin-top: 4px;
  transition: font-size .3s var(--ease), color .2s var(--ease);
}
#navbar.scrolled .nav-wordmark { padding-left: 11px; }
#navbar.scrolled .nw-main { font-size: 1rem; }
#navbar.scrolled .nw-sub { font-size: .54rem; }
.nav-logo .logo-dark { display: none; }
:root[data-theme="dark"] .nav-logo .logo-light { display: none; }
:root[data-theme="dark"] .nav-logo .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-logo .logo-light { display: none; }
  :root:not([data-theme="light"]) .nav-logo .logo-dark { display: block; }
}

.nav-links { display: flex; gap: 4px; list-style: none; align-items: center; }
.nav-links a {
  position: relative;
  font-size: .92rem; font-weight: 500; color: var(--ink-2);
  padding: 10px 16px; border-radius: var(--radius-sm);
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav-links a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 6px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav-links a:not(.nav-cta):hover { color: var(--ink); }
.nav-links a:not(.nav-cta):hover::after { transform: scaleX(1); }
.nav-links .nav-cta {
  margin-left: 10px; background: var(--brand); color: #fff; font-weight: 600;
  padding: 11px 22px; box-shadow: var(--shadow-sm);
}
.nav-links .nav-cta:hover { background: var(--brand-700); transform: translateY(-1px); }
.nav-links a:not(.nav-cta).active { color: var(--brand-ink); }
.nav-links a:not(.nav-cta).active::after { transform: scaleX(1); }
.nav-links .nav-cta.active { background: var(--brand-700); }

.nav-right { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: .9rem;
  transition: color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.theme-toggle:hover { color: var(--brand-ink); border-color: var(--brand-ink); transform: translateY(-1px); }
.theme-toggle .fa-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .fa-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .fa-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .fa-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .fa-moon { display: none; }
}

.hamburger { display: none; width: 40px; height: 40px; position: relative; cursor: pointer; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.hamburger span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--ink); transition: .3s var(--ease); }
.hamburger span:nth-child(1) { top: 14px; }
.hamburger span:nth-child(2) { top: 19px; }
.hamburger span:nth-child(3) { top: 24px; }
.hamburger.open span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 auto 0; z-index: 890;
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 12px 24px 24px;
  transform: translateY(-120%); transition: transform .35s var(--ease);
  box-shadow: var(--shadow-lg);
}
.mobile-menu.open { transform: translateY(0); }
.mm-link { padding: 15px 6px; font-weight: 500; color: var(--ink-2); border-bottom: 1px solid var(--border); }
.mm-link:last-child { border-bottom: 0; }
.mm-link.active { color: var(--brand-ink); font-weight: 600; }
.mm-link.m-cta { margin-top: 14px; background: var(--brand); color: #fff; text-align: center; border-radius: var(--radius-sm); font-weight: 600; }

/* ---------- inner pages: first section clears the fixed navbar ---------- */
body.page > #about,
body.page > #services,
body.page > #projects,
body.page > #branches,
body.page > #contact { padding-top: calc(var(--nav-h) + clamp(36px, 5vw, 60px)); }

/* ---------- hero ---------- */
#hero {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 80px;
  color: #fff; overflow: hidden; isolation: isolate;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -3;
  background: url('https://images.unsplash.com/photo-1503387762-592deb58ef4e?w=1920&q=80') center/cover no-repeat;
  transform: scale(1.05);
}
/* Photo unrolls left-to-right, like a drawing pulled across the board. */
@keyframes heroReveal {
  from { clip-path: inset(0 100% 0 0); transform: scale(1.14); }
  to   { clip-path: inset(0 0 0 0);    transform: scale(1.05); }
}
.hero-overlay {
  position: absolute; inset: 0; z-index: -2;
  background:
    linear-gradient(180deg, rgba(12,21,36,.55) 0%, rgba(12,21,36,.72) 45%, rgba(12,21,36,.92) 100%),
    linear-gradient(90deg, rgba(28,76,156,.55), rgba(12,21,36,.10));
}
.hero-content { width: min(100% - 48px, var(--maxw)); margin-inline: auto; }
@keyframes heroUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* Headline sets first — rises out of a mask — then the outlined word
   draws itself across, like a line traced on a plan. */
@keyframes heroMask {
  from { clip-path: inset(-0.15em 0 110% 0); transform: translateY(14px); }
  to   { clip-path: inset(-0.15em 0 -0.15em 0); transform: none; }
}

/* The full choreography runs only on the first visit of a session (the inline
   <head> script adds .hero-play). Every other load — repeat visit, reload,
   reduced-motion, no JS — shows the hero already composed. */
.hero-play .hero-bg {
  clip-path: inset(0 100% 0 0);
  animation: heroReveal 1s var(--ease-entrance) forwards;
}
.hero-play .hero-tag,
.hero-play .hero-sub,
.hero-play .hero-btns { opacity: 0; animation: heroUp .8s var(--ease) forwards; }
.hero-play .hero-tag  { animation-delay: .18s; }
.hero-play .hero-sub  { animation-delay: .62s; }
.hero-play .hero-btns { animation-delay: .74s; }
.hero-play .hero-title {
  clip-path: inset(-0.15em 0 110% 0);
  animation: heroMask .72s var(--ease-entrance) .28s forwards;
}
.hero-play .hero-title span {
  clip-path: inset(0 100% 0 -0.08em);
  animation: heroDraw .5s cubic-bezier(.45,0,.15,1) .8s forwards;
}
.hero-play .scroll-hint { opacity: 0; animation: heroUp .8s var(--ease) .8s forwards; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  padding: 9px 16px; border: 1px solid rgba(255,255,255,.28); border-radius: 100px;
  background: rgba(255,255,255,.08); backdrop-filter: blur(4px);
  margin-bottom: 26px;
}
.hero-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(225,35,26,.25); }
.hero-title {
  font-size: clamp(2.6rem, 7vw, 5rem); color: #fff; letter-spacing: -.03em;
  max-width: 16ch;
}
.hero-title span {
  display: inline-block; color: transparent; -webkit-text-stroke: 1.5px rgba(255,255,255,.9);
}
@keyframes heroDraw {
  from { clip-path: inset(0 100% 0 -0.08em); }
  to   { clip-path: inset(0 -0.12em 0 -0.08em); }
}
.hero-sub { margin-top: 24px; font-size: clamp(1rem, 1.5vw, 1.2rem); color: rgba(255,255,255,.82); max-width: 52ch; }
.hero-btns { display: flex; gap: 14px; margin-top: 38px; flex-wrap: wrap; }
.hero-btns .btn-outline { color: #fff; border-color: rgba(255,255,255,.4); }
.hero-btns .btn-outline:hover { background: rgba(255,255,255,.12); border-color: #fff; color: #fff; }
.scroll-hint {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  font-size: .68rem; letter-spacing: .3em; text-transform: uppercase; color: rgba(255,255,255,.6);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scroll-hint::after { content: ""; width: 1px; height: 34px; background: linear-gradient(rgba(255,255,255,.7), transparent); animation: scrollLine 1.8s var(--ease) infinite; }
@keyframes scrollLine { 0% { opacity: 0; transform: scaleY(.2); transform-origin: top; } 50% { opacity: 1; } 100% { opacity: 0; transform: scaleY(1); transform-origin: bottom; } }

/* ---------- stats ---------- */
#stats {
  width: min(100% - 48px, var(--maxw)); margin: 0 auto; position: relative; z-index: 5;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: grid; grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
}
/* Homepage: lift the stats card so it straddles the hero edge. */
#hero + #stats { margin-top: -64px; }

.stat-item { padding: 32px 24px; text-align: center; border-right: 1px solid var(--border); }
.stat-item:last-child { border-right: 0; }
.stat-num { font-family: var(--font-display); font-size: clamp(2rem, 3.4vw, 2.9rem); font-weight: 700; color: var(--brand-ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 6px; font-size: .82rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }

/* ---------- about ---------- */
#about { padding: clamp(80px, 11vw, 150px) 0; }
.about-grid {
  width: min(100% - 48px, var(--maxw)); margin-inline: auto;
  display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(40px, 6vw, 90px); align-items: center;
}
.about-img-wrap { position: relative; }
.about-img-wrap > img { width: 100%; height: 520px; object-fit: cover; border-radius: var(--radius); }
.about-img-wrap::before {
  content: ""; position: absolute; left: -18px; top: -18px; width: 120px; height: 120px;
  border-top: 3px solid var(--accent); border-left: 3px solid var(--accent); border-radius: 6px 0 0 0;
}
.about-img-badge {
  position: absolute; right: -22px; bottom: -22px;
  background: var(--brand); color: #fff; padding: 22px 26px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 14px;
}
.about-img-badge .bnum { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; line-height: 1; }
.about-img-badge .btxt { font-size: .8rem; font-weight: 600; line-height: 1.35; color: rgba(255,255,255,.88); }
.about-text p { margin-top: 16px; color: var(--muted); }
.about-text p:first-of-type { margin-top: 22px; }
.why-list { margin-top: 34px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.why-item { display: flex; gap: 14px; }
.why-icon { flex-shrink: 0; width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--brand-050); color: var(--brand-ink); font-size: 1rem; }
.why-title { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: 1rem; }
.why-desc { font-size: .88rem; color: var(--muted); margin-top: 2px; }

/* ---------- services ---------- */
#services { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: clamp(72px, 10vw, 130px) 0; }
#services > .reveal, #services > .sec-head { width: min(100% - 48px, var(--maxw)); margin-inline: auto; }
.services-grid {
  width: min(100% - 48px, var(--maxw)); margin: 44px auto 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.service-card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
  overflow: hidden;
}
.service-card::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 0; background: var(--accent); transition: width .3s var(--ease); z-index: 3; }
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--brand-100); }
.service-card:hover::before { width: 100%; }
.service-card-img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-alt); }
.service-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.service-card:hover .service-card-img img { transform: scale(1.06); }
.service-num {
  position: absolute; right: 14px; top: 14px; font-family: var(--font-display); font-weight: 700; font-size: .85rem;
  color: #fff; background: rgba(12,21,36,.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  padding: 4px 11px; border-radius: 100px;
}
.service-card-body { padding: 0 26px 30px; }
.service-icon {
  width: 54px; height: 54px; display: grid; place-items: center; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff; font-size: 1.3rem;
  margin-top: -27px; margin-bottom: 18px; position: relative; z-index: 2;
  border: 3px solid var(--surface); box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease);
}
.service-card:hover .service-icon { transform: scale(1.08) rotate(-4deg); }
.service-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; color: var(--ink); }
.service-desc { margin-top: 10px; font-size: .92rem; color: var(--muted); }

/* ---------- projects ---------- */
#projects { padding: clamp(72px, 10vw, 130px) 0; }
#projects > .reveal, #projects > .sec-head { width: min(100% - 48px, var(--maxw)); margin-inline: auto; }
.filter-bar { width: min(100% - 48px, var(--maxw)); margin: 28px auto 0; display: flex; flex-wrap: wrap; gap: 10px; }
.filter-btn {
  font-family: var(--font-body); font-size: .85rem; font-weight: 600; color: var(--ink-2);
  padding: 9px 18px; border-radius: 100px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer;
  transition: .18s var(--ease);
}
.filter-btn:hover { border-color: var(--brand-ink); color: var(--brand-ink); }
.filter-btn.active { background: var(--brand); border-color: var(--brand-ink); color: #fff; }
.filter-btn-ongoing { display: inline-flex; align-items: center; gap: 7px; }
.filter-btn-ongoing i { font-size: .8em; }
.projects-grid[hidden], .ongoing-list[hidden] { display: none; }
.projects-grid {
  width: min(100% - 48px, var(--maxw)); margin: 32px auto 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.project-card {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 4 / 3; background: var(--bg-alt); box-shadow: var(--shadow-sm);
}
.project-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.project-card:hover img { transform: scale(1.06); }
.project-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 22px; color: #fff;
  background: linear-gradient(180deg, transparent 35%, rgba(12,21,36,.85));
  opacity: 1;
}
.proj-cat { font-size: .68rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #fff; background: var(--accent); align-self: flex-start; padding: 4px 10px; border-radius: 4px; }
.proj-name { margin-top: 10px; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.projects-cta { text-align: center; margin-top: 40px; }

/* ---------- ongoing construction (inside #projects, "Ongoing" filter) ---------- */
.ongoing-list { width: min(100% - 48px, var(--maxw)); margin: 32px auto 0; display: grid; gap: 22px; }
.ongoing-intro { color: var(--muted); font-size: .95rem; margin-bottom: 4px; }
.ongoing-card {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
  background: var(--panel-invert); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-md);
}
.ongoing-card:nth-of-type(even) { grid-template-columns: 1fr 1.15fr; }
.ongoing-card:nth-of-type(even) .ongoing-media { order: 2; }
.ongoing-gallery { position: relative; min-height: 320px; background: #0A1220; }
.ongoing-gallery img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ongoing-thumbs { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.ongoing-thumbs::-webkit-scrollbar { display: none; }
.ongoing-thumbs button {
  flex: 0 0 56px; height: 42px; border-radius: 4px; overflow: hidden; border: 2px solid transparent;
  cursor: pointer; padding: 0; background: none; opacity: .6; transition: .18s var(--ease);
}
.ongoing-thumbs button.active, .ongoing-thumbs button:hover { opacity: 1; border-color: #fff; }
.ongoing-thumbs img { position: static; width: 100%; height: 100%; object-fit: cover; }
.ongoing-body { padding: clamp(28px, 3.4vw, 44px); display: flex; flex-direction: column; }
.ongoing-loc { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #9DC0F0; display: flex; align-items: center; gap: 8px; }
.ongoing-title { font-family: var(--font-display); font-size: clamp(1.3rem, 2.4vw, 1.8rem); font-weight: 700; color: #fff; margin-top: 12px; }
.ongoing-desc { margin-top: 12px; color: rgba(255,255,255,.66); font-size: .95rem; }
.ongoing-meta { margin-top: auto; padding-top: 24px; display: flex; gap: 26px; flex-wrap: wrap; }
.ongoing-meta div span { display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.ongoing-meta div strong { font-family: var(--font-display); font-size: 1.05rem; color: #fff; font-weight: 600; }
.progress-wrap { margin-top: 22px; }
.progress-wrap .pl { display: flex; justify-content: space-between; font-size: .8rem; color: rgba(255,255,255,.7); margin-bottom: 8px; }
.progress-bar { height: 8px; border-radius: 100px; background: rgba(255,255,255,.12); overflow: hidden; }
.progress-bar i {
  display: block; height: 100%; border-radius: 100px;
  background: linear-gradient(90deg, var(--brand), #4E86D6);
  transform: scaleX(0); transform-origin: left;
  transition: transform 1.1s var(--ease-entrance) .15s;
}
.ongoing-card.visible .progress-bar i { transform: scaleX(1); }

/* ---------- process ---------- */
#process { padding: clamp(72px, 10vw, 130px) 0; background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
#process > .reveal { width: min(100% - 48px, var(--maxw)); margin-inline: auto; }
.process-steps { width: min(100% - 48px, var(--maxw)); margin: 48px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.step { position: relative; padding: 28px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.step::after { content: ""; position: absolute; right: -12px; top: 44px; width: 24px; height: 2px; background: var(--border-strong); z-index: 1; }
.process-steps .step:last-child::after { display: none; }
.step-circle { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-050); color: var(--brand-ink); font-family: var(--font-display); font-weight: 700; border: 1px solid var(--brand-100); }
.step-title { font-family: var(--font-display); font-weight: 600; color: var(--ink); margin-top: 18px; font-size: 1.05rem; }
.step-desc { margin-top: 8px; font-size: .88rem; color: var(--muted); }

/* ---------- testimonials ---------- */
#testimonials { padding: clamp(72px, 10vw, 130px) 0; }
#testimonials > .reveal { width: min(100% - 48px, var(--maxw)); margin-inline: auto; }
.testi-slider { width: min(100% - 48px, 860px); margin: 0 auto; overflow: hidden; }
.testi-track { display: flex; transition: transform .5s var(--ease); }
.testi-card { flex: 0 0 100%; padding: 44px clamp(20px, 4vw, 56px); text-align: center; }
.quote-icon { color: var(--brand-ink); opacity: .35; font-size: 2.4rem; margin-bottom: 12px; }
.testi-text { font-family: var(--font-display); font-size: clamp(1.15rem, 2.3vw, 1.5rem); font-weight: 500; color: var(--ink); line-height: 1.5; letter-spacing: -.01em; }
.stars { color: var(--accent); letter-spacing: 3px; margin-top: 22px; font-size: 1rem; }
.testi-author { margin-top: 16px; font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.testi-loc { font-size: .85rem; color: var(--muted); }
.testi-nav { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 26px; }
.testi-arrow { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; display: grid; place-items: center; transition: .18s var(--ease); }
.testi-arrow:hover { background: var(--brand); border-color: var(--brand-ink); color: #fff; }
.testi-dot { width: 8px; height: 8px; border-radius: 50%; border: 0; background: var(--border-strong); cursor: pointer; padding: 0; transition: .2s var(--ease); }
.testi-dot.active { background: var(--brand); width: 24px; border-radius: 100px; }

/* ---------- branches ---------- */
#branches { padding: clamp(72px, 10vw, 130px) 0; background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
#branches > .sec-head { width: min(100% - 48px, var(--maxw)); margin-inline: auto; }
.branches-grid { width: min(100% - 48px, var(--maxw)); margin: 44px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.branch-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 28px; transition: transform .22s var(--ease), box-shadow .22s var(--ease); }
.branch-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.branch-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.branch-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.branch-flag { font-size: .64rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-ink); background: var(--brand-050); padding: 4px 9px; border-radius: 4px; white-space: nowrap; }
.branch-row { display: flex; gap: 12px; margin-top: 16px; font-size: .92rem; color: var(--muted); }
.branch-row i { color: var(--brand-ink); width: 16px; text-align: center; margin-top: 4px; flex-shrink: 0; }
.branch-row a:hover { color: var(--brand-ink); }
.branch-map { margin-top: 18px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .88rem; color: var(--brand-ink); }
.branch-map i { transition: transform .2s var(--ease); }
.branch-map:hover i { transform: translateX(3px); }

/* ---------- cta banner ---------- */
#cta-banner {
  width: min(100% - 48px, var(--maxw)); margin: clamp(64px, 9vw, 110px) auto;
  background: var(--brand); color: #fff; border-radius: var(--radius);
  padding: clamp(38px, 5vw, 60px); display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
#cta-banner::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.06); }
#cta-banner::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent); }
.cta-text h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.cta-text p { margin-top: 8px; color: rgba(255,255,255,.82); }
#cta-banner .btn-dark { background: #fff; color: var(--brand); }
#cta-banner .btn-dark:hover { background: var(--ink); color: #fff; }

/* ---------- contact ---------- */
#contact { padding: clamp(72px, 10vw, 130px) 0; }
#contact > .reveal { width: min(100% - 48px, var(--maxw)); margin-inline: auto; }
.contact-grid { width: min(100% - 48px, var(--maxw)); margin: 44px auto 0; display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(36px, 5vw, 70px); }
.contact-item { display: flex; gap: 16px; margin-bottom: 26px; }
.ci-icon { width: 46px; height: 46px; flex-shrink: 0; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--brand-050); color: var(--brand-ink); font-size: 1.05rem; }
.ci-label { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ci-val { margin-top: 3px; color: var(--ink); font-weight: 500; }
.ci-val a:hover { color: var(--brand-ink); }
.social-row { display: flex; gap: 10px; }
.social-btn { width: 42px; height: 42px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; transition: .18s var(--ease); }
.social-btn:hover { background: var(--brand); border-color: var(--brand-ink); color: #fff; transform: translateY(-2px); }

.contact-form { display: flex; flex-direction: column; gap: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(24px, 3vw, 38px); box-shadow: var(--shadow-sm); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label { font-size: .82rem; font-weight: 600; color: var(--ink); }
.form-group input, .form-group select, .form-group textarea {
  font-family: var(--font-body); font-size: .95rem; color: var(--ink);
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px 15px; outline: none; transition: border-color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
  width: 100%;
}
.form-group textarea { min-height: 130px; resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-050); }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--muted); }
.form-msg { display: none; font-size: .86rem; padding: 10px 14px; border-radius: var(--radius-sm); }
.form-msg.error { color: var(--danger-ink); background: var(--danger-bg); border: 1px solid var(--danger-border); }
.form-msg.success { color: var(--success-ink); background: var(--success-bg); border: 1px solid var(--success-border); }

/* ---------- footer ---------- */
footer { background: var(--bg-dark); color: rgba(255,255,255,.66); padding: clamp(56px, 8vw, 90px) 0 0; }
.footer-grid { width: min(100% - 48px, var(--maxw)); margin-inline: auto; display: grid; grid-template-columns: 1.6fr 1fr 1.2fr; gap: 40px; }
.footer-brand p { margin: 18px 0; font-size: .92rem; max-width: 34ch; }
.footer-brand .nav-logo svg, .footer-brand .nav-logo img { height: 44px; }
.footer-brand .social-btn { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #fff; }
.footer-brand .social-btn:hover { background: var(--brand); border-color: var(--brand-ink); }
.footer-col h4 { color: #fff; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; font-family: var(--font-body); font-weight: 700; margin-bottom: 16px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.footer-col a { font-size: .92rem; transition: color .16s var(--ease); }
.footer-col a:hover { color: #fff; }
.footer-col i { color: var(--brand-ink); margin-right: 8px; width: 14px; }
.footer-bottom {
  width: min(100% - 48px, var(--maxw)); margin: 48px auto 0; padding: 22px 0 26px;
  border-top: 1px solid rgba(255,255,255,.1); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: .82rem; color: rgba(255,255,255,.5);
}
.footer-bottom i { color: var(--accent); }

/* ---------- project detail ---------- */
.project-detail { padding: calc(var(--nav-h) + 48px) 0 clamp(64px, 9vw, 110px); }
.project-detail .sec-title { margin-top: 6px; }
.pd-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.pd-meta span { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--ink-2); background: var(--bg-alt); border: 1px solid var(--border); padding: 8px 14px; border-radius: 100px; }
.pd-meta i { color: var(--brand-ink); }
.pd-hero { width: 100%; max-height: 540px; object-fit: cover; border-radius: var(--radius); margin-top: 30px; border: 1px solid var(--border); }
.pd-desc { margin-top: 26px; max-width: 72ch; color: var(--ink-2); font-size: 1.05rem; }
.pd-block { margin-top: 52px; }
.pd-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 20px; }
.pd-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* ---------- back to top ---------- */
#btt {
  position: fixed; right: 24px; bottom: 24px; z-index: 800;
  width: 46px; height: 46px; border: 0; padding: 0; border-radius: 50%;
  background: var(--brand); color: #fff; font: inherit; font-size: .95rem;
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transform: translateY(12px); transition: .25s var(--ease);
}
#btt.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
#btt:hover { background: var(--brand-700); }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

/* A grid or list that reads as one unit: reveals together, with a short
   stagger that is capped so later items never lag behind the eye. */
.reveal-group > * { opacity: 0; transform: translateY(20px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal-group.visible > * { opacity: 1; transform: none; }
.reveal-group.visible > *:nth-child(2) { transition-delay: .06s; }
.reveal-group.visible > *:nth-child(3) { transition-delay: .12s; }
.reveal-group.visible > *:nth-child(n+4) { transition-delay: .18s; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-img-wrap > img { height: 420px; }
  .services-grid, .branches-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .process-steps { grid-template-columns: repeat(2, 1fr); }
  .step::after { display: none; }
  #stats { grid-template-columns: repeat(2, 1fr); }
  .stat-item:nth-child(2) { border-right: 0; }
  .stat-item:nth-child(1), .stat-item:nth-child(2) { border-bottom: 1px solid var(--border); }
  .ongoing-card, .ongoing-card:nth-of-type(even) { grid-template-columns: 1fr; }
  .ongoing-card:nth-of-type(even) .ongoing-media { order: 0; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
  .wrap, .hero-content, #stats, .about-grid, .services-grid, .projects-grid,
  .process-steps, .branches-grid, .contact-grid, #cta-banner, .footer-grid,
  #branches .sec-head, .ongoing-list, .filter-bar,
  #services > .reveal, #projects > .reveal, #process > .reveal, #testimonials > .reveal,
  #contact > .reveal, #about .sec-head { width: calc(100% - 40px); }
  .services-grid, .projects-grid, .branches-grid, .process-steps, #stats { grid-template-columns: 1fr; }
  .stat-item { border-right: 0 !important; border-bottom: 1px solid var(--border); }
  .stat-item:last-child { border-bottom: 0; }
  .why-list { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .about-img-badge { right: 12px; bottom: -18px; padding: 16px 18px; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  #cta-banner { flex-direction: column; align-items: flex-start; text-align: left; }
  .hero-title span { -webkit-text-stroke: 1px rgba(255,255,255,.9); }
  .nav-wordmark { padding-left: 11px; }
  .nw-main { font-size: 1.02rem; }
}

@media (max-width: 430px) {
  .nav-wordmark { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal, .reveal-group, .reveal-group > * { opacity: 1; transform: none; }
  .progress-bar i { transform: scaleX(1); }
  .scroll-hint::after { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
  .btn-primary.is-sending i { animation: none !important; }
}
