/* ============================================
   Arte Inicial — Hand-drawn studio theme
============================================ */

:root {
  --bg: #f5efe3;
  --paper: #fbf6e9;
  --paper-alt: #f0e9d8;
  --ink: #1a1512;
  --ink-soft: #4a4038;
  --ink-muted: #8a7d6e;
  --accent: #c8381f;     /* tinta roja */
  --accent-2: #1f4fc8;   /* lápiz azul */
  --accent-3: #d9a441;   /* ocre */
  --line: rgba(26,21,18,0.15);
  --line-strong: rgba(26,21,18,0.4);
  --shadow: rgba(60,45,30,0.12);
  --radius: 3px;
  --ease: cubic-bezier(0.25, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg: #14110d;
  --paper: #1c1814;
  --paper-alt: #23201a;
  --ink: #f0e8d8;
  --ink-soft: #cabfae;
  --ink-muted: #7a6f60;
  --accent: #ff6a4a;
  --accent-2: #6a9cff;
  --accent-3: #e8b858;
  --line: rgba(240,232,216,0.14);
  --line-strong: rgba(240,232,216,0.4);
  --shadow: rgba(0,0,0,0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Fraunces', 'Playfair Display', Georgia, serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-weight: 400;
  font-size: 17px;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
  /* paper texture */
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,0.015) 0, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.02) 0, transparent 40%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.hand { font-family: 'Caveat', 'Kalam', 'Shadows Into Light', cursive; font-weight: 500; }
.serif-it { font-style: italic; }

img, svg { display: block; max-width: 100%; }
img { image-rendering: auto; -ms-interpolation-mode: bicubic; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ============================================
   NAV
============================================ */

.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Caveat', cursive;
  font-size: 30px; font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1;
  transform: rotate(-2deg);
}
.logo-mark {
  display: inline-block; width: 34px; height: 34px;
  background: var(--accent); color: var(--paper);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 18px;
  transform: rotate(5deg);
  font-style: italic;
}
.logo-mark-img {
  display: block; width: 34px; height: 34px;
  object-fit: contain;
}

.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links > li { list-style: none; position: relative; }
.nav-links a, .nav-links > li > button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  font-family: 'Fraunces', serif;
  font-size: 15px; font-weight: 500;
  color: var(--ink-soft);
  border: 1px solid transparent; background: transparent;
  border-radius: 20px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover, .nav-links > li > button:hover { color: var(--ink); background: var(--paper-alt); }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 4px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8' preserveAspectRatio='none'><path d='M2,5 Q25,1 50,4 T98,3' stroke='%23c8381f' stroke-width='2' fill='none' stroke-linecap='round'/></svg>");
  background-size: 100% 100%; background-repeat: no-repeat;
  pointer-events: none;
}

.dropdown-panel {
  position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  min-width: 220px;
  box-shadow: 0 14px 40px var(--shadow);
  display: none;
  flex-direction: column;
  transform: rotate(-0.4deg);
}
.dropdown-panel.open { display: flex; }
.dropdown-panel a {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 15px;
  color: var(--ink-soft);
  display: flex; align-items: center; gap: 10px;
  transition: background 0.15s, color 0.15s;
}
.dropdown-panel a:hover { background: var(--paper-alt); color: var(--ink); }
.dropdown-panel a .swatch {
  width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line-strong);
}
.dropdown-panel a .sw-color { background: linear-gradient(135deg, #c8381f, #d9a441, #1f4fc8); }
.dropdown-panel a .sw-grey { background: #888; }
.dropdown-panel a .sw-bw { background: linear-gradient(90deg, #111 50%, #fff 50%); }
.dropdown-panel a .sw-ai { background: conic-gradient(from 0deg, #b33, #39c, #d9a441, #b33); }
.dropdown-panel a .sw-all { background: repeating-linear-gradient(45deg, var(--ink) 0 2px, transparent 2px 4px); }

.nav-tools { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink); cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.icon-btn:hover { background: var(--paper-alt); transform: rotate(-8deg); }
.icon-btn svg { width: 16px; height: 16px; }

.lang-switch { position: relative; }
.lang-btn {
  padding: 8px 14px; border-radius: 20px;
  border: 1px solid var(--line-strong); background: transparent;
  color: var(--ink); cursor: pointer;
  font-family: 'Caveat', cursive; font-size: 18px; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
  transition: background 0.2s;
}
.lang-btn:hover { background: var(--paper-alt); }
.lang-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px; min-width: 160px;
  display: none; box-shadow: 0 12px 40px var(--shadow);
  transform: rotate(0.4deg);
  z-index: 110;
}
.lang-menu.open { display: block; }
.lang-menu button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 14px; border: none;
  background: transparent; color: var(--ink); cursor: pointer;
  font-family: 'Fraunces', serif; font-size: 15px;
  border-radius: 6px; text-align: left;
}
.lang-menu button:hover { background: var(--paper-alt); }
.lang-menu button.active { color: var(--accent); font-weight: 600; }

.menu-toggle { display: none; background: none; border: 1px solid var(--line-strong); border-radius: 20px; padding: 8px 12px; cursor: pointer; color: var(--ink); }

/* ============================================
   LAYOUT
============================================ */

main { min-height: 60vh; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.container-narrow { max-width: 960px; margin: 0 auto; padding: 0 32px; }

section { padding: 90px 0; position: relative; }

.eyebrow {
  font-family: 'Caveat', cursive;
  font-size: 26px; color: var(--accent);
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
  transform: rotate(-1.5deg);
}
.eyebrow::before {
  content: ''; display: inline-block; width: 40px; height: 14px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 14'><path d='M2,7 Q10,2 20,8 T38,6' stroke='%23c8381f' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
  background-size: contain; background-repeat: no-repeat;
}

.h1 {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: clamp(42px, 7vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.h1 .scribble { position: relative; display: inline-block; }
.h1 .scribble::after {
  content: ''; position: absolute; left: -4%; right: -4%; bottom: -6px; height: 18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 18' preserveAspectRatio='none'><path d='M4,12 Q80,2 160,10 T296,7' stroke='%23c8381f' stroke-width='3' fill='none' stroke-linecap='round'/></svg>");
  background-size: 100% 100%; background-repeat: no-repeat;
}
.h1 em { font-style: italic; font-weight: 400; color: var(--accent); }

.h2 {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.h2 em { font-style: italic; color: var(--accent); font-weight: 400; }
.h2 .hand-accent {
  font-family: 'Caveat', cursive;
  color: var(--accent);
  font-size: 0.95em; font-weight: 700;
  display: inline-block;
  transform: rotate(-2deg);
}

.lead { font-size: 19px; color: var(--ink-soft); max-width: 560px; }

/* decorative drawn arrow */
.drawn-arrow {
  display: inline-block;
  width: 80px; height: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 40'><path d='M4,30 Q20,5 50,20 Q62,26 72,14' stroke='%231a1512' stroke-width='1.8' fill='none' stroke-linecap='round'/><path d='M68,9 L74,14 L67,19' stroke='%231a1512' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-size: contain; background-repeat: no-repeat;
}
[data-theme="dark"] .drawn-arrow { filter: invert(1) hue-rotate(180deg); }

/* ============================================
   HERO (home)
============================================ */

.hero {
  padding: 100px 0 80px;
  position: relative;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'><g stroke='%231a1512' stroke-opacity='0.08' stroke-width='1' fill='none'><path d='M50,500 Q200,300 400,400 T580,200'/><circle cx='480' cy='120' r='35'/><path d='M90,90 L140,90 L140,140 L90,140 Z'/></g></svg>");
  background-repeat: no-repeat; background-position: right -40px top 40px;
  background-size: 600px;
  pointer-events: none; opacity: 0.9;
}
.hero-grid {
  display: grid; grid-template-columns: 1.2fr 1fr;
  gap: 60px; align-items: center;
  position: relative; z-index: 2;
}
.hero-copy h1 { margin: 10px 0 24px; }
.hero-copy .lead { font-size: 20px; margin-bottom: 30px; }
.hero-meta {
  display: flex; gap: 40px; flex-wrap: wrap;
  padding-top: 24px; border-top: 1px dashed var(--line-strong);
}
.hero-meta .stat {
  font-family: 'Fraunces', serif; font-size: 42px; line-height: 1;
}
.hero-meta .stat small {
  display: block; font-family: 'Caveat', cursive;
  font-size: 18px; color: var(--ink-muted); margin-top: 6px;
  letter-spacing: 0.02em;
}

.sketch-panel {
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  aspect-ratio: 4/5;
  position: relative;
  box-shadow: 4px 6px 0 var(--accent), 8px 10px 0 var(--ink);
  transform: rotate(1.6deg);
  overflow: hidden;
}
.sketch-panel svg { width: 100%; height: 100%; }
.sketch-panel img, .sketch-panel video { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero-video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  box-shadow: 0 16px 40px var(--shadow);
}
.sketch-panel .paper-tape {
  position: absolute; top: -18px; left: 30%;
  width: 100px; height: 30px;
  background: rgba(217, 164, 65, 0.55);
  transform: rotate(-4deg);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ============================================
   MARQUEE (brand logos — hand lettered, not scroll)
============================================ */

.brand-strip {
  padding: 34px 0;
  border-top: 1px dashed var(--line-strong);
  border-bottom: 1px dashed var(--line-strong);
  background: var(--paper-alt);
  overflow: hidden;
  position: relative;
}
.brand-strip .label {
  font-family: 'Caveat', cursive;
  font-size: 22px; color: var(--ink-muted);
  transform: rotate(-2deg);
  text-align: center;
  margin-bottom: 20px;
}
/* infinite marquee */
.brand-marquee {
  display: flex;
  width: 100%;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%);
}
.brand-track {
  display: flex;
  flex-shrink: 0;
  gap: 24px;
  padding-right: 24px;
  align-items: center;
  min-width: max-content;
  animation: brand-scroll 90s linear infinite;
  will-change: transform;
}
@keyframes brand-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.brand {
  display: inline-flex; align-items: center; justify-content: center;
  height: 60px;
  font-family: 'Fraunces', serif;
  font-size: 30px; font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  opacity: 0.8;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand.s-italic   { font-style: italic; transform: rotate(0.8deg); }
.brand.s-bold     { font-weight: 700; letter-spacing: 0.18em; transform: rotate(-0.5deg); text-transform: uppercase; }
.brand.s-hand     { font-family: 'Caveat', cursive; font-size: 40px; transform: rotate(1.2deg); color: var(--accent); }
.brand.s-serif-sm { font-size: 24px; transform: rotate(-1deg); }
.brand .dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-left: 24px; vertical-align: middle;
  opacity: 0.7;
}
.brand-logo {
  height: 72px; width: 148px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  opacity: 1;
}
.brand-logo img {
  max-height: 42px; max-width: 116px;
  width: auto; height: auto;
  object-fit: contain;
  display: block;
}
@media (max-width: 768px) {
  .brand-logo { height: 60px; width: 120px; padding: 10px 14px; }
  .brand-logo img { max-height: 34px; max-width: 92px; }
}

/* ============================================
   FEATURE CARDS / SERVICES
============================================ */

.service-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
  margin-top: 40px;
}
.service-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: 3px 5px 0 var(--line);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.service-card:hover {
  transform: translate(-2px, -2px) rotate(-0.3deg);
  box-shadow: 5px 7px 0 var(--accent);
}
.service-card .num {
  font-family: 'Caveat', cursive; font-size: 30px;
  color: var(--accent); margin-bottom: 16px;
  transform: rotate(-3deg); display: inline-block;
}
.service-card h3 {
  font-family: 'Fraunces', serif; font-weight: 400;
  font-size: 30px; letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.service-card p { color: var(--ink-soft); font-size: 16px; margin-bottom: 22px; }
.service-card .tags { display: flex; flex-wrap: wrap; gap: 8px; }
.service-card .tag {
  font-family: 'Caveat', cursive; font-size: 17px;
  padding: 4px 12px;
  border: 1.5px solid var(--ink-muted); border-radius: 20px;
  color: var(--ink-soft);
  transform: rotate(-0.5deg);
}
.service-card .tag:nth-child(2n) { transform: rotate(1deg); }

/* ============================================
   PORTFOLIO — frames that look like storyboard panels
============================================ */

.storyboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
  margin-top: 40px;
}
.panel {
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 14px 14px 16px;
  box-shadow: 3px 5px 0 var(--line);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  position: relative;
  cursor: pointer;
}
.panel:hover {
  transform: translate(-1px, -3px) rotate(-0.4deg);
  box-shadow: 4px 7px 0 var(--accent);
}
.panel-frame {
  aspect-ratio: 16/10;
  background: var(--paper-alt);
  border: 1px solid var(--ink);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.panel-frame svg { width: 100%; height: 100%; }
.panel-frame img { width: 100%; height: 100%; object-fit: contain; display: block; background: var(--paper-alt); }
.panel-meta {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-top: 12px; padding-top: 2px;
}
.panel-number {
  font-family: 'Caveat', cursive; font-size: 22px; color: var(--accent);
  line-height: 1;
}
.panel-title {
  font-family: 'Fraunces', serif; font-weight: 500;
  font-size: 17px; color: var(--ink);
  line-height: 1.2;
}
.panel-tag {
  font-family: 'Caveat', cursive; font-size: 16px;
  color: var(--ink-muted); text-align: right;
}

/* ============================================
   PROCESS
============================================ */

.process {
  display: grid; grid-template-columns: 1fr; gap: 0;
  margin-top: 40px;
}
.process-item {
  display: grid;
  grid-template-columns: 100px 1fr 1.8fr;
  gap: 40px;
  padding: 32px 0;
  border-top: 1px dashed var(--line-strong);
  align-items: start;
}
.process-item:last-child { border-bottom: 1px dashed var(--line-strong); }
.process-num {
  font-family: 'Caveat', cursive; font-size: 46px;
  color: var(--accent); line-height: 1;
  transform: rotate(-4deg);
}
.process-item h3 {
  font-family: 'Fraunces', serif; font-weight: 400;
  font-size: 28px; letter-spacing: -0.02em;
}
.process-item p { color: var(--ink-soft); }

/* ============================================
   ABOUT / ESTUDIO
============================================ */

.about-grid {
  display: grid; grid-template-columns: 1.2fr 1fr;
  gap: 60px; align-items: center;
}
.about-visual {
  aspect-ratio: 1; position: relative;
  background: var(--paper); border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 5px 6px 0 var(--accent-2);
  transform: rotate(-1.4deg);
  padding: 20px;
}
.about-visual svg { width: 100%; height: 100%; }

/* ============================================
   CONTACT
============================================ */

.contact-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  margin-top: 50px;
}
.contact-card {
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 28px 28px 30px;
  box-shadow: 3px 4px 0 var(--line);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  position: relative;
}
.contact-card:hover { transform: translate(-2px, -2px); box-shadow: 5px 6px 0 var(--accent); }
.contact-flag {
  font-family: 'Caveat', cursive; font-size: 28px;
  color: var(--accent); margin-bottom: 6px;
  transform: rotate(-2deg); display: inline-block;
}
.contact-card h3 {
  font-family: 'Fraunces', serif; font-weight: 500;
  font-size: 26px; letter-spacing: -0.01em;
}
.contact-card .role {
  font-family: 'Caveat', cursive; font-size: 20px;
  color: var(--ink-muted); margin: 4px 0 20px;
}
.contact-card address {
  font-style: normal; font-size: 15px; line-height: 1.8;
  color: var(--ink-soft);
}
.contact-card address strong {
  display: block; margin-top: 14px; margin-bottom: 2px;
  font-family: 'Caveat', cursive;
  font-size: 18px; font-weight: 600; color: var(--ink);
  letter-spacing: 0.02em;
}
.contact-card address a {
  color: var(--ink);
  border-bottom: 1.5px dotted var(--accent);
  transition: color 0.2s, border-color 0.2s;
}
.contact-card address a:hover { color: var(--accent); }

/* ============================================
   CTA
============================================ */

.cta {
  padding: 120px 0;
  text-align: center;
  background: var(--paper-alt);
  border-top: 1px dashed var(--line-strong);
  position: relative;
  overflow: hidden;
}
.cta h2 {
  font-family: 'Fraunces', serif; font-weight: 300;
  font-size: clamp(40px, 7vw, 96px);
  line-height: 1; letter-spacing: -0.03em;
  margin-bottom: 30px;
}
.cta h2 em { font-style: italic; color: var(--accent); }
.cta .hand { font-size: clamp(46px, 8vw, 110px); color: var(--accent); display: block; margin-top: 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 32px;
  font-family: 'Fraunces', serif;
  font-size: 17px; font-weight: 500;
  background: var(--ink); color: var(--paper);
  border: none; border-radius: 40px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s;
}
.btn:hover { transform: translateY(-2px); background: var(--accent); }
.btn.outline {
  background: transparent; color: var(--ink); border: 1.5px solid var(--ink);
}
.btn.outline:hover { background: var(--ink); color: var(--paper); }

/* ============================================
   PAGE HERO (sub-pages)
============================================ */

.page-hero {
  padding: 70px 0 50px;
  border-bottom: 1px dashed var(--line-strong);
  position: relative;
}
.breadcrumbs {
  font-family: 'Caveat', cursive;
  font-size: 20px;
  color: var(--ink-muted);
  margin-bottom: 18px;
  display: flex; gap: 8px; align-items: center;
}
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--accent); }

/* sub-nav for storyboards */
.sub-nav {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 28px;
}
.sub-nav a {
  font-family: 'Fraunces', serif; font-size: 14px; font-weight: 500;
  padding: 8px 18px;
  border: 1.2px solid var(--ink);
  border-radius: 30px;
  color: var(--ink);
  background: var(--paper);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.sub-nav a:hover { background: var(--paper-alt); transform: translateY(-1px); }
.sub-nav a.active { background: var(--ink); color: var(--paper); }

/* ============================================
   FOOTER
============================================ */

footer {
  padding: 60px 32px 40px;
  border-top: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--paper-alt) 60%, var(--paper) 40%);
  font-size: 15px;
  color: var(--ink-soft);
}
footer .footer-content {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
footer .foot-about-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}
footer address span {
  color: var(--ink-muted);
}
footer .footer-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
footer .foot-logo {
  font-family: 'Fraunces', serif;
  font-size: 32px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.01em;
}
footer .foot-tagline {
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: var(--ink-muted);
  font-size: 16px;
  margin: -10px 0 10px 0;
}
footer .foot-copyright {
  font-size: 13px;
  color: var(--ink-muted);
}
footer h4 {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
footer .office {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
footer .office:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
footer .office strong {
  font-weight: 500;
  color: var(--ink);
  font-size: 15px;
}
footer .office address {
  font-style: normal;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}
footer .footer-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
footer .footer-nav a {
  color: var(--ink-soft);
  transition: color 0.2s;
  font-family: 'Fraunces', serif;
  font-size: 15px;
}
footer .footer-nav a:hover {
  color: var(--accent);
}
footer .footer-legal {
  display: flex;
  gap: 8px;
  font-size: 13px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
footer .footer-legal a {
  color: var(--ink-muted);
  transition: color 0.2s;
}
footer .footer-legal a:hover {
  color: var(--accent);
}
footer a {
  text-decoration: none;
}

@media (max-width: 768px) {
  footer {
    padding: 40px 32px 30px;
  }
  footer .footer-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  footer .foot-logo {
    font-size: 28px;
  }
}

/* ============================================
   REVEAL ANIMATION
============================================ */

.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================
   MODAL — Storyboard detail viewer
============================================ */

.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center;
  animation: fadeIn 0.3s var(--ease);
}
.modal-overlay.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  width: 90vw; height: 90vh;
  max-width: 1400px;
  position: relative;
  display: flex; flex-direction: column;
  animation: slideUp 0.4s var(--ease);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

/* Single-frame modal layout */
.modal-content--single {
  position: relative;
  overflow: hidden;
}

/* Frame ocupa todo el modal */
.modal-single-frame {
  position: absolute;
  inset: 0;
  background: var(--paper-alt);
}

.modal-single-frame svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Info card superpuesta — banda horizontal abajo */
.modal-content--single .modal-info-card {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  border-radius: 0;
  border: none;
  border-top: 1px solid rgba(26, 21, 18, 0.15);
  background: rgba(251, 246, 233, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 20px 32px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  z-index: 10;
}

.modal-content--single .modal-info-card h2 {
  font-size: 22px;
  margin-bottom: 0;
  white-space: nowrap;
}

.modal-content--single .modal-info-card .modal-number {
  margin-bottom: 0;
  font-size: 22px;
}

.modal-content--single .modal-info-card .modal-description {
  margin-top: 0;
  font-size: 14px;
  opacity: 0.85;
}

.modal-content--single .modal-info-card .modal-meta-row {
  padding-top: 0;
  border-top: none;
  margin-left: auto;
}

[data-theme="dark"] .modal-content--single .modal-info-card {
  background: rgba(20, 17, 13, 0.88);
  border-top-color: rgba(240, 232, 216, 0.15);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute; top: 20px; right: 20px; z-index: 1001;
  width: 44px; height: 44px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 24px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.modal-close:hover {
  background: var(--accent);
  color: var(--paper);
  transform: rotate(90deg);
}

.modal-header {
  padding: 32px 32px 0 32px;
  border-bottom: 1px dashed var(--line-strong);
  flex-shrink: 0;
}

.modal-info-card {
  background: var(--paper-alt);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 24px 28px;
  margin-bottom: 24px;
}

.modal-info-card .modal-number {
  font-family: 'Caveat', cursive;
  font-size: 28px; color: var(--accent);
  margin-bottom: 6px; display: inline-block;
  transform: rotate(-1deg);
}

.modal-info-card h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 36px;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
  color: var(--ink);
}

.modal-meta-row {
  display: flex; flex-wrap: wrap; gap: 16px;
  padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-soft);
}

.modal-meta-item {
  display: flex; gap: 6px;
}

.modal-meta-item strong {
  color: var(--ink);
  font-family: 'Caveat', cursive;
  font-size: 16px;
}

.modal-description {
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-top: 16px;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px 32px 32px 32px;
}

.modal-frames {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.modal-frame {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  aspect-ratio: 16/10;
  overflow: hidden;
  position: relative;
}

.modal-frame svg {
  width: 100%;
  height: 100%;
}

/* ============================================
   CATEGORY SECTIONS (index.html grouped view)
============================================ */

.category-section {
  margin-bottom: 80px;
}

.category-header {
  display: flex; align-items: baseline; gap: 24px;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--accent);
}

.category-header .eyebrow {
  margin-bottom: 0;
}

.category-header h2 {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 42px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}

/* ============================================
   RESPONSIVE MODAL
============================================ */

@media (max-width: 768px) {
  .modal-content {
    width: 95vw; height: 95vh;
    border-radius: 8px;
  }

  .modal-header {
    padding: 24px 20px 0 20px;
  }

  .modal-body {
    padding: 24px 20px;
  }

  .modal-close {
    width: 40px; height: 40px;
    top: 16px; right: 16px;
    font-size: 20px;
  }

  .modal-info-card {
    padding: 18px 20px;
  }

  .modal-info-card h2 {
    font-size: 28px;
    margin-bottom: 14px;
  }

  .modal-frames {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
  }

  .category-header {
    flex-direction: column;
    gap: 12px;
  }

  .category-header h2 {
    font-size: 32px;
  }
}

/* ============================================
   RESPONSIVE
============================================ */

@media (max-width: 960px) {
  .nav { padding: 12px 16px; }
  .nav-links, .nav-tools .lang-switch { display: none; }
  .menu-toggle { display: inline-flex; }
  .nav-links.mobile-open {
    display: flex; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); padding: 16px;
    flex-direction: column; gap: 4px;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 30px var(--shadow);
  }
  .nav-links.mobile-open .dropdown-panel { position: static; display: flex; border: none; box-shadow: none; margin-left: 20px; padding: 0; min-width: 0; transform: none; }
  .container, .container-narrow { padding: 0 20px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .service-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .contact-grid { grid-template-columns: 1fr; }
  .brand-track { gap: 16px; padding-right: 16px; animation-duration: 70s; }
  .brand { font-size: 24px; }
  .brand.s-hand { font-size: 32px; }
  .process-item { grid-template-columns: 60px 1fr; gap: 16px; }
  .process-item p { grid-column: 1 / -1; margin-left: 76px; }
  footer .footer-content { grid-template-columns: 1fr; text-align: center; }
  footer .foot-logo, footer h4 { text-align: center; }
  section { padding: 70px 0; }
}

/* ============================================
   DESIGN EFFECTS
============================================ */

/* ============================================
   HISTORIA STORYBOARD — Company timeline strip
============================================ */

.historia-section {
  overflow: hidden;
  padding-bottom: 0;
}

.historia-header {
  padding: 80px var(--container-pad, 48px) 40px;
}

.historia-header .eyebrow {
  margin-bottom: 10px;
}

/* Film strip wrapper */
.filmstrip-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Film sprocket track top */
.filmstrip-track {
  display: flex;
  align-items: stretch;
  width: max-content;
  cursor: grab;
  user-select: none;
  padding: 0 48px 0 48px;
  gap: 0;
  transition: transform 0.05s linear;
}
.filmstrip-track:active { cursor: grabbing; }

/* Individual film panel */
.history-panel {
  display: flex;
  flex-direction: column;
  width: 300px;
  flex-shrink: 0;
  position: relative;
}

/* Sprocket holes — top & bottom row */
.sprocket-row {
  display: flex;
  align-items: center;
  height: 28px;
  background: var(--ink);
  gap: 0;
  padding: 0 8px;
  position: relative;
  z-index: 1;
}
.sprocket-hole {
  width: 22px;
  height: 14px;
  border-radius: 3px;
  background: var(--bg);
  margin: 0 5px;
  opacity: 0.85;
  flex-shrink: 0;
  transition: background 0.4s;
}

/* Frame image area */
.history-frame {
  background: var(--paper);
  border-left: 3px solid var(--ink);
  border-right: 3px solid var(--ink);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.history-frame svg {
  width: 100%;
  height: 100%;
}

/* Year badge */
.history-year {
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: 'Caveat', cursive;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.85;
  z-index: 2;
  pointer-events: none;
}

/* Caption strip under frame */
.history-caption {
  background: var(--ink);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 3px solid var(--ink);
  border-right: 3px solid var(--ink);
}
.history-caption-title {
  font-family: 'Caveat', cursive;
  font-size: 19px;
  font-weight: 700;
  color: var(--paper);
  line-height: 1.1;
}
.history-caption-desc {
  font-family: 'Fraunces', serif;
  font-size: 13px;
  color: var(--paper);
  opacity: 0.65;
  line-height: 1.4;
}

/* Nav arrows */
.filmstrip-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 48px;
}
.filmstrip-btn {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-size: 16px;
}
.filmstrip-btn:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.filmstrip-counter {
  font-family: 'Caveat', cursive;
  font-size: 20px;
  color: var(--ink-muted);
  min-width: 80px;
}

@media (max-width: 768px) {
  .history-panel { width: 240px; }
  .filmstrip-nav { padding: 20px 24px; }
  .historia-header { padding: 60px 24px 28px; }
}

/* Cursor effect — desactivado */

/* Page transition overlay */
#page-transition {
  will-change: transform;
}

/* Panel numbers with hand-drawn circles */
.panel-number svg {
  margin-right: 4px;
}

.panel-number svg text {
  font-family: 'Caveat', cursive;
  font-size: 24px;
  font-weight: 500;
}

/* Scroll progress bar */
#scroll-progress-bar {
  will-change: auto;
}
