/* ===================================
   BASE STYLES - Fonts, Variables, Resets (Optimized)
   =================================== */

@import url("https://fonts.cdnfonts.com/css/thegoodmonolith");

@font-face {
  src: url("https://fonts.cdnfonts.com/css/pp-neue-montreal") format("woff2");
  font-family: "PP Neue Montreal", sans-serif;
  font-weight: 400;
  font-display: swap;
}

/* CSS Variables */
:root {
  --spacing-base: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --color-text: #ffffff;
  --color-bg: #000000;
  --color-dim: #888888;
  --color-text-dim-opacity: 0.6;
  --transition-medium: 0.3s ease;
  --font-size-base: 14px;
  --font-primary: "PP Neue Montreal", sans-serif;
  --font-mono: "TheGoodMonolith", monospace;
}

/* Light Mode */
:root[data-theme="light"] {
  --color-text: #000000;
  --color-bg: #ffffff;
  --color-dim: #666666;
}

/* Global Box Sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* HTML */
html {
  overflow-x: hidden;
  width: 100%;
  height: 100%;
  background-color: #000000;
  scroll-behavior: smooth;
}

/* Body - Different overflow for index vs project pages */
body {
  font-family: var(--font-primary);
  background-color: var(--color-bg);
  color: var(--color-text);
  overflow: hidden;
  position: relative;
  transition: background-color 0.3s ease, color 0.3s ease;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ADDED: Ensure header and footer are always visible by default */
.header,
.footer {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Menu open state - NO padding or shifting */
body.menu-open {
  overflow: hidden;
}

/* Project Page Body - MUST allow scrolling and ensure black background */
.project-page {
  overflow-x: hidden;
  overflow-y: auto;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  background-color: #000000;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.project-page.menu-open {
  overflow: hidden;
}

/* Force black background for project pages in light theme */
:root[data-theme="light"] .project-page {
  background-color: #000000;
}

/* Typography */
p {
  display: block;
  text-decoration: none;
  color: var(--color-text);
  font-size: var(--font-size-base);
  font-weight: 600;
  letter-spacing: -0.01rem;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

ul {
  list-style: none;
}

h3 {
  font-size: var(--font-size-base);
  margin-bottom: var(--spacing-base);
  font-weight: 600;
  letter-spacing: -0.01rem;
  -webkit-font-smoothing: antialiased;
}

/* Links */
a {
  position: relative;
  cursor: pointer;
  color: var(--color-text);
  padding: 0;
  display: inline-block;
  z-index: 1;
  text-decoration: none;
  font-size: var(--font-size-base);
  opacity: 1;
  transition: color var(--transition-medium);
  font-weight: 700;
}

a::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background-color: var(--color-text);
  z-index: -1;
  transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

a:hover::after {
  width: 100%;
}

a:hover {
  color: black;
  opacity: 1;
}

/* Logo Container Link - Remove Link Styles */
a.logo-container {
  display: block;
  text-decoration: none;
  padding: 0;
  outline: none;
  border: none;
}

a.logo-container:focus {
  outline: none;
  border: none;
}

a.logo-container::after {
  display: none;
}

a.logo-container:hover {
  color: inherit;
  mix-blend-mode: difference;
  outline: none;
}

/* OPTIMIZED: Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Mobile Specific Overrides */
@media (max-width: 768px) {
  body:not(.project-page) {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh;
    position: static !important;
    -webkit-overflow-scrolling: touch;
  }
  
  html {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    height: auto !important;
  }
  
  /* iOS Safari specific fixes */
  body:not(.project-page).menu-open {
    position: fixed !important;
    width: 100%;
    overflow: hidden !important;
  }
}