@font-face {
  font-family: "Sunday Notes";
  src: url("images/Sunday-Notes/Sunday Notes Regular.ttf") format("truetype"),
    url("images/Sunday-Notes/Sunday Notes Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sunday Notes";
  src: url("images/Sunday-Notes/Sunday Notes Italic.ttf") format("truetype"),
    url("images/Sunday-Notes/Sunday Notes Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #e9f1e7;
  --ink: #151515;
  --muted: #5a5a5a;
  --chalk: #f1f1f1;
  --accent: #111111;
  --stroke: rgba(0, 0, 0, 0.12);
  --card: #ffffff;
  --radius: 20px;
  --max: 1100px;
  --font-hand: "Sunday Notes", "Kalam", "Caveat", "Bradley Hand", cursive;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  line-height: 1.5;
}

/* Global offset for anchor links to account for the sticky header */
section[id],
div[id] {
  scroll-margin-top: 110px;
  /* Header height (approx 100px) + some breathing room */
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.noise {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 8px 6vw;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}

.logo img {
  height: 84px;
  width: auto;
}

.menu {
  display: flex;
  gap: 18px;
  justify-content: center;
  font-family: "Sora", "IBM Plex Sans", sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
}

.menu a {
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-family: "Sora", "IBM Plex Sans", sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
}

.btn-small {
  padding: 10px 16px;
  font-size: 11px;
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 32px;
  padding: clamp(12px, 2.2vw, 28px) 6vw 64px;
}

.hero-media {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2.2vw, 28px);
  min-height: min(86vh, 860px);
  overflow: hidden;
  background: var(--bg);
}

.hero-image {
  margin: 0;
  position: relative;
  overflow: hidden;
}

.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.1));
  pointer-events: none;
  z-index: 1;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.1) contrast(1.05);
  animation: hero-breathe 8s ease-in-out infinite alternate;
  /* Faster breathe as requested */
}

@keyframes hero-breathe {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(1.1);
  }
}

.hero-copy {
  max-width: var(--max);
  margin: -120px auto 0;
  padding: 40px 24px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05), 0 30px 60px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 2;
  /* Premium reveal animation triggered by JS */
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.2s cubic-bezier(0.19, 1, 0.22, 1), transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.hero-copy.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.eyebrow {
  font-family: "Sora", "IBM Plex Sans", sans-serif;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 11px;
  margin: 0 0 10px;
  opacity: 0;
  transition: opacity 1s ease-out 0.3s;
}

.hero-copy.is-visible .eyebrow {
  opacity: 1;
}

.hero h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(32px, 5.5vw, 66px);
  /* Slightly refined max size */
  font-weight: 800;
  /* Dropped from 900 to feel less 'heavy' */
  letter-spacing: -0.02em;
  /* Relaxed slightly for better balance */
  line-height: 1;
  margin: 0 0 22px;
  opacity: 0;
  transition: opacity 1s ease-out 0.5s;
}

.hero-copy.is-visible h1 {
  opacity: 1;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  opacity: 0;
  transition: opacity 1s ease-out 0.7s;
}

.hero-copy.is-visible .hero-actions {
  opacity: 1;
}

.mission {
  background: #111111;
  /* Deep charcoal */
  color: #fff;
  padding: clamp(40px, 8vw, 80px) 24px;
  position: relative;
  overflow: hidden;
}

.mission::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.3'/%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}

.mission-inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

#mission-title {
  font-family: "Rock Salt", cursive;
  font-size: clamp(32px, 6vw, 48px);
  margin-bottom: 0.8em;
  color: #fff;
  text-align: center;
  opacity: 0.75;
}

.mission-manifest {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
  align-items: center;
  /* Centers the spans horizontally */
  justify-content: center;
  width: 100%;
  margin: 0 auto;
}

.mission-manifest span {
  font-family: "Rock Salt", cursive;
  font-size: clamp(20px, 3.2vw, 38px);
  line-height: 1.3;
  text-align: center;
  display: inline-block;
  /* Changed to inline-block for better fit-content behavior */
  width: fit-content;
  opacity: 0.75;
  /* Uniform soft opacity for eye comfort */
  white-space: nowrap;
  transition: opacity 0.4s ease;
  color: #fff;
}

.mission-manifest:hover span {
  opacity: 0.9;
  /* Subtle focus when hovering */
}

.mission-manifest span strong {
  font-weight: normal;
  /* Remove visual highlight but keep semantics */
  color: inherit;
  opacity: 1;
  text-shadow: none;
  /* Remove the "blurry" glow */
}

/* Subtle organic character */
.mission-manifest span:nth-child(odd) {
  transform: rotate(-0.2deg) translateX(-2px);
}

.mission-manifest span:nth-child(even) {
  transform: rotate(0.2deg) translateX(2px);
}

.bridge {
  padding: 0;
  /* Let section-inner handle padding */
  text-align: left;
}

.bridge .section-inner {
  padding-bottom: 0;
  /* Tighten connection to next section */
}

.bridge h2 {
  font-family: "Fraunces", serif;
  font-weight: 800;
  font-size: clamp(24px, 3.5vw, 36px);
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 820px;
  line-height: 1.25;
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px 6vw;
}

.section-inner h2 {
  font-family: "Fraunces", serif;
  font-weight: 800;
  font-size: clamp(32px, 4.5vw, 48px);
  letter-spacing: -0.02em;
  /* Harmonized */
  line-height: 1.1;
  margin: 0 0 24px;
}

.what .section-inner {
  padding-top: 24px;
  /* Small gap for breath but connected */
}

.lead {
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.6;
  max-width: 820px;
  opacity: 0.9;
}

.planes .cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 32px);
  border: 1px solid var(--stroke);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.1);
  border-color: rgba(214, 43, 43, 0.2);
}

.card-dot {
  width: 12px;
  height: 12px;
  background: #d62b2b;
  border-radius: 50%;
  margin-bottom: 8px;
  box-shadow: 0 0 10px rgba(214, 43, 43, 0.3);
}

.card h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.card p {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
}

.talleres {
  background: var(--bg);
  /* Match site background for consistency */
}

.talleres-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-top: 48px;
}

@media (min-width: 992px) {
  .talleres-grid {
    grid-template-columns: repeat(2, 1fr);
    align-items: start;
  }
}

.taller-item {
  display: grid;
  gap: 16px;
  /* Centered by default, but let's allow it to stretch in grid */
}

.taller-head {
  display: grid;
  gap: 8px;
  width: 100%;
}

@media (min-width: 992px) {
  .taller-head {
    min-height: 140px;
    /* Enough for 3 lines + title to keep cards aligned */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
}

.taller-card {
  position: relative;
  background: url('images/chalkboard_bg.png') center/cover no-repeat;
  border-radius: 24px;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  min-height: 480px;
  /* Airier height */
  cursor: pointer;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  opacity: 0;
  transform: translateY(20px) translateZ(0);
  mask-image: radial-gradient(white, black);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  /* Fix for Safari border-radius bleed */
}

.taller-card.is-visible {
  opacity: 1;
  transform: translateY(0) translateZ(0);
}

.taller-card:hover {
  transform: translateY(-8px) translateZ(0);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.2);
}

.taller-card::before {
  display: none;
  /* Removed the double frame hack */
}

.taller-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, transparent 40%, rgba(0, 0, 0, 0.6) 100%);
  z-index: 1;
}

.taller-title {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(24px, 3.5vw, 38px);
  letter-spacing: -0.02em;
  /* Harmonized */
  font-weight: 800;
  /* Dropped to match hero */
  line-height: 1;
  margin-bottom: 0.1em;
}

.taller-tag {
  font-family: "Sora", "IBM Plex Sans", sans-serif;
  font-size: clamp(12px, 1.4vw, 15px);
  /* Reduced tag size */
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
}

/* Remove old stage/icon system as the button now holds everything */
/* The stage and icon classes are no longer used since the button is the graphic itself */
.taller-stage,
.taller-icon {
  display: none;
}

.taller-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: screen;
  /* Chalk on red */
  filter: brightness(1.2) contrast(1.1);
  transition: transform 0.6s ease;
}

.taller-card:hover .taller-icon {
  transform: scale(1.05);
}

.dot-button {
  position: relative;
  width: 280px;
  /* Larger as it's the main artistic piece */
  height: 280px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border: none;
  background-color: transparent;
  cursor: pointer;
  z-index: 10;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.5));
  text-indent: -9999px;
  /* Hide text */
}

/* Specific button images */
.card-encorazonarte .dot-button {
  background-image: url('images/PNG/encorazonarte.png');
}

.card-enclave .dot-button {
  background-image: url('images/PNG/enclave.png');
}

.card-entre-lineas .dot-button {
  background-image: url('images/PNG/entrelineas.png');
}

.card-iurguei .dot-button {
  background-image: url('images/PNG/iurguei engranatge.png');
}

.card-fabulosamente .dot-button {
  background-image: url('images/PNG/fabulosamente foc.png');
}

.dot-button:hover {
  transform: scale(1.08) rotate(2deg);
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.6));
}

.dot-button:active {
  transform: scale(0.94);
  transition: transform 0.1s ease;
}

.dot-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 6px;
}

.taller-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: 10px;
  left: 10px;
  background: rgba(249, 248, 245, 0.98);
  padding: 40px;
  box-shadow: none;
  /* No shadow when closed to avoid bleed */
  transform: translateX(105%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.4s ease, visibility 0.4s, box-shadow 0.4s;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  z-index: 20;
  border-radius: 14px;
  /* Mathematically nested: 24px (outer) - 10px (offset) = 14px */
}

.taller-panel p {
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.5;
  margin: 0;
  width: 100%;
  max-width: 80%;
  /* Targeted width for a neat central block */
  text-align: left;
  /* Changed from center to left as requested */
  color: #222;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
  word-break: break-word;
}

/* Hide the red button when the card is open to avoid clutter and overlap */
.taller-card.is-open .dot-button {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.taller-card.is-open .taller-panel {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.contacts {
  background: #fff;
}

.studio-intro {
  margin-bottom: 48px;
  max-width: 800px;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.contact-card {
  padding: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: #fafafa;
  transition: all 0.4s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-card:hover {
  transform: translateY(-4px);
  background: #fff;
  border-color: rgba(214, 43, 43, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.contact-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 8px;
  background: #eee;
  border: 2px solid var(--stroke);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.contact-card:hover .contact-avatar {
  transform: scale(1.05) rotate(2deg);
  border-color: rgba(214, 43, 43, 0.4);
}

.contact-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-role {
  font-family: "Sora", sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #d62b2b;
  font-weight: 600;
}

.contact-card h3 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: "Inter", sans-serif;
  font-size: 17px;
  opacity: 0.8;
}

.contact-info a {
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-info a:hover {
  color: #d62b2b;
}

.contact-cta {
  margin-top: 12px;
  font-family: "Sora", sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 700;
  color: var(--muted);
}

.site-footer {
  padding: 32px 6vw 48px;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.footer-inner {
  display: grid;
  gap: 12px;
  justify-items: center;
}

@media (max-width: 860px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    padding: 8px 4vw;
  }

  .menu {
    display: none;
  }

  .logo img {
    height: 64px;
  }

  .hero-copy {
    margin-top: -60px;
  }
}

@media (max-width: 720px) {
  .hero-media {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-copy {
    margin-top: 0;
  }

  .dot-button {
    width: 220px;
    height: 220px;
  }

  .taller-card {
    min-height: 400px;
    padding: 24px;
  }
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--ink);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-4px);
  background: #d62b2b;
}

@media (max-width: 600px) {
  .mission {
    /* Reduced padding to let text breathe */
    padding: 60px 8px !important;
  }

  .mission-inner {
    width: 100% !important;
    padding: 0 !important;
  }

  .mission-manifest {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 0;
  }

  .mission-manifest span {
    white-space: normal !important;
    font-size: 14px !important;
    line-height: 1.6;
    width: 100% !important;
    max-width: 100% !important;
    text-align: center;
    display: block !important;
    transform: none !important;
    box-sizing: border-box;
    /* Removed internal padding to maximize width */
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}