/* ==========================================================
   IMPERIO STUDIO — components.css
   Hero, secciones, carrusel, tarjetas
   ========================================================== */

/* ============ HERO ============ */
.hero {
  position: relative;
  border-radius: var(--r-xl);
  padding: var(--sp-9) var(--sp-8);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  isolation: isolate;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: drift 18s ease-in-out infinite;
}

.hero__blob--1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -100px;
  right: -80px;
}

.hero__blob--2 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, #8B6914 0%, transparent 70%);
  bottom: -120px;
  left: 10%;
  animation-delay: -9s;
  opacity: 0.22;
}

[data-theme='dark'] .hero__blob { opacity: 0.35; }
[data-theme='dark'] .hero__blob--2 { opacity: 0.25; }

.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.08); }
  66% { transform: translate(-20px, 30px) scale(0.95); }
}

.hero__content {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}

.hero__eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.hero__eyebrow::before,
.hero__eyebrow::after {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--border-strong);
}

.hero__title {
  font-size: var(--fs-hero);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.hero__title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  font-variation-settings: 'opsz' 144;
}

.hero__subtitle {
  font-size: var(--fs-md);
  color: var(--text-soft);
  max-width: 520px;
  line-height: 1.55;
}

/* Quick actions */
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.quick-action {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5) var(--sp-3) var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: all var(--t-fast);
  box-shadow: var(--shadow-sm);
}

.quick-action:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quick-action__icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--bg-sunk);
  border-radius: var(--r-full);
  color: var(--text-soft);
  transition: background var(--t-fast), color var(--t-fast);
}

.quick-action__icon svg {
  width: 18px;
  height: 18px;
}

.quick-action:hover .quick-action__icon {
  background: var(--accent-soft);
  color: var(--accent);
}

.quick-action--primary {
  background: var(--ink);
  color: var(--ink-contrast);
  border-color: var(--ink);
}

.quick-action--primary .quick-action__icon {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink-contrast);
}

[data-theme='dark'] .quick-action--primary .quick-action__icon {
  background: rgba(0, 0, 0, 0.2);
}

.quick-action--primary:hover {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.quick-action--primary:hover .quick-action__icon {
  background: rgba(0, 0, 0, 0.1);
  color: var(--accent-contrast);
}

.quick-action__badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  background: var(--accent);
  color: var(--accent-contrast);
  margin-left: var(--sp-1);
}

/* ============ SECCIÓN ============ */
.section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.section__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--sp-4);
}

.section__title {
  font-size: var(--fs-xl);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.section__subtitle {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: 4px;
}

.section__link {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-soft);
  transition: color var(--t-fast), gap var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  white-space: nowrap;
}

.section__link:hover {
  color: var(--accent);
}

/* ============ CAROUSEL ============ */
.carousel {
  position: relative;
}

.carousel__track {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: var(--sp-1) 2px var(--sp-4);
  scroll-padding-left: 2px;
  scroll-behavior: smooth;
}

.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track { scrollbar-width: none; }

.carousel__arrow {
  position: absolute;
  top: calc(50% - var(--sp-2));
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast), transform var(--t-fast), background var(--t-fast);
  z-index: 5;
}

.carousel:hover .carousel__arrow {
  opacity: 1;
  pointer-events: auto;
}

.carousel__arrow:hover {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.carousel__arrow svg { width: 18px; height: 18px; }

.carousel__arrow--prev { left: -12px; }
.carousel__arrow--next { right: -12px; }

.carousel__arrow:disabled {
  opacity: 0 !important;
  pointer-events: none;
}

/* ============ TARJETAS: Estilo (prompt) ============ */
.style-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: transform var(--t-fast);
}

.style-card:hover { transform: translateY(-4px); }

.style-card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-sunk);
  border: 1px solid var(--border);
}

.style-card__thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  border-radius: inherit;
  pointer-events: none;
}

.style-card__gradient {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.style-card__ratio-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  border-radius: var(--r-xs);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  display: flex;
  gap: 3px;
}

.style-card__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px;
}

.style-card__name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}

.style-card__meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* ============ TARJETAS: Proyecto ============ */
.project-card {
  flex: 0 0 260px;
  scroll-snap-align: start;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: transform var(--t-fast);
}

.project-card:hover { transform: translateY(-4px); }

.project-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-sunk);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
}

.project-card__thumb-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-full);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  color: #fff;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity var(--t-fast), transform var(--t-fast);
}

.project-card:hover .project-card__thumb-icon {
  opacity: 1;
  transform: scale(1);
}

.project-card__thumb-icon svg { width: 22px; height: 22px; margin-left: 2px; }

.project-card__format {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: var(--r-xs);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.project-card__duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 3px 8px;
  border-radius: var(--r-xs);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
}

.project-card__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px;
}

.project-card__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card__date {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Estado vacío en proyectos */
.empty-card {
  flex: 0 0 260px;
  aspect-ratio: 16 / 9;
  scroll-snap-align: start;
  border-radius: var(--r-md);
  border: 1.5px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  color: var(--text-muted);
  transition: border-color var(--t-fast), color var(--t-fast);
  cursor: pointer;
}

.empty-card:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.empty-card svg { width: 24px; height: 24px; }

.empty-card__label {
  font-size: var(--fs-sm);
  font-weight: 500;
}

/* ============ ANIMACIONES DE ENTRADA ============ */
.hero,
.section {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.6s cubic-bezier(.2,.8,.2,1) forwards;
}

.section:nth-child(2) { animation-delay: 0.08s; }
.section:nth-child(3) { animation-delay: 0.16s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero, .section { animation: none; opacity: 1; transform: none; }
  .hero__blob { animation: none; }
}

/* ============ MODAL: Start a new project ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--sp-5);
}

.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  animation: fadeIn 0.22s ease forwards;
}

.modal__panel {
  position: relative;
  width: min(100%, 880px);
  max-height: calc(100vh - var(--sp-8));
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-7);
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s cubic-bezier(.2,.8,.2,1) forwards;
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
}

.modal__title {
  font-size: var(--fs-lg);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.modal__close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-full);
  color: var(--text-muted);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}

.modal__close svg { width: 18px; height: 18px; }

.modal__close:hover {
  background: var(--surface-hover);
  color: var(--text);
  transform: rotate(90deg);
}

/* Grid de tipos de proyecto */
.modal__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-3);
}

.project-type {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  text-align: left;
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}

.project-type:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.project-type__icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--bg-sunk);
  color: var(--text-soft);
  transition: background var(--t-fast), color var(--t-fast);
  flex-shrink: 0;
}

.project-type__icon svg { width: 18px; height: 18px; }

.project-type:hover .project-type__icon {
  background: var(--accent-soft);
  color: var(--accent);
}

.project-type__label {
  flex: 1;
}

/* Sección de templates dentro del modal */
.modal__section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

.modal__section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.modal__section-title {
  font-size: var(--fs-md);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.modal__section-link {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-soft);
  transition: color var(--t-fast);
}

.modal__section-link:hover { color: var(--accent); }

.modal__templates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-4);
}

.modal-template {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  cursor: pointer;
  transition: transform var(--t-fast);
}

.modal-template:hover { transform: translateY(-3px); }

.modal-template__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.modal-template__quality {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  background: var(--accent);
  color: var(--accent-contrast);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.modal-template__name {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text);
  padding: 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bloquear scroll del body cuando el modal está abierto */
body.modal-open { overflow: hidden; }

@media (max-width: 640px) {
  .modal__panel { padding: var(--sp-5); border-radius: var(--r-lg); }
  .modal__grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- FORM INPUTS (genérico) ---------- */
.form-input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-input::placeholder { color: var(--text-muted); }
