:root {
  --basharaa-navy: #0f1722;
  --basharaa-steel: #3c4c63;
  --basharaa-ink: #1c2430;
  --basharaa-warm: #f4efe7;
  --basharaa-copper: #c59a68;
}

body {
  background: var(--basharaa-warm);
}

.header__widget-note,
.basharaa-footer-copy,
.service-card__copy,
.process-step__copy,
.engagement-card__copy,
.problem-card__copy,
.about-pill__copy,
.trust-copy,
.section-intro {
  color: rgba(28, 36, 48, 0.76);
}

.hero-grain {
  position: relative;
}

.hero-grain:before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    radial-gradient(circle at 20% 20%, rgba(197, 154, 104, 0.12), transparent 32%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.14), transparent 28%);
  opacity: 0.9;
  pointer-events: none;
}

.hero-grain .slider,
.hero-grain .container,
.hero-grain .row {
  position: relative;
  z-index: 1;
}

.page-home .section-projects-slider {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

.page-home .section-projects-slider .section-fullheight__inner {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

.page-home #page-header,
.page-home #page-header .header__container {
  background: transparent !important;
  box-shadow: none !important;
}

.page-home .slider-fullscreen-projects,
.page-home .slider-fullscreen-projects__images,
.page-home .slider-fullscreen-projects__images .swiper-wrapper,
.page-home .slider-fullscreen-projects__images .swiper-slide,
.page-home .slider-fullscreen-projects__images .slider__images-slide-inner,
.page-home .slider-fullscreen-projects__images .slider__bg {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

.page-home .slider-fullscreen-projects__content {
  margin-left: auto;
  margin-right: auto;
  max-width: min(100%, 1220px);
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  padding-bottom: clamp(2.5rem, 6vh, 4rem);
  padding-top: clamp(6rem, 11vh, 8rem);
  pointer-events: none;
  text-align: center;
}

.page-home .slider-fullscreen-projects__content .swiper-wrapper {
  min-height: inherit;
}

.page-home .slider-fullscreen-projects__content .swiper-slide {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: calc(100vh - clamp(6rem, 11vh, 8rem) - clamp(2.5rem, 6vh, 4rem));
  min-height: calc(100svh - clamp(6rem, 11vh, 8rem) - clamp(2.5rem, 6vh, 4rem));
  min-height: calc(100dvh - clamp(6rem, 11vh, 8rem) - clamp(2.5rem, 6vh, 4rem));
}

.page-home .slider__copy {
  align-self: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.page-home .slider__heading {
  font-size: clamp(3.1rem, 6.2vw, 7.15rem);
  line-height: 0.94;
  text-wrap: balance;
}

.page-home .slider__subheading {
  max-width: min(100%, 64rem);
  margin-left: auto;
  margin-right: auto;
}

.page-home .slider__inline-action {
  display: flex;
  align-self: end;
  justify-content: center;
  margin-top: 0;
  pointer-events: auto;
  width: 100%;
}

.page-home .slider__inline-action .button {
  min-width: clamp(12rem, 18vw, 16rem);
  white-space: nowrap;
}

.page-home .slider-fullscreen-projects__footer {
  display: none;
}

.section-rich {
  background: var(--basharaa-warm);
}

/* ── Grid System ──────────────────────────────────────────────────── */

.stats-grid,
.problems-grid,
.services-grid,
.industries-grid,
.process-grid,
.engagement-grid,
.about-pill-grid {
  display: grid;
  gap: 1.5rem;
}

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

.industries-grid,
.problems-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Default 3-col for any services-grid */
.services-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ── 5-card services grid: centers the last two items ───────────── */
/* Uses a 6-column ghost grid so items 4+5 land in columns 2–3 and 4–5,
   visually centred in the row.                                       */
.services-grid--five {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.services-grid--five > * {
  grid-column: span 2;
}

/* Force item 4 to start at col 2; item 5 then auto-places at col 4 */
.services-grid--five > :nth-child(4) {
  grid-column: 2 / span 2;
}

.process-grid,
.about-pill-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

/* ── Cards ───────────────────────────────────────────────────────── */

.stat-card,
.problem-card,
.service-card,
.process-step,
.engagement-card,
.about-pill,
.industry-pill,
.testimonial-placeholder {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(60, 76, 99, 0.12);
  border-radius: 20px;
  box-shadow: 0 24px 48px rgba(15, 23, 34, 0.08);
  padding: 1.5rem;
}

.stat-card {
  text-align: center;
}

.stat-card__value {
  color: var(--basharaa-navy);
  font-size: 2rem;
  font-weight: 700;
}

.stat-card__label {
  color: rgba(28, 36, 48, 0.72);
  font-size: 0.95rem;
  margin-top: 0.4rem;
}

.industry-pill {
  align-items: center;
  display: flex;
  gap: 0.85rem;
}

.industry-pill i,
.process-step__number {
  align-items: center;
  background: rgba(197, 154, 104, 0.14);
  border-radius: 999px;
  color: var(--basharaa-navy);
  display: inline-flex;
  font-size: 1rem;
  height: 2.5rem;
  justify-content: center;
  width: 2.5rem;
}

.problem-card__eyebrow,
.service-card__eyebrow,
.engagement-card__eyebrow,
.about-pill__eyebrow,
.testimonial-placeholder__tag {
  color: var(--basharaa-steel);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
}

.problem-card h3,
.service-card h3,
.engagement-card h3,
.process-step h3,
.about-pill h3,
.testimonial-placeholder h3 {
  margin-bottom: 0.8rem;
}

/* ── Panels ──────────────────────────────────────────────────────── */

.confidentiality-panel {
  background:
    linear-gradient(135deg, rgba(15, 23, 34, 0.95), rgba(28, 36, 48, 0.92)),
    linear-gradient(90deg, rgba(197, 154, 104, 0.18), transparent);
  border-radius: 28px;
  box-shadow: 0 30px 60px rgba(15, 23, 34, 0.24);
  color: #fff;
  padding: 3rem;
}

.confidentiality-panel p {
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 0;
}

.section-anchor {
  position: relative;
  top: -110px;
}

.section-soft-dark {
  background: linear-gradient(180deg, rgba(15, 23, 34, 0.98), rgba(28, 36, 48, 0.96));
}

.section-soft-dark .section-intro,
.section-soft-dark .problem-card__copy,
.section-soft-dark .service-card__copy,
.section-soft-dark .engagement-card__copy,
.section-soft-dark .about-pill__copy,
.section-soft-dark p {
  color: rgba(255, 255, 255, 0.76);
}

.section-soft-dark .problem-card,
.section-soft-dark .service-card,
.section-soft-dark .engagement-card,
.section-soft-dark .about-pill {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

/* ── Contact ─────────────────────────────────────────────────────── */

.contact-layout {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
}

.contact-card,
.contact-form-shell {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(60, 76, 99, 0.12);
  border-radius: 24px;
  box-shadow: 0 24px 48px rgba(15, 23, 34, 0.08);
  height: 100%;
  padding: 2rem;
}

.contact-card__item + .contact-card__item {
  margin-top: 1.6rem;
}

.contact-card__label {
  color: var(--basharaa-steel);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}

.contact-card__value,
.contact-card__value a {
  color: var(--basharaa-ink);
}

.contact-trust {
  border-top: 1px solid rgba(60, 76, 99, 0.12);
  margin-top: 1.5rem;
  padding-top: 1.5rem;
}

/* ── Form Status ─────────────────────────────────────────────────── */

.form-status {
  border-radius: 14px;
  font-size: 0.95rem;
  margin-top: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 1rem;
  transform: translateY(-8px);
  transition: max-height 0.35s ease, opacity 0.35s ease, transform 0.35s ease, margin-top 0.35s ease, padding 0.35s ease;
}

.form-status.is-visible {
  margin-top: 1rem;
  max-height: 8rem;
  opacity: 1;
  padding: 0.9rem 1rem;
  transform: translateY(0);
}

.form-status.is-success {
  background: rgba(38, 104, 72, 0.12);
  color: #1d5f41;
}

.form-status.is-error {
  background: rgba(143, 43, 43, 0.1);
  color: #8f2b2b;
}

.input-float__input_textarea {
  min-height: 180px;
}

.testimonial-placeholder {
  border-style: dashed;
}

/* ── CTA Panel ───────────────────────────────────────────────────── */

.cta-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(60, 76, 99, 0.12);
  border-radius: 24px;
  box-shadow: 0 24px 48px rgba(15, 23, 34, 0.08);
  padding: 2.25rem;
}

.cta-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.hide-visually {
  left: -9999px;
  position: absolute;
}

/* ── Responsive ──────────────────────────────────────────────────── */

@media screen and (max-width: 1199px) {
  /* Standard 3-col services grid falls to 2-col */
  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* 5-card variant: 2-col, last card centered */
  .services-grid--five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .services-grid--five > * {
    grid-column: span 1;
  }

  .services-grid--five > :nth-child(4) {
    grid-column: span 1; /* reset the desktop override */
  }

  /* Last card (5th of 5) gets full row but constrained width */
  .services-grid--five > :nth-child(5):last-child {
    grid-column: 1 / -1;
    max-width: calc(50% - 0.75rem);
    margin-left: auto;
    margin-right: auto;
  }
}

@media screen and (max-width: 991px) {
  .stats-grid,
  .industries-grid,
  .problems-grid,
  .services-grid,
  .services-grid--five,
  .process-grid,
  .engagement-grid,
  .about-pill-grid,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  /* Reset all explicit column placements at mobile */
  .services-grid--five > *,
  .services-grid--five > :nth-child(4),
  .services-grid--five > :nth-child(5):last-child {
    grid-column: span 1;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  .confidentiality-panel {
    padding: 2rem;
  }

  .page-home .section-projects-slider .section-fullheight__inner {
    min-height: 100svh;
    min-height: 100dvh;
  }

  .page-home .slider-fullscreen-projects__content {
    max-width: calc(100% - 2rem);
    min-height: 100svh;
    min-height: 100dvh;
    padding-bottom: clamp(2rem, 5vh, 3rem);
    padding-top: clamp(7rem, 14vh, 8.5rem);
  }

  .page-home .slider-fullscreen-projects__content .swiper-slide {
    min-height: calc(100svh - clamp(7rem, 14vh, 8.5rem) - clamp(2rem, 5vh, 3rem));
    min-height: calc(100dvh - clamp(7rem, 14vh, 8.5rem) - clamp(2rem, 5vh, 3rem));
  }

  .page-home .slider__heading {
    font-size: clamp(2.7rem, 12vw, 4.5rem);
    line-height: 0.98;
  }

  .page-home .slider__subheading {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    max-width: 28rem;
  }

  .page-home .slider__inline-action .button {
    min-width: 0;
    width: auto;
    max-width: 100%;
    padding-left: 1.2rem;
    padding-right: 1.2rem;
    white-space: normal;
  }
}

@media screen and (max-width: 575px) {
  .page-home .slider-fullscreen-projects__content {
    max-width: calc(100% - 1.5rem);
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    padding-top: calc(92px + env(safe-area-inset-top, 0px));
  }

  .page-home .slider-fullscreen-projects__content .swiper-slide {
    min-height: calc(100svh - (92px + env(safe-area-inset-top, 0px)) - (24px + env(safe-area-inset-bottom, 0px)));
    min-height: calc(100dvh - (92px + env(safe-area-inset-top, 0px)) - (24px + env(safe-area-inset-bottom, 0px)));
  }

  .page-home .slider__heading {
    font-size: clamp(2.35rem, 11.2vw, 3.5rem);
    line-height: 1.02;
  }

  .page-home .slider__subheading {
    font-size: 0.72rem;
    line-height: 1.55;
    max-width: 20rem;
  }

  .page-home .slider__inline-action {
    margin-top: 1rem;
  }

  .page-home .slider__arrow {
    transform: scale(0.82);
  }
}


/* ── Konami Overlay ─────────────────────────────────────────────── */

.konami-overlay {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity 0.28s ease;
  z-index: 12000;
}

.konami-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.konami-overlay__backdrop {
  background: rgba(15, 23, 34, 0.82);
  inset: 0;
  position: absolute;
}

.konami-overlay__panel {
  background: rgba(244, 239, 231, 0.98);
  border: 1px solid rgba(60, 76, 99, 0.16);
  border-radius: 28px;
  box-shadow: 0 32px 64px rgba(15, 23, 34, 0.28);
  max-height: min(82vh, 920px);
  max-width: min(860px, calc(100% - 2rem));
  overflow: auto;
  padding: 2.25rem;
  position: relative;
  width: 100%;
  z-index: 1;
}

.konami-overlay__quotes {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1.5rem;
}

.konami-quote {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(60, 76, 99, 0.12);
  border-radius: 18px;
  padding: 1rem 1rem 0.9rem;
}

.konami-quote__tag,
.software-quote-reveal__tag {
  color: var(--basharaa-steel);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  margin-bottom: 0.55rem;
  text-transform: uppercase;
}

.konami-quote__text,
.software-quote-reveal__text {
  color: var(--basharaa-ink);
  line-height: 1.7;
  margin: 0;
}

.konami-overlay__button {
  margin-top: 1.5rem;
}

/* ── Software Page Extras ───────────────────────────────────────── */

.software-sigil {
  background: transparent;
  border: 0;
  color: rgba(28, 36, 48, 0.44);
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  letter-spacing: 0.12em;
  padding: 0.35rem 0.5rem;
  text-transform: uppercase;
}

.software-sigil:hover,
.software-sigil:focus {
  color: rgba(28, 36, 48, 0.72);
  outline: none;
}

.software-sigil__cursor {
  animation: basharaaBlink 1.15s step-end infinite;
}

.software-quote-reveal {
  margin-top: 1rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.28s ease, opacity 0.28s ease, margin-top 0.28s ease;
}

.software-quote-reveal.is-visible {
  margin-top: 1.25rem;
  max-height: 12rem;
  opacity: 1;
}

.software-quote-reveal__card {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(60, 76, 99, 0.12);
  border-radius: 18px;
  margin: 0 auto;
  max-width: 42rem;
  padding: 1rem 1.1rem;
}

@keyframes basharaaBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}


@media screen and (max-width: 991px) {
  .konami-overlay__quotes {
    grid-template-columns: 1fr;
  }

  .konami-overlay__panel {
    padding: 1.5rem;
  }
}

/* ── Masthead background image (wrapper-div approach) ────────────────
   The Rhye theme JS reads data-background-color on the <section> and
   writes back to element.style, which would wipe any inline style set
   directly on the section. Instead we put the image and overlay in
   separate absolutely-positioned children that the theme JS ignores.

   The page templates now provide two image candidates in order:
   1) /img/headers/<page>-bg.png
   2) /img/assets/bashar/<page>-bg.jpg
   So the masthead still renders if only one of those paths exists.
   ------------------------------------------------------------------ */

.section-masthead--has-bg {
  background-color: var(--color-dark-1);
  isolation: isolate;
  overflow: hidden;
  position: relative;
}

.section-masthead--has-bg .masthead-bg-image,
.section-masthead--has-bg .masthead-bg-overlay {
  pointer-events: none;
}

.masthead-bg-image {
  background-color: #101722;
  background-position: center center, center center;
  background-repeat: no-repeat, no-repeat;
  background-size: cover, cover;
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transform: scale(1.01);
  transform-origin: center center;
  z-index: 0;
}

.masthead-bg-overlay {
  background:
    linear-gradient(180deg, rgba(15, 23, 34, 0.46), rgba(15, 23, 34, 0.76)),
    linear-gradient(90deg, rgba(197, 154, 104, 0.08), transparent 40%);
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 1;
}

.section-masthead--has-bg > *:not(.masthead-bg-image):not(.masthead-bg-overlay) {
  position: relative;
  z-index: 2;
}

.section-masthead--has-bg .section-masthead__inner {
  align-items: center;
  display: flex;
  min-height: clamp(300px, 34vw, 500px);
}

.section-masthead--has-bg .section-masthead__header {
  width: 100%;
}

.section-masthead--has-bg .section-intro,
.section-masthead--has-bg .section-masthead__subheading,
.section-masthead--has-bg .small-caps {
  color: rgba(255, 255, 255, 0.78);
}

.section-masthead--has-bg[data-arts-theme-text="light"] h1,
.section-masthead--has-bg[data-arts-theme-text="light"] h2 {
  color: #eeece6;
}

@media screen and (max-width: 767px) {
  .section-masthead--has-bg .section-masthead__inner {
    min-height: clamp(220px, 52vw, 340px);
  }
}
