/* LAMAA DESIGN — minimal custom CSS
 * Tailwind utilities in the HTML handle normal layout, spacing, typography and responsive behavior.
 * This file is limited to theme tokens and behavior Tailwind cannot express cleanly in static markup.
 */
:root {
  --theme-bg: #ffffff;
  --theme-surface: #ffffff;
  --theme-surface-soft: #f5f6f8;
  --theme-text: #111827;
  --theme-heading: #14213d;
  --theme-muted: #6b7280;
  --theme-line: #e6e9ed;
  --theme-line-soft: #eceef1;
  --theme-subtle: #f7f8fa;
  --theme-shadow: rgba(17, 24, 39, 0.08);
  --navy: #14213d;
  --secondary: #6b7280;
  --muted: #8a93a1;
  --soft: #f5f6f8;
  --orange: #ff8a00;
  --pink: #e83e8c;
  --header-bg: rgba(255, 255, 255, 0.96);
  --cta-bg: #14213d;
  --cta-muted: #c7ced9;
}

html[data-theme="dark"] {
  --theme-bg: #0b1020;
  --theme-surface: #111827;
  --theme-surface-soft: #161e2f;
  --theme-text: #f5f7fb;
  --theme-heading: #f2f5fa;
  --theme-muted: #aab4c3;
  --theme-line: #273247;
  --theme-line-soft: #263141;
  --theme-subtle: #151e30;
  --theme-shadow: rgba(0, 0, 0, 0.24);
  --secondary: #aab4c3;
  --muted: #8894a6;
  --soft: #151e30;
  --header-bg: rgba(11, 16, 32, 0.94);
  --cta-muted: #c7ced9;
}

html {
  scroll-behavior: smooth;
  background: var(--theme-bg);
}

body {
  color: var(--theme-text);
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.site-header.scrolled {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.09);
  backdrop-filter: blur(14px);
}

/* Theme-aware logo switching: Tailwind controls desktop/mobile breakpoints. */
html:not([data-theme="dark"]) .header-brand-logo .logo-dark,
html[data-theme="dark"] .header-brand-logo .logo-light {
  display: none !important;
}

/* Theme switch is a stateful control, so its knob/icon swap is kept here. */
.theme-toggle {
  direction: rtl;
  display: inline-flex;
  width: 42px;
  height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--theme-heading);
  cursor: pointer;
  border: 0;
  background: transparent;
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 999px;
}
.theme-toggle-track {
  position: relative;
  display: flex;
  width: 42px;
  height: 24px;
  align-items: center;
  justify-content: flex-start;
  padding: 2px;
  border: 1px solid var(--theme-line);
  border-radius: 999px;
  background: var(--theme-surface-soft);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.theme-toggle-thumb {
  display: grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--theme-surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  transition: transform 0.22s ease, background-color 0.25s ease;
}
.theme-toggle .sun,
.theme-toggle .moon {
  grid-area: 1 / 1;
  font-size: 11px;
  line-height: 1;
  color: var(--theme-heading);
}
.theme-toggle .moon { display: none; }
.theme-toggle[aria-pressed="true"] .theme-toggle-thumb { transform: translateX(-16px); }
.theme-toggle[aria-pressed="true"] .sun { display: none; }
.theme-toggle[aria-pressed="true"] .moon { display: block; }

/* Mobile menu theme control gets a full-width, thumb-friendly tap target. */
.mobile-menu-footer .theme-toggle {
  width: 100%;
  min-height: 48px;
  justify-content: space-between;
  padding: 0 12px;
  border: 1px solid var(--theme-line);
  border-radius: 14px;
  background: var(--theme-surface-soft);
  color: var(--theme-heading);
}
.mobile-menu-footer .theme-toggle .theme-toggle-label {
  font-size: 0.86rem;
  font-weight: 800;
}
.mobile-menu-footer .theme-toggle .theme-label-light { display: none; }
.mobile-menu-footer .theme-toggle[aria-pressed="true"] .theme-label-dark { display: none; }
.mobile-menu-footer .theme-toggle[aria-pressed="true"] .theme-label-light { display: inline; }
.mobile-menu-footer .theme-toggle-track { flex: 0 0 auto; }

/* Mobile drawer uses utility classes for its open/closed state; only the theme-specific link treatment remains custom. */
.mobile-menu-links a {
  padding: 1rem;
  border-radius: 14px;
  font-weight: 800;
  color: var(--theme-heading);
  transition: background-color 0.2s ease;
}
.mobile-menu-links a:hover { background: var(--theme-surface-soft); }
.mobile-menu-backdrop { transition: opacity 0.2s ease; }

/* Small fixed mobile actions keep their two destinations visually distinct. */
.mobile-sticky .works {
  background: var(--theme-surface-soft);
  color: var(--theme-heading);
}
.mobile-sticky .wa {
  background: var(--orange);
  color: #fff;
}

/* JS reveal state is applied as Tailwind classes; this is only the progressive-enhancement default. */
.js-ready .reveal-on-scroll:not(.opacity-100) {
  opacity: 0;
  transform: translateY(18px);
}

/* Home masonry: CSS columns have no concise cross-browser Tailwind equivalent for all three density variants. */
.home-masonry-item > span {
  position: absolute;
  inset-inline: 14px;
  bottom: 14px;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: rgba(20, 33, 61, 0.82);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.home-masonry-item:hover > span,
.home-masonry-item:focus-within > span { opacity: 1; transform: none; }

/* Timeline connector on the process section. */
.process::before {
  content: "";
  position: absolute;
  top: 26px;
  inset-inline: 6%;
  height: 1px;
  background: var(--theme-line);
}
@media (max-width: 1023px) { .process::before { display: none; } }

/* CTA glow is a genuine pseudo-element effect. */
.cta-panel::after {
  content: "";
  position: absolute;
  inset-inline-end: -140px;
  top: -140px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 0, 0.18), transparent 68%);
  pointer-events: none;
}

/* Before/after slider has geometry and a runtime-updated clip path. */
.ba-frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; touch-action: none; }
.ba-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-before { clip-path: inset(0 50% 0 0); }
.ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: #fff;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.16);
}
.ba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  color: var(--theme-heading);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  font-weight: 800;
  cursor: ew-resize;
}

/* Hero Swiper — the outer viewport owns clipping so Swiper Cards can keep overflow visible safely. */
.hero-swiper-viewport {
  width: 100%;
  min-width: 0;
  max-width: 660px;
  overflow: hidden;
  contain: layout;
}
.hero-swiper.swiper-cards {
  overflow: visible !important;
}
.hero-swiper {
  width: 100%;
  min-width: 0;
  overflow: visible !important;
}
.hero-swiper .swiper-wrapper { align-items: center; }
.hero-swiper .swiper-slide { min-width: 0; }

@media (min-width: 1024px) {
  .hero-swiper-viewport {
    overflow: visible;
  }
}

/* Gallery image framing is controlled by Tailwind utility classes. */

/* Lightbox is a full-screen interaction surface and is intentionally custom. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 10px;
  padding: clamp(12px, 4vw, 52px);
  background: rgba(10, 16, 28, 0.94);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.lightbox.open { opacity: 1; visibility: visible; pointer-events: auto; }
.lightbox figure {
  display: flex;
  width: min(1100px, calc(100vw - 32px));
  height: min(86vh, calc(100dvh - 80px));
  margin: 0 auto;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
}
.lightbox img {
  max-width: 100%;
  max-height: calc(86vh - 50px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}
.lightbox figcaption { color: #fff; font-size: 0.86rem; font-weight: 700; text-align: center; }
.lightbox button { border: 0; cursor: pointer; }
.lightbox-close {
  position: absolute;
  top: 18px;
  inset-inline-end: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
}
.lightbox-prev,
.lightbox-next {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 2rem;
}

/* On small screens the lightbox uses the full viewport and keeps navigation close to the thumbs. */
@media (max-width: 639px) {
  .lightbox {
    padding: 58px 12px 66px;
    grid-template-columns: 1fr;
    gap: 0;
  }
  .lightbox figure {
    width: 100%;
    height: calc(100dvh - 124px);
    gap: 8px;
  }
  .lightbox img {
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 170px);
    border-radius: 8px;
  }
  .lightbox figcaption {
    max-width: calc(100vw - 40px);
    font-size: 0.78rem;
    line-height: 1.6;
  }
  .lightbox-close {
    top: 10px;
    inset-inline-end: 12px;
    width: 42px;
    height: 42px;
  }
  .lightbox-prev,
  .lightbox-next {
    bottom: 12px;
    width: 44px;
    height: 44px;
    font-size: 1.7rem;
  }
}

/* Portfolio filter count + text polish. */
.portfolio-meta strong { color: var(--theme-heading); }
.portfolio-meta small { color: var(--theme-muted); }

/* Homepage splash: timing/assembly is intentionally custom animation. */
.site-splash {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  background: var(--theme-bg);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
html.splash-seen #site-splash { display: none !important; }
.splash-stage {
  position: relative;
  display: block;
  width: min(76vw, 520px);
  max-width: 520px;
  aspect-ratio: 865.4 / 382.9;
  transform-origin: center;
  will-change: opacity, transform;
}
.splash-full-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: translateZ(0) scale(0.985);
  animation: splash-logo-reveal 0.32s cubic-bezier(0.22, 0.61, 0.36, 1) 0.82s forwards;
}
.splash-full-logo-dark { display: none; }
html[data-theme="dark"] .splash-full-logo-light { display: none; }
html[data-theme="dark"] .splash-full-logo-dark { display: block; }
.splash-fragment {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13.19412%;
  height: auto;
  transform: translate(-50%, -50%) rotate(-11deg) scale(0.94);
  transform-origin: center;
  will-change: left, top, transform, opacity;
  animation:
    splash-fragment-assembly 1.08s cubic-bezier(0.22, 0.61, 0.36, 1) 0.04s forwards,
    splash-fragment-settle 0.16s cubic-bezier(0.34, 1.1, 0.64, 1) 1.04s forwards;
}
.site-splash.is-exiting { animation: splash-exit 0.24s cubic-bezier(0.4, 0, 0.2, 1) forwards; pointer-events: none; }
@keyframes splash-fragment-assembly {
  0% { left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-11deg) scale(0.94); opacity: 1; }
  14% { left: 47%; top: 47%; transform: translate(-50%, -50%) rotate(3deg) scale(0.98); }
  58% { left: 69%; top: 35%; transform: translate(-50%, -50%) rotate(-2deg) scale(0.99); }
  82% { left: 84%; top: 25%; transform: translate(-50%, -50%) rotate(0.6deg) scale(1.01); }
  100% { left: 93.3946%; top: 22.8154%; transform: translate(-50%, -50%) rotate(0deg) scale(1); }
}
@keyframes splash-fragment-settle {
  from { filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.12)); }
  to { filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0)); }
}
@keyframes splash-logo-reveal {
  from { opacity: 0; transform: translateZ(0) scale(0.985); filter: blur(0.6px); }
  to { opacity: 1; transform: translateZ(0) scale(1); filter: blur(0); }
}
@keyframes splash-exit {
  from { opacity: 1; visibility: visible; }
  to { opacity: 0; visibility: hidden; }
}
@media (max-width: 640px) { .splash-stage { width: min(82vw, 420px); } }

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

::selection { background: var(--theme-heading); color: #fff; }
html[data-theme="dark"] ::selection { background: var(--orange); color: #0b1020; }

/* Paired logos inside the mobile drawer/footer follow the active theme as well. */
.brand-logo .logo-light { display: block; }
.brand-logo .logo-dark { display: none; }
html[data-theme="dark"] .brand-logo .logo-light { display: none !important; }
html[data-theme="dark"] .brand-logo .logo-dark { display: block !important; }
