/* ==============================================
   NON-CRITICAL CSS — Load async via styles.css
   Project cards, modals, FAQ, footer, extras
   ============================================== */

/* --- Extra font weights (below fold) --- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: optional;
  src: url('fonts/inter-v20-latin-300.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url('fonts/playfair-display-v40-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 500;
  font-display: optional;
  src: url('fonts/playfair-display-v40-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 700;
  font-display: optional;
  src: url('fonts/playfair-display-v40-latin-700.woff2') format('woff2');
}

/* --- Custom Colors (below fold) --- */
.bg-primary-dark { background-color: #1a1a2e; }
.bg-secondary-dark { background-color: #16213e; }
.text-secondary-dark { color: #16213e; }
.text-accent-gold-hover { color: #b8941f; }

/* --- Layout extras --- */
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.bottom-16 { bottom: 4rem; }
.right-6 { right: 1.5rem; }
.top-20 { top: 5rem; }
.z-10 { z-index: 10; }
.z-30 { z-index: 30; }
.z-\[100\] { z-index: 100; }

/* --- Flexbox extras --- */
.flex-wrap { flex-wrap: wrap; }
.items-baseline { align-items: baseline; }
.items-start { align-items: flex-start; }

/* --- Inline display --- */
.inline-block { display: inline-block; }
.block { display: block; }

/* --- Grid extras --- */
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* --- Sizing extras --- */
.h-1 { height: 0.25rem; }
.h-4 { height: 1rem; }
.h-8 { height: 2rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.h-48 { height: 12rem; }
.w-4 { width: 1rem; }
.w-8 { width: 2rem; }
.w-12 { width: 3rem; }
.w-14 { width: 3.5rem; }
.w-16 { width: 4rem; }
.w-24 { width: 6rem; }

/* --- Max-width extras --- */
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-lg { max-width: 32rem; }
.max-w-none { max-width: none; }
.max-h-\[90vh\] { max-height: 90vh; }

/* --- Spacing extras --- */
.m-4 { margin: 1rem; }
.mr-2 { margin-right: 0.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.pt-24 { padding-top: 6rem; }
.space-x-4 > :not(:first-child) { margin-left: 1rem; }
.space-y-4 > :not(:first-child) { margin-top: 1rem; }
.space-y-5 > :not(:first-child) { margin-top: 1.25rem; }
.space-y-8 > :not(:first-child) { margin-top: 2rem; }

/* --- Typography extras --- */
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.tracking-wide { letter-spacing: 0.025em; }
.uppercase { text-transform: uppercase; }
.text-center { text-align: center; }
.resize-none { resize: none; }

/* --- Colors extras --- */
.text-slate-100 { color: #f1f5f9; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-800 { color: #1e293b; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-red-500 { color: #ef4444; }
.text-teal-600 { color: #0d9488; }
.text-emerald-600 { color: #059669; }
.text-blue-600 { color: #2563eb; }
.text-purple-600 { color: #9333ea; }
.text-orange-600 { color: #ea580c; }
.text-pink-600 { color: #db2777; }

/* --- Background extras --- */
.bg-slate-100 { background-color: #f1f5f9; }
.bg-slate-900 { background-color: #0f172a; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-teal-100 { background-color: #ccfbf1; }
.bg-emerald-100 { background-color: #d1fae5; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-purple-100 { background-color: #f3e8ff; }
.bg-orange-100 { background-color: #ffedd5; }
.bg-pink-100 { background-color: #fce7f3; }
.bg-\[\#25D366\] { background-color: #25D366; }
.bg-black\/80 { background-color: rgb(0 0 0 / 0.8); }
.bg-accent-gold\/30 { background-color: rgb(212 175 55 / 0.3); }

/* --- Background utilities --- */
.bg-cover { background-size: cover; }
.bg-center { background-position: center; }
.bg-no-repeat { background-repeat: no-repeat; }
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops)); }
.bg-gradient-to-b { background-image: linear-gradient(to bottom, var(--tw-gradient-stops)); }

/* --- Borders extras --- */
.border-slate-300 { border-color: #cbd5e1; }
.border-slate-800 { border-color: #1e293b; }
.border-gray-200 { border-color: #e5e7eb; }
.border-teal-100 { border-color: #ccfbf1; }
.border-emerald-100 { border-color: #d1fae5; }
.border-blue-100 { border-color: #dbeafe; }
.border-purple-100 { border-color: #f3e8ff; }
.border-orange-100 { border-color: #ffedd5; }
.border-pink-100 { border-color: #fce7f3; }
.rounded { border-radius: 0.25rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* --- Shadow extras --- */
.shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }

/* --- Overflow extras --- */
.overflow-y-auto { overflow-y: auto; }

/* --- Opacity --- */
.opacity-0 { opacity: 0; }
.opacity-80 { opacity: 0.8; }
.opacity-90 { opacity: 0.9; }

/* --- Cursor --- */
.cursor-pointer { cursor: pointer; }

/* --- Transitions extras --- */
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-500 { transition-duration: 500ms; }

/* --- Backdrop --- */
.backdrop-blur-sm { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

/* --- Gradient from-stops --- */
.from-gray-50 { --tw-gradient-from: #f9fafb; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-teal-50 { --tw-gradient-from: #f0fdfa; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-emerald-50 { --tw-gradient-from: #ecfdf5; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-blue-50 { --tw-gradient-from: #eff6ff; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-purple-50 { --tw-gradient-from: #faf5ff; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-orange-50 { --tw-gradient-from: #fff7ed; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-pink-50 { --tw-gradient-from: #fdf2f8; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-blue-500 { --tw-gradient-from: #3b82f6; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-emerald-500 { --tw-gradient-from: #10b981; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-teal-500 { --tw-gradient-from: #14b8a6; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-purple-500 { --tw-gradient-from: #a855f7; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-orange-500 { --tw-gradient-from: #f97316; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.from-slate-900 { --tw-gradient-from: #0f172a; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }

/* --- Gradient to-stops --- */
.to-emerald-500 { --tw-gradient-to: #10b981; }
.to-indigo-500 { --tw-gradient-to: #6366f1; }
.to-teal-500 { --tw-gradient-to: #14b8a6; }
.to-pink-500 { --tw-gradient-to: #ec4899; }
.to-red-500 { --tw-gradient-to: #ef4444; }
.to-slate-800 { --tw-gradient-to: #1e293b; }

/* --- Focus states (forms) --- */
.focus\:ring-2:focus { --tw-ring-offset-shadow: 0 0 0 0px #fff; --tw-ring-shadow: 0 0 0 2px var(--tw-ring-color); box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), 0 0 #0000; }
.focus\:ring-accent-gold:focus { --tw-ring-color: #d4af37; }
.focus\:border-accent-gold:focus { border-color: #d4af37; }
.focus\:border-teal-500:focus { border-color: #14b8a6; }
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:bg-white:focus { background-color: #fff; }

/* --- Hover states (below fold) --- */
@media (hover: hover) {
  .hover\:bg-accent-gold:hover { background-color: #d4af37; }
  .hover\:shadow-xl:hover { box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); }
  .hover\:bg-\[\#128C7E\]:hover { background-color: #128C7E; }
  .hover\:bg-accent-gold\/20:hover { background-color: rgb(212 175 55 / 0.2); }
  .hover\:border-accent-gold:hover { border-color: #d4af37; }
  .hover\:border-accent-gold\/30:hover { border-color: rgb(212 175 55 / 0.3); }
  .hover\:text-slate-900:hover { color: #0f172a; }
  .hover\:scale-110:hover { transform: scale(1.1); }
  .hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); }
  .group:hover .group-hover\:scale-110 { transform: scale(1.1); }
}

/* --- Responsive: sm extras --- */
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- Responsive: md extras --- */
@media (min-width: 768px) {
  .md\:p-8 { padding: 2rem; }
  .md\:py-24 { padding-top: 6rem; padding-bottom: 6rem; }
  .md\:space-y-8 > :not(:first-child) { margin-top: 2rem; }
  .md\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
  .md\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
  .md\:text-5xl { font-size: 3rem; line-height: 1; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:flex-row { flex-direction: row; }
}

/* --- Responsive: lg extras --- */
@media (min-width: 1024px) {
  .lg\:text-5xl { font-size: 3rem; line-height: 1; }
  .lg\:text-6xl { font-size: 3.75rem; line-height: 1; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

/* --- Responsive: xl extras --- */
@media (min-width: 1280px) {
  .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* --- Prose (footer SEO section) --- */
.prose { line-height: 1.75; }
.prose p { margin-top: 1.25em; margin-bottom: 1.25em; }
.prose-gray { color: #374151; }

/* === PERFORMANCE: Below-fold rendering optimization === */
section:not(#home) {
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}

/* --- Lazy load projects --- */
.projects-grid > .project-hidden {
  display: none;
}
#loadMoreSentinel {
  height: 1px;
  width: 100%;
}
#loadMoreBtn {
  display: none;
}
#loadMoreBtn.visible {
  display: inline-flex;
}