/* ═══════════════════════════════════
   GOOGLE FONTS
   ═══════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&family=Playfair+Display:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Space+Mono:wght@400&display=swap');

/* ═══════════════════════════════════
   TYPOGRAPHY SYSTEM
   ═══════════════════════════════════ */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
  --font-mono: 'Space Mono', 'Menlo', monospace;

  /* Typographic scale — minor third (1.2) */
  --text-xs:   0.694rem;   /* ~11px */
  --text-sm:   0.833rem;   /* ~13px */
  --text-base: 1rem;       /* 16px  */
  --text-lg:   1.125rem;   /* 18px  */
  --text-xl:   1.35rem;    /* ~22px */
  --text-2xl:  1.62rem;    /* ~26px */
  --text-3xl:  2.074rem;   /* ~33px */
  --text-4xl:  2.8rem;     /* ~45px */
  --text-5xl:  3.6rem;     /* ~58px */
  --text-6xl:  4.5rem;     /* ~72px */
  --text-hero: clamp(2.8rem, 6vw, 5.5rem);
}

/* Base body */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: #111;
}

/* Headings */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #111;
}

h1 { font-size: var(--text-3xl); margin-bottom: 1.5rem; }
h2 { font-size: var(--text-xl); margin-bottom: 1.25rem; }
h3 { font-size: var(--text-lg); }

/* Body text refinement */
p {
  font-size: var(--text-base);
  line-height: 1.85;
  color: #444;
  max-width: 65ch; /* optimal reading width */
}

/* Small / meta text */
small, .text-meta {
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 400;
  color: #888;
}

/* Label-style text (used in contact, project meta) */
.text-label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #999;
}

/* Mono accent (dates, codes, system references) */
.text-mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
}

/* Pull quote / large accent */
.pull-quote {
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: 300;
  font-size: var(--text-xl);
  line-height: 1.55;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #222;
}

/* Link styles */
a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.3s ease;
}
a:hover {
  opacity: 0.7;
}

/* Selection color */
::selection {
  background: rgba(17, 17, 17, 0.08);
  color: #111;
}

/* ─── Scroll‑reveal animations ─── */
.fade-up, .fade-in, .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible, .fade-up.is-visible, .fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════
   MODERN NAVBAR
   ═══════════════════════════════════ */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 2rem;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.5s ease, box-shadow 0.5s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  background: transparent;
}

/* Glassmorphism on scroll */
.site-header.scrolled {
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06), 0 4px 24px rgba(0,0,0,0.05);
}

/* Hide on scroll down, show on scroll up */
.site-header.nav-hidden {
  transform: translateY(-100%);
}

/* Logo */
.site-header .logo {
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  color: #111;
  text-decoration: none;
  opacity: 0;
  animation: navFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
  transition: opacity 0.3s;
}
.site-header .logo:hover {
  opacity: 0.6;
}

/* Nav links */
.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  position: relative;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #111;
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
  padding-bottom: 2px;
  transition: color 0.3s, opacity 0.3s;
}

/* Staggered entrance for nav links */
.nav-links a:nth-child(1) { animation: navFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards; }
.nav-links a:nth-child(2) { animation: navFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards; }
.nav-links a:nth-child(3) { animation: navFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards; }
.nav-links a:nth-child(4) { animation: navFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards; }
.nav-links a:nth-child(5) { animation: navFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.55s forwards; }

@keyframes navFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 0.85; transform: translateY(0); }
}

/* Animated underline */
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 1px;
  background: #111;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
  left: 0;
}
.nav-links a:hover,
.nav-links a.active {
  opacity: 1 !important;
}

/* ─── Mobile hamburger ─── */
.hamburger {
  display: none;
  cursor: pointer;
  width: 28px;
  height: 20px;
  position: relative;
  z-index: 110;
  background: none;
  border: none;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: #111;
  position: absolute;
  left: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s, top 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger span:nth-child(3) { top: 100%; transform: translateY(-100%); }

/* Open state */
.hamburger.open span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { top: 50%; transform: translateY(-50%) rotate(-45deg); }

/* ─── Hero Dark Mode (White Text) ─── */
.site-header.hero-dark:not(.scrolled) .logo,
.site-header.hero-dark:not(.scrolled) .nav-links a {
  color: rgba(255, 255, 255, 0.9);
}
.site-header.hero-dark:not(.scrolled) .nav-links a::after {
  background: rgba(255, 255, 255, 0.9);
}
.site-header.hero-dark:not(.scrolled) .hamburger:not(.open) span {
  background: rgba(255, 255, 255, 0.9);
}

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(250, 250, 250, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu a {
  font-family: inherit;
  font-size: 1.5rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #111;
  text-decoration: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s;
}
.mobile-menu.open a {
  opacity: 1;
  transform: translateY(0);
}
.mobile-menu.open a:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.open a:nth-child(2) { transition-delay: 0.18s; }
.mobile-menu.open a:nth-child(3) { transition-delay: 0.26s; }
.mobile-menu.open a:nth-child(4) { transition-delay: 0.34s; }
.mobile-menu.open a:nth-child(5) { transition-delay: 0.42s; }
.mobile-menu a:hover { opacity: 0.5; }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
  .site-header { padding: 0 1.25rem; }
}

/* ─── Hover scale for images ─── */
.hover-scale {
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1), filter 0.7s ease;
}
.hover-scale:hover {
  transform: scale(1.03);
  filter: brightness(1.05);
}

/* ─── Gradient overlay ─── */
.gradient-to-t {
  background: linear-gradient(to top, #fafafa, transparent);
}

/* ─── Divider ─── */
.bg-divider { background: rgba(17, 17, 17, 0.1); }
.border-divider { border-color: rgba(17, 17, 17, 0.1); }

/* ═══════════════════════════════════
   PREMIUM LIGHTBOX MODAL
   ═══════════════════════════════════ */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 12, 12, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 2.5rem;
}

.gallery-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1400px;
  height: 100%;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 768px) {
  .lightbox-content {
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
  }
}

.lightbox-info {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transform: translateY(20px);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
  .lightbox-info {
    flex: 0 0 25%;
    transform: translateX(-20px);
  }
}

.gallery-lightbox.active .lightbox-info {
  opacity: 1;
  transform: translate(0);
  transition-delay: 0.2s;
}

.lightbox-info h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.lightbox-info p {
  font-size: 0.85rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.6);
  white-space: pre-wrap;
}

.lightbox-image-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-image-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: scale(0.97);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  background-color: #f4f3ef;
}

.gallery-lightbox.active .lightbox-image-wrapper img {
  transform: scale(1);
  opacity: 1;
  transition-delay: 0.1s;
}

/* Highlight cursor for grid images */
.tab-content img {
  cursor: zoom-in;
  background-color: #f4f3ef;
}
