/* ========================================
   NEVER NOT EATING — Styles
   ======================================== */

/* ---------- Custom Fonts ---------- */
@font-face {
  font-family: 'Optician Sans';
  src: url('../fonts/optician-sans.woff2') format('woff2'),
       url('../fonts/optician-sans.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

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

:root {
  /* Colors - WCAG AA compliant */
  --bg: #fefefe;
  --text: #1a1a1a;
  --text-light: #666666;
  --text-muted: #757575;
  --accent: #1a1a1a;
  --overlay: rgba(254, 254, 254, 0.98);

  /* Typography */
  --font-logo: 'Caveat', cursive;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 300ms;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* ---------- Landing Page ---------- */
.landing {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ---------- Orbital Navigation ---------- */
.orbital-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: 1200px;
}

/* ---------- Logo ---------- */
.logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-user-select: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.logo-image {
  width: 100%;
  max-width: clamp(105px, 13vw, 150px);
  height: auto;
  display: block;
  transform-origin: center center;
  transition: transform 400ms var(--ease-out);
  animation: logo-breathe 8s ease-in-out infinite;
}

@keyframes logo-breathe {
  0%, 100% {
    transform: scale(1) rotate(-0.5deg);
  }
  25% {
    transform: scale(1.01) rotate(-0.8deg);
  }
  50% {
    transform: scale(1.015) rotate(0deg);
  }
  75% {
    transform: scale(1.008) rotate(-0.6deg);
  }
}

.logo:hover .logo-image {
  transform: scale(1.02) rotate(-0.3deg);
  animation-play-state: paused;
}

/* ---------- Orbital Items (Splash Effect Positioning) ---------- */
.orbital-item {
  position: absolute;
  top: 50%;
  left: 50%;

  /* Dynamic positioning via JS custom properties */
  --orbit-x: 0px;
  --orbit-y: 0px;
  --orbit-rotate: 0deg;
  --float-duration: 12s;
  --float-delay: 0s;
  --float-distance: 6px;
  --pulse-scale: 0.03;
  --splash-opacity: 1;
  --float-angle: 0rad;
  --depth-layer: 1;

  transform:
    translate(-50%, -50%)
    translate(var(--orbit-x), var(--orbit-y))
    rotate(var(--orbit-rotate));

  font-family: 'Optician Sans', var(--font-body);
  font-size: 1.1rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs) var(--space-sm);
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
  opacity: var(--splash-opacity);
  transition:
    opacity 400ms var(--ease-out),
    transform 400ms var(--ease-out);
  z-index: calc(2 + var(--depth-layer));

  /* Liquid float animation - organic, slow, hypnotic */
  animation:
    liquid-float var(--float-duration) ease-in-out infinite,
    droplet-pulse calc(var(--float-duration) * 0.7) ease-in-out infinite;
  animation-delay: var(--float-delay), calc(var(--float-delay) * 0.5);

  /* Subtle will-change for GPU optimization */
  will-change: transform, opacity;
}

/* --- LIQUID FLOAT ANIMATION ---
   Simulates floating in liquid - slow, organic, multi-directional
   Like droplets suspended in honey or olive oil */
@keyframes liquid-float {
  0% {
    transform:
      translate(-50%, -50%)
      translate(var(--orbit-x), var(--orbit-y))
      rotate(var(--orbit-rotate))
      translate(0, 0);
  }
  20% {
    transform:
      translate(-50%, -50%)
      translate(var(--orbit-x), var(--orbit-y))
      rotate(calc(var(--orbit-rotate) + 0.8deg))
      translate(
        calc(var(--float-distance) * 0.6),
        calc(var(--float-distance) * -0.8)
      );
  }
  40% {
    transform:
      translate(-50%, -50%)
      translate(var(--orbit-x), var(--orbit-y))
      rotate(calc(var(--orbit-rotate) - 0.5deg))
      translate(
        calc(var(--float-distance) * -0.4),
        calc(var(--float-distance) * -0.3)
      );
  }
  60% {
    transform:
      translate(-50%, -50%)
      translate(var(--orbit-x), var(--orbit-y))
      rotate(calc(var(--orbit-rotate) + 0.3deg))
      translate(
        calc(var(--float-distance) * -0.7),
        calc(var(--float-distance) * 0.5)
      );
  }
  80% {
    transform:
      translate(-50%, -50%)
      translate(var(--orbit-x), var(--orbit-y))
      rotate(calc(var(--orbit-rotate) - 0.6deg))
      translate(
        calc(var(--float-distance) * 0.3),
        calc(var(--float-distance) * 0.7)
      );
  }
  100% {
    transform:
      translate(-50%, -50%)
      translate(var(--orbit-x), var(--orbit-y))
      rotate(var(--orbit-rotate))
      translate(0, 0);
  }
}

/* --- DROPLET PULSE ANIMATION ---
   Subtle breathing effect like liquid surface tension */
@keyframes droplet-pulse {
  0%, 100% {
    opacity: var(--splash-opacity);
    filter: blur(0);
  }
  50% {
    opacity: calc(var(--splash-opacity) - 0.05);
    filter: blur(0.2px);
  }
}

/* --- HOVER STATES ---
   On hover, elements "float up" like bubbles rising */
.orbital-item:hover {
  opacity: 0.7;
  transform:
    translate(-50%, -50%)
    translate(var(--orbit-x), var(--orbit-y))
    rotate(var(--orbit-rotate))
    translateY(-3px)
    scale(1.02);
  animation-play-state: paused;
}

.orbital-item:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 6px;
}

/* ---------- Project Logos (Medium Droplets) ---------- */
.project-logo {
  width: clamp(70px, 9vw, 100px);
  height: clamp(70px, 9vw, 100px);
  object-fit: contain;
  transition: transform 400ms var(--ease-out);
}

.orbital-item--project {
  /* Medium droplets have slightly different timing */
  --float-duration: 14s;
}

.orbital-item:hover .project-logo {
  transform: scale(1.08) rotate(-1deg);
}

/* Colher logo slightly larger - bigger droplet */
.orbital-item--colher .project-logo {
  width: clamp(80px, 10vw, 115px);
  height: clamp(80px, 10vw, 115px);
}

/* El Japa - organic tilt */
.orbital-item--japa .project-logo {
  transition: transform 500ms var(--ease-out);
}

.orbital-item--japa:hover .project-logo {
  transform: scale(1.1) rotate(2deg);
}

/* ---------- Location Text ---------- */
.location-text {
  font-family: var(--font-logo);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 700;
  line-height: 1;
}

/* ---------- Video (Heavy Droplet) ---------- */
.orbital-item--video {
  padding: 0;
  cursor: default;
  /* Heavy droplets move slower, more majestic */
  --float-duration: 20s;
  --float-distance: 10px;
}

.video-wrapper {
  width: clamp(120px, 14vw, 180px);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  position: relative;
  /* Organic shadow - like a droplet casting shadow */
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.08),
    0 8px 40px rgba(0, 0, 0, 0.04);
  /* Slight border radius for organic feel */
  border-radius: 3px;
  transition: box-shadow 400ms var(--ease-out);
}

.orbital-item--video:hover .video-wrapper {
  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.1),
    0 12px 48px rgba(0, 0, 0, 0.06);
}

.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  pointer-events: none;
}

/* ---------- Photo ---------- */
.orbital-item--photo {
  padding: 0;
  cursor: default;
}

.photo-wrapper {
  width: clamp(100px, 12vw, 150px);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
}

.photo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms var(--ease-out);
}

.orbital-item--photo:hover .photo-wrapper img {
  transform: scale(1.05);
}

/* ---------- Icon Styles (Light Droplets) ---------- */
.orbital-item svg {
  width: 24px;
  height: 24px;
  transition: transform 400ms var(--ease-out);
}

.orbital-item:hover svg {
  transform: scale(1.12) rotate(-3deg);
}

/* Instagram icon - tiny dancing droplet */
.orbital-item--instagram {
  --float-duration: 11s;
  --float-distance: 5px;
}

/* Email icon - slightly calmer */
.orbital-item--email {
  --float-duration: 13s;
  --float-distance: 4px;
}

/* Text buttons (about, services) - small mist particles */
.orbital-item--about,
.orbital-item--services {
  --float-duration: 12s;
  --float-distance: 4px;
  /* Subtle text shadow for depth */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.orbital-item--about:hover,
.orbital-item--services:hover {
  letter-spacing: 0.15em;
}

/* ---------- Nave Logo (Medium Droplet) ---------- */
.nave-logo {
  width: clamp(55px, 7vw, 80px);
  height: clamp(55px, 7vw, 80px);
  object-fit: contain;
  /* Cross-browser image rendering */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  transition: transform 400ms var(--ease-out);
}

.orbital-item--nave {
  --float-duration: 15s;
  --float-distance: 5px;
}

.orbital-item:hover .nave-logo {
  transform: scale(1.1) rotate(-2deg);
}

/* ---------- Modals ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--duration) var(--ease-out),
    visibility var(--duration);
}

.modal[hidden] {
  display: none;
}

.modal.is-active {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.modal-content {
  position: relative;
  max-width: 500px;
  width: 100%;
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  transform: translateY(20px) scale(0.98);
  transition: transform var(--duration) var(--ease-out);
  /* Thinner Arial Narrow for modal text */
  font-family: 'Optician Sans', var(--font-body);
  font-weight: 200;
}


.modal.is-active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  opacity: 0.7;
  transition: opacity var(--duration);
}

.modal-close:hover,
.modal-close:focus-visible {
  opacity: 1;
}

.modal-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: lowercase;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.modal-text {
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 200;
  line-height: 1.9;
  letter-spacing: 0.03em;
  color: var(--text);
}

.services-list {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
}

.modal-location {
  margin-top: var(--space-md);
  font-size: 0.875rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Projects Modal ---------- */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.project-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md);
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
  transition:
    border-color 400ms var(--ease-out),
    transform 400ms var(--ease-out);
}

.project-item:hover,
.project-item:focus-visible {
  border-color: var(--text);
  transform: translateX(8px);
}

.project-name {
  font-family: var(--font-logo);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
}

.project-tag {
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: lowercase;
  color: var(--text-muted);
}

/* ---------- Contact Modal ---------- */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.contact-label {
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: lowercase;
  color: var(--text-muted);
}

.contact-value {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
}

.contact-link {
  text-decoration: none;
  color: var(--text);
  transition: opacity var(--duration);
}

.contact-link:hover {
  opacity: 0.6;
}

.contact-button {
  display: inline-block;
  padding: var(--space-sm) var(--space-md);
  min-height: 44px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  text-decoration: none;
  color: var(--bg);
  background: var(--text);
  border: 1px solid var(--text);
  border-radius: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    transform 400ms var(--ease-out),
    color 400ms var(--ease-out);
  z-index: 1;
}

.contact-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg);
  transform: translateY(100%);
  transition: transform 450ms var(--ease-out);
  z-index: -1;
}

.contact-button:hover,
.contact-button:focus-visible {
  color: var(--text);
  transform: translateY(-3px);
}

.contact-button:hover::before,
.contact-button:focus-visible::before {
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .landing {
    padding: var(--space-sm);
  }

  /* Logo maior em mobile - mais proeminente */
  .logo-image {
    max-width: clamp(90px, 22vw, 128px);
  }

  .orbital-item {
    font-size: 0.85rem;
    padding: var(--space-xs);
    /* Slightly faster animations on mobile for responsiveness */
    --float-duration: 10s;
    --float-distance: 4px;
  }

  /* Logos dos projetos menores em mobile para dar mais espaco */
  .project-logo {
    width: clamp(45px, 10vw, 60px);
    height: clamp(45px, 10vw, 60px);
  }

  .nave-logo {
    width: clamp(40px, 9vw, 55px);
    height: clamp(40px, 9vw, 55px);
  }

  /* Heavy droplets slightly smaller movement on mobile */
  .orbital-item--video {
    --float-duration: 16s;
    --float-distance: 6px;
  }

  .video-wrapper {
    width: clamp(85px, 18vw, 120px);
  }

  .project-item:hover,
  .project-item:focus-visible {
    transform: translateX(4px);
  }
}

@media (max-width: 480px) {
  .modal-content {
    padding: var(--space-md) var(--space-sm);
  }

  .contact-info {
    gap: var(--space-sm);
  }

  .modal-label {
    margin-bottom: var(--space-sm);
  }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 6px;
}

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

/* ---------- Print Styles ---------- */
@media print {
  .orbital-item,
  .modal {
    display: none;
  }

  .landing {
    padding: 2cm;
  }
}
