/* ============================================================
   Saq Al-Ard — custom design layer (on top of Tailwind CDN)
   ============================================================ */

:root {
  --night: #1B1917;
  --gold: #D9A55C;
  --charcoal: #55524C;
}

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body {
  font-feature-settings: "kern" 1, "liga" 1;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 100;
  background: var(--gold);
  color: #211E1A;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1rem;
}

/* ---------- Focus visibility ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #D9A55C;
  outline-offset: 2px;
}

/* ---------- Signature chamfer motif ----------
   One cut corner, referencing cut steel/pipe stock.
   Used consistently across buttons, cards, tags. */
.chamfer {
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}
.chamfer-sm {
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}
.chamfer-lg {
  clip-path: polygon(0 0, calc(100% - 32px) 0, 100% 32px, 100% 100%, 0 100%);
}
.chamfer-br {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}
.chamfer-tl-br {
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
}

/* ---------- Header scroll state ---------- */
#site-header.is-scrolled #main-nav-bar {
  height: auto;
  box-shadow: 0 8px 30px -12px rgba(0,0,0,0.5);
}
#site-header.is-scrolled #main-nav-bar .h-\[76px\] {
  height: 64px;
}

.nav-link.active {
  color: #F5F1E8;
}
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 4px;
  height: 2px;
  background: #E4B475;
}

/* ---------- Mobile menu ---------- */
#mobile-menu {
  transition: opacity 0.25s ease;
}
#mobile-menu nav {
  transition: transform 0.32s cubic-bezier(.22,.9,.32,1);
  transform: translateX(100%);
}
#mobile-menu.is-open {
  visibility: visible;
  opacity: 1;
}
#mobile-menu.is-open nav {
  transform: translateX(0);
}
#menu-toggle.is-open .menu-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#menu-toggle.is-open .menu-bar:nth-child(2) { opacity: 0; }
#menu-toggle.is-open .menu-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Strata / core-sample background pattern ----------
   A subtle banded texture referencing sediment layers & borehole
   core samples — used behind dark hero / CTA panels only. */
.bg-strata {
  background-image:
    repeating-linear-gradient(180deg, rgba(228,180,117,0.07) 0px, rgba(228,180,117,0.07) 1px, transparent 1px, transparent 46px),
    radial-gradient(ellipse at 15% 20%, rgba(156,153,146,0.12), transparent 55%),
    radial-gradient(ellipse at 85% 85%, rgba(217,165,92,0.16), transparent 55%);
}

.bg-strata-light {
  background-image:
    repeating-linear-gradient(180deg, rgba(85,82,76,0.05) 0px, rgba(85,82,76,0.05) 1px, transparent 1px, transparent 40px);
}

/* Vertical depth-ruler accent, used sparingly beside key headings */
.depth-rule {
  position: relative;
  padding-left: 1.35rem;
}
.depth-rule::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 3px;
  background: linear-gradient(180deg, #D9A55C, #55524C);
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.2,.7,.3,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Cards ---------- */
.service-card {
  transition: transform 0.35s cubic-bezier(.2,.7,.3,1), box-shadow 0.35s ease, border-color 0.35s ease;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -20px rgba(15,19,23,0.35);
}
.service-card .card-img {
  transition: transform 0.6s cubic-bezier(.2,.7,.3,1);
}
.service-card:hover .card-img {
  transform: scale(1.06);
}

/* ---------- Gallery / lightbox ---------- */
.gallery-item {
  cursor: zoom-in;
  overflow: hidden;
  position: relative;
}
.gallery-item img {
  transition: transform 0.5s ease;
}
.gallery-item:hover img {
  transform: scale(1.08);
}
.gallery-item.is-hidden {
  display: none;
}

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10,13,16,0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}
#lightbox.is-open {
  opacity: 1;
  visibility: visible;
}
#lightbox img {
  max-width: min(92vw, 1200px);
  max-height: 86vh;
  object-fit: contain;
}
#lightbox .lb-nav {
  width: 48px;
  height: 48px;
}

/* ---------- Filter pills ---------- */
.filter-pill {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.filter-pill.is-active {
  background: #D9A55C;
  color: #211E1A;
  border-color: #D9A55C;
}

/* ---------- Counters ---------- */
.stat-figure {
  font-variant-numeric: tabular-nums;
}

/* ---------- Process stepper ---------- */
.process-line {
  background: linear-gradient(180deg, transparent, #DED5C0 8%, #DED5C0 92%, transparent);
}

/* ---------- Forms ---------- */
.form-field {
  background: #fff;
  border: 1px solid #DED5C0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-field:focus {
  border-color: #D9A55C;
  box-shadow: 0 0 0 3px rgba(217,165,92,0.16);
  outline: none;
}
.form-field::placeholder {
  color: #9c9481;
}

/* ---------- Misc ---------- */
.text-balance { text-wrap: balance; }

::selection {
  background: #D9A55C;
  color: #211E1A;
}

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #F5F1E8; }
::-webkit-scrollbar-thumb { background: #DED5C0; border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: #D9A55C; }

/* Loader */
#page-loader {
  position: fixed; inset: 0; z-index: 200; background: #1B1917;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#page-loader.is-done { opacity: 0; visibility: hidden; }
