/* Myco Motion - Base Styles
   2026 Best Practices: CSS Custom Properties, Container Queries, Scroll Animations
*/

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
  /* Brand Colors - Extracted from logo */
  --color-cream: #F2E2C9;
  --color-cream-light: #F8F2E8;
  --color-cream-dark: #E5D4BC;
  --color-brown: #8B7355;
  --color-brown-dark: #5C4A3A;
  --color-brown-deeper: #3D2E24;
  --color-forest: #2D4739;
  --color-moss: #4A5D4A;
  --color-amber: #D4A574;
  --color-charcoal: #1a1a1a;
  --color-black: #0a0a0a;
  --color-white: #ffffff;

  /* Typography - System fonts (similar to Inter/Sora) */
  --font-heading: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Fluid Typography - clamp(min, preferred, max) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.825rem + 0.25vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.75rem);
  --text-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2.25rem);
  --text-3xl: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
  --text-4xl: clamp(2.5rem, 1.75rem + 3.75vw, 5rem);
  --text-display: clamp(3rem, 2rem + 5vw, 7rem);

  /* Fluid Spacing - Brand standard: balanced, professional spacing */
  --space-3xs: clamp(0.125rem, 0.1rem + 0.15vw, 0.25rem);
  --space-2xs: clamp(0.25rem, 0.2rem + 0.2vw, 0.375rem);
  --space-xs: clamp(0.5rem, 0.4rem + 0.25vw, 0.625rem);
  --space-sm: clamp(0.75rem, 0.6rem + 0.4vw, 1rem);
  --space-md: clamp(1rem, 0.85rem + 0.5vw, 1.25rem);
  --space-lg: clamp(1.25rem, 1rem + 0.75vw, 1.5rem);
  --space-xl: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  --space-2xl: clamp(2rem, 1.75rem + 1.5vw, 3rem);
  --space-3xl: clamp(3rem, 2.5rem + 2.5vw, 5rem);

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);
  --duration-fast: 150ms;
  --duration-base: 300ms;
  --duration-slow: 500ms;
  --duration-slower: 800ms;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(92, 74, 58, 0.05);
  --shadow-md: 0 4px 12px rgba(92, 74, 58, 0.08);
  --shadow-lg: 0 8px 30px rgba(92, 74, 58, 0.12);
  --shadow-xl: 0 20px 50px rgba(92, 74, 58, 0.15);
  --shadow-glow: 0 0 40px rgba(212, 165, 116, 0.3);

  /* Layout */
  --container-max: 1400px;
  --container-content: 900px;
  --container-narrow: 680px;
  --header-height: 80px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  background-color: var(--color-cream);
  color: var(--color-brown-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

/* ============================================
   Accessibility
   ============================================ */
@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;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--color-brown);
  outline-offset: 3px;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-brown-deeper);
}

.text-display {
  font-size: var(--text-display);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.text-label {
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-brown);
}

.text-body-lg {
  font-size: var(--text-lg);
  line-height: 1.7;
}

.slogan {
  font-family: var(--font-body);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--color-brown);
}

/* ============================================
   Layout Utilities
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.container--content {
  max-width: var(--container-content);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.flow > * + * {
  margin-block-start: var(--flow-space, 1em);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.03em;
  border-radius: var(--radius-full);
  transition: all var(--duration-base) var(--ease-out-quart);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.btn:hover::before {
  opacity: 0.1;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--color-brown-dark);
  color: var(--color-cream);
}

.btn--primary:hover {
  background: var(--color-brown-deeper);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn--secondary {
  background: transparent;
  color: var(--color-brown-dark);
  border: 1.5px solid var(--color-brown);
}

.btn--secondary:hover {
  background: var(--color-brown-dark);
  color: var(--color-cream);
  border-color: var(--color-brown-dark);
}

.btn--ghost {
  background: transparent;
  color: var(--color-brown-dark);
  padding: var(--space-xs) var(--space-sm);
}

.btn--ghost:hover {
  color: var(--color-brown-deeper);
}

.btn--icon {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* ============================================
   Form Elements
   ============================================ */
.form-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-base);
  background: var(--color-cream-light);
  border: 2px solid var(--color-cream-dark);
  border-radius: var(--radius-full);
  transition: all var(--duration-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-brown);
  background: var(--color-white);
  box-shadow: 0 0 0 4px rgba(139, 115, 85, 0.1);
}

.form-input::placeholder {
  color: var(--color-brown);
  opacity: 0.5;
}

.form-inline {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

@media (min-width: 480px) {
  .form-inline {
    flex-direction: row;
  }
  .form-inline .form-input {
    flex: 1;
  }
}

/* ============================================
   Cards & Surfaces
   ============================================ */
.card {
  background: var(--color-cream-light);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  transition: all var(--duration-base) var(--ease-out-quart);
}

.card--elevated {
  box-shadow: var(--shadow-md);
}

.card--elevated:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card--glass {
  background: rgba(248, 242, 232, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(229, 212, 188, 0.5);
}

/* ============================================
   Video Components
   ============================================ */
.video-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.video-container--hero {
  aspect-ratio: 16/9;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(61, 46, 36, 0.1) 50%,
    rgba(61, 46, 36, 0.4) 100%
  );
  pointer-events: none;
}

.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(60px, 10vw, 100px);
  height: clamp(60px, 10vw, 100px);
  background: var(--color-cream);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-base) var(--ease-out-quart);
  box-shadow: var(--shadow-xl);
}

.video-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: var(--shadow-glow);
}

.video-play-btn svg {
  width: 40%;
  height: 40%;
  margin-left: 5%;
  color: var(--color-brown-dark);
}

/* ============================================
   Hero Video Autoplay Fixes
   Hide native controls and play button overlays
   ============================================ */
/* Hide all native video controls */
.hero__video-bg video,
.hero__video video,
.showcase__video video,
.story__image video {
  /* Remove default controls */
  pointer-events: none;
}

/* Hide webkit/Chrome play button overlay */
.hero__video-bg video::-webkit-media-controls,
.hero__video video::-webkit-media-controls,
.showcase__video video::-webkit-media-controls,
.story__image video::-webkit-media-controls {
  display: none !important;
  -webkit-appearance: none;
}

.hero__video-bg video::-webkit-media-controls-panel,
.hero__video video::-webkit-media-controls-panel,
.showcase__video video::-webkit-media-controls-panel,
.story__image video::-webkit-media-controls-panel {
  display: none !important;
  -webkit-appearance: none;
}

.hero__video-bg video::-webkit-media-controls-play-button,
.hero__video video::-webkit-media-controls-play-button,
.showcase__video video::-webkit-media-controls-play-button,
.story__image video::-webkit-media-controls-play-button {
  display: none !important;
  -webkit-appearance: none;
}

.hero__video-bg video::-webkit-media-controls-start-playback-button,
.hero__video video::-webkit-media-controls-start-playback-button,
.showcase__video video::-webkit-media-controls-start-playback-button,
.story__image video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}

/* Hide Firefox controls */
.hero__video-bg video::-moz-media-controls,
.hero__video video::-moz-media-controls,
.showcase__video video::-moz-media-controls,
.story__image video::-moz-media-controls {
  display: none !important;
}

/* Ensure video fills container and hides any overlays during load */
.hero__video-bg video,
.hero__video video {
  background-color: var(--color-cream);
}

/* ============================================
   Hero Video Loading State
   Hide video until it starts playing to prevent
   showing browser's default play button
   ============================================ */
/* Hide video by default until it's ready */
.hero__video-bg video,
.hero__video video {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

/* Show video only when it has the video-ready class */
.hero__video-bg video.video-ready,
.hero__video video.video-ready {
  opacity: 1;
}

/* Show poster image as background on video containers while loading */
.hero__video-bg {
  background: url('../assets/video-poster.jpg') center/cover no-repeat;
  background-color: var(--color-cream);
}

.hero__video {
  background: url('../assets/video-poster.jpg') center/cover no-repeat;
  background-color: var(--color-cream);
}

/* Hero play button - shown when autoplay fails */
.hero__play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-brown, #4a3728);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__play-btn svg {
  width: 32px;
  height: 32px;
  margin-left: 4px; /* Optical centering for play icon */
}

.hero__play-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: #fff;
}

/* Show play button when autoplay failed */
.hero__video-bg.autoplay-failed .hero__play-btn,
.hero__video.autoplay-failed .hero__play-btn {
  opacity: 1;
  visibility: visible;
}

/* Hide play button when video is playing */
.hero__video-bg.video-playing .hero__play-btn,
.hero__video.video-playing .hero__play-btn {
  opacity: 0;
  visibility: hidden;
}

/* ============================================
   Social Links
   ============================================ */
.social-links {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--color-cream-light);
  border: 1.5px solid var(--color-cream-dark);
  border-radius: var(--radius-full);
  color: var(--color-brown-dark);
  transition: all var(--duration-base) var(--ease-out-quart);
}

.social-link:hover {
  background: var(--color-brown-dark);
  border-color: var(--color-brown-dark);
  color: var(--color-cream);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.social-link svg {
  width: 22px;
  height: 22px;
}

/* ============================================
   Design Switcher
   ============================================ */
.design-switcher {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: var(--space-3xs);
  padding: var(--space-3xs);
  background: var(--color-brown-deeper);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xl);
}

.design-switcher__label {
  padding-inline: var(--space-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-cream);
  opacity: 0.7;
}

.design-switcher__btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-cream);
  background: transparent;
  border-radius: var(--radius-full);
  transition: all var(--duration-fast);
}

.design-switcher__btn:hover {
  background: rgba(242, 226, 201, 0.15);
}

.design-switcher__btn.active {
  background: var(--color-cream);
  color: var(--color-brown-deeper);
}

/* ============================================
   Scroll Animations
   Only animate elements below the fold - hero content should always be visible
   ============================================ */

/*
 * Scroll Animations - DISABLED FOR DEBUGGING
 * All content always visible
 */

/* Everything visible by default - animations disabled */
[data-animate],
[data-animate-stagger],
[data-animate-stagger] > * {
  opacity: 1 !important;
  transform: none !important;
}

/* Scroll-driven animations (2026 feature) */
@supports (animation-timeline: scroll()) {
  .parallax-slow {
    animation: parallax-up linear;
    animation-timeline: scroll();
    animation-range: 0% 100%;
  }

  @keyframes parallax-up {
    from { transform: translateY(50px); }
    to { transform: translateY(-50px); }
  }
}

/* ============================================
   Sections
   ============================================ */
.section {
  padding-block: var(--space-3xl);
}

.section--compact {
  padding-block: var(--space-2xl);
}

.section__header {
  text-align: center;
  margin-block-end: var(--space-2xl);
}

.section__label {
  display: block;
  margin-block-end: var(--space-sm);
}

.section__title {
  font-size: var(--text-3xl);
}

.section__subtitle {
  margin-block-start: var(--space-sm);
  font-size: var(--text-lg);
  color: var(--color-brown);
  max-width: 600px;
  margin-inline: auto;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  padding-block: var(--space-xl);
  border-top: 1px solid var(--color-cream-dark);
}

.footer__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

.footer__logo {
  height: 60px;
  opacity: 0.8;
}

.footer__contact a {
  color: var(--color-brown-dark);
  font-weight: 500;
  transition: color var(--duration-fast);
}

.footer__contact a:hover {
  color: var(--color-brown-deeper);
}

.footer__copyright {
  font-size: var(--text-sm);
  color: var(--color-brown);
}

@media (min-width: 768px) {
  .footer__content {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* ============================================
   Loading States
   ============================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-cream-dark) 25%,
    var(--color-cream-light) 50%,
    var(--color-cream-dark) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
