/**
 * styles/main.css
 * Global Resets, Base Layout Scaffolding, Typography & Accessibility
 * Northshore Gen LLC — Independent Technology Research & Design Studio
 */

/* ==========================================================================
   1. Modern CSS Reset & Box Sizing
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.5;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
  scroll-behavior: auto;
  overscroll-behavior-y: none;
}

body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 400;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Lenis Smooth Scroll Integration */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

/* ==========================================================================
   2. Typography Foundations
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

p {
  color: var(--color-text-secondary);
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease, opacity 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

ul, ol {
  list-style: none;
}

img, svg, canvas {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* Tabular Numbers */
.font-tabular {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums slashed-zero;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   3. Base Glassmorphic Components & Buttons
   ========================================================================== */
.glass-card {
  position: relative;
  background: var(--glass-bg-low);
  backdrop-filter: var(--glass-blur-md);
  -webkit-backdrop-filter: var(--glass-blur-md);
  border: 1px solid var(--glass-border-subtle);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: transform 0.35s var(--ease-spring), border-color 0.35s ease, box-shadow 0.35s ease;
}

.glass-card:hover {
  transform: translateY(-4px);
  border-color: var(--glass-border-medium);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 20px var(--color-accent-glow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  border-radius: 9999px;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.3s var(--ease-spring);
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent-emerald) 0%, var(--accent-cyan) 100%);
  color: #050b08;
  box-shadow: 0 4px 20px var(--color-accent-glow);
}

.btn--primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 28px rgba(194, 164, 118, 0.45);
}

.btn--glass {
  background: var(--glass-bg-medium);
  backdrop-filter: var(--glass-blur-md);
  -webkit-backdrop-filter: var(--glass-blur-md);
  border: 1px solid var(--glass-border-subtle);
  color: var(--text-primary);
}

.btn--glass:hover {
  background: var(--glass-bg-high);
  border-color: var(--glass-border-medium);
  transform: translateY(-2px);
}

.btn-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ==========================================================================
   4. Section & Layout Scaffolding
   ========================================================================== */
.section-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-emerald);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: var(--text-3xl);
  margin-bottom: 1rem;
}

.section-desc {
  font-size: var(--text-base);
  max-width: 640px;
}

/* ==========================================================================
   5. Focus Visible & Accessibility Enforcements
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--accent-emerald);
  outline-offset: 3px;
  box-shadow: 0 0 12px var(--color-accent-glow);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-particles-canvas {
    display: none !important;
  }
}

/* Custom Global Cursor */
body, a, button, input, textarea {
  cursor: none !important;
}

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  background-color: var(--accent-emerald, #8A6B32);
  border-radius: 50%;
  pointer-events: none;
  z-index: 999999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  transition: width 0.2s, height 0.2s, background-color 0.2s;
}

.custom-cursor.hover {
  width: 40px;
  height: 40px;
  background-color: transparent;
  border: 2px solid var(--accent-emerald, #8A6B32);
}

/* Fix for cursor inside Rivet */
.rivet-widget, .rivet-widget *, .rivet-fab, .rivet-fab * {
  cursor: auto !important;
}

/* Base Glassmorphism utility */
.glass-panel {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Ambient Fireflies */
#ambient-fireflies {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1; /* Above background, below content */
  opacity: 0.8;
}

/* Title Fireflies */
.title-fireflies {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1; /* Behind the text */
  mix-blend-mode: screen;
}

#hero-title {
  position: relative; /* Context for absolute canvas */
  text-shadow: 0 4px 32px rgba(138, 107, 50, 0.4);
}

/* Hover dark text */
.hoverable-text {
  transition: color 0.3s ease;
}
.hoverable-text:hover {
  color: #121318 !important; /* turns dark when hovered over */
}

/* Fix text turning dark on hover for glass buttons and nav links */
.btn--glass:hover, .btn--outline:hover, .btn:not(.btn--primary):hover {
  background: white;
  color: #121318 !important;
}

.nav-link:hover {
  color: var(--accent-emerald, #8A6B32) !important;
}
