/* =============================================================
   TWEED TURTLE TOURS — Ocean Sky Design System
   Philosophy: Light sky-blue background (#bdf5ff), dark text, teal accents.
   Fresh, airy, and oceanic — like the surface of a calm sea.
   Fonts: Helvetica Neue (all)
   ============================================================= */

@import "tailwindcss";
@import "tw-animate-css";

@custom-variant dark (&:is(.dark *));

@theme inline {
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);

  /* Font stack — Helvetica everywhere */
  --font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-serif: 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Custom Ocean Tokens — Light Theme */
  --color-ocean-deep: oklch(0.18 0.04 230);
  --color-ocean-mid: oklch(0.30 0.06 220);
  --color-ocean-surface: oklch(0.93 0.02 200);
  --color-teal-glow: oklch(0.55 0.18 185);
  --color-teal-bright: oklch(0.48 0.20 185);
  --color-sand: oklch(0.22 0.03 230);
  --color-sand-warm: oklch(0.96 0.02 80);
  --color-coral: oklch(0.60 0.18 30);
}

:root {
  --radius: 0.5rem;
  /* Ocean Sky — light blue background with dark text */
  --background: oklch(0.93 0.060 214);
  --foreground: oklch(0.10 0.04 220);
  --card: oklch(0.959 0.025 223);
  --card-foreground: oklch(0.10 0.04 220);
  --popover: oklch(0.959 0.025 223);
  --popover-foreground: oklch(0.10 0.04 220);
  --primary: oklch(0.45 0.18 200);
  --primary-foreground: oklch(0.98 0 0);
  --secondary: oklch(0.959 0.025 223);
  --secondary-foreground: oklch(0.10 0.04 220);
  --muted: oklch(0.959 0.025 223);
  --muted-foreground: oklch(0.35 0.06 215);
  --accent: oklch(0.45 0.18 200);
  --accent-foreground: oklch(0.98 0 0);
  --destructive: oklch(0.60 0.22 25);
  --destructive-foreground: oklch(0.98 0 0);
  --border: oklch(0.10 0.04 220 / 18%);
  --input: oklch(0.10 0.04 220 / 12%);
  --ring: oklch(0.45 0.18 200);
  --chart-1: oklch(0.45 0.18 200);
  --chart-2: oklch(0.40 0.15 210);
  --chart-3: oklch(0.35 0.12 220);
  --chart-4: oklch(0.30 0.10 230);
  --chart-5: oklch(0.25 0.08 240);
  --sidebar: oklch(0.88 0.050 210);
  --sidebar-foreground: oklch(0.10 0.04 220);
  --sidebar-primary: oklch(0.45 0.18 200);
  --sidebar-primary-foreground: oklch(0.98 0 0);
  --sidebar-accent: oklch(0.959 0.025 223);
  --sidebar-accent-foreground: oklch(0.20 0.04 220);
  --sidebar-border: oklch(0.18 0.04 220 / 10%);
  --sidebar-ring: oklch(0.45 0.18 200);
}

/* Dark theme — for admin and dark-mode pages */
.dark {
  --background: oklch(0.12 0.04 230);
  --foreground: oklch(0.95 0.02 200);
  --card: oklch(0.18 0.04 230);
  --card-foreground: oklch(0.95 0.02 200);
  --popover: oklch(0.18 0.04 230);
  --popover-foreground: oklch(0.95 0.02 200);
  --primary: oklch(0.55 0.18 185);
  --primary-foreground: oklch(0.10 0.04 220);
  --secondary: oklch(0.18 0.04 230);
  --secondary-foreground: oklch(0.95 0.02 200);
  --muted: oklch(0.25 0.04 230);
  --muted-foreground: oklch(0.70 0.05 210);
  --accent: oklch(0.55 0.18 185);
  --accent-foreground: oklch(0.10 0.04 220);
  --destructive: oklch(0.65 0.20 25);
  --destructive-foreground: oklch(0.98 0 0);
  --border: oklch(0.95 0.02 200 / 15%);
  --input: oklch(0.95 0.02 200 / 10%);
  --ring: oklch(0.55 0.18 185);
  --chart-1: oklch(0.55 0.18 185);
  --chart-2: oklch(0.50 0.15 190);
  --chart-3: oklch(0.45 0.12 200);
  --chart-4: oklch(0.40 0.10 210);
  --chart-5: oklch(0.35 0.08 220);
  --sidebar: oklch(0.15 0.04 230);
  --sidebar-foreground: oklch(0.95 0.02 200);
  --sidebar-primary: oklch(0.55 0.18 185);
  --sidebar-primary-foreground: oklch(0.10 0.04 220);
  --sidebar-accent: oklch(0.25 0.04 230);
  --sidebar-accent-foreground: oklch(0.80 0.05 210);
  --sidebar-border: oklch(0.95 0.02 200 / 10%);
  --sidebar-ring: oklch(0.55 0.18 185);
}

@layer base {
  html {
    scroll-behavior: smooth;
  }
  
  * {
    @apply border-border outline-ring/50;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
  }
  
  /* Accessibility: Visible focus indicators for keyboard navigation */
  *:focus {
    outline: none;
  }
  

  
  /* Screen reader only text */
  .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;
  }
  
  /* Enhanced focus indicators for accessibility */
  button:focus-visible,
  a:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  [role="button"]:focus-visible,
  [role="link"]:focus-visible {
    outline: 3px solid oklch(0.55 0.18 185);
    outline-offset: 2px;
  }
  
  /* Ensure text has sufficient color contrast */
  body {
    color: oklch(0.10 0.04 220);
  }
  
  /* Ensure form labels are visible */
  label {
    color: oklch(0.10 0.04 220);
    font-weight: 500;
  }
  
  /* Improve readability of muted text - WCAG AA 4.5:1 against light bg */
  .text-muted-foreground {
    color: oklch(0.35 0.04 220);
  }
  body {
    @apply bg-background text-foreground;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  h1, h2, h3, h4 {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
  }
  code, pre, kbd, samp, input, textarea, select, button {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  }
  button:not(:disabled),
  [role="button"]:not([aria-disabled="true"]),
  [type="button"]:not(:disabled),
  [type="submit"]:not(:disabled),
  a[href] {
    @apply cursor-pointer;
  }
}

@layer components {
  .container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .flex {
    min-height: 0;
    min-width: 0;
  }
  @media (min-width: 640px) {
    .container {
      padding-left: 1.5rem;
      padding-right: 1.5rem;
    }
  }
  @media (min-width: 1024px) {
    .container {
      padding-left: 2rem;
      padding-right: 2rem;
      max-width: 1280px;
    }
  }

  /* Ocean Light Utilities */
  .font-display {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  }
  .font-mono-ocean {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  }
  .text-teal {
    color: oklch(0.55 0.18 185);
  }
  .text-sand {
    color: oklch(0.22 0.03 230);
  }
  .bg-ocean-deep {
    background-color: oklch(0.18 0.04 230);
  }
  .bg-ocean-mid {
    background-color: oklch(0.93 0.02 200);
  }
  .bg-ocean-surface {
    background-color: oklch(0.96 0.01 200);
  }
  .border-teal {
    border-color: oklch(0.55 0.18 185);
  }
  .glow-teal {
    box-shadow: 0 0 30px oklch(0.55 0.18 185 / 0.25);
  }
  .section-label {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: oklch(0.55 0.18 185);
  }
  .wave-divider {
    position: relative;
    overflow: hidden;
  }
  .wave-divider::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60'%3E%3Cpath fill='%23bdf5ff' d='M0,30 C360,60 1080,0 1440,30 L1440,60 L0,60 Z'/%3E%3C/svg%3E") no-repeat bottom;
    background-size: cover;
  }
  .card-ocean {
    background: oklch(0.97 0.030 210);
    border: 1px solid oklch(0.18 0.04 220 / 15%);
    transition: all 0.3s ease;
  }
  .card-ocean:hover {
    border-color: oklch(0.45 0.18 200 / 0.4);
    box-shadow: 0 8px 40px oklch(0.45 0.18 200 / 0.12);
    transform: translateY(-2px);
  }
  .btn-primary {
    background: oklch(0.55 0.18 185);
    color: oklch(0.98 0 0);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 0.75rem 2rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
  }
  .btn-primary:hover {
    background: oklch(0.48 0.20 185);
    box-shadow: 0 0 20px oklch(0.55 0.18 185 / 0.35);
    transform: translateY(-1px);
  }
  .btn-outline-teal {
    background: transparent;
    color: oklch(0.55 0.18 185);
    border: 1.5px solid oklch(0.55 0.18 185);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 500;
    letter-spacing: 0.05em;
    padding: 0.75rem 2rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    cursor: pointer;
  }
  .btn-outline-teal:hover {
    background: oklch(0.55 0.18 185 / 0.08);
    box-shadow: 0 0 15px oklch(0.55 0.18 185 / 0.15);
  }
  .animate-fade-up {
    animation: fadeUp 0.7s ease forwards;
  }
@keyframes fadeUp {
  from { opacity: 0; transform: translate3d(0, 24px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
  .animate-fade-in {
    animation: fadeIn 0.8s ease forwards;
  }
@keyframes fadeIn {
  from { opacity: 0; transform: translate3d(0, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
  .hero-overlay {
    background: linear-gradient(
      to bottom,
      oklch(0.13 0.04 240 / 0.45) 0%,
      oklch(0.13 0.04 240 / 0.18) 40%,
      oklch(0.13 0.04 240 / 0.65) 100%
    );
  }
  .noise-texture {
    position: relative;
  }
  .noise-texture::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
  }
}

/* GPU-composited bounce animation (transform-only, no layout thrashing) */
@keyframes heroChevronBounce {
  0%, 100% { transform: translate3d(-50%, 0, 0); }
  50% { transform: translate3d(-50%, 8px, 0); }
}

/* Hide scrollbar for horizontal scroll containers */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* Touch target minimum size for mobile accessibility (48x48px) */
@media (pointer: coarse) {
  button,
  [role="button"],
  a[href] {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Performance Optimizations */

/* Enable font-display: swap for faster text rendering */
@font-face {
  font-family: 'Helvetica Neue';
  font-display: swap;
}

/* Optimize images for lazy loading — exclude LCP hero image */
img[loading="lazy"] {
  content-visibility: auto;
  contain-intrinsic-size: auto 300px;
  background-color: oklch(0.93 0.02 200);
}

/* Below-fold sections: defer rendering */
section:not(:first-child) {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}

/* Optimize animations for performance */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Enable GPU acceleration for transforms - only on specific elements to avoid paint overhead */
.animate-fade-up,
.animate-fade-in {
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
}

/* GPU acceleration for scroll animations */
.parallax,
[data-parallax] {
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

/* Optimize hover states - use transform only, avoid background-color will-change */
button:hover,
[role="button"]:hover,
a:hover {
  will-change: auto;
}

/* Defer animations until user interaction */
@media (prefers-reduced-motion: no-preference) {
  .animate-fade-up {
    animation: fadeUp 0.7s ease forwards;
  }
  .animate-fade-in {
    animation: fadeIn 0.8s ease forwards;
  }
}

/* Optimize text rendering */
body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-display: swap;
}

/* Optimize button interactions */
button,
[role="button"],
a[href] {
  -webkit-tap-highlight-color: transparent;
}

/* Optimize scrolling performance */
.scrollbar-hide,
[data-scroll] {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Reduce paint operations */
.card-ocean {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Optimize video playback */
video {
  content-visibility: auto;
}

/* System font stack for faster rendering */
* {
  font-family: inherit;
}

/* Prevent layout shift on font load */
@font-face {
  font-family: 'system-ui';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local(-apple-system), local(BlinkMacSystemFont), local('Segoe UI'), local(Roboto);
}

/* Critical CSS for above-fold content */
.hero-overlay {
  contain: layout style paint;
}

/* Optimize container queries for performance */
@supports (container-type: inline-size) {
  .responsive-container {
    container-type: inline-size;
  }
}
