/* Nista Projects Inc — shared styles */
:root {
  --teal: #13B49D;
  --teal-dark: #0e9483;
  --black: #000000;
  --ink: #111111;
  --grey: #555555;
  --line: #e6e6e6;
  --bg-soft: #f6f8f8;
  --white: #ffffff;
  --radius: 5px;
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: none; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; color: var(--black); }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }

.container { width: min(1140px, 92%); margin: 0 auto; }
section { padding: 4.5rem 0; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: .8rem;
}
.section-head { max-width: 640px; margin-bottom: 2.5rem; }
.section-head p { color: var(--grey); margin-top: .75rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .95rem 1.9rem;
  border-radius: 999px;
  border: 2px solid var(--teal);
  cursor: pointer;
  transition: background .2s, color .2s, transform .15s;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn-ghost { background: transparent; color: var(--teal); }
.btn-ghost:hover { background: var(--teal); color: #fff; }
.btn-dark { background: #000; border-color: #000; color: #fff; }
.btn-dark:hover { background: var(--teal); border-color: var(--teal); }

/* ===== Header / nav ===== */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
/* Every item in the top bar — logo, each nav link, the phone number, the
   Get a Quote button, the hamburger — sits at the same fixed gap from its
   neighbor. .desktop-nav and .header-cta keep their wrapper elements for
   semantics and the existing mobile display:none rules, but `display:
   contents` removes their own box from layout so their children become
   direct flex items of .header-inner and share its single --header-gap,
   instead of each wrapper having its own (previously mismatched) gap. */
.header-inner {
  --header-gap: clamp(1.1rem, 2.3vw, 1.65rem);
  display: flex; align-items: center; justify-content: center;
  height: 72px; gap: var(--header-gap);
}
.logo {
  display: flex; align-items: center; flex: none;
}
.logo img { height: 42px; width: auto; flex: none; }

.desktop-nav { display: contents; }
.desktop-nav a {
  font-family: var(--font-display);
  font-size: .82rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink); white-space: nowrap; flex: none;
  transition: color .2s;
}
.desktop-nav a:hover, .desktop-nav a.active { color: var(--teal); }
.header-cta { display: contents; }
.header-cta .btn { flex: none; white-space: nowrap; }
.header-phone {
  font-family: var(--font-display); font-weight: 600; font-size: .9rem;
  color: var(--black); white-space: nowrap; flex: none;
}
.header-phone:hover { color: var(--teal); }

/* Hamburger */
.hamburger {
  width: 44px; height: 44px; border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px;
  z-index: 400; position: relative; flex: none;
}
.hamburger span {
  display: block; width: 26px; height: 3px; background: var(--black);
  border-radius: 2px; transition: transform .3s, opacity .3s, background .3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* Slide-in menu */
.menu-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  opacity: 0; pointer-events: none; transition: opacity .35s; z-index: 300;
}
.menu-overlay.open { opacity: 1; pointer-events: auto; }
.side-menu {
  position: fixed; top: 0; right: 0; height: 100dvh;
  width: min(300px, 80vw);
  /* Liquid-glass look: translucent panel + light blur/saturate so whatever's
     behind it (page content, the dark overlay) still shows through recognizably,
     plus a faint inner top highlight and hairline edge to read as a pane of glass
     rather than flat tinted color. Blur radius is kept low on purpose — a heavy
     blur smears the backdrop into a flat blob before the low-alpha tint is even
     applied, which reads as opaque instead of glassy. Falls back to the old solid
     --white panel on browsers without backdrop-filter support (Firefox < 103, older Safari). */
  background: rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
  backdrop-filter: blur(8px) saturate(150%);
  border-left: 1px solid rgba(255, 255, 255, .4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), -8px 0 40px rgba(0, 0, 0, .12);
  z-index: 350;
  transform: translateX(102%);
  transition: transform .4s cubic-bezier(.77,0,.18,1);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 5rem 1.6rem 1.6rem;
  overflow-y: auto;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .side-menu { background: var(--white); }
}
.side-menu.open { transform: translateX(0); }
.side-menu nav { display: flex; flex-direction: column; gap: .4rem; }
.side-menu nav a {
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 600; color: var(--black);
  padding: .45rem 0;
  opacity: 0; transform: translateX(24px);
  transition: opacity .4s var(--reveal-delay, 0s), transform .4s var(--reveal-delay, 0s), color .1s;
}
.side-menu.open nav a { opacity: 1; transform: translateX(0); }
.side-menu nav a:hover { color: var(--teal); }
.side-menu-footer { border-top: 1px solid var(--line); padding-top: 1.4rem; font-size: .92rem; color: var(--grey); }
.side-menu-footer .menu-phone {
  display: block; font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700; color: var(--black); margin-bottom: .4rem;
}
.side-menu-footer .menu-phone:hover { color: var(--teal); }
.side-menu-footer .menu-email {
  display: block; font-size: .88rem; color: var(--grey);
  margin-bottom: .4rem; word-break: break-all;
}
.side-menu-footer .menu-email:hover { color: var(--teal); }
.social-icons { display: flex; gap: .8rem; margin: 1rem 0 1.3rem; }
.social-icons a {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--black); transition: all .2s;
}
.social-icons a:hover { background: var(--teal); border-color: var(--teal); color: #fff; }
.social-icons svg { width: 18px; height: 18px; }

/* ===== Hero ===== */
.hero { padding: 3.5rem 0 4.5rem; }
.rating {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .88rem; font-weight: 600; color: var(--ink);
  background: var(--bg-soft); border: 1px solid var(--line);
  padding: .4rem .9rem; border-radius: 999px; margin-bottom: 1.3rem;
}
.rating .stars { color: #f5a623; letter-spacing: 1px; }
.lede { color: var(--grey); font-size: 1.08rem; margin: 1.3rem 0 2rem; max-width: 480px; }
.hero-actions { display: flex; gap: .9rem; flex-wrap: wrap; align-items: center; }

/* ===== Before/After slider ===== */
.ba-slider {
  position: relative; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: 3 / 3.2;
  user-select: none; -webkit-user-select: none;
  touch-action: pan-y;
  background: #ddd;
  cursor: ew-resize;
}
.ba-slider img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; pointer-events: none;
}
.ba-before-wrap {
  position: absolute; inset: 0; overflow: hidden;
  clip-path: inset(0 50% 0 0);
}
.ba-after-wrap {
  position: absolute; inset: 0; overflow: hidden;
  clip-path: inset(0 0 0 50%);
}
.ba-after-wrap img { position: absolute; inset: 0; }
.ba-handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 3px;
  background: #fff; z-index: 4; transform: translateX(-50%);
  box-shadow: 0 0 12px rgba(0,0,0,.35);
}
.ba-handle::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 8l-4 4 4 4M16 8l4 4-4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.ba-tag {
  position: absolute; top: 12px; z-index: 3;
  font-family: var(--font-display); font-size: .68rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  background: rgba(0,0,0,.72); color: #fff;
  padding: .3rem .7rem; border-radius: 3px;
  pointer-events: none;
}
.ba-tag.before { left: 12px; }
.ba-tag.after { right: 12px; background: var(--teal); }

/* Homepage "Our Work" sliders — smaller than the full Portfolio page version, all 4 in one row */
.portfolio-grid.work-grid-compact { grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
.work-grid-compact .ba-slider { aspect-ratio: 4 / 3; }

/* Portfolio grid */
.portfolio-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.2rem;
}
.project-card h3 { margin: 1.1rem 0 .3rem; text-align: center; }
.project-card p.desc { color: var(--grey); font-size: .95rem; margin-top: .4rem; }
.static-shot { border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 3.2; }
.static-shot img { width: 100%; height: 100%; object-fit: cover; }

/* Video showcase — portrait before/after clip alongside the drag-slider grid */
.video-showcase {
  display: flex; align-items: center; gap: 2.6rem;
  margin-top: 2.6rem; padding: 2rem; border-radius: var(--radius);
  background: var(--bg-soft); border: 1px solid var(--line);
}
.video-showcase-media {
  flex: none; width: 220px; aspect-ratio: 9 / 16;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 16px 36px rgba(0,0,0,.14);
}
.video-showcase-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-showcase-title {
  display: inline-block; font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; color: var(--teal);
}
/* Video gallery — three clips in a row (Services / Portfolio) */
.video-gallery { text-align: center; margin: 2.6rem 0; }
.video-gallery-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem;
  max-width: 900px; margin: 1.4rem auto 0;
}
.video-gallery-grid video {
  width: 100%; aspect-ratio: 9 / 16; object-fit: cover;
  border-radius: var(--radius); display: block;
  box-shadow: 0 16px 36px rgba(0,0,0,.14);
}
@media (max-width: 640px) {
  .video-showcase { flex-direction: column; text-align: center; padding: 1.6rem; }
  .video-showcase-media { width: 180px; }
  .video-gallery-grid { grid-template-columns: 1fr; max-width: 280px; }
}

/* Services */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.service-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.8rem 1.6rem;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  background: var(--white);
}
.service-card:hover { border-color: var(--teal); box-shadow: 0 12px 32px rgba(0,0,0,.08); transform: translateY(-3px); }
.service-icon { color: var(--teal); margin-bottom: 1rem; }
.service-icon svg { width: 34px; height: 34px; }
.service-card p { color: var(--grey); font-size: .93rem; margin-top: .5rem; }
.service-card ul { margin: .8rem 0 0 1.1rem; color: var(--grey); font-size: .92rem; }
.service-card ul li { margin-bottom: .3rem; }

/* Testimonials */
.reviews-band { background: var(--bg-soft); }
.testimonial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.testimonial {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.8rem 1.6rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.testimonial .stars { color: #f5a623; letter-spacing: 2px; font-size: .95rem; }
.testimonial p { color: var(--ink); font-size: .97rem; flex: 1; }
.testimonial .who { font-family: var(--font-display); font-weight: 600; font-size: .85rem; color: var(--grey); }

/* CTA band */
.cta-band { background: #000; color: #fff; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band h2 em { font-style: normal; color: var(--teal); }
.cta-band p { color: #bbb; max-width: 520px; margin: 1rem auto 2rem; }

/* Meet Fariborz */
.bio-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 3.5rem; align-items: start; }
.bio-photo {
  border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 1 / 1.15; background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
}
.bio-photo .placeholder { text-align: center; color: var(--grey); padding: 2rem; }
.bio-photo .placeholder svg { width: 90px; height: 90px; color: #ccc; margin: 0 auto 1rem; }
.bio-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.bio-copy p { color: var(--grey); margin-bottom: 1.1rem; }
.value-list { list-style: none; margin-top: 1.6rem; display: grid; gap: .9rem; }
.value-list li { display: flex; gap: .8rem; align-items: flex-start; color: var(--ink); font-size: .97rem; }
.value-list .check { color: var(--teal); flex: none; margin-top: .2rem; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: start; }
.quote-form { display: grid; gap: 1.1rem; }
.quote-form label {
  font-family: var(--font-display); font-size: .78rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink);
  display: grid; gap: .4rem;
}
.quote-form input, .quote-form select, .quote-form textarea {
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  padding: .85rem 1rem; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--white); width: 100%;
}
.quote-form input:focus, .quote-form select:focus, .quote-form textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(19,180,157,.15);
}
.quote-form textarea { min-height: 130px; resize: vertical; }
.contact-info-card {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 2rem;
  display: grid; gap: 1.4rem;
}
.contact-info-card .item { display: flex; gap: 1rem; align-items: flex-start; }
.contact-info-card .item svg { width: 22px; height: 22px; color: var(--teal); flex: none; margin-top: .15rem; }
.contact-info-card .item strong { display: block; font-family: var(--font-display); font-size: .95rem; }
.contact-info-card .item span, .contact-info-card .item a.plain { color: var(--grey); font-size: .93rem; }
.contact-info-card .item a.big-phone {
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--black);
}
.contact-info-card .item a.big-phone:hover { color: var(--teal); }
.map-embed { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); margin-top: 1.4rem; }
.map-embed iframe { display: block; width: 100%; height: 260px; border: 0; }

/* Footer */
.site-footer { background: #000; color: #aaa; padding: 3.5rem 0 2rem; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 1rem; letter-spacing: .06em; text-transform: uppercase; }
.site-footer a { color: #aaa; }
.site-footer a:hover { color: var(--teal); }
.site-footer ul { list-style: none; display: grid; gap: .5rem; }
.footer-bottom { border-top: 1px solid #222; padding-top: 1.5rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: #777; }

/* Sticky mobile call bar */
.mobile-call-bar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 180;
  background: var(--white); border-top: 1px solid var(--line);
  padding: .7rem .9rem;
  gap: .7rem;
  box-shadow: 0 -6px 20px rgba(0,0,0,.08);
}
.mobile-call-bar .btn { flex: 1; text-align: center; padding: .85rem .5rem; font-size: .74rem; }

/* Chatbot FAQ widget mount point — styling for the widget itself lives in effects.css */
#chatbot-widget-placeholder {
  position: fixed; bottom: 24px; right: 24px; z-index: 190;
  width: 60px; height: 60px;
}

/* Page hero (inner pages) */
.page-hero { background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: 3.5rem 0; }
.page-hero p { color: var(--grey); max-width: 620px; margin-top: .8rem; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ===== Responsive ===== */
/* The full top bar (logo + 5 nav links + phone + Get a Quote + hamburger, all
   at one equal --header-gap) needs roughly 1240px of container width to fit
   without the gap collapsing to nothing — narrower than that, drop the nav
   links and phone number and lean on the hamburger's side menu instead,
   same as the below-960px behavior already did. */
@media (max-width: 1240px) {
  .desktop-nav { display: none; }
  .header-phone { display: none; }
}
@media (max-width: 960px) {
  .bio-grid, .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .services-grid, .testimonial-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .portfolio-grid.work-grid-compact { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  section { padding: 3rem 0; }
  .portfolio-grid, .services-grid, .testimonial-grid, .footer-grid { grid-template-columns: 1fr; }
  .portfolio-grid.work-grid-compact { grid-template-columns: 1fr; }
  .mobile-call-bar { display: flex; }
  .header-cta .btn { display: none; }
  body { padding-bottom: 70px; }
  #chatbot-widget-placeholder { bottom: 84px; }
  .hero { padding-top: 2rem; }
}

/* ===== Dark mode (follows the OS/browser setting automatically — no manual toggle) =====
   Placed last so it reliably wins the cascade over the equal-specificity rules above it.
   --black and --white are dual-purpose tokens (heading/ink color vs. page surface), so only
   THOSE get redefined here; every spot that needs to stay a fixed black or white regardless
   of theme (footer, CTA band, buttons, photo-overlay UI) was hardcoded in place earlier
   rather than routed through these variables. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --black: #f2f2f2;
    --ink: #e6e6e6;
    --grey: #9a9a9a;
    --line: #2a2e31;
    --bg-soft: #16191b;
    --white: #101314;
  }
  .site-header { background: rgba(16,19,20,.92); }
  .menu-overlay { background: rgba(0,0,0,.7); }
  .service-card:hover, .chip:hover { box-shadow: 0 12px 32px rgba(0,0,0,.35); }
  .side-menu {
    background: rgba(20, 23, 24, .2);
    border-left-color: rgba(255, 255, 255, .08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), -8px 0 40px rgba(0, 0, 0, .45);
  }
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .side-menu { background: var(--white); }
  }
}
