/* Typography System */
:root {
  /* Font Families */
  --font-display: 'Bebas Neue', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Font Weights */
  --font-light: 300;
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* Font Sizes */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */
  --text-5xl: 3rem;       /* 48px */
  
  /* Line Heights */
  --leading-tight: 1.2;
  --leading-snug: 1.3;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  
  /* Letter Spacing */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;
  
  /* Colors */
  --color-bg: #E0F4FF;
  --color-surface: #F8FBFF;
  --color-header: #E63946;         /* Red for headers/bars */
  --color-text: #1A2E4F;
  --color-muted: rgba(26, 46, 79, 0.75);
  --color-border: rgba(26, 46, 79, 0.12);
  --color-button: #FFD447;         /* Yellow for buttons */
  --color-button-hover: #E6C53F;   /* Slightly darker yellow for hover */
  --color-link: #FFD447;           /* Yellow for links to match buttons */
  --color-accent: #E63946;         /* Red for accents to match headers */
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-duration: 300ms;
}

/* Base Typography */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-wide);
  margin-top: 0;
  margin-bottom: 0.5em;
}

h1 { 
  font-size: var(--text-5xl); 
  letter-spacing: var(--tracking-wider);
}

h2 { 
  font-size: var(--text-4xl);
  letter-spacing: var(--tracking-wider);
}

h3 { 
  font-size: var(--text-3xl);
  letter-spacing: var(--tracking-wider);
}

h4 { 
  font-size: var(--text-2xl);
  letter-spacing: var(--tracking-wide);
}

h5 { 
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-normal);
}

h6 { 
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-normal);
}

/* Text Elements */
p {
  margin-top: 0;
  margin-bottom: 1rem;
  line-height: var(--leading-relaxed);
  font-size: var(--text-base);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s var(--ease-in-out);
}

a:hover {
  color: var(--color-link);
}

/* Text Utilities */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }
.text-5xl { font-size: var(--text-5xl); }

.font-light { font-weight: var(--font-light); }
.font-regular { font-weight: var(--font-regular); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

.leading-tight { line-height: var(--leading-tight); }
.leading-snug { line-height: var(--leading-snug); }
.leading-normal { line-height: var(--leading-normal); }
.leading-relaxed { line-height: var(--leading-relaxed); }

.tracking-tight { letter-spacing: var(--tracking-tight); }
.tracking-normal { letter-spacing: var(--tracking-normal); }
.tracking-wide { letter-spacing: var(--tracking-wide); }
.tracking-wider { letter-spacing: var(--tracking-wider); }
.tracking-widest { letter-spacing: var(--tracking-widest); }

/* Text Colors */
.text-work-title { color: var(--color-text); } /* Dark blue text for better contrast */
.text-white { color: var(--color-text); }
.text-yellow { color: var(--color-accent); }
.text-gray-100 { color: var(--color-text); opacity: 0.9; } /* Changed to dark blue with opacity */
.text-gray-200 { color: var(--color-text); opacity: 0.8; }
.text-gray-300 { color: var(--color-text); opacity: 0.6; }
.text-gray-400 { color: var(--color-text); opacity: 0.4; }

/* Palette utilities */
.text-primary { color: var(--color-text); }
.text-work-meta { color: var(--color-muted); }
.text-accent { color: var(--color-accent); }
.hover\:text-button:hover { color: var(--color-button); }
.bg-page { background-color: var(--color-bg); }
.bg-surface { background-color: var(--color-surface); }
.bg-header { background-color: var(--color-header); }
.bg-card { background-color: rgba(255, 255, 255, 0.85); }
.border-muted { border-color: var(--color-border); }
.ring-muted { --tw-ring-color: var(--color-border); }
.text-white\/90 { color: rgba(26, 46, 79, 0.9); }
.text-white\/80 { color: rgba(26, 46, 79, 0.8); }
.text-white\/70 { color: rgba(26, 46, 79, 0.7); }
.text-white\/60 { color: rgba(26, 46, 79, 0.6); }
.text-white\/40 { color: rgba(26, 46, 79, 0.4); }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* Text Decoration */
.underline { text-decoration: underline; }
.line-through { text-decoration: line-through; }
.no-underline { text-decoration: none; }

/* Text Transform */
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }
.normal-case { text-transform: none; }

/* Text Overflow */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive Typography */
@media (min-width: 640px) {
  :root {
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --text-3xl: 2.25rem;
    --text-4xl: 3rem;
    --text-5xl: 3.75rem;
  }
}

/* Project Specific Typography */
.project-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-wider);
  margin-bottom: 1rem;
}

.project-meta {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2rem;
}

.project-description {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
}

.section-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  letter-spacing: var(--tracking-wide);
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 2px;
  background: var(--yellow);
}

/* Credits Section */
.credits-section {
  margin-bottom: 2rem;
}

.credits-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--yellow);
  margin-bottom: 0.75rem;
}

.credits-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

.credits-list li {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  margin-bottom: 0.25rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .project-title {
    font-size: var(--text-3xl);
  }
  
  .project-meta {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  
  .section-title {
    font-size: var(--text-xl);
  }
  
  .project-description {
    font-size: var(--text-sm);
  }
}

/* Tailwind via CDN. Solo utilidades extra. */
:root {
  --yellow: var(--color-accent);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-duration: 300ms;
}

/* Custom spray-can cursor (sitewide) */
:root {
  /* Path is relative to this CSS file (assets/css/styles.css) */
  --cursor-spray: url('../cursors/spray.png') 6 2, auto;
}

html, body, a, button, [role="button"], .btn, .chip, .group, .cursor-pointer {
  cursor: var(--cursor-spray) !important;
}

/* Keep native text cursor for typing/selecting in form fields */
input, textarea, [contenteditable="true"] {
  cursor: text !important;
}

/* Base styles */
.font-display { 
  font-family: 'Bebas Neue', system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif; 
  letter-spacing: 0.025em;
}

body { 
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Header and Navigation */
header {
  transition: all 0.3s var(--ease-in-out);
}

/* Mobile Menu Styles */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: max-height 0.3s var(--ease-in-out), opacity 0.3s var(--ease-in-out), transform 0.3s var(--ease-in-out);
}

#mobile-menu.active,
#mobile-menu:not(.hidden) {
  max-height: 500px; /* Adjust based on your content */
  transform: translateY(0);
  opacity: 1;
}

/* Language Toggle */
.language-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease-in-out);
  cursor: pointer;
  border: none;
  outline: none;
  font-weight: 600;
}

.language-toggle:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Show/hide language text based on active language */
html[lang="es"] .language-toggle .es,
html[lang="en"] .language-toggle .en {
  display: inline-block;
}

html[lang="es"] .language-toggle .en,
html[lang="en"] .language-toggle .es {
  display: none;
}

/* Mobile menu transitions */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: max-height 0.3s var(--ease-in-out), opacity 0.3s var(--ease-in-out), transform 0.3s var(--ease-in-out);
}

#mobile-menu.active,
#mobile-menu:not(.hidden) {
  max-height: 500px; /* Adjust based on your content */
  opacity: 1;
  transform: translateY(0);
}

/* Backdrop for mobile menu */
.mobile-menu-backdrop {
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-in-out);
}

.mobile-menu-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid var(--color-button);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* Skip to main content link */
.skip-to-content {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 1em;
  background-color: white;
  color: black;
  opacity: 0;
}

.skip-to-content:focus {
  left: 50%;
  transform: translateX(-50%);
  opacity: 1;
}
.btn-yellow,
.btn-primary {
  background: var(--color-button);
  color: #ffffff;
  padding: 0.6rem 1rem;
  border-radius: 0.375rem;
  font-weight: 700;
  transition: background-color 0.2s var(--ease-in-out), transform 0.2s var(--ease-in-out);
}

.btn-yellow:hover,
.btn-primary:hover {
  background: var(--color-button-hover);
  transform: translateY(-1px);
}

.btn-outline {
  border: 1px solid rgba(26, 46, 79, 0.25);
  padding: 0.6rem 1rem;
  border-radius: 0.375rem;
  color: var(--color-text);
}

.chip {
  border: 1px solid rgba(26, 46, 79, 0.25);
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.6);
  color: var(--color-text);
}

.chips-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.hide-scrollbar {
  scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.chip.active,
.chip:hover {
  background: var(--color-button);
  color: #fff;
  border-color: transparent;
}

/* Graffiti accent line */
.accent-line{ height:4px; background: linear-gradient(90deg,var(--color-accent),#fff0); }

.bg-black { background-color: var(--color-bg) !important; color: var(--color-text); }
.bg-black\/90 { background-color: var(--color-header) !important; color: var(--color-text); }
.bg-black\/95 { background-color: var(--color-header) !important; color: var(--color-text); }
.bg-white\/5 { background-color: rgba(255, 255, 255, 0.7) !important; color: var(--color-text); }
.bg-white\/10 { background-color: rgba(255, 255, 255, 0.85) !important; color: var(--color-text); }
.bg-yellow-300 { background-color: var(--color-button) !important; color: var(--color-text); }
.text-white { color: var(--color-text) !important; }
.text-yellow-300 { color: var(--color-button) !important; }
.hover\:text-yellow-300:hover { color: var(--color-button) !important; }
.border-white\/10 { border-color: rgba(26, 46, 79, 0.15) !important; }
.border-white\/20 { border-color: rgba(26, 46, 79, 0.25) !important; }
.ring-white\/10 { --tw-ring-color: rgba(26, 46, 79, 0.15) !important; }
.ring-white\/20 { --tw-ring-color: rgba(26, 46, 79, 0.25) !important; }
.text-white\/80 { color: rgba(26, 46, 79, 0.8) !important; }
.text-white\/70 { color: rgba(26, 46, 79, 0.7) !important; }
.text-white\/60 { color: rgba(26, 46, 79, 0.6) !important; }
.text-white\/40 { color: rgba(26, 46, 79, 0.4) !important; }
.hover\:bg-white\/10:hover { background-color: rgba(255, 255, 255, 0.9) !important; }
.hover\:bg-white\/20:hover { background-color: rgba(255, 255, 255, 0.95) !important; }

/* Equal-height cards for grids */
#home-works .group, #works-grid .group{ height: 100%; }
.card-info{ margin-top:.75rem; display:flex; flex-direction:column; gap:.25rem; flex:1 0 auto; }
.card-title{ line-height:1.2; max-height:2.4em; overflow:hidden; color: var(--color-text); }
.card-meta{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color: var(--color-text); opacity: 0.75; }

/* Floating decor (illustration sticker) */
.floating-decor{ position: absolute; pointer-events: none; inset: auto 0 0 auto; right: 2%; bottom: -10px; z-index: 10; opacity:.9; }
.floating-decor img{ width: clamp(140px, 18vw, 260px); height: auto; filter: drop-shadow(0 6px 12px rgba(0,0,0,.35)); }
.float-anim{ animation: floatY 7s ease-in-out infinite; }
@keyframes floatY{ 0%,100%{ transform: translateY(0) rotate(0.2deg);} 50%{ transform: translateY(-10px) rotate(-0.2deg);} }
@media (max-width: 768px){ .floating-decor{ display:none; } }
@media (prefers-reduced-motion: reduce){ .float-anim{ animation: none; } }

/* Variant: left sticker */
.floating-decor.left{ left: 2%; right: auto; bottom: 40px; }
.floating-decor.left img{ width: clamp(120px, 14vw, 220px); }
.mirror{ transform: scaleX(-1); }

/* Page transition overlay */
.page-fade-overlay{ position:fixed; inset:0; background:#000; opacity:0; pointer-events:none; transition:opacity .35s ease; z-index:50; }
.page-fade-overlay.show{ opacity:1; pointer-events:auto; }
/* Simple page fade-in */
body.page-in main, body.page-in #work-video, body.page-in #home-works{ animation: pageIn .4s ease both; }
@keyframes pageIn{ from{ opacity:0; transform: translateY(6px);} to{ opacity:1; transform:none;} }

/* Hero responsive layout */
.hero-section {
  background-color: var(--color-bg);
}

.hero-grid {
  gap: clamp(1.5rem, 4vw, 3rem);
}

.hero-text p {
  font-size: 1rem;
  color: rgba(26, 46, 79, 0.85);
}

.hero-ctas a {
  font-size: 1rem;
}

.hero-video iframe {
  border-radius: 0.75rem;
}

@media (max-width: 640px) {
  .hero-grid {
    display: flex;
    flex-direction: column;
  }

  .hero-text {
    text-align: center;
  }

  .hero-text p {
    margin-inline: auto;
  }

  .hero-ctas {
    width: 100%;
  }

  .hero-ctas a {
    width: 100%;
    font-size: 1.05rem;
    padding-block: 0.9rem;
  }

  .hero-video {
    width: 100%;
    order: -1;
  }

  .hero-video iframe {
    min-height: 220px;
  }
}
