/* ============ Variables · DIY Modern Rustic Workshop ============ */
:root {
  --color-bg: #FAF5EE;          /* warm cream */
  --color-bg-soft: #F0E8DD;     /* sand light */
  --color-bg-dark: #2C1E14;     /* deep espresso */
  --color-surface: #FFFFFF;
  --color-text: #2C1E14;
  --color-text-soft: #6B5B4E;
  --color-text-muted: #8C7B6E;
  --color-amber: #B8763C;       /* copper primary */
  --color-amber-dark: #8B5A2B;
  --color-amber-light: #D4A574;
  --color-green: #5B8A5B;       /* sage accent */
  --color-green-dark: #3F6B3F;
  --color-red: #C0392B;
  --color-wood-deep: #3D2817;
  --color-wood-medium: #7A4E28;
  --color-wood-light: #B8844A;
  --shadow-soft: 0 4px 12px rgba(60, 40, 23, 0.10);
  --shadow-strong: 0 20px 40px rgba(60, 40, 23, 0.18);
  --radius: 0.75rem;
  --radius-lg: 1.5rem;
  --container: 72rem;
  --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ Reset / Base ============ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { transition: color var(--transition); }

/* ============ Animaciones decorativas ============ */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes blob-morph {
  0%, 100% { border-radius: 50% 40% 60% 50%; }
  50% { border-radius: 60% 50% 40% 60%; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.float { animation: float-y 4s ease-in-out infinite; }
.blob { animation: blob-morph 12s ease-in-out infinite; }
.fade-up { animation: fade-up 0.8s ease-out backwards; }
.fade-up-delay-1 { animation-delay: 0.15s; }
.fade-up-delay-2 { animation-delay: 0.3s; }
.fade-up-delay-3 { animation-delay: 0.45s; }

/* ============ Texturas — papel parchment ============ */
.parchment {
  position: relative;
  background-color: #FAF5EE;
  background-image:
    radial-gradient(ellipse at top left, rgba(184,118,60,0.06), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(122,78,40,0.05), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.28 0 0 0 0 0.15 0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.grain { position: relative; }
.grain::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 baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 0;
}
.grain > * { position: relative; z-index: 1; }

/* Tabla de madera (para footers, separadores, secciones acento) */
.wood-plank {
  background-color: #7A4E28;
  background-image:
    repeating-linear-gradient(90deg,
      rgba(60,30,10,0.18) 0 1px, transparent 1px 60px),
    repeating-linear-gradient(0deg,
      rgba(255,255,255,0.04) 0 2px, transparent 2px 8px),
    radial-gradient(ellipse at 30% 40%, rgba(255,210,140,0.18), transparent 60%),
    radial-gradient(ellipse at 70% 60%, rgba(40,20,5,0.25), transparent 60%);
  color: #FFF7E8;
}
.wood-plank-light {
  background-color: #B8844A;
  background-image:
    repeating-linear-gradient(90deg, rgba(80,40,15,0.15) 0 1px, transparent 1px 80px),
    radial-gradient(ellipse at 25% 50%, rgba(255,230,180,0.20), transparent 65%);
  color: var(--color-text);
}

/* Marco ornamental enciclopédico (esquinas tipo guide-tools.png) */
.ornate-frame {
  position: relative;
  padding: 1.5rem;
}
.ornate-frame::before, .ornate-frame::after {
  content: "";
  position: absolute;
  width: 40px; height: 40px;
  border: 2px solid var(--color-amber-dark);
  opacity: 0.55;
}
.ornate-frame::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; border-radius: 4px 0 0 0; }
.ornate-frame::after  { bottom: 8px; right: 8px; border-left: 0; border-top: 0; border-radius: 0 0 4px 0; }
.ornate-frame .corner-tr, .ornate-frame .corner-bl {
  position: absolute; width: 40px; height: 40px;
  border: 2px solid var(--color-amber-dark); opacity: 0.55;
}
.ornate-frame .corner-tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; border-radius: 0 4px 0 0; }
.ornate-frame .corner-bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; border-radius: 0 0 0 4px; }

/* Etiqueta "lámina nº" estilo cuaderno */
.plate-tag {
  position: absolute;
  top: -10px; right: 18px;
  background: var(--color-bg);
  color: var(--color-amber-dark);
  border: 1.5px solid var(--color-amber-dark);
  padding: 2px 12px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Número en círculo (lápiz) */
.pencil-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1.5px solid var(--color-text);
  border-radius: 50%;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.25rem;
  background: rgba(255,255,255,0.4);
  box-shadow: inset 0 0 0 3px var(--color-bg);
}

/* Anotación a lápiz (caligrafía suelta) */
.pencil-note {
  font-family: 'Caveat', 'Fraunces', cursive;
  color: var(--color-wood-medium);
  font-size: 1.1rem;
  transform: rotate(-2deg);
  display: inline-block;
}

/* Sello rojo / chapa */
.stamp {
  display: inline-block;
  border: 2.5px solid var(--color-red);
  color: var(--color-red);
  padding: 4px 12px;
  font-family: 'Fraunces', serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.7rem;
  transform: rotate(-4deg);
  border-radius: 4px;
  opacity: 0.85;
}

/* ============ Componentes ============ */

/* Botón primario copper (DIY) */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--color-amber);
  color: #FFFFFF;
  font-weight: 700;
  padding: 1rem 1.75rem;
  border-radius: 9999px;
  box-shadow: 0 8px 24px rgba(184, 118, 60, 0.40);
  transition: all var(--transition);
}
.btn-primary:hover {
  background: var(--color-amber-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(184, 118, 60, 0.55);
}

/* Botón secundario dark */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--color-bg-dark);
  color: var(--color-bg-soft);
  font-weight: 600;
  padding: 1rem 1.5rem;
  border-radius: 9999px;
  transition: all var(--transition);
}
.btn-secondary:hover {
  background: #292524;
  transform: translateY(-2px);
}

/* Card feature */
.feature-card {
  background: var(--color-bg-soft);
  border: 1px solid rgba(28, 25, 23, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(184, 118, 60, 0.35);
}

/* Mockup iPhone */
.iphone-mockup {
  background: var(--color-bg-dark);
  border-radius: 3rem;
  padding: 0.75rem;
  box-shadow: var(--shadow-strong);
  max-width: 280px;
  margin-inline: auto;
}
.iphone-mockup .screen {
  background: var(--color-bg);
  border-radius: 2.4rem;
  aspect-ratio: 9 / 19.5;
  position: relative;
  overflow: hidden;
}
.iphone-mockup .notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-bg-dark);
  width: 8rem;
  height: 1.5rem;
  border-radius: 0 0 1rem 1rem;
}

/* Inputs */
.input-base {
  width: 100%;
  padding: 1rem 1.25rem;
  border-radius: 9999px;
  border: 2px solid #D6D3D1;
  background: white;
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition);
}
.input-base {
  border: 2px solid #E5DACB;
  background: #FFFFFF;
  color: var(--color-text);
}
.input-base:focus {
  border-color: var(--color-amber);
}

/* Decoraciones blob */
.decor-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.decor-blob.amber { background: rgba(184, 118, 60, 0.28); }
.decor-blob.green { background: rgba(91, 138, 91, 0.22); }
.decor-blob.stone { background: rgba(122, 78, 40, 0.18); }

/* ========= Componentes DIY extra ========= */

/* Card categoría (estilo home DIY) */
.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid #EADBC8;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem 1.5rem;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--color-text);
}
.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
  border-color: var(--color-amber-light);
}
.cat-card img {
  width: 100%;
  max-width: 140px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  margin-bottom: 0.75rem;
}
.cat-card h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
}
.cat-card p {
  font-size: 0.85rem;
  color: var(--color-text-soft);
  margin: 0.25rem 0 0;
}

/* Card guía (estilo paso-a-paso) */
.guide-card {
  background: var(--color-surface);
  border: 1px solid #EADBC8;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}
.guide-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-strong);
}
.guide-card .img-wrap {
  background: var(--color-bg-soft);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.guide-card .img-wrap img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
}
.guide-card .body { padding: 1.25rem 1.5rem 1.5rem; }
.guide-card h3 {
  font-size: 1.1rem; font-weight: 700; margin: 0 0 0.35rem;
}
.guide-card p {
  color: var(--color-text-soft); font-size: 0.9rem; margin: 0;
}

/* Sello / chapa de madera */
.wood-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  background: linear-gradient(135deg, var(--color-wood-light), var(--color-wood-medium));
  color: #FFFFFF;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 2px 8px rgba(122, 78, 40, 0.25);
}

/* Hero mockup nuevo */
.hero-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.hero-stage::before {
  content: "";
  position: absolute;
  inset: 10% 5%;
  background: radial-gradient(closest-side, rgba(184,118,60,0.18), transparent 70%);
  z-index: 0;
}
.hero-stage img { position: relative; z-index: 1; }

/* Sección con fondo crema alterno */
.section-cream { background: var(--color-bg-soft); }
.section-white { background: var(--color-surface); }

/* Línea de virutas (separador rústico) */
.shaving-divider {
  height: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='28' viewBox='0 0 160 28' fill='none'%3E%3Cpath d='M2 18 Q 20 4 40 18 T 80 18 T 120 18 T 158 18' stroke='%23B8763C' stroke-width='1.5' stroke-linecap='round' fill='none' opacity='0.55'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
  opacity: 0.7;
}

/* ============ Utilidades ============ */
.container-x { max-width: var(--container); margin-inline: auto; padding-inline: 1.5rem; }
@media (min-width: 768px) { .container-x { padding-inline: 3rem; } }

/* Pill / badge */
.pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.pill-amber { background: rgba(184, 118, 60, 0.18); color: var(--color-amber-dark); }
.pill-green { background: rgba(91, 138, 91, 0.18); color: var(--color-green-dark); }
.pill-stone { background: rgba(108, 91, 78, 0.15); color: var(--color-text-soft); }

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