/* ============================================================
   Zoha Kharratha — shared design system
   Used by index.html and every page in projects/
   ============================================================ */

:root{
  --paper: #E1ECE1;
  --paper-raised: #EDF3EA;
  --ink: #16241A;
  --ink-soft: #4B5A4E;
  --ink-faint: #7C8A7E;
  --line: #C9D6C6;
  --accent: #2F3AB2;
  --accent-soft: #DCE6DC;
  --available: #1D9E75;
  --radius: 18px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: #fff; }
.mono { font-family: 'JetBrains Mono', monospace; }
.display { font-family: 'Fraunces', Georgia, serif; }
img, video { max-width: 100%; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 32px; }

/* ---------- NAV (shared) ---------- */
nav.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247,246,242,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
nav.site-nav .wrap {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding-top: 20px; padding-bottom: 20px; gap: 12px;
}
.logo {
  font-family: 'Fraunces', Georgia, serif; font-weight: 460;
  font-size: 19.5px; letter-spacing: -0.01em; text-decoration: none; color: var(--ink);
  text-align: center; grid-column: 2;
}
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links.left { justify-content: flex-start; grid-column: 1; }
.nav-links.right { justify-content: flex-end; grid-column: 3; }
.nav-links a {
  font-size: 13px; color: var(--ink-soft); text-decoration: none;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links .cta {
  color: var(--ink); border: 1px solid var(--line); padding: 8px 16px;
  border-radius: 100px; background: var(--paper-raised);
}
.nav-links .cta:hover { border-color: var(--ink); }
.back-link {
  font-size: 13px; color: var(--ink-soft); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.back-link:hover { color: var(--ink); }

/* ---------- BUTTONS ---------- */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--paper);
  font-size: 13.5px; font-weight: 500; text-decoration: none;
  padding: 13px 22px; border-radius: 100px;
  transition: transform 0.15s, background 0.15s;
}
.btn-primary:hover { background: var(--accent); transform: translateY(-1px); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; color: var(--ink); text-decoration: none;
  padding: 13px 4px; border-bottom: 1px solid var(--ink);
}

/* ---------- TAGS ---------- */
.tag {
  display: inline-block;
  font-size: 10px; padding: 4px 9px; border-radius: 5px; font-weight: 500; letter-spacing: 0.03em;
  font-family: 'JetBrains Mono', monospace;
}
.tag-bi { background: #E6F1FB; color: #0C447C; }
.tag-saas { background: #F1EFE8; color: #2C2C2A; }
.tag-service { background: #E1F5EE; color: #085041; }
.tag-brand { background: #FAEEDA; color: #633806; }
.tag-motion { background: var(--accent-soft); color: var(--accent); }

/* ---------- SECTION HEADS ---------- */
.section { padding: 88px 0; border-top: 1px solid var(--line); }
.section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 48px; gap: 24px; flex-wrap: wrap;
}
.eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--accent); font-weight: 600; margin-bottom: 12px; display: block;
  font-family: 'JetBrains Mono', monospace;
}
.section-head h2 {
  font-family: 'Fraunces', Georgia, serif; font-weight: 460;
  font-size: clamp(24px, 3vw, 36px); letter-spacing: -0.02em;
}
.section-head .range { font-size: 13px; color: var(--ink-faint); }

/* ---------- FOOTER / CTA (shared) ---------- */
footer.cta-footer { padding: 96px 0 48px; border-top: 1px solid var(--line); }
.cta-footer h2 {
  font-family: 'Fraunces', Georgia, serif; font-weight: 460;
  font-size: clamp(28px, 4.4vw, 46px); letter-spacing: -0.02em; line-height: 1.15;
  margin-bottom: 36px; max-width: 680px;
}
.cta-footer h2 em { font-style: normal; color: var(--accent); }
.contact-links { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 64px; }
.contact-link {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--ink); text-decoration: none;
  padding-bottom: 3px; border-bottom: 1px solid var(--line);
  transition: border-color 0.15s;
}
.contact-link:hover { border-color: var(--ink); }
.contact-link svg { width: 15px; height: 15px; color: var(--ink-soft); }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: var(--ink-faint); padding-top: 24px; border-top: 1px solid var(--line); }

/* ============================================================
   PRELOADER + REVEAL ANIMATIONS (shared, slow & deliberate)
   ============================================================ */
#preloader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: transform 1.3s cubic-bezier(.76,0,.24,1);
}
#preloader.done { transform: translateY(-100%); }
#preloader .count {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(15px, 2vw, 18px);
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  margin-bottom: 18px;
  font-variant-numeric: tabular-nums;
}
#preloader .bar { width: 220px; height: 1px; background: var(--line); overflow: hidden; }
#preloader .bar-fill { height: 100%; width: 0%; background: var(--ink); transition: width 0.12s linear; }
html.loading, html.loading body { overflow: hidden; height: 100%; }

.reveal-up {
  opacity: 0; transform: translateY(34px);
  transition: opacity 1.3s cubic-bezier(.22,1,.36,1), transform 1.3s cubic-bezier(.22,1,.36,1);
}
.reveal-up.in { opacity: 1; transform: translateY(0); }

.reveal-line { overflow: hidden; display: block; }
.reveal-line span {
  display: block; transform: translateY(115%);
  transition: transform 1.3s cubic-bezier(.22,1,.36,1);
}
.reveal-line.in span { transform: translateY(0); }

.reveal-mask { clip-path: inset(0 0 100% 0); transition: clip-path 1.5s cubic-bezier(.65,0,.35,1); }
.reveal-mask.in { clip-path: inset(0 0 0% 0); }

.reveal-scale img, .reveal-scale video { transform: scale(1.14); transition: transform 1.8s cubic-bezier(.22,1,.36,1); }
.reveal-scale.in img, .reveal-scale.in video { transform: scale(1); }

.stagger-1 { transition-delay: 0.16s; }
.stagger-2 { transition-delay: 0.32s; }
.stagger-3 { transition-delay: 0.48s; }
.stagger-4 { transition-delay: 0.64s; }
.stagger-5 { transition-delay: 0.8s; }

@media (prefers-reduced-motion: reduce) {
  #preloader { display: none; }
  .reveal-up, .reveal-line span, .reveal-mask, .reveal-scale img, .reveal-scale video {
    opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important;
  }
}

/* ============================================================
   PROJECT DETAIL PAGES (projects/*.html)
   ============================================================ */
.detail-container { max-width: 760px; margin: 0 auto; padding: 64px 32px 96px; }
.detail-container .tag { margin-bottom: 20px; }
.detail-container h1 {
  font-family: 'Fraunces', Georgia, serif; font-weight: 460;
  font-size: clamp(26px, 3.4vw, 36px); line-height: 1.2; letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.detail-container .subtitle { font-size: 16px; color: var(--ink-soft); line-height: 1.7; margin-bottom: 44px; max-width: 560px; }

.meta-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin-bottom: 56px;
}
.meta-item .label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.meta-item .value { font-size: 13.5px; color: var(--ink); line-height: 1.5; }

.description { margin-bottom: 60px; }
.description p { font-size: 15px; line-height: 1.8; color: var(--ink-soft); margin-bottom: 16px; }
.description p:last-child { margin-bottom: 0; }

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--accent); text-transform: uppercase;
  letter-spacing: 0.12em; font-weight: 500; margin-bottom: 18px;
}

.gallery { display: flex; flex-direction: column; gap: 16px; margin-bottom: 60px; }
.gallery .pair { display: flex; flex-direction: column; gap: 0; border-radius: var(--radius); overflow: hidden; }
.gallery .pair img { border-radius: 0; border: none; display: block; }
.gallery img, .gallery video {
  width: 100%; border-radius: var(--radius); display: block; cursor: zoom-in;
  transition: opacity 0.15s;
}
.gallery img:hover { opacity: 0.92; }
.gallery img, .gallery .pair, .gallery .pair img { box-shadow: none !important; filter: none !important; -webkit-filter: none !important; }

.gallery-frame {
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  margin-top: 44px;
  margin-bottom: 60px;
}
.gallery-frame .gallery { margin-bottom: 0; }

.lightbox {
  display: none; position: fixed; inset: 0; background: rgba(20,20,15,0.94); z-index: 1000;
  align-items: center; justify-content: center; cursor: zoom-out; padding: 32px;
  animation: fadeIn 0.2s ease-out;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 4px 40px rgba(0,0,0,0.4); object-fit: contain; }
.lightbox-close {
  position: absolute; top: 24px; right: 32px; color: #fff; background: rgba(255,255,255,0.1);
  border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lightbox-hint {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.55); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.next-project {
  border-top: 1px solid var(--line); padding-top: 32px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
.next-project a { font-size: 14px; color: var(--ink); text-decoration: none; font-weight: 500; }
.next-project a:hover { color: var(--accent); }

@media (max-width: 600px) {
  .detail-container { padding: 40px 20px 64px; }
  .meta-grid { grid-template-columns: 1fr 1fr; }
  .lightbox { padding: 16px; }
  .lightbox-close { top: 12px; right: 12px; }
}
@media (max-width: 720px) {
  nav.site-nav .wrap { grid-template-columns: auto 1fr; }
  .logo { grid-column: 1; text-align: left; }
  .nav-links.left { display: none; }
  .nav-links.right { grid-column: 2; }
}
