:root {
  --ink: #18131d;
  --muted: #6f6672;
  --canvas: #fcf9fc;
  --paper: #fff;
  --line: #e9e0e8;
  --violet: #833ab4;
  --pink: #c13584;
  --coral: #fd1d1d;
  --orange: #f77737;
  --yellow: #fcaf45;
  --gradient: linear-gradient(110deg, var(--violet), var(--pink) 34%, var(--coral) 61%, var(--orange) 82%, var(--yellow));
  --shadow: 0 24px 65px rgba(77, 29, 66, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 94% 2%, rgba(255, 202, 103, .36) 0, transparent 24rem),
    radial-gradient(circle at 6% 65%, rgba(210, 167, 230, .24) 0, transparent 28rem),
    var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img, video { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header {
  width: min(1160px, calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.03em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: #fff; background: var(--gradient); box-shadow: 0 7px 18px rgba(193,53,132,.22); }
.site-header nav { display: flex; align-items: center; gap: 24px; color: #544b57; font-size: .88rem; font-weight: 650; }
.site-header nav a:hover, .footer-links a:hover, .text-link:hover { color: var(--pink); }

.home-main, .content-main { width: min(1040px, calc(100% - 40px)); margin: auto; }
.home-main { padding: 8vh 0 7vh; }
.hero { max-width: 820px; }
.eyebrow, .section-kicker, .control-topline { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .72rem; font-weight: 700; letter-spacing: .13em; }
.eyebrow { display: inline-block; margin: 0; padding: 7px 10px; border: 1px solid #e4c6df; border-radius: 999px; color: #952374; background: rgba(255,255,255,.76); }
h1 { max-width: 850px; margin: 20px 0 22px; font-size: clamp(3.2rem, 8vw, 6.2rem); font-weight: 850; line-height: .96; letter-spacing: -.066em; }
h1 em { font-style: normal; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.intro { max-width: 680px; margin: 0 0 30px; color: #4f4752; font-size: 1.08rem; line-height: 1.65; }

#link-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 7px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 12px 34px rgba(94,53,82,.07); }
#instagram-url { min-width: 0; border: 0; outline: 0; border-radius: 11px; padding: 13px 12px; color: var(--ink); background: transparent; font-size: .96rem; }
#instagram-url:focus { box-shadow: inset 0 0 0 2px rgba(193,53,132,.22); }
#process-button, .download { min-height: 48px; padding: 0 20px; border: 0; border-radius: 11px; color: #fff; background: var(--gradient); box-shadow: 0 7px 16px rgba(193,53,132,.21); font-size: .9rem; font-weight: 800; transition: transform .15s ease, filter .15s ease; }
#process-button:hover, .download:hover { transform: translateY(-1px); filter: saturate(1.12); }
#process-button:disabled { opacity: .62; cursor: wait; }
#process-button span { margin-left: 7px; font-size: 1.15rem; }
.rights-check { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 8px; padding: 5px 8px 2px; color: #6a606c; font-size: .76rem; line-height: 1.45; }
.rights-check input { flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--pink); }
#status { margin: 12px 4px 0; color: var(--muted); font-size: .82rem; }
.loading { display: flex; gap: 9px; align-items: center; margin: 14px 3px 0; color: #982579; font-size: .82rem; font-weight: 750; }
.loader { width: 19px; height: 19px; border: 3px solid #f2cee4; border-top-color: var(--pink); border-right-color: var(--orange); border-radius: 50%; animation: spin .72s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.studio { margin-top: 58px; padding: 22px; border: 1px solid var(--line); border-radius: 23px; background: #fff; box-shadow: var(--shadow); }
.viewer { position: relative; display: grid; place-items: center; min-height: 260px; max-height: 65vh; overflow: hidden; border-radius: 15px; background: #18131a; }
.viewer::before { position: absolute; inset: 0; z-index: 0; content: ""; opacity: .22; background: radial-gradient(circle at 70% 0, rgba(215,71,151,.5), transparent 30%); pointer-events: none; }
.viewer video, .viewer img { position: relative; z-index: 1; display: block; max-height: 65vh; }
.viewer-label { position: absolute; z-index: 2; top: 13px; left: 13px; padding: 6px 9px; border: 1px solid rgba(255,255,255,.18); border-radius: 7px; color: #fff; background: rgba(22,12,23,.68); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .69rem; font-weight: 650; backdrop-filter: blur(8px); }
.controls { margin-top: 20px; }
.control-topline { display: flex; justify-content: space-between; margin-bottom: 13px; color: #716975; }
.control-topline strong { color: #b82c7c; font-weight: 700; }
input[type="range"] { width: 100%; height: 18px; margin: 0; padding: 0; accent-color: #d23481; cursor: pointer; }
.thumbnails { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; min-height: 56px; margin-top: 10px; }
.thumbnails[aria-busy="true"]::after { grid-column: 1 / -1; align-self: center; content: "Generando previsualizaciones…"; color: var(--muted); font-size: .76rem; }
.thumbnail { position: relative; min-width: 0; aspect-ratio: 1.35; overflow: hidden; padding: 0; border: 1px solid #eadce8; border-radius: 8px; background: #f5eff5; }
.thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumbnail span { position: absolute; right: 3px; bottom: 3px; padding: 2px 3px; border-radius: 3px; color: #fff; background: rgba(24,13,24,.75); font: 600 .55rem ui-monospace, monospace; }
.thumbnail:hover { border-color: var(--pink); box-shadow: 0 0 0 2px rgba(193,53,132,.14); }
.actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.nudge { width: 42px; height: 40px; border: 1px solid #eadce8; border-radius: 10px; background: #fff8fc; color: #962474; font-size: 1.15rem; font-weight: 800; }
.hint { margin-left: 5px; color: var(--muted); font-size: .8rem; }
.download { min-height: 40px; margin-left: auto; }
.photo-mode .video-only { display: none; }
.photo-mode .actions { margin-top: 0; }

.home-info { margin-top: 100px; padding: 52px; border-radius: 28px; color: #fff; background: #1b151e; }
.section-kicker { margin: 0 0 12px; color: #ef9ed0; }
.home-info h2 { max-width: 720px; margin: 0; font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.04; letter-spacing: -.045em; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 38px; }
.feature-grid article { min-height: 190px; padding: 24px; border: 1px solid rgba(255,255,255,.11); border-radius: 18px; background: rgba(255,255,255,.045); }
.feature-grid strong { color: #ef91c9; font: 700 .7rem ui-monospace, monospace; }
.feature-grid h3 { margin: 30px 0 9px; font-size: 1.05rem; }
.feature-grid p { margin: 0; color: #c8c0ca; font-size: .88rem; line-height: 1.6; }
.platform-note { margin: 28px 0 0; color: #9f96a2; font-size: .76rem; line-height: 1.55; }

.content-main { padding: 7vh 0 9vh; }
.content-hero { max-width: 790px; margin-bottom: 48px; }
.content-hero h1 { margin-bottom: 18px; font-size: clamp(2.7rem, 7vw, 5rem); }
.content-hero p { max-width: 680px; color: #5a515d; font-size: 1.05rem; line-height: 1.7; }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 44px; align-items: start; }
.prose { min-width: 0; }
.prose section, .article-card, .legal-card { margin-bottom: 18px; padding: 30px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.86); }
.prose h2 { margin: 0 0 14px; font-size: 1.55rem; letter-spacing: -.03em; }
.prose h3 { margin: 26px 0 8px; font-size: 1.05rem; }
.prose p, .prose li { color: #564e59; line-height: 1.72; }
.prose p { margin: 0 0 13px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 7px; }
.text-link { color: #a42379; font-weight: 750; }
.callout { border-left: 4px solid var(--pink) !important; }
.content-aside { position: sticky; top: 24px; }
.aside-card { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 14px 40px rgba(75,34,65,.06); }
.aside-card h2 { margin: 0 0 10px; font-size: 1rem; }
.aside-card p { margin: 0 0 16px; color: var(--muted); font-size: .82rem; line-height: 1.6; }
.aside-card a { color: #9c2576; font-size: .82rem; font-weight: 750; }
.ad-slot { display: none; margin-top: 20px; min-height: 250px; border: 1px dashed #d9ced8; border-radius: 16px; background: rgba(255,255,255,.45); }
.ad-slot.is-active { display: block; }
.article-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.article-card { display: flex; min-height: 260px; margin: 0; flex-direction: column; }
.article-card .tag { color: #9d2678; font: 700 .7rem ui-monospace, monospace; letter-spacing: .1em; }
.article-card h2 { margin-top: 26px; }
.article-card a { margin-top: auto; color: #9d2678; font-weight: 800; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { padding: 18px 0; cursor: pointer; font-weight: 800; }
.faq details p { padding: 0 0 18px; }

.legal-meta { display: grid; grid-template-columns: 170px 1fr; gap: 10px 18px; margin: 20px 0; }
.legal-meta dt { color: var(--muted); }
.legal-meta dd { margin: 0; font-weight: 700; }
.notice { padding: 16px 18px; border: 1px solid #edcfe2; border-radius: 13px; color: #704060; background: #fff6fb; font-size: .87rem; line-height: 1.6; }
.legal-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.legal-form label { display: grid; gap: 7px; color: #4f4652; font-size: .82rem; font-weight: 750; }
.legal-form .full { grid-column: 1 / -1; }
.legal-form input, .legal-form textarea, .legal-form select { width: 100%; border: 1px solid #ded3dc; border-radius: 10px; padding: 12px; outline: none; background: #fff; }
.legal-form textarea { min-height: 140px; resize: vertical; }
.legal-form input:focus, .legal-form textarea:focus, .legal-form select:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(193,53,132,.1); }
.legal-form button { justify-self: start; min-height: 44px; padding: 0 18px; border: 0; border-radius: 10px; color: #fff; background: var(--gradient); font-weight: 800; }
.form-note { color: var(--muted); font-size: .78rem; }

.site-footer { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 32px; align-items: start; }
.footer-brand { margin-bottom: 10px; }
.site-footer p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 20px; color: #5e5561; font-size: .78rem; }
.copyright { white-space: nowrap; }

@media (max-width: 820px) {
  .site-header { padding: 14px 0; align-items: flex-start; }
  .site-header nav { justify-content: flex-end; gap: 12px 16px; flex-wrap: wrap; font-size: .78rem; }
  .feature-grid, .content-layout, .site-footer { grid-template-columns: 1fr; }
  .content-aside { position: static; }
  .article-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .site-header, .home-main, .content-main, .site-footer { width: calc(100% - 28px); }
  .site-header { display: block; }
  .site-header nav { justify-content: flex-start; margin-top: 16px; }
  .home-main { padding-top: 6vh; }
  h1 { font-size: clamp(2.9rem, 15vw, 4.5rem); }
  #link-form { grid-template-columns: 1fr; }
  .rights-check { grid-column: auto; }
  #process-button { min-height: 52px; }
  .studio { margin-top: 42px; padding: 10px; border-radius: 16px; }
  .thumbnails { gap: 4px; }
  .thumbnail span, .hint { display: none; }
  .actions { gap: 10px; padding: 0 3px 3px; }
  .download { padding: 0 13px; font-size: .78rem; }
  .home-info { margin-top: 70px; padding: 30px 22px; }
  .feature-grid { grid-template-columns: 1fr; }
  .content-main { padding-top: 5vh; }
  .prose section, .article-card, .legal-card { padding: 22px; }
  .legal-meta, .legal-form { grid-template-columns: 1fr; }
  .legal-form .full { grid-column: auto; }
}
