/* ========================================
   LOAFPICKLE WORLDWIDE — Global Design System
   "Brutal Precision" Foundation
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,700;1,900&family=Space+Grotesk:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;700&family=Inter:wght@400;600&display=swap');

:root {
  /* -- Colors: The High-Definition Palette -- */
  --bg-primary:    #0A0D0A;
  --bg-layer-2:    #0E110E;
  --accent-brine:  #D4FF00; /* Acid Brine */
  --accent-crust:  #F5F5E9; /* Parchment House */
  --text-primary:  var(--accent-crust);
  --text-dim:      rgba(245, 245, 233, 0.5);
  
  /* -- Glow Tokens -- */
  --glow-brine:    rgba(212, 255, 0, 0.4);
  --glow-brine-sm: rgba(212, 255, 0, 0.15);

  /* -- Borders & Structure -- */
  --border-subtle: 1px solid rgba(212, 255, 0, 0.08);
  --border-main:   1px solid rgba(212, 255, 0, 0.15);
  --border-strong: 1px solid var(--accent-brine);
  
  /* -- Units (Strict 8px Grid) -- */
  --unit:          8px;
  --container-w:   1160px;
  --reading-w:     760px;
  
  /* -- Easing -- */
  --ease-in-out:   cubic-bezier(0.645, 0.045, 0.355, 1);
  --ease-out:      cubic-bezier(0.19, 1, 0.22, 1);
  --trans-med:     400ms var(--ease-out);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

::selection {
  background: var(--accent-brine);
  color: var(--bg-primary);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-primary);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- Grain + Scanline Overlay ---- */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.grain-overlay::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.025) 2px,
    rgba(0, 0, 0, 0.025) 4px
  );
  z-index: 9999;
}

/* ---- Typography Hierarchy ---- */
h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -0.04em;
}

.serif {
  font-family: 'Playfair Display', serif;
  text-transform: none;
  letter-spacing: normal;
  font-style: italic;
  font-weight: 900;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

/* ---- Section Titles: Diamond Accent ---- */
.section-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '◆';
  display: block;
  text-align: center;
  font-size: 0.45rem;
  color: var(--accent-brine);
  margin-top: calc(var(--unit) * 2);
  letter-spacing: 1.2em;
  opacity: 0.5;
}

/* ---- Structural Foundations ---- */
.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 calc(var(--unit) * 4);
}

.container-narrative {
  max-width: var(--reading-w);
  margin: 0 auto;
}

section {
  padding: calc(var(--unit) * 16) 0;
  border-bottom: var(--border-subtle);
  position: relative;
}

/* ---- Navigation: Zero Slop ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 13, 10, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: var(--border-main);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: calc(var(--unit) * 10);
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 calc(var(--unit) * 4);
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--text-primary);
  letter-spacing: -0.05em;
  transition: color var(--trans-med);
}

.nav-logo:hover {
  color: var(--accent-brine);
}

.nav-links {
  display: flex;
  gap: calc(var(--unit) * 4);
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  transition: color var(--trans-med);
  position: relative;
  padding-bottom: 4px;
}

/* Animated underline on hover */
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent-brine);
  transition: width 300ms var(--ease-out);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Pulsing dot on active link */
.nav-links a.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-brine);
  box-shadow: 0 0 6px var(--glow-brine);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--glow-brine); }
  50%      { opacity: 0.4; box-shadow: 0 0 2px var(--glow-brine-sm); }
}

.nav-links a:hover, .nav-links a.active {
  color: var(--accent-brine);
}

/* ---- Animation Reveals (richer) ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.985);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.delay-1 { transition-delay: 120ms; }
.delay-2 { transition-delay: 240ms; }
.delay-3 { transition-delay: 360ms; }

/* ---- Ambient Glow (reusable hero hotspot) ---- */
.ambient-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 255, 0, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: drift 12s ease-in-out infinite alternate;
}

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -20px) scale(1.1); }
}

/* ---- Utilities ---- */
.text-center { text-align: center; }
.text-brine  { color: var(--accent-brine); }
.text-dim    { color: var(--text-dim); }
.mb-1 { margin-bottom: var(--unit); }
.mb-2 { margin-bottom: calc(var(--unit) * 2); }
.mb-4 { margin-bottom: calc(var(--unit) * 4); }
.mb-6 { margin-bottom: calc(var(--unit) * 6); }
.mt-2 { margin-top: calc(var(--unit) * 2); }
.mt-4 { margin-top: calc(var(--unit) * 4); }

/* ---- Footer (shared across pages) ---- */
footer {
  padding: calc(var(--unit) * 10) 0;
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-brine), transparent);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: calc(var(--unit) * 6);
  border-bottom: var(--border-subtle);
  margin-bottom: calc(var(--unit) * 4);
}

.footer-nav {
  display: flex;
  gap: calc(var(--unit) * 12);
}

.footer-nav-group {
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 1);
}

.footer-nav-group a {
  text-decoration: none;
  font-size: 0.8rem;
  color: var(--text-dim);
  transition: color var(--trans-med), padding-left 300ms var(--ease-out);
}

.footer-nav-group a:hover {
  color: var(--accent-brine);
  padding-left: 4px;
}

.footer-base {
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* ---- Mobile Nav Toggle ---- */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(212, 255, 0, 0.15);
  padding: calc(var(--unit) * 1) calc(var(--unit) * 1.25);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  transition: border-color var(--trans-med);
}

.nav-toggle:hover {
  border-color: var(--accent-brine);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--accent-brine);
  transition: all 300ms var(--ease-out);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  :root { --unit: 6px; }
  
  .nav-links { 
    display: none; 
    position: absolute;
    top: calc(var(--unit) * 10);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-primary);
    padding: calc(var(--unit) * 4);
    border-bottom: var(--border-main);
    gap: calc(var(--unit) * 4);
    z-index: 1000;
  }

  .nav-links.open {
    display: flex;
    animation: slide-down 400ms var(--ease-out) forwards;
  }

  @keyframes slide-down {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .nav-toggle { display: flex; }

  /* Hamburger to X Animation */
  .nav-toggle.active span:nth-child(1) {
    transform: translateY(5.5px) rotate(45deg);
  }
  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle.active span:nth-child(3) {
    transform: translateY(-5.5px) rotate(-45deg);
  }

  .footer-grid { flex-direction: column; gap: calc(var(--unit) * 6); }
  .footer-nav { 
    width: 100%;
    justify-content: space-between;
    gap: calc(var(--unit) * 4); 
  }
  .ambient-glow { width: 300px; height: 300px; }
}
