/* ==========================================================================
   Sirsinate Sound Labs
   Sounding the Depths of Perception
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette */
  --color-abyss: #050d12;
  --color-deep: #0a1a22;
  --color-teal: #0d7377;
  --color-teal-light: #20b2aa;
  --color-cyan: #5fd4d4;
  --color-glow: #7fefef;
  
  /* Text Colors */
  --color-text: rgba(255, 255, 255, 0.94);
  --color-text-muted: rgba(255, 255, 255, 0.75);
  --color-text-subtle: rgba(255, 255, 255, 0.5);
  
  /* Typography */
  --font-display: 'Cinzel', 'Times New Roman', serif;
  --font-serif: 'Source Serif 4', 'Georgia', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  
  /* Spacing Scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3.5rem;
  --space-xl: 6rem;
  --space-2xl: 10rem;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 600ms ease;
  --transition-glacial: 1200ms ease;
  
  /* Layout */
  --content-width: 38rem;
  --nav-height: 4rem;
}

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

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-serif);
  font-weight: var(--font-weight-regular);
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--color-text);
  background: var(--color-abyss);
  overflow-x: hidden;
}

::selection {
  background: var(--color-teal);
  color: white;
}

/* --------------------------------------------------------------------------
   Custom Cursor
   -------------------------------------------------------------------------- */
@media (pointer: fine) {
  /* Only show custom cursor on devices with precise pointer (not touch) */
  body {
    cursor: none;
  }
  
  a, button {
    cursor: none;
  }
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, rgba(127, 239, 239, 0.9) 0%, rgba(95, 212, 212, 0.6) 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, opacity 0.2s ease;
  opacity: 0;
  mix-blend-mode: screen;
}

.cursor.visible {
  opacity: 1;
}

.cursor.hover {
  transform: translate(-50%, -50%) scale(1.8);
  background: radial-gradient(circle, rgba(127, 239, 239, 1) 0%, rgba(95, 212, 212, 0.7) 40%, transparent 70%);
}

.cursor-trail {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  background: radial-gradient(circle, rgba(95, 212, 212, 0.15) 0%, rgba(13, 115, 119, 0.08) 40%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cursor-trail.visible {
  opacity: 1;
}

/* Hide custom cursor on touch devices */
@media (pointer: coarse) {
  .cursor,
  .cursor-trail {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Background Layer
   -------------------------------------------------------------------------- */
.background-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
  background-image: url('../assets/sirsinate-background.jpeg');
  background-size: cover;
  background-position: top left;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* --------------------------------------------------------------------------
   Seahorse Watermark
   -------------------------------------------------------------------------- */
.seahorse-watermark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  animation: seahorseFadeIn 2.5s ease forwards;
  animation-delay: 0.3s;
}

.seahorse-image {
  width: auto;
  height: 60vh;
  max-height: 550px;
  opacity: 0.07;
  filter: invert(1) brightness(1.2);
  transition: opacity var(--transition-glacial);
}

/* Fade watermark as user scrolls */
.seahorse-watermark.faded .seahorse-image {
  opacity: 0.025;
}

@keyframes seahorseFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -48%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* --------------------------------------------------------------------------
   Particle Canvas
   -------------------------------------------------------------------------- */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 0 var(--space-md);
  opacity: 0;
  transform: translateY(-0.5rem);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 13, 18, 0.7) 0%, rgba(5, 13, 18, 0.3) 70%, transparent 100%);
}

.nav.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-home {
  display: flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.nav-home:hover {
  opacity: 1;
}

.nav-seahorse {
  height: 2.75rem;
  width: auto;
  filter: invert(1) brightness(1.1);
}

.nav-spacer {
  width: 2.75rem; /* Match seahorse width */
}

.nav-list {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  list-style: none;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: var(--font-weight-regular);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-xs) var(--space-sm);
  transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Hamburger Toggle (Mobile)
   -------------------------------------------------------------------------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 101;
}

.nav-toggle-line {
  display: block;
  width: 22px;
  height: 1.5px;
  background-color: var(--color-text-muted);
  transition: transform var(--transition-base), opacity var(--transition-base), background-color var(--transition-fast);
}

.nav-toggle:hover .nav-toggle-line {
  background-color: var(--color-text);
}

/* Hamburger to X animation */
.nav-toggle.active .nav-toggle-line:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle.active .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active .nav-toggle-line:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Mobile Menu Overlay
   -------------------------------------------------------------------------- */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 13, 18, 0.97);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-list {
  list-style: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.mobile-menu-link {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: var(--font-weight-regular);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-sm);
  display: block;
  transition: color var(--transition-fast);
}

.mobile-menu-link:hover,
.mobile-menu-link:focus {
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.section-content {
  width: 100%;
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
  padding: var(--space-xl) var(--space-md);
}

/* Surface / Hero Section */
.section-surface {
  min-height: 100vh;
}

.section-surface .section-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.wordmark {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 12vw, 7rem);
  font-weight: var(--font-weight-regular);
  letter-spacing: 0.08em;
  text-indent: 0.08em; /* Offset letter-spacing for true center */
  color: var(--color-text);
  margin-bottom: 0.25rem;
  opacity: 0;
  animation: fadeInUp 1.8s ease forwards;
  animation-delay: 0.5s;
  text-shadow: 0 0 80px rgba(95, 212, 212, 0.1);
}

.wordmark-sub {
  font-family: var(--font-display);
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-weight: var(--font-weight-regular);
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  opacity: 0;
  animation: fadeInUp 1.8s ease forwards;
  animation-delay: 0.7s;
}

.tagline {
  font-family: var(--font-display);
  font-size: clamp(0.9375rem, 2.2vw, 1.1875rem);
  font-weight: var(--font-weight-regular);
  letter-spacing: 0.18em;
  text-indent: 0.18em; /* Offset letter-spacing for true center */
  text-transform: uppercase;
  color: var(--color-text-muted);
  opacity: 0;
  animation: fadeInUp 1.8s ease forwards;
  animation-delay: 1s;
}

/* Content Sections */
.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--font-weight-regular);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-cyan);
  margin-bottom: var(--space-lg);
}

.prose {
  font-size: 1.125rem;
  line-height: 1.9;
  letter-spacing: 0.01em;
}

.prose p {
  margin-bottom: var(--space-md);
  color: var(--color-text-muted);
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose em {
  font-style: italic;
  color: var(--color-text);
}

.prose a {
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-text-subtle);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.prose a:hover {
  color: var(--color-cyan);
  border-color: var(--color-cyan);
}

/* Contact Section */
.contact-email {
  margin-top: var(--space-md);
}

.contact-email a {
  font-family: var(--font-serif);
  font-size: 1.625rem;
  font-weight: var(--font-weight-light);
  letter-spacing: 0.02em;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-text-subtle);
  padding-bottom: 3px;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.contact-email a:hover {
  color: var(--color-cyan);
  border-color: var(--color-cyan);
}

.contact-location {
  font-size: 1rem;
  color: var(--color-text-subtle);
  margin-top: var(--space-sm);
  letter-spacing: 0.03em;
}

.contact-links {
  margin-top: var(--space-lg);
  font-size: 0.9375rem;
  letter-spacing: 0.03em;
}

.contact-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.contact-links a:hover {
  color: var(--color-cyan);
}

.link-separator {
  margin: 0 var(--space-sm);
  color: var(--color-text-subtle);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  position: relative;
  z-index: 1;
  padding: var(--space-lg) var(--space-md);
  text-align: center;
}

.footer p {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  color: var(--color-text-subtle);
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section content fade-in on scroll */
.section-content {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity var(--transition-glacial), transform var(--transition-glacial);
}

.section-content.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero content always visible (handled by animation) */
.section-surface .section-content {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  .wordmark,
  .tagline,
  .seahorse-watermark {
    animation: none;
    opacity: 1;
  }
  
  .section-content {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

/* Tablet */
@media (max-width: 768px) {
  :root {
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --nav-height: 3.5rem;
  }
  
  body {
    font-size: 1rem;
  }
  
  /* Fix iOS background-attachment: fixed issue */
  .background-layer {
    background-attachment: scroll;
  }
  
  /* Hide desktop nav, show hamburger */
  .nav-desktop {
    display: none;
  }
  
  .nav-toggle {
    display: flex;
  }
  
  .nav-spacer {
    display: none;
  }
  
  .nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--space-sm);
  }
  
  .nav-home {
    position: relative;
    left: auto;
  }
  
  .nav-seahorse {
    height: 1.75rem;
  }
  
  .section {
    min-height: auto;
    padding: var(--space-xl) 0;
  }
  
  .section-surface {
    min-height: 100svh;
    padding: 0;
  }
  
  .section-content {
    padding: var(--space-lg) var(--space-sm);
  }
  
  .wordmark {
    font-size: clamp(2.5rem, 14vw, 4.5rem);
    letter-spacing: 0.05em;
  }
  
  .tagline {
    font-size: 0.8125rem;
    letter-spacing: 0.14em;
    padding: 0 var(--space-sm);
  }
  
  .section-title {
    font-size: 1.25rem;
    letter-spacing: 0.1em;
  }
  
  .prose {
    font-size: 1rem;
    line-height: 1.8;
  }
  
  .contact-email a {
    font-size: 1.375rem;
  }
  
  .seahorse-watermark {
    opacity: 1;
    animation: none;
  }
  
  .seahorse-image {
    height: 40vh;
    max-height: 350px;
    opacity: 0.05;
  }
}

/* Mobile */
@media (max-width: 480px) {
  :root {
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
  }
  
  .nav {
    padding: 0 var(--space-xs);
  }
  
  .nav-seahorse {
    height: 1.5rem;
  }
  
  .wordmark {
    font-size: clamp(2rem, 15vw, 3.5rem);
    letter-spacing: 0.04em;
  }
  
  .tagline {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
  }
  
  .section-title {
    font-size: 1.125rem;
    margin-bottom: var(--space-md);
  }
  
  .prose {
    font-size: 0.9375rem;
    line-height: 1.75;
  }
  
  .prose p {
    margin-bottom: var(--space-sm);
  }
  
  .contact-email a {
    font-size: 1.125rem;
  }
  
  .contact-location {
    font-size: 0.875rem;
  }
  
  .contact-links {
    font-size: 0.8125rem;
    margin-top: var(--space-md);
  }
  
  .link-separator {
    margin: 0 var(--space-xs);
  }
  
  .seahorse-image {
    height: 35vh;
    max-height: 280px;
  }
  
  .mobile-menu-link {
    font-size: 1.125rem;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .wordmark {
    font-size: 2rem;
  }
  
  .prose {
    font-size: 0.875rem;
  }
  
  .mobile-menu-link {
    font-size: 1rem;
    letter-spacing: 0.15em;
  }
}

/* Landscape mobile - reduce section heights */
@media (max-height: 500px) and (orientation: landscape) {
  .section {
    min-height: auto;
    padding: var(--space-lg) 0;
  }
  
  .section-surface {
    min-height: 100svh;
  }
  
  .seahorse-image {
    height: 50vh;
  }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */
@media print {
  #particle-canvas,
  .nav,
  .background-layer,
  .seahorse-watermark {
    display: none;
  }
  
  .section {
    min-height: auto;
    page-break-inside: avoid;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .prose p,
  .section-title {
    color: black;
  }
}
