@tailwind base;
@tailwind components;
@tailwind utilities;

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap');

:root {
  /* Bella Italia Color Palette */
  --color-ivory: #FAF6F1;
  --color-green: #9BAF8F;
  --color-green-light: #D4E0D0;
  --color-terracotta: #C46A54;
  --color-terracotta-light: #E8A090;
  --color-black: #1E1E1E;
  --color-gold: #C2A878;
  --color-gray: #6B6B6B;
  --color-lavender: #E8E0F0;
  --color-skeleton: #E8E4DF;
  
  /* Typography */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-mono: 'Space Mono', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Fluid Scaling - Base values */
  --scale-factor: 1;
  --container-max: 1600px;
  --nav-height: 4rem;
}

/* Responsive Root Scaling for Large Screens */
html {
  font-size: 16px;
}

/* 2K / QHD Screens (2560px+) */
@media (min-width: 2560px) {
  :root {
    --scale-factor: 1.25;
    --container-max: 2000px;
    --nav-height: 5rem;
  }
  html {
    font-size: 20px;
  }
}

/* 4K UHD Screens (3840px+) */
@media (min-width: 3840px) {
  :root {
    --scale-factor: 1.5;
    --container-max: 2800px;
    --nav-height: 6rem;
  }
  html {
    font-size: 24px;
  }
}

/* ================================================
   FLUID TYPOGRAPHY & SPACING UTILITIES
   ================================================ */

/* Fluid Headings */
.fluid-h1 {
  font-size: clamp(2rem, 4vw + 1rem, 6rem);
  line-height: 1.1;
}

.fluid-h2 {
  font-size: clamp(1.5rem, 2.5vw + 0.5rem, 4rem);
  line-height: 1.2;
}

.fluid-h3 {
  font-size: clamp(1.25rem, 1.5vw + 0.5rem, 2.5rem);
  line-height: 1.3;
}

.fluid-h4 {
  font-size: clamp(1rem, 1vw + 0.5rem, 1.75rem);
  line-height: 1.4;
}

/* Fluid Body Text */
.fluid-body {
  font-size: clamp(0.875rem, 0.5vw + 0.6rem, 1.25rem);
  line-height: 1.6;
}

.fluid-body-lg {
  font-size: clamp(1rem, 0.7vw + 0.6rem, 1.5rem);
  line-height: 1.6;
}

.fluid-small {
  font-size: clamp(0.75rem, 0.4vw + 0.5rem, 1rem);
  line-height: 1.5;
}

.fluid-xs {
  font-size: clamp(0.65rem, 0.3vw + 0.4rem, 0.875rem);
  line-height: 1.4;
}

/* Fluid Spacing */
.fluid-p-section {
  padding: clamp(1rem, 2vw, 3rem);
}

.fluid-p-card {
  padding: clamp(1.5rem, 2.5vw, 4rem);
}

.fluid-gap {
  gap: clamp(1rem, 1.5vw, 2.5rem);
}

.fluid-gap-lg {
  gap: clamp(1.5rem, 2vw, 4rem);
}

/* Fluid Container */
.fluid-container {
  max-width: var(--container-max, 1600px);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 3vw, 3rem);
  padding-right: clamp(1rem, 3vw, 3rem);
}

/* Fluid Border Radius */
.fluid-rounded {
  border-radius: clamp(1rem, 1.5vw, 2.5rem);
}

.fluid-rounded-lg {
  border-radius: clamp(1.5rem, 2vw, 3.5rem);
}

/* Fluid Icons/Doodles */
.fluid-icon-sm {
  width: clamp(1rem, 1vw, 2rem);
  height: clamp(1rem, 1vw, 2rem);
}

.fluid-icon-md {
  width: clamp(1.5rem, 1.5vw, 3rem);
  height: clamp(1.5rem, 1.5vw, 3rem);
}

.fluid-icon-lg {
  width: clamp(2rem, 2vw, 4rem);
  height: clamp(2rem, 2vw, 4rem);
}

.fluid-doodle {
  width: clamp(1.5rem, 1.5vw + 0.5rem, 4rem);
  height: clamp(1.5rem, 1.5vw + 0.5rem, 4rem);
}

/* ================================================ */

/* Skeleton Shimmer Animation */
@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* Floating Doodle Animation for Timeline */
@keyframes floatDoodle {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-6px) rotate(3deg);
  }
  50% {
    transform: translateY(-3px) rotate(-2deg);
  }
  75% {
    transform: translateY(-8px) rotate(2deg);
  }
}

@keyframes floatDoodleAlt {
  0%, 100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  33% {
    transform: translateY(-5px) rotate(-4deg) scale(1.05);
  }
  66% {
    transform: translateY(-8px) rotate(3deg) scale(0.98);
  }
}

.timeline-doodle:nth-child(odd) {
  animation-name: floatDoodle !important;
}

.timeline-doodle:nth-child(even) {
  animation-name: floatDoodleAlt !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--color-ivory);
  color: var(--color-black);
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-ivory);
}

::-webkit-scrollbar-thumb {
  background: var(--color-terracotta);
  border-radius: 4px;
}

::selection {
  background-color: var(--color-terracotta);
  color: var(--color-ivory);
}

/* Typography */
.font-serif { font-family: var(--font-serif); }
.font-mono { font-family: var(--font-mono); }
.font-sans { font-family: var(--font-sans); }

/* Section Window Style - Edge to Edge */
.section-window {
  height: 100vh;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

.window-content {
  width: 100%;
  height: calc(100vh - 1.5rem);
  border-radius: 1.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Mobile-responsive viewport fixes - Allows content to expand beyond viewport */
@media (max-width: 768px) {
  .section-window {
    min-height: 100vh;
    height: auto;
    padding: 0.5rem;
    align-items: flex-start;
  }
  
  .window-content {
    min-height: calc(100vh - 1rem);
    height: auto;
    border-radius: 1rem;
    /* Keep overflow hidden to maintain border-radius effect */
    overflow: hidden;
  }
}

/* Section that adapts to content - for Methodology */
.section-window-adaptive {
  min-height: 100vh;
  height: auto;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

.section-window-adaptive .window-content {
  width: 100%;
  min-height: calc(100vh - 1.5rem);
  height: auto;
  border-radius: 1.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .section-window-adaptive {
    padding: 0.5rem;
    align-items: flex-start;
  }
  
  .section-window-adaptive .window-content {
    min-height: calc(100vh - 1rem);
    border-radius: 1rem;
  }
}

/* Scroll container without snap */
.scroll-container {
  height: 100vh;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* Legacy snap classes - disabled */
.snap-section {
  /* scroll-snap removed for better navigation */
}

/* Floating circles */
.floating-circle {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-style: italic;
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

/* Marquee */
.marquee-container {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
}

.marquee-track {
  display: inline-flex;
  animation: marquee 40s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Hand SVG Animation */
.hand-container {
  position: relative;
}

.hand-svg {
  transform-origin: bottom center;
}

/* Stacked Testimonial Cards */
.testimonial-stack {
  position: relative;
  height: 450px;
  width: 100%;
  max-width: 650px;
  margin: 0 auto;
}

.testimonial-card-stacked {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: white;
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transform-origin: center center;
  backface-visibility: hidden;
}

@media (max-width: 768px) {
  .testimonial-stack {
    height: 420px;
  }
  .testimonial-card-stacked {
    padding: 1.5rem;
  }
}

/* Video placeholder */
.video-placeholder {
  background: linear-gradient(135deg, var(--color-black) 0%, #2a2a2a 100%);
  border-radius: 1rem;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.video-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.3) 100%);
}

/* Nav Pill - Scales with root font-size */
.nav-pill {
  background: white;
  border-radius: 50px;
  padding: clamp(0.75rem, 0.5vw + 0.5rem, 1.25rem) clamp(1.5rem, 1vw + 1rem, 3rem);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  gap: clamp(1rem, 1vw + 0.5rem, 2rem);
}

/* Large screen nav-pill adjustments */
@media (min-width: 2560px) {
  .nav-pill {
    border-radius: 60px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.12);
  }
}

@media (min-width: 3840px) {
  .nav-pill {
    border-radius: 80px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  }
}

/* Typewriter cursor */
.typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--color-terracotta);
  margin-left: 4px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Button styles */
.btn-editorial {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 2px solid currentColor;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-editorial:hover {
  background: var(--color-black);
  color: var(--color-ivory);
  border-color: var(--color-black);
}

.btn-filled {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--color-black);
  color: var(--color-ivory);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-filled:hover {
  background: var(--color-terracotta);
}

/* Accessibility - Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.sr-only:focus,
.sr-only:active {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Focus Visible Styles */
.focus-visible:focus-visible {
  outline: 2px solid var(--color-green);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@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;
  }
}

@layer base {
  :root {
    --background: 40 33% 97%;
    --foreground: 0 0% 12%;
    --primary: 12 50% 55%;
    --primary-foreground: 40 33% 97%;
    --secondary: 85 18% 62%;
    --secondary-foreground: 0 0% 12%;
    --muted: 30 20% 90%;
    --muted-foreground: 0 0% 42%;
    --border: 30 15% 85%;
    --ring: 12 50% 55%;
    --radius: 0.5rem;
  }
}
