@font-face {
  font-family: "DynaPuff";
  src: url("assets/fonts/DynaPuff-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage";
  src: url("assets/fonts/BricolageGrotesque-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage";
  src: url("assets/fonts/BricolageGrotesque-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #fbf3df;
  --panel: #f3e7cb;
  --header-bg: rgba(251, 243, 223, 0.88);
  --ink: #4a3324;
  --ink-soft: #6b5140;
  --ink-faint: #8a705b;
  --hairline: rgba(74, 51, 36, 0.14);
  --dot: rgba(74, 51, 36, 0.16);
  --coral: #e8836f;

  --footer-bg: #4a3324;
  --footer-ink: #fbf3df;
  --footer-ink-soft: #d8c4ac;
  --footer-ink-faint: #a88f76;
  --footer-hairline: rgba(251, 243, 223, 0.14);

  --radius-pill: 999px;
  --shadow-soft: 0 10px 24px -8px rgba(74, 51, 36, 0.35);
  --header-h: 68px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Bricolage", system-ui, sans-serif;
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

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

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Interactive dot grid background ---------- */

.grid-layer {
  position: fixed;
  inset: -60px;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(var(--dot) 1.3px, transparent 1.8px);
  background-size: 26px 26px;
  will-change: transform, background-position;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
  transition: background 0.4s ease, border-color 0.4s ease;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--header-h);
  padding: 12px 32px;
  flex-wrap: nowrap;
}

.site-header__brand-mark img {
  height: 34px;
  width: auto;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .site-header__nav a { display: none; }
}

.site-header__nav a {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  opacity: 0.82;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.site-header__nav a:hover { opacity: 1; color: var(--coral); }

.lang-toggle {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--hairline);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.lang-toggle__btn {
  padding: 6px 14px;
  font-size: 0.76rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  font-family: "Bricolage", sans-serif;
  transition: background 0.2s ease, color 0.2s ease;
}
.lang-toggle__btn.is-active {
  background: var(--coral);
  color: #fff9f0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Bricolage", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn--primary {
  background: var(--coral);
  color: #fff9f0;
  padding: 15px 30px;
  box-shadow: var(--shadow-soft);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -8px rgba(74, 51, 36, 0.5); }
.btn--primary:active { transform: translateY(0) scale(0.98); }

.btn--outline {
  border: 1.5px solid var(--ink);
  color: var(--ink);
  padding: 12px 24px;
  font-size: 0.92rem;
}
.btn--outline:hover { background: var(--ink); color: var(--paper); }

.link-mail {
  display: inline-flex;
  align-items: center;
  color: var(--coral);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 12px 6px;
  text-decoration: none;
}
.link-mail:hover { text-decoration: underline; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 56px 0 100px;
  z-index: 2;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  gap: 48px;
  align-items: end;
}

.hero__wordmark-wrap {
  position: relative;
  width: min(420px, 88%);
  margin-bottom: 20px;
}

.hero__wordmark {
  position: relative;
  width: 100%;
}

.hero__tagline {
  font-family: "DynaPuff", "Bricolage", sans-serif;
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.9rem);
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 20px;
}

.hero__sub {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 480px;
  margin: 0 0 32px;
}

.hero__cta { margin: 0; }

/* ---------- Hero interactive demo ---------- */

.hero__demo-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-faint);
  text-align: center;
  margin: 0 0 18px;
}

.hero__stage {
  position: relative;
  height: 230px;
}

.hero__slot {
  position: absolute;
  bottom: 0;
  width: 90px;
  height: 74px;
  border-radius: 16px;
  border: 2px dashed var(--hairline);
}

.hero__piece-wrap {
  position: absolute;
  top: 0;
  width: 90px;
  height: 230px;
}

.hero__piece {
  position: absolute;
  top: 0;
  left: 0;
  width: 90px;
  height: 90px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hero__piece img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.hero__piece.is-dropped {
  transform: translateY(160px) rotate(0deg) scale(0.94);
}

@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__demo { margin-top: 8px; }
}

/* ---------- Section shared ---------- */

.section-title {
  font-family: "DynaPuff", "Bricolage", sans-serif;
  font-weight: 600;
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  margin: 0 0 20px;
  color: var(--ink);
}

.section-lead {
  font-size: 1.06rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 16px;
}
.section-lead:last-of-type { margin-bottom: 0; }

/* ---------- Fit (El encaje) ---------- */

.fit {
  position: relative;
  margin-top: -60px;
  padding: 100px 0 140px;
  background: var(--panel);
  border-top: 1px solid var(--hairline);
  overflow: hidden;
  z-index: 1;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.fit__inner { position: relative; }

.fit__copy { max-width: 460px; margin-bottom: 64px; }
.fit__copy .section-lead { margin-bottom: 0; }

.fit__powerups {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 6vw;
  padding: 20px 0 10px;
}

.fit__powerup {
  filter: drop-shadow(0 10px 18px rgba(74, 51, 36, 0.16));
  animation: floatY 6s ease-in-out infinite;
}
.fu-1 { width: 130px; animation-duration: 5.5s; --rot: -4deg; }
.fu-2 { width: 96px; animation-duration: 6.5s; --rot: 6deg; margin-bottom: 30px; animation-name: floatSlow; }
.fu-3 { width: 109px; animation-duration: 7s; --rot: 3deg; }
.fu-4 { width: 100px; animation-duration: 6s; --rot: -5deg; margin-bottom: 18px; animation-name: floatSlow; }
.fu-5 { width: 90px; animation-duration: 5.8s; --rot: 5deg; }

@keyframes floatY {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50% { transform: translateY(-14px) rotate(var(--rot, 0deg)); }
}
@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50% { transform: translateY(-9px) rotate(calc(var(--rot, 0deg) * -1)); }
}

@media (max-width: 700px) {
  .fit__powerups { gap: 5vw; }
  .fu-1, .fu-3 { width: 84px; }
  .fu-2, .fu-4, .fu-5 { width: 70px; }
}

/* ---------- Workshop (El taller) ---------- */

.workshop {
  position: relative;
  padding: 120px 0 140px;
  background: var(--paper);
  z-index: 1;
}

.workshop__inner {
  display: grid;
  grid-template-columns: minmax(200px, 320px) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.workshop__art {
  justify-self: center;
}

.workshop__piece {
  display: block;
  width: min(240px, 70vw);
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  transform: rotate(-4deg);
  filter: drop-shadow(0 22px 30px rgba(74, 51, 36, 0.28));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.workshop__piece:hover,
.workshop__piece:focus-visible {
  transform: rotate(3deg) scale(1.06) translateY(-6px);
}
.workshop__piece:active {
  transform: rotate(-2deg) scale(0.97);
}

.workshop__copy .section-lead { max-width: 620px; }

.workshop__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

@media (max-width: 780px) {
  .workshop__inner { grid-template-columns: 1fr; text-align: center; }
  .workshop__copy .section-lead { margin-left: auto; margin-right: auto; }
  .workshop__actions { justify-content: center; }
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  padding: 72px 32px 32px;
  background: var(--footer-bg);
  color: var(--footer-ink);
  z-index: 1;
  transition: background 0.4s ease;
}

.site-footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(140px, 1fr));
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--footer-hairline);
}

.site-footer__brand p {
  font-size: 0.95rem;
  color: var(--footer-ink-soft);
  margin: 0;
  line-height: 1.5;
}

.site-footer__col h3 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--footer-ink);
  margin: 0 0 14px;
}

.site-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-footer__col a {
  font-size: 0.9rem;
  color: var(--footer-ink-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}
.site-footer__col a:hover { color: var(--coral); }

.site-footer__bottom {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 !important;
}
.site-footer__bottom p {
  font-size: 0.82rem;
  color: var(--footer-ink-faint);
  margin: 20px 0 0;
}

@media (max-width: 780px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}

::selection { background: #f0b850; color: #4a3324; }

@media (prefers-reduced-motion: reduce) {
  .hero__wordmark, .hero__piece, .btn, .fit__powerup, .workshop__piece {
    animation: none !important;
    transition: none !important;
  }
  .grid-layer { transition: none !important; }
}
