/* ════════════════════════════════════════
   BILALMECCAI.COM — BASE DESIGN SYSTEM
   Shared across all pages
════════════════════════════════════════ */

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ── TOKENS ── */
:root {
  --ink:        #0F0F0F;
  --ink-soft:   #4A4A4A;
  --ink-muted:  #8A8A8A;
  --paper:      #FAFAF7;
  --paper-2:    #F2F1EC;
  --accent:     #1A3C5E;
  --accent-2:   #C8873A;
  --rule:       #E0DDD5;
  --green:      #2a7a4a;
  --red:        #c0392b;
  --serif:      'Playfair Display', Georgia, serif;
  --sans:       'DM Sans', system-ui, sans-serif;
  --mono:       'DM Mono', 'Courier New', monospace;

  --sp-xs:   8px;
  --sp-sm:  16px;
  --sp-md:  24px;
  --sp-lg:  48px;
  --sp-xl:  80px;
  --sp-2xl: 120px;

  --col-narrow: 680px;
  --col-wide:   900px;

  --safe-l: env(safe-area-inset-left,  0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

/* ── BODY ── */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Noise texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9000;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
  font-family: var(--serif);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}

code, kbd {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--paper-2);
  padding: 2px 6px;
  border: 1px solid var(--rule);
}

/* ── NAV ── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  padding: 18px clamp(20px, 5vw, 48px);
  padding-left:  calc(clamp(20px, 5vw, 48px) + var(--safe-l));
  padding-right: calc(clamp(20px, 5vw, 48px) + var(--safe-r));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-sm);
  background: rgba(250,250,247,0.93);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.site-nav.scrolled { border-bottom-color: var(--rule); }

.nav__logo {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.nav__logo span { color: var(--accent-2); }

.nav__links {
  display: flex;
  gap: clamp(16px, 3vw, 36px);
  list-style: none;
}
.nav__links a {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.2s;
  white-space: nowrap;
}
.nav__links a:hover,
.nav__links a[aria-current="page"] { color: var(--accent); }

.nav__cta {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--accent);
  border: none;
  padding: 10px 20px;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
  text-decoration: none;
  display: inline-block;
}
.nav__cta:hover { background: var(--ink); transform: translateY(-1px); }

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
  z-index: 501;
}
.nav__hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s, opacity 0.3s;
}
.nav__hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__hamburger.open span:nth-child(2) { opacity: 0; }
.nav__hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile drawer */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--paper);
  z-index: 499;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--sp-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.mobile-menu.open { opacity: 1; pointer-events: all; }
.mobile-menu a {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 8vw, 2.4rem);
  color: var(--ink);
  transition: color 0.2s;
}
.mobile-menu a:hover { color: var(--accent); }
.mobile-menu .mobile-cta {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--accent);
  padding: 14px 36px;
  margin-top: var(--sp-sm);
}

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: clamp(28px, 4vw, 48px) clamp(20px, 5vw, 48px);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-md);
}
.footer__logo { font-family: var(--serif); font-size: 1rem; color: var(--ink); }
.footer__logo span { color: var(--accent-2); }
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(16px, 3vw, 28px);
  list-style: none;
}
.footer__links a {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: color 0.2s;
}
.footer__links a:hover { color: var(--ink); }
.footer__copy { font-family: var(--mono); font-size: 0.6rem; color: var(--ink-muted); letter-spacing: 0.08em; }

/* ── UTILITIES ── */
.section-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--sp-sm);
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::after {
  content: '';
  display: block;
  height: 1px;
  width: 32px;
  background: var(--rule);
  flex-shrink: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Buttons */
.btn {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: inline-block;
  padding: clamp(12px, 2vw, 16px) clamp(20px, 3vw, 32px);
  transition: background 0.2s, transform 0.15s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.btn--primary { color: var(--paper); background: var(--accent); }
.btn--primary:hover { background: var(--ink); transform: translateY(-2px); }
.btn--ghost { color: var(--ink-soft); background: none; border: 1px solid var(--rule); }
.btn--ghost:hover { border-color: var(--ink-soft); color: var(--ink); transform: translateY(-2px); }

/* ── CUSTOM CURSOR ── */
.cursor, .cursor-ring {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
}
.cursor { width: 8px; height: 8px; background: var(--accent); mix-blend-mode: multiply; transition: transform 0.12s ease; }
.cursor-ring { width: 34px; height: 34px; border: 1px solid var(--accent); opacity: 0.35; mix-blend-mode: multiply; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--rule); }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .nav__links, .nav__cta { display: none; }
  .nav__hamburger { display: flex; }
  .cursor, .cursor-ring { display: none; }
}
@media (max-width: 600px) {
  .site-footer { flex-direction: column; text-align: center; }
  .footer__links { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media print {
  .site-nav, .cursor, .cursor-ring, body::before { display: none !important; }
}
